Skip to content

Standardize local min()/max() macros to MIN/MAXΒ #36

Description

@metux

πŸ€– Automated issue β€” generated by Claude Code on behalf of @metux. Not a human report.

The X server's public min() / max() macros (include/misc.h) are being deprecated in favor of a private, non-exported MIN / MAX β€” see X11Libre/xserver#1490.

This driver is not at build-break risk: it already defines its own min() / max() in src/util-macros.h rather than relying on the server. However, for consistency with the rest of the tree (and to match the upstream direction), it would be good to standardize on the uppercase MIN / MAX spelling.

Action (consistency only β€” low priority)

Rename the local lowercase macros in src/util-macros.h:

#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

and update the call sites (min( β†’ MIN(, max( β†’ MAX().

Affected files

  • src/util-macros.h β€” the local min/max definitions (rename to MIN/MAX)
  • src/xf86libinput.c β€” 4 call sites

Reference

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions