Re: [hackers] [lsw] [PATCH] Improve compliance with our coding style

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Sun, 3 Jul 2022 23:36:21 +0200

Hi Tom,

> - if (!XGetTextProperty(dpy, win, &prop, netwmname) || prop.nitems == 0)
> - if (!XGetWMName(dpy, win, &prop) || prop.nitems == 0)
> + if (!XGetTextProperty(dpy, win, &prop, netwmname) || !prop.nitems) {
> + if (!XGetWMName(dpy, win, &prop) || !prop.nitems)
> return "";
> + }

I disagree with “!prop.nitems” change.
Variable nitems isn't a boolean value,
it's a numeral counter,
so better testing explicitly against 0.

Rest of the changes are good though, thanks. :)
Received on Sun Jul 03 2022 - 23:36:21 CEST

This archive was generated by hypermail 2.3.0 : Sun Jul 03 2022 - 23:48:29 CEST