chore: Annotate fallthrough switch paths with FALLTHROUGH
The compiler was throwing errors about unannotated fallthroughs when building with GN.
This commit is contained in:
parent
3f40e93ba7
commit
8ccb5cc6eb
4 changed files with 26 additions and 2 deletions
|
@ -173,12 +173,12 @@ bool ScopedDisableResize::disable_resize_ = false;
|
||||||
buttonFrame.origin.x += NSWidth(
|
buttonFrame.origin.x += NSWidth(
|
||||||
[[self standardWindowButton:NSWindowMiniaturizeButton] frame]);
|
[[self standardWindowButton:NSWindowMiniaturizeButton] frame]);
|
||||||
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
|
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
|
||||||
// fallthrough
|
FALLTHROUGH;
|
||||||
case NSWindowMiniaturizeButton:
|
case NSWindowMiniaturizeButton:
|
||||||
buttonFrame.origin.x +=
|
buttonFrame.origin.x +=
|
||||||
NSWidth([[self standardWindowButton:NSWindowCloseButton] frame]);
|
NSWidth([[self standardWindowButton:NSWindowCloseButton] frame]);
|
||||||
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
|
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
|
||||||
// fallthrough
|
FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,7 @@ void WebDialogHelper::RunFileChooser(
|
||||||
switch (params.mode) {
|
switch (params.mode) {
|
||||||
case content::FileChooserParams::OpenMultiple:
|
case content::FileChooserParams::OpenMultiple:
|
||||||
flags |= file_dialog::FILE_DIALOG_MULTI_SELECTIONS;
|
flags |= file_dialog::FILE_DIALOG_MULTI_SELECTIONS;
|
||||||
|
FALLTHROUGH;
|
||||||
case content::FileChooserParams::Open:
|
case content::FileChooserParams::Open:
|
||||||
flags |= file_dialog::FILE_DIALOG_OPEN_FILE;
|
flags |= file_dialog::FILE_DIALOG_OPEN_FILE;
|
||||||
flags |= file_dialog::FILE_DIALOG_TREAT_PACKAGE_APP_AS_DIRECTORY;
|
flags |= file_dialog::FILE_DIALOG_TREAT_PACKAGE_APP_AS_DIRECTORY;
|
||||||
|
|
|
@ -88,87 +88,108 @@ ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted) {
|
||||||
|
|
||||||
case ')':
|
case ')':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '0':
|
case '0':
|
||||||
return ui::VKEY_0;
|
return ui::VKEY_0;
|
||||||
case '!':
|
case '!':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '1':
|
case '1':
|
||||||
return ui::VKEY_1;
|
return ui::VKEY_1;
|
||||||
case '@':
|
case '@':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '2':
|
case '2':
|
||||||
return ui::VKEY_2;
|
return ui::VKEY_2;
|
||||||
case '#':
|
case '#':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '3':
|
case '3':
|
||||||
return ui::VKEY_3;
|
return ui::VKEY_3;
|
||||||
case '$':
|
case '$':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '4':
|
case '4':
|
||||||
return ui::VKEY_4;
|
return ui::VKEY_4;
|
||||||
case '%':
|
case '%':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '5':
|
case '5':
|
||||||
return ui::VKEY_5;
|
return ui::VKEY_5;
|
||||||
case '^':
|
case '^':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '6':
|
case '6':
|
||||||
return ui::VKEY_6;
|
return ui::VKEY_6;
|
||||||
case '&':
|
case '&':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '7':
|
case '7':
|
||||||
return ui::VKEY_7;
|
return ui::VKEY_7;
|
||||||
case '*':
|
case '*':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '8':
|
case '8':
|
||||||
return ui::VKEY_8;
|
return ui::VKEY_8;
|
||||||
case '(':
|
case '(':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '9':
|
case '9':
|
||||||
return ui::VKEY_9;
|
return ui::VKEY_9;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case ';':
|
case ';':
|
||||||
return ui::VKEY_OEM_1;
|
return ui::VKEY_OEM_1;
|
||||||
case '+':
|
case '+':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '=':
|
case '=':
|
||||||
return ui::VKEY_OEM_PLUS;
|
return ui::VKEY_OEM_PLUS;
|
||||||
case '<':
|
case '<':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case ',':
|
case ',':
|
||||||
return ui::VKEY_OEM_COMMA;
|
return ui::VKEY_OEM_COMMA;
|
||||||
case '_':
|
case '_':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '-':
|
case '-':
|
||||||
return ui::VKEY_OEM_MINUS;
|
return ui::VKEY_OEM_MINUS;
|
||||||
case '>':
|
case '>':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '.':
|
case '.':
|
||||||
return ui::VKEY_OEM_PERIOD;
|
return ui::VKEY_OEM_PERIOD;
|
||||||
case '?':
|
case '?':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '/':
|
case '/':
|
||||||
return ui::VKEY_OEM_2;
|
return ui::VKEY_OEM_2;
|
||||||
case '~':
|
case '~':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '`':
|
case '`':
|
||||||
return ui::VKEY_OEM_3;
|
return ui::VKEY_OEM_3;
|
||||||
case '{':
|
case '{':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '[':
|
case '[':
|
||||||
return ui::VKEY_OEM_4;
|
return ui::VKEY_OEM_4;
|
||||||
case '|':
|
case '|':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '\\':
|
case '\\':
|
||||||
return ui::VKEY_OEM_5;
|
return ui::VKEY_OEM_5;
|
||||||
case '}':
|
case '}':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case ']':
|
case ']':
|
||||||
return ui::VKEY_OEM_6;
|
return ui::VKEY_OEM_6;
|
||||||
case '"':
|
case '"':
|
||||||
*shifted = true;
|
*shifted = true;
|
||||||
|
FALLTHROUGH;
|
||||||
case '\'':
|
case '\'':
|
||||||
return ui::VKEY_OEM_7;
|
return ui::VKEY_OEM_7;
|
||||||
|
|
||||||
|
|
|
@ -43,10 +43,12 @@ v8::Local<v8::Value> MenuItemToV8(
|
||||||
case content::MenuItem::CHECKABLE_OPTION:
|
case content::MenuItem::CHECKABLE_OPTION:
|
||||||
case content::MenuItem::GROUP:
|
case content::MenuItem::GROUP:
|
||||||
v8_item.Set("checked", item.checked);
|
v8_item.Set("checked", item.checked);
|
||||||
|
FALLTHROUGH;
|
||||||
case content::MenuItem::OPTION:
|
case content::MenuItem::OPTION:
|
||||||
case content::MenuItem::SUBMENU:
|
case content::MenuItem::SUBMENU:
|
||||||
v8_item.Set("label", item.label);
|
v8_item.Set("label", item.label);
|
||||||
v8_item.Set("enabled", item.enabled);
|
v8_item.Set("enabled", item.enabled);
|
||||||
|
FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
v8_item.Set("type", item.type);
|
v8_item.Set("type", item.type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue