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

From: NRK <nrk_AT_disroot.org>
Date: Sat, 25 Jun 2022 23:38:20 +0600

On Sat, Jun 25, 2022 at 05:25:54PM +0000, Tom Schwindl wrote:
> -static void run();
> -static void usage();
> -static void xdraw();
> -static void xhints();
> -static void xinit();
> -static void xloadfonts();
> +static void run(void);
> +static void usage(void);
> +static void xdraw(void);
> +static void xhints(void);
> +static void xinit(void);
> +static void xloadfonts(void);

Functions with unspecified arguments is legacy cruft and obsolete since
C99. I'd perhaps go one step further and add `-Wstrict-prototypes` and
`-Wold-style-definition` to the list of default warnings in the
Makefile.

> - for (j = 0; j < LEN(fontfallbacks); j++)
> + for (j = 0; j < LEN(fontfallbacks); j++) {
> if (fstrs[j])
> free(fstrs[j]);
> + }

free on NULL is defined to be no-op. The check could be dropped.

- NRK
Received on Sat Jun 25 2022 - 19:38:20 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 25 2022 - 19:48:30 CEST