Commit graph

3 commits

Author SHA1 Message Date
Peter Hutterer
4e002383cf clang-tidy: fix WarningAsErrors option to actually work
Not a boolean, despite what one would immediately assume.

Closes #1168

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1298>
2025-08-11 15:27:35 +10:00
Peter Hutterer
76c87d2486 util: add various helper functions to use __attribute__(cleanup)
Taken from libei, with slight modifications. The general approach is:
basic data types use _autofoo_ to call the maching foo function on
cleanup. Struct types use _unref_, _destory_, _free_, whichever applies
to that struct.

Notably: attribute syntax depends on where it's declared [1] so in the
following examles only a, b, and d have the autofree attribute:
   _autofree_ char *a, *b;
   char *c, _autofree *d;

Simplest way to ensure it's all correct to keep the declarations one per
line.

[1] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184>
2025-04-16 17:04:58 +10:00
Peter Hutterer
6876d71a4d Add a clang-tidy file
This gives us the ninja clang-tidy command. clang-tidy replaces
scan-build and is more featureful (and picky).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1182>
2025-04-07 08:43:36 +00:00