[ovs-dev] [PATCH 10/11] lib: Avoid using C++ keywords as variable names

Flavio Leitner fbl at redhat.com
Wed Nov 12 17:55:00 UTC 2014


On Wed, Nov 12, 2014 at 03:06:08PM +0100, Thomas Graf wrote:
> From: Amit Bose <bose at noironetworks.com>

It would be nice to have some description to what this is
trying to solve. Is there a real problem being fixed here?

> Signed-off-by: Amit Bose <bose at noironetworks.com>
> ---
>  AUTHORS              | 1 +
>  lib/dynamic-string.h | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/AUTHORS b/AUTHORS
> index b5ac696..84fca3a 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -8,6 +8,7 @@ Alexey I. Froloff       raorn at altlinux.org
>  Alex Wang               alexw at nicira.com
>  Alfredo Finelli         alf at computationes.de
>  Alin Serdean            aserdean at cloudbasesolutions.com
> +Amit Bose               bose at noironetworks.com
>  Andrew Evans            aevans at nicira.com
>  Andrew Lambeth          wal at nicira.com
>  Andy Hill               hillad at gmail.com
> diff --git a/lib/dynamic-string.h b/lib/dynamic-string.h
> index 2272343..396a24e 100644
> --- a/lib/dynamic-string.h
> +++ b/lib/dynamic-string.h
> @@ -61,9 +61,9 @@ int ds_get_line(struct ds *, FILE *);
>  int ds_get_preprocessed_line(struct ds *, FILE *, int *line_number);
>  int ds_get_test_line(struct ds *, FILE *);
>  
> -void ds_put_strftime_msec(struct ds *, const char *template, long long int when,
> +void ds_put_strftime_msec(struct ds *, const char *format, long long int when,
>  			  bool utc);

What about the function itself in lib/dynamic-string.c:

187 /* Writes the current time with optional millisecond resolution to 'string'
188  * based on 'template'.
189  * The current time is either localtime or UTC based on 'utc'. */
190 void
191 ds_put_strftime_msec(struct ds *ds, const char *template, long long int when,
192                      bool utc)
193 {


> -char *xastrftime_msec(const char *template, long long int when, bool utc);
> +char *xastrftime_msec(const char *format, long long int when, bool utc);

187 /* Writes the current time with optional millisecond resolution to 'string'
188  * based on 'template'.
189  * The current time is either localtime or UTC based on 'utc'. */
190 void
191 ds_put_strftime_msec(struct ds *ds, const char *template, long long int when,
192                      bool utc)
193 {

It would require fixing the comments as well.

fbl

>  char *ds_cstr(struct ds *);
>  const char *ds_cstr_ro(const struct ds *);
> -- 
> 1.9.3
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list