Files
OpenCellular/board/spring
Bill Richardson 2fb228c198 cleanup: Don't use [N] = {} when initializing arrays
If we do this:

  enum foo_v {
    FOO_A,
    FOO_B,
    FOO_COUNT
  };

  struct foo_t foo[] = {
    {...},
    {...},
  };
  BUILD_ASSERT(ARRAY_SIZE(foo) == FOO_COUNT);

Then we can be sure we're at least initialized all the elements of foo,
although there's no particular guarantee that the order is correct.

However, if we use this:

  struct foo_t foo[] = {
    [FOO_A] = {...},
    [FOO_B] = {...},
  };

and we accidentally get one wrong:

  struct foo_t foo[] = {
    [FOO_B] = {...},
    [FOO_B] = {...},
  };

Then the assertion still passes, but we've only initialized one element.

Don't do that.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual

Refactoring only. Build everything. It should still work.

Change-Id: I58f659207990f18c6fb74b1cac2ec1163cdb07ea
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/172115
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-10 15:16:06 +00:00
..