From d2f5fe3bf5e295b8157f53c7d1d6bf8aae960f8f Mon Sep 17 00:00:00 2001 From: Howard Su Date: Thu, 21 Feb 2019 00:26:21 +0800 Subject: [PATCH] use const to see if helps --- src/pages/common/layout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/common/layout.h b/src/pages/common/layout.h index fa1403c700..253cf605c6 100644 --- a/src/pages/common/layout.h +++ b/src/pages/common/layout.h @@ -8,7 +8,8 @@ typedef struct _grid_layout_data { #define BeginGridLayout(row, col) BeginGridLayout2(0, HEADER_HEIGHT, LCD_WIDTH, LCD_HEIGHT - HEADER_HEIGHT, row, col) #define BeginGridLayout2(startx, starty, width, height, row, col) \ - for (GridData _grid = { (width)/(col), (height)/(row), (startx), (starty)}; _grid.w > 0; _grid.w = 0) + unsigned _d = 1; \ + for (const GridData _grid = { (width)/(col), (height)/(row), (startx), (starty)}; _d > 0 ; _d = 0 ) #define Grid_XY(row, col) \ (_grid.x + _grid.w * ((col) - 1)), (_grid.y + _grid.h * ((row) - 1))