-
Notifications
You must be signed in to change notification settings - Fork 621
Open
Milestone
Description
void runMenuEvent(WORD id, uiWindow *w)
{
uiMenu *m;
uiMenuItem *item;
size_t i, j;
// this isn't optimal, but it works, and it should be just fine for most cases
for (i = 0; i < len; i++) {
m = menus[i];
for (j = 0; j < m->len; j++) {
item = m->items[j];
if (item->id == id)
goto found;
}
}
// no match
implbug("unknown menu ID %hu in runMenuEvent()", id);
found:
// first toggle checkboxes, if any
if (item->type == typeCheckbox)
uiMenuItemSetChecked(item, !uiMenuItemChecked(item));
// then run the event
(*(item->onClicked))(item, w, item->onClickedData);
}
C4703 May use uninitialized local pointer variables"item"
Metadata
Metadata
Assignees
Labels
No labels