[dev] [sic] [patch] const-correctness and formalities

2013-08-21 Thread FRIGN
util.c --- util.c 2013-08-21 20:53:34.774661860 +0200 +++ util.c 2013-08-21 17:58:22.327780012 +0200 @@ -17,7 +17,7 @@ } static int -dial(char *host, char *port) { +dial(const char *host, const char *port) { static struct addrinfo hints; int srv; struc

Re: [dev] [sic] [patch] const-correctness and formalities

2013-08-21 Thread sin
> -static char * > -eat(char *s, int (*p)(int), int r) { > +static char* > +eat(char *s, int (*p)(int), const int r) { > while(*s != '\0' && p(*s) == r) > s++; > return s; > } Please do not use char* instead use char *. > int > -main(int argc, char *argv[]) { > +

Re: [dev] [sic] [patch] const-correctness and formalities

2013-08-21 Thread Roberto E. Vargas Caballero
> Declaring immutable arguments makes reading the code easier. Depends of the eyes, for me, const only adds noise to the code and it should be avoid except in some situations. In the case of main is directly an error because the standard says explicityly that main must be defined as: mai