From 2b3eec1d9a80e22fc467abe95bc34e320e42180c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 29 Oct 2023 21:50:00 +0200 Subject: [PATCH 32/32] sdl3: Replace KMOD_NONE uses with SDL_KMOD_NONE Symbol renamed in sdl3. See osdn #48920 Signed-off-by: Marko Lindqvist --- client/gui-sdl3/widget_combo.c | 6 +++--- client/gui-sdl3/widget_edit.c | 4 ++-- client/gui-sdl3/widget_icon.c | 8 ++++---- client/gui-sdl3/widget_label.c | 10 +++++----- client/gui-sdl3/widget_scrollbar.c | 4 ++-- client/gui-sdl3/widget_window.c | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client/gui-sdl3/widget_combo.c b/client/gui-sdl3/widget_combo.c index a57268614f..66194e7276 100644 --- a/client/gui-sdl3/widget_combo.c +++ b/client/gui-sdl3/widget_combo.c @@ -241,13 +241,13 @@ struct widget *combo_new(SDL_Surface *background, struct gui_layer *dest, set_wflag(combo, WF_FREE_STRING | WF_FREE_GFX | flags); set_wstate(combo, FC_WS_DISABLED); set_wtype(combo, WT_COMBO); - combo->mod = KMOD_NONE; + combo->mod = SDL_KMOD_NONE; baseclass_redraw = combo->redraw; combo->redraw = combo_redraw; combo->destroy = combo_popdown; - if (NULL != pstr) { + if (pstr != NULL) { combo->string_utf8->style |= SF_CENTER; utf8_str_size(pstr, &buf); buf.h += adj_size(4); @@ -258,7 +258,7 @@ struct widget *combo_new(SDL_Surface *background, struct gui_layer *dest, combo->size.w = buf.w + adj_size(10); combo->size.h = buf.h; - if (dest) { + if (dest != NULL) { combo->dst = dest; } else { combo->dst = add_gui_layer(combo->size.w, combo->size.h); diff --git a/client/gui-sdl3/widget_edit.c b/client/gui-sdl3/widget_edit.c index 52f42b5aca..79ff219245 100644 --- a/client/gui-sdl3/widget_edit.c +++ b/client/gui-sdl3/widget_edit.c @@ -350,12 +350,12 @@ struct widget *create_edit(SDL_Surface *background, struct gui_layer *pdest, struct widget *pedit = widget_new(); pedit->theme = current_theme->edit; - pedit->theme2 = background; /* FIXME: make somewhere use of it */ + pedit->theme2 = background; /* FIXME: Make use of it somewhere. */ pedit->string_utf8 = pstr; set_wflag(pedit, (WF_FREE_STRING | WF_FREE_GFX | flags)); set_wstate(pedit, FC_WS_DISABLED); set_wtype(pedit, WT_EDIT); - pedit->mod = KMOD_NONE; + pedit->mod = SDL_KMOD_NONE; baseclass_redraw = pedit->redraw; pedit->redraw = redraw_edit; diff --git a/client/gui-sdl3/widget_icon.c b/client/gui-sdl3/widget_icon.c index 45a5192d37..92e9c85894 100644 --- a/client/gui-sdl3/widget_icon.c +++ b/client/gui-sdl3/widget_icon.c @@ -216,13 +216,13 @@ struct widget *create_themeicon(SDL_Surface *icon_theme, set_wflag(icon_widget, (WF_FREE_STRING | WF_FREE_GFX | flags)); set_wstate(icon_widget, FC_WS_DISABLED); set_wtype(icon_widget, WT_ICON); - icon_widget->mod = KMOD_NONE; + icon_widget->mod = SDL_KMOD_NONE; icon_widget->dst = pdest; baseclass_redraw = icon_widget->redraw; icon_widget->redraw = redraw_icon; - if (icon_theme) { + if (icon_theme != NULL) { icon_widget->size.w = icon_theme->w / 4; icon_widget->size.h = icon_theme->h; } @@ -340,13 +340,13 @@ struct widget *create_icon2(SDL_Surface *icon, struct gui_layer *pdest, set_wflag(icon_widget, (WF_FREE_STRING | WF_FREE_GFX | flags)); set_wstate(icon_widget, FC_WS_DISABLED); set_wtype(icon_widget, WT_ICON2); - icon_widget->mod = KMOD_NONE; + icon_widget->mod = SDL_KMOD_NONE; icon_widget->dst = pdest; baseclass_redraw = icon_widget->redraw; icon_widget->redraw = redraw_icon2; - if (icon) { + if (icon != NULL) { icon_widget->size.w = icon->w + adj_size(4); icon_widget->size.h = icon->h + adj_size(4); } diff --git a/client/gui-sdl3/widget_label.c b/client/gui-sdl3/widget_label.c index 9d4c6bd684..10b41ff4c1 100644 --- a/client/gui-sdl3/widget_label.c +++ b/client/gui-sdl3/widget_label.c @@ -191,7 +191,7 @@ struct widget *create_themelabel(SDL_Surface *icon, struct gui_layer *pdest, WF_RESTORE_BACKGROUND | flags)); set_wstate(label, FC_WS_DISABLED); set_wtype(label, WT_T_LABEL); - label->mod = KMOD_NONE; + label->mod = SDL_KMOD_NONE; label->dst = pdest; baseclass_redraw = label->redraw; @@ -220,7 +220,7 @@ struct widget *create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, set_wflag(icon_label, WF_FREE_STRING | WF_FREE_GFX | flags); set_wstate(icon_label, FC_WS_DISABLED); set_wtype(icon_label, WT_I_LABEL); - icon_label->mod = KMOD_NONE; + icon_label->mod = SDL_KMOD_NONE; icon_label->dst = pdest; baseclass_redraw = icon_label->redraw; @@ -255,7 +255,7 @@ struct widget *create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest, set_wflag(label, (WF_FREE_THEME | WF_FREE_STRING | WF_FREE_GFX | flags)); set_wstate(label, FC_WS_DISABLED); set_wtype(label, WT_T2_LABEL); - label->mod = KMOD_NONE; + label->mod = SDL_KMOD_NONE; baseclass_redraw = label->redraw; label->redraw = redraw_label; @@ -275,10 +275,10 @@ struct widget *create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest, area = label->size; label->dst = gui_layer_new(0, 0, ptheme); - /* normal */ + /* Normal */ redraw_iconlabel(label); - /* selected */ + /* Selected */ area.x = 0; area.y = label->size.h; diff --git a/client/gui-sdl3/widget_scrollbar.c b/client/gui-sdl3/widget_scrollbar.c index 35e61dcd55..87acb7ecfd 100644 --- a/client/gui-sdl3/widget_scrollbar.c +++ b/client/gui-sdl3/widget_scrollbar.c @@ -168,7 +168,7 @@ struct widget *create_vertical(SDL_Surface *vert_theme, struct gui_layer *pdest, set_wflag(vert, (WF_FREE_STRING | WF_FREE_GFX | flags)); set_wstate(vert, FC_WS_DISABLED); set_wtype(vert, WT_VSCROLLBAR); - vert->mod = KMOD_NONE; + vert->mod = SDL_KMOD_NONE; vert->dst = pdest; baseclass_redraw = vert->redraw; @@ -301,7 +301,7 @@ struct widget *create_horizontal(SDL_Surface *horiz_theme, set_wflag(hor, WF_FREE_STRING | flags); set_wstate(hor, FC_WS_DISABLED); set_wtype(hor, WT_HSCROLLBAR); - hor->mod = KMOD_NONE; + hor->mod = SDL_KMOD_NONE; hor->dst = pdest; baseclass_redraw = hor->redraw; diff --git a/client/gui-sdl3/widget_window.c b/client/gui-sdl3/widget_window.c index 49880dbffa..c916b8b4aa 100644 --- a/client/gui-sdl3/widget_window.c +++ b/client/gui-sdl3/widget_window.c @@ -191,7 +191,7 @@ struct widget *create_window_skeleton(struct gui_layer *pdest, WF_DRAW_FRAME_AROUND_WIDGET| flags); set_wstate(pwindow, FC_WS_DISABLED); set_wtype(pwindow, WT_WINDOW); - pwindow->mod = KMOD_NONE; + pwindow->mod = SDL_KMOD_NONE; if (get_wflags(pwindow) & WF_DRAW_FRAME_AROUND_WIDGET) { w += current_theme->fr_left->w + current_theme->fr_right->w; @@ -212,7 +212,7 @@ struct widget *create_window_skeleton(struct gui_layer *pdest, set_client_area(pwindow); - if (pdest) { + if (pdest != NULL) { pwindow->dst = pdest; } else { pwindow->dst = add_gui_layer(w, h); -- 2.42.0