Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect mask and fix warning #376

Merged

Commits on Dec 27, 2023

  1. Do not check for mask in evt->response_type

    Value of `evt->response_type` comes from X11 server and at least in
    Xorg it's not constant but depends on number of loaded extensions
    https://gitlab.freedesktop.org/xorg/xserver/-/blob/21b3dad2380639573c251d95910bcb644049ee5f/mi/miinitext.c#L110
    and a number of arguments each loaded extension takes. When randr
    module is loaded
    https://gitlab.freedesktop.org/xorg/xserver/-/blob/d6c02ffd9c910637f6b3b7249507998e9e45f93c/randr/randr.c#L439
    `REventBase` is calculated.
    
    On Debian 12 its value is 89 so the method _incidentally_ works as 89
    & 1 is 1 but on my Slackware system it's value is 88 and since 88 & 1
    isn't 1 the method doesn't work.
    
    Fixes phillipberndt#375
    ardrabczyk committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    cd88825 View commit details
    Browse the repository at this point in the history
  2. Fix const warnings

    gcc and clang report warnings due to -Wwrite-strings:
    
        $ docker run -it --rm -v "$PWD":/workspace -w /workspace gcc sh -c 'apt-get update &&
        apt-get -y install libxcb1-dev libxcb-randr0-dev &&
        make'
        (...)
        cc -pipe -o2 -Wstrict-overflow=5 -fstack-protector-all -W -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wfloat-equal -Wformat-y2k -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=nfc -Wold-style-definition -Woverlength-strings -Wpacked -Wpadded -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wunsafe-loop-optimizations -Wvolatile-register-var -Wwrite-strings  "-DAUTORANDR_PATH=\"\"" -o autorandr-launcher autorandr_launcher.c -lxcb -lxcb-randr
        autorandr_launcher.c: In function 'ar_launch':
        <command-line>: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
        autorandr_launcher.c:47:41: note: in expansion of macro 'AUTORANDR_PATH'
           47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
              |                                         ^~~~~~~~~~~~~~
        autorandr_launcher.c:47:57: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
           47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
              |                                                         ^~~~~~~~~~
        autorandr_launcher.c:47:69: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
           47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
              |                                                                     ^~~~~~~~~~~
        autorandr_launcher.c:47:82: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
           47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
              |                                                                                  ^~~~~~~~~
    ardrabczyk committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    2b87db8 View commit details
    Browse the repository at this point in the history