Skip to content

Commit

Permalink
Fix warnings about non-specified cases of enums
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Mar 2, 2024
1 parent 936b3c3 commit 3be4aa1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions examples/custom_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ void draw_button(os::Surface* surface, int x, Hit button, const Hit hit)
surface->drawPath(path, p);
break;
}
default:
break;
}
}

Expand Down Expand Up @@ -223,6 +225,7 @@ bool handle_mouse_down(os::Window* window,
case Hit::MinimizeButton: window->minimize(); return true;
case Hit::MaximizeButton: window->maximize(); return true;
case Hit::CloseButton: return false;
default: break;
}
window->performWindowAction(action, &ev);
return true;
Expand Down Expand Up @@ -269,6 +272,8 @@ int app_main(int argc, char* argv[])
case os::kKeyF11:
window->setFullscreen(!window->isFullscreen());
break;
default:
break;
}
break;

Expand Down
3 changes: 3 additions & 0 deletions examples/floating_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class CustomWindow {
ev.scancode() == os::kKeyEnterPad)
onEnterKey();
break;

default:
break;
}
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions examples/multiple_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ int app_main(int argc, char* argv[])
case os::kKeyUp: rc.y -= rc.h; break;
case os::kKeyRight: rc.x += rc.w; break;
case os::kKeyDown: rc.y += rc.h; break;
default: break;
}
ev.window()->setFrame(rc);

Expand All @@ -233,6 +234,8 @@ int app_main(int argc, char* argv[])
break;
}

default:
break;
}
break;

Expand Down
2 changes: 2 additions & 0 deletions os/osx/view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
case NSEventTypeRightMouseUp:
case NSEventTypeRightMouseDragged:
return Event::RightButton;
default:
break;
}

switch (event.buttonNumber) {
Expand Down
2 changes: 2 additions & 0 deletions os/osx/window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ - (BOOL)setNativeCursor:(os::NativeCursor)cursor
case os::NativeCursor::SizeW:
nsCursor = [NSCursor resizeLeftCursor];
break;
default:
break;
}

[self.contentView setCursor:nsCursor];
Expand Down
4 changes: 2 additions & 2 deletions os/x11/keys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ KeySym x11_keysym_to_scancode(const KeyScancode scancode)
case kKeyX: return XK_x;
case kKeyY: return XK_y;
case kKeyZ: return XK_z;
default: return 0;
}
return 0;
}

bool x11_is_key_pressed(const KeyScancode scancode)
Expand Down Expand Up @@ -357,8 +357,8 @@ int x11_get_unicode_from_scancode(const KeyScancode scancode)
case kKeyX: return 'x';
case kKeyY: return 'y';
case kKeyZ: return 'z';
default: return 0;
}
return 0;
}

KeyModifiers get_modifiers_from_x(const int state)
Expand Down

0 comments on commit 3be4aa1

Please sign in to comment.