----- Rodolfo García Peñas <[email protected]> a écrit :
> On Fri, 31 Jan 2014, Carlos R. Mafra escribió:
>
> > On Fri, 31 Jan 2014 at 20:19:35 +0100, Rodolfo García Peñas wrote:
> > > Hi,
> > >
> > > wmaker includes the ./test folder. We need this folder? Could be removed?
> >
> > I'd rather keep it, for educational purposes.
>
> Patch attached.
Hi,
If that code's gonna be educational, may I suggest a few improvements below to
teach good practices?
> [...]
>
> diff --git a/test/wtest.c b/test/wtest.c
> index 8490e9c..c886c5b 100644
> --- a/test/wtest.c
> +++ b/test/wtest.c
> @@ -29,18 +29,24 @@ Display *dpy;
> Window leader;
> WMAppContext *app;
>
> -static void callback(void *foo, int item, Time time)
> +static void callback(int item)
> {
> + (void) item;
This one is not needed;
> printf("pushed item %i\n", item);
> }
>
> -static void quit(void *foo, int item, Time time)
> +static void quit(int item)
> {
> + (void) item;
This one would benefit a comment to explain what this line does and why
> exit(0);
> }
>
> -static void hide(void *foo, int item, Time time)
> +static void hide(int item)
> {
> + (void) item;
...same here...
> WMHideApplication(app);
> }
>
> @@ -52,11 +58,12 @@ WMMenu *menu;
> WMMenu *submenu;
> int wincount = 0;
>
> -static void newwin(void *foo, int item, Time time)
> +static void newwin(int item)
> {
> Window win;
> XClassHint classhint;
> char title[100];
same here also, and needs a blank line to separate the declarative part from
the statement
> + (void) item;
>
> wincount++;
> win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10 * wincount,
> 10 * wincount, 200, 100, 0, 0, 0);
> [...]
--
To unsubscribe, send mail to [email protected].