<html><head><title>Samsung Enterprise Portal mySingle</title>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
<style id="mysingle_style" type="text/css">P {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 12pt
}
TD {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 12pt
}
LI {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 12pt
}
BODY {
        LINE-HEIGHT: 1.4; MARGIN: 10px; FONT-FAMILY: Arial, arial; FONT-SIZE: 12pt
}
</style>

<meta name="GENERATOR" content="ActiveSquare">
</head><body>
<p><span style="font-family: Calibri;">Hello All, </span></p>
<p><span style="font-family: Calibri;"></span> </p>
<p><span style="font-family: Calibri;">Can someone please provide your review comments on the patch and the logs ?</span></p>
<p> </p>
<p>Thanks and Best Regards, </p>
<p>N Ravi</p><!--nravi.n:EP-->
<p> </p>
<p>------- <b>Original Message</b> -------</p>
<p><b>Sender</b> : RAVI NANJUNDAPPA<nravi.n@samsung.com> Technical Lead/SRI-Bangalore-TZN/Samsung Electronics</p>
<p><b>Date</b> : Apr 24, 2014 08:35 (GMT+05:30)</p>
<p><b>Title</b> : Re: [cairo] [PATCH] test and util: maintain consistency in the usage of ARRAY_LENGTH macro</p>
<p> </p>Hello Bryce, <br><br>Please see the comments inline below.<br><br>Thanks and Best Regards, <br><br>N Ravi<br><br>> -----Original Message-----<br>> From: Bryce W. Harrington [mailto:b.harrington@samsung.com]<br>> Sent: Wednesday, April 23, 2014 11:42 PM<br>> To: Ravi Nanjundappa<br>> Cc: cairo@cairographics.org<br>> Subject: Re: [cairo] [PATCH] test and util: maintain consistency in the<br>usage<br>> of ARRAY_LENGTH macro<br>> <br>> Looks good to me.<br><br>Thanks for the review.<br><br>> <br>> Have you run 'make test' and 'make perf' with this patch compiled in?<br>> (For this patch, you don't need to let the tests run to completion; if<br>this is<br>> going to fail, it'll fail right away, so just run each for a few minutes<br>and verify<br>> results look okay.)<br><br>Yes. I've run the 'make test' and 'make perf' with this patch.<br>PFA the logs for the same. (as you had mentioned, I didn't run the<br>tests/perf for long time... The log files include output lines<br>until the executing the tests).<br>I hope this should be fine.<br><br><br>> <br>> Reviewed-by: Bryce Harrington <b.harrington@samsung.com><br>> <br>> On Wed, Apr 23, 2014 at 08:32:19AM +0530, Ravi Nanjundappa wrote:<br>> > ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,<br>> > test's cairo-test.h and in some internal header files of util's<br>> > directory.So to maintain consistency ARRAY_SIZE is replaced with<br>> > ARRAY_LENGTH macro.<br>> ><br>> > Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com><br>> > ---<br>> >  test/cairo-test.c        |   12 ++++++------<br>> >  util/cairo-trace/trace.c |    7 ++++---<br>> >  util/malloc-stats.c      |    9 +++++----<br>> >  3 files changed, 15 insertions(+), 13 deletions(-)<br>> ><br>> > diff --git a/test/cairo-test.c b/test/cairo-test.c index<br>> > 119506d..8dbf4c6 100644<br>> > --- a/test/cairo-test.c<br>> > +++ b/test/cairo-test.c<br>> > @@ -83,8 +83,8 @@<br>> >  #define TRUE !FALSE<br>> >  #endif<br>> ><br>> > -#ifndef ARRAY_SIZE<br>> > -#define ARRAY_SIZE(A) (sizeof(A) / sizeof (A[0]))<br>> > +#ifndef ARRAY_LENGTH<br>> > +#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof<br>> > +(__array[0])))<br>> >  #endif<br>> ><br>> >  #if ! HAVE_ALARM || ! defined(SIGALRM) @@ -1088,13 +1088,13 @@<br>> > REPEAT:<br>> ><br>> >       if (cairo_test_file_is_older (pass_filename,<br>> >     filenames,<br>> > -   ARRAY_SIZE (filenames)))<br>> > +   ARRAY_LENGTH (filenames)))<br>> >       {<br>> >   _xunlink (ctx, pass_filename);<br>> >       }<br>> >       if (cairo_test_file_is_older (fail_filename,<br>> >     filenames,<br>> > -   ARRAY_SIZE (filenames)))<br>> > +   ARRAY_LENGTH (filenames)))<br>> >       {<br>> >   _xunlink (ctx, fail_filename);<br>> >       }<br>> > @@ -1180,13 +1180,13 @@ REPEAT:<br>> ><br>> >       if (cairo_test_file_is_older (pass_filename,<br>> >     filenames,<br>> > -   ARRAY_SIZE (filenames)))<br>> > +   ARRAY_LENGTH (filenames)))<br>> >       {<br>> >   _xunlink (ctx, pass_filename);<br>> >       }<br>> >       if (cairo_test_file_is_older (fail_filename,<br>> >     filenames,<br>> > -   ARRAY_SIZE (filenames)))<br>> > +   ARRAY_LENGTH (filenames)))<br>> >       {<br>> >   _xunlink (ctx, fail_filename);<br>> >       }<br>> > diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index<br>> > ebfc81a..d5111d7 100644<br>> > --- a/util/cairo-trace/trace.c<br>> > +++ b/util/cairo-trace/trace.c<br>> > @@ -127,8 +127,9 @@ static void *_dlhandle = RTLD_NEXT;<br>> >      (*name##_real) (args);  \<br>> >  })<br>> ><br>> > -#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) -#define<br>> > ARRAY_LENGTH(a) ((int) ARRAY_SIZE(a))<br>> > +#ifndef ARRAY_LENGTH<br>> > +#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof<br>> > +(__array[0]))) #endif<br>> ><br>> >  #if SIZEOF_VOID_P == 4<br>> >  #define PTR_SHIFT 2<br>> > @@ -280,7 +281,7 @@ _type_next_token (Type *t)<br>> ><br>> >   if (b->count < sizeof (b->map) * CHAR_BIT) {<br>> >       unsigned int n, m, bit;<br>> > -     for (n = 0; n < ARRAY_SIZE (b->map); n++) {<br>> > +     for (n = 0; n < ARRAY_LENGTH (b->map); n++) {<br>> >   if (b->map[n] == (unsigned int) -1)<br>> >       continue;<br>> ><br>> > diff --git a/util/malloc-stats.c b/util/malloc-stats.c index<br>> > da91656..690efcf 100644<br>> > --- a/util/malloc-stats.c<br>> > +++ b/util/malloc-stats.c<br>> > @@ -60,8 +60,9 @@ static struct alloc_stats_t total_allocations;<br>> > static struct func_stat_t *func_stats[31627];  static int<br>> > func_stats_num;<br>> ><br>> > -#define ARRAY_SIZE(A) (sizeof (A)/sizeof (A[0]))<br>> > -<br>> > +#ifndef ARRAY_LENGTH<br>> > +#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof<br>> > +(__array[0]))) #endif<br>> >  static void<br>> >  alloc_stats_add (struct alloc_stats_t *stats, int is_realloc, size_t<br>> > size)  { @@ -147,7 +148,7 @@ func_stats_add (const void *caller, int<br>> > is_realloc, size_t size)<br>> ><br>> >   alloc_stats_add (&total_allocations, is_realloc, size);<br>> ><br>> > - i = ((uintptr_t) caller ^ 1215497) % ARRAY_SIZE (func_stats);<br>> > + i = ((uintptr_t) caller ^ 1215497) % ARRAY_LENGTH (func_stats);<br>> >   for (elt = func_stats[i]; elt != NULL; elt = elt->next) {<br>> >   if (elt->addr == caller)<br>> >   break;<br>> > @@ -328,7 +329,7 @@ malloc_stats (void)<br>> >   return;<br>> ><br>> >   j = 0;<br>> > - for (i = 0; i < ARRAY_SIZE (func_stats); i++) {<br>> > + for (i = 0; i < ARRAY_LENGTH (func_stats); i++) {<br>> >   struct func_stat_t *elt;<br>> >   for (elt = func_stats[i]; elt != NULL; elt = elt->next)<br>> >   sorted_func_stats[j++] = *elt;<br>> > --<br>> > 1.7.9.5<br>> ><br>> > --<br>> > cairo mailing list<br>> > cairo@cairographics.org<br>> > http://lists.cairographics.org/mailman/listinfo/cairo=<br>
<p> </p>
<table id="confidentialsignimg">
<tbody>
<tr>
<td NAMO_LOCK="">
<p><img border="0" src="cid:BEI0XT4NZ5JE@namo.co.kr" width="520"></p></td></tr></tbody></table></nravi.n@samsung.com></b.harrington@samsung.com></body></html><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=379a6105ad59d7616df4777c9e1950817b66c8e2eb6a5f6ec8b2bb558ee3c5857a7d13a75eee0fa797a3adbfcf2587a949e5ff3dfdc8681d76f80bf81d31c863cf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>