mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Fixed warning C6313: Incorrect operator. Use an equality test to check for zero-valued flags.
This commit is contained in:
parent
9ed96f392d
commit
656c519cca
2 changed files with 6 additions and 4 deletions
|
|
@ -591,12 +591,14 @@ SDL_TrayEntry *SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *la
|
|||
entry->item = gtk_separator_menu_item_new();
|
||||
} else if (flags & SDL_TRAYENTRY_CHECKBOX) {
|
||||
entry->item = gtk_check_menu_item_new_with_label(label);
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(entry->item), !!(flags & SDL_TRAYENTRY_CHECKED));
|
||||
gboolean active = ((flags & SDL_TRAYENTRY_CHECKED) != 0);
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(entry->item), active);
|
||||
} else {
|
||||
entry->item = gtk_menu_item_new_with_label(label);
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive(entry->item, !(flags & SDL_TRAYENTRY_DISABLED));
|
||||
gboolean sensitive = ((flags & SDL_TRAYENTRY_DISABLED) == 0);
|
||||
gtk_widget_set_sensitive(entry->item, sensitive);
|
||||
|
||||
SDL_TrayEntry **new_entries = (SDL_TrayEntry **)SDL_realloc(menu->entries, (menu->nEntries + 2) * sizeof(*new_entries));
|
||||
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ bool SDL_GetTrayEntryChecked(SDL_TrayEntry *entry)
|
|||
|
||||
GetMenuItemInfoW(entry->parent->hMenu, (UINT) entry->id, FALSE, &mii);
|
||||
|
||||
return !!(mii.fState & MFS_CHECKED);
|
||||
return ((mii.fState & MFS_CHECKED) != 0);
|
||||
}
|
||||
|
||||
void SDL_SetTrayEntryEnabled(SDL_TrayEntry *entry, bool enabled)
|
||||
|
|
@ -549,7 +549,7 @@ bool SDL_GetTrayEntryEnabled(SDL_TrayEntry *entry)
|
|||
|
||||
GetMenuItemInfoW(entry->parent->hMenu, (UINT) entry->id, FALSE, &mii);
|
||||
|
||||
return !!(mii.fState & MFS_ENABLED);
|
||||
return ((mii.fState & MFS_ENABLED) != 0);
|
||||
}
|
||||
|
||||
void SDL_SetTrayEntryCallback(SDL_TrayEntry *entry, SDL_TrayCallback callback, void *userdata)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue