Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
howard0su committed Feb 20, 2019
1 parent 9e11837 commit 278d392
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/config/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static int layout_ini_handler(void* user, const char* section, const char* name,
};
if (! MATCH_SECTION(SECTION_GUI)) {
if(MATCH_SECTION("gui-320x240")
&& (! ELEM_USED(Model.elem[0]) || seen_res != HIRES))
&& (!ELEM_USED(Model.elem[0]) || seen_res != HIRES))
{
seen_res = LOWRES;
offset_x = (LCD_WIDTH - 320) / 2;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/128x64x1/pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void PAGE_ChangeQuick(int dir)
{
int quick = 0;
for (int i = 0; i < NUM_QUICKPAGES; i++) {
if(Model.quickpage[i] && Model.quickpage[i] == cur_page) {
if (Model.quickpage[i] && Model.quickpage[i] == cur_page) {
quick = i + 1;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/128x64x1/toggle_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void show_iconsel_page(int SelectedIcon) {
GUI_CreateLabelBox(&gui->togglelabel[i], LABEL_X, row, LABEL_W, LABEL_H, SelectedIcon == i ? &inverted : &DEFAULT_FONT, NULL, NULL, tglidx[i]);
#ifdef HAS_CHAR_ICONS
GUI_CreateLabelBox(&gui->toggleicon[i], ICON_X, row, ICON_W, LABEL_H, &DEFAULT_FONT, TGLICO_font_cb,
NULL, (void *)(long)Model.elem[tp->tglidx].extra.ico[i]);
NULL, (void *)(uintptr_t)Model.elem[tp->tglidx].extra.ico[i]);
#else
struct ImageMap img = TGLICO_GetImage(Model.elem[tp->tglidx].extra.ico[i]);
GUI_CreateImageOffset(&gui->toggleicon[i], ICON_X, row, ICON_W, LABEL_H, img.x_off, img.y_off, img.file,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/320x240x16/pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void PAGE_ChangeQuick(int dir)
{
int quick = 0;
for (int i = 0; i < NUM_QUICKPAGES; i++) {
if(Model.quickpage[i] && Model.quickpage[i] == cur_page) {
if (Model.quickpage[i] && Model.quickpage[i] == cur_page) {
quick = i+1;
break;
}
Expand All @@ -266,7 +266,7 @@ int PAGE_QuickPage(u32 buttons, u8 flags, void *data)
(void)flags;
int i;
for(i = 0; i < NUM_QUICKPAGES; i++)
if(Model.quickpage[i])
if (Model.quickpage[i])
break;
if(i == NUM_QUICKPAGES)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/common/_main_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static const char *dlgts_cb(guiObject_t *obj, int dir, void *data)
Model.elem[idx].src = GUI_TextSelectHelper(Model.elem[idx].src, 0, NUM_TRIMS, dir, 1, 1, NULL);
if (Model.elem[idx].src == 0)
return _tr("None");
snprintf(tempstring, sizeof(tempstring), "%s%d", _tr("Trim"),Model.elem[idx].src);
snprintf(tempstring, sizeof(tempstring), "%s%d", _tr("Trim"), Model.elem[idx].src);
return tempstring;
}
return _tr("None");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/common/_main_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void draw_elements()
FullRedraw = redraw_mode;
}
for (i = 0; i < NUM_ELEMS; i++) {
if (! GetWidgetLoc(&Model.elem[i], &x, &y, &w, &h))
if (!GetWidgetLoc(&Model.elem[i], &x, &y, &w, &h))
break;
int type = Model.elem[i].type;
const char *(*strCallback)(guiObject_t *, const void *) = label_cb;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/common/_main_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void PAGE_MainEvent()
//switch
for (int j = 0; j < 3; j++) {
// Assume switch 0/1/2 are in order
if(Model.elem[i].extra.ico[j] && raw[src+j] > 0) {
if (Model.elem[i].extra.ico[j] && raw[src+j] > 0) {
idx = Model.elem[i].extra.ico[j];
break;
}
Expand Down Expand Up @@ -350,7 +350,7 @@ void show_elements()
{
u16 x, y, w, h;
for (int i = 0; i < NUM_ELEMS; i++) {
if (! GetWidgetLoc(&Model.elem[i], &x, &y, &w, &h))
if (!GetWidgetLoc(&Model.elem[i], &x, &y, &w, &h))
break;
int type = Model.elem[i].type;
switch(type) {
Expand Down Expand Up @@ -408,7 +408,7 @@ void show_elements()
GUI_CreateLabelBox(&gui->elem[i].box, x, y, 2, 2, &DEFAULT_FONT, TGLICO_font_cb, NULL,
(void *)(uintptr_t)Model.elem[i].extra.ico[0]);
#else
struct ImageMap img = TGLICO_GetImage(Model.elem[i].extra.ico[0]); //We'll set this properly down below
struct ImageMap img = TGLICO_GetImage(Model.elem[i].extra.ico[0]); // We'll set this properly down below
GUI_CreateImageOffset(&gui->elem[i].img, x, y, w, h,
img.x_off, img.y_off, img.file, NULL, NULL);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/pages/common/_toggle_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ struct ImageMap TGLICO_GetImage(int idx)
void TGLICO_Select(guiObject_t *obj, const void *data)
{
(void)obj;
if(Model.elem[(long)data].src)
if (Model.elem[(uintptr_t)data].src)
{
PAGE_PushByID(PAGEID_TGLEDIT, (long)data);
PAGE_PushByID(PAGEID_TGLEDIT, (uintptr_t)data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/remap_channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void RemapChannelsForProtocol(const u8 *oldmap)
}
//Map display
for(i = 0; i < NUM_ELEMS; i++) {
switch(Model.elem[i].type) {
switch (Model.elem[i].type) {
case ELEM_SMALLBOX:
case ELEM_BIGBOX:
_map_inp(chmap, &Model.elem[i].src, NUM_TELEM + NUM_TIMERS + NUM_RTC+1);
Expand Down

0 comments on commit 278d392

Please sign in to comment.