Re: [dev] [st PATCH 1/3] xloadcols: remove cp variable

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Tue, 21 Apr 2015 07:54:27 +0200

Hi,

> - Color *cp;
>
> if(loaded) {
> - for (cp = dc.col; cp < dc.col + LEN(dc.col); ++cp)
> - XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
> + for (i = 0; i < LEN(dc.col); i++)
> + XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[i]);
> }
>

I prefer the pointer version. I don't know why an index version
is better in this case. The reference here is [1], section "The
use of pointers".


Regards,

[1] http://www.lysator.liu.se/c/pikestyle.html
Received on Tue Apr 21 2015 - 07:54:27 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 21 2015 - 08:00:16 CEST