Re: [PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-15 Thread Irina Tirdea
>> + >> + *gnumber = NULL; >> + /* No grouping */ >> + if (thousands_sep == NULL || grouping == NULL || >> + *thousands_sep == '\0' || *grouping == CHAR_MAX || *grouping <= 0) >> { >> + *gnumber = strdup(number); >> + if (*gnumber == NULL) >> +

Re: [PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-15 Thread Irina Tirdea
+ + *gnumber = NULL; + /* No grouping */ + if (thousands_sep == NULL || grouping == NULL || + *thousands_sep == '\0' || *grouping == CHAR_MAX || *grouping = 0) { + *gnumber = strdup(number); + if (*gnumber == NULL) + ret =

Re: [PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-08 Thread Arnaldo Carvalho de Melo
Em Mon, Oct 08, 2012 at 09:43:33AM +0300, Irina Tirdea escreveu: > > +/* Group the digits according to the grouping rules of the current locale. > + The interpretation of GROUPING is as in `struct lconv' from . > */ > +static int group_number_locale(char *number, char **gnumber) > +{ > +

[PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-08 Thread Irina Tirdea
From: Irina Tirdea In glibc, printf supports ' to group numbers with thousands' grouping characters. Bionic does not support ' for printf. Implement thousands's grouping for numbers according to locale. The implementation uses the algorithm from glibc (http://www.gnu.org/software/libc/).

[PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-08 Thread Irina Tirdea
From: Irina Tirdea irina.tir...@intel.com In glibc, printf supports ' to group numbers with thousands' grouping characters. Bionic does not support ' for printf. Implement thousands's grouping for numbers according to locale. The implementation uses the algorithm from glibc

Re: [PATCH v3 8/8] perf stat: implement --big-num grouping

2012-10-08 Thread Arnaldo Carvalho de Melo
Em Mon, Oct 08, 2012 at 09:43:33AM +0300, Irina Tirdea escreveu: +/* Group the digits according to the grouping rules of the current locale. + The interpretation of GROUPING is as in `struct lconv' from locale.h. */ +static int group_number_locale(char *number, char **gnumber) +{ +