 Chromium Code Reviews
 Chromium Code Reviews Issue 
            1123923002:
    Update our SK_ARRAY_COUNT macro to account for when pointers are passed.  (Closed)
    
  
    Issue 
            1123923002:
    Update our SK_ARRAY_COUNT macro to account for when pointers are passed.  (Closed) 
  | DescriptionUpdate our SK_ARRAY_COUNT macro to account for when pointers are passed.
In SkTypes.h SK_ARRAY_COUNT is defined as:
 #define SK_ARRAY_COUNT(array)       (sizeof(array) / sizeof(array[0]))
This definition will compile if passed a pointer, even though this is
meaningless. The arraysize macro in Chromium's base\macros.h uses
template magic to avoid this problem. Fixing SK_ARRAY_COUNT will prevent
checking in errors like the SkOpEdgeBuilder.cpp(211) bug in CL
https://codereview.chromium.org/1002693002. Making this fix may find
some other latent bugs, and it will allow readers to have more
confidence in the results of SK_ARRAY_COUNT.
We updated our macro to use this template magic from Chromium.
BUG=skia:3593
R=mtklein@google.com
   Patch Set 1 #Patch Set 2 : cq-dry-run #
 Messages
    Total messages: 7 (3 generated)
     | |||||||||||||||||||