[Toybox] [CLEANUP] logger
Isaac
idunham at lavabit.com
Thu Jul 25 22:55:56 PDT 2013
On Thu, Jul 25, 2013 at 03:00:40PM +0300, Georgi Chorbadzhiyski wrote:
> Around 07/25/2013 01:58 AM, Felix Janda scribbled:
> > Various fixes to logger in below patch.
> >
> > Mainly inline parse_priority(). Many other small changes e.g. s/const//,
> > move around some variables, ...
> >
> > -Felix
> >
> > # HG changeset patch
> > # User Felix Janda <felix.janda at posteo.de>
> > # Date 1374706109 -7200
> > # Node ID 8cc26924c2ef2e862c975a31167a685e18f555ec
> > # Parent 8ad85a95f7c3b75214fbd3a46fe834de45c39417
> > logger: Some cleanup
> >
> > diff -r 8ad85a95f7c3 -r 8cc26924c2ef toys/pending/logger.c
> > --- a/toys/pending/logger.c Tue Jul 23 20:19:31 2013 -0500
> > +++ b/toys/pending/logger.c Thu Jul 25 00:48:29 2013 +0200
> > @@ -18,23 +18,18 @@
> > #define FOR_logger
> > #include "toys.h"
> > #include <syslog.h>
> > -#include <strings.h>
> > -#include <string.h>
> >
> > GLOBALS(
> > char *priority_arg;
> > char *ident;
> > -
> > - int facility;
> > - int priority;
> > )
> >
> > struct mapping {
> > - const char *key;
> > + char *key;
> > int value;
> > };
> >
> > -static const struct mapping facilities[] = {
> > +static struct mapping facilities[] = {
>
> Why do you remove "const"? It is useful because this structure never
> changes and allows the compiler to put it in the read-only section.
>
It's one of the matters of style.
See
http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000891.html
> --
> Georgi Chorbadzhiyski
> http://github.com/gfto/
> http://georgi.unixsol.org/
Isaac Dunham
1374818156.0
More information about the Toybox
mailing list