[Toybox] [CLEANUP] logger
Georgi Chorbadzhiyski
gf at unixsol.org
Thu Jul 25 05:00:40 PDT 2013
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.
--
Georgi Chorbadzhiyski
http://github.com/gfto/
http://georgi.unixsol.org/
1374753640.0
More information about the Toybox
mailing list