Skip to content

Commit

Permalink
use const to see if helps
Browse files Browse the repository at this point in the history
  • Loading branch information
howard0su committed Feb 20, 2019
1 parent f1344b2 commit d2f5fe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/common/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d2f5fe3

Please sign in to comment.