~linaro-graphics-wg/compiz-core/linaro-gles2

Viewing all changes in revision 2912.

  • Committer: Alexandros Frantzis
  • Date: 2012-03-13 10:16:59 UTC
  • Revision ID: alexandros.frantzis@linaro.org-20120313101659-n5upzl30j8p70k3a
Work around compile issue on ARM.

When compiling with -O2 on ARM, the original code leads to an array index out
of bounds compilation error. In that case, the compiler doesn't infer that
sizeof(a)/sizeof(T) is a constant, and tries to compile cases in the switch
statement that use array indices that are invalid for the particular template
instantiation.

To fix this we use the 'C' template variable, which is constant for each
template instantiation, directly in the switch statement.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: