summaryrefslogtreecommitdiff
path: root/src/hotkeys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hotkeys.cpp')
-rw-r--r--src/hotkeys.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp
index 3093a8229..38ac4325d 100644
--- a/src/hotkeys.cpp
+++ b/src/hotkeys.cpp
@@ -24,7 +24,7 @@ char *_hotkeys_file;
* List of all HotkeyLists.
* This is a pointer to ensure initialisation order with the various static HotkeyList instances.
*/
-static std::vector<HotkeyList*> *_hotkey_lists = NULL;
+static std::vector<HotkeyList*> *_hotkey_lists = nullptr;
/** String representation of a keycode */
struct KeycodeNames {
@@ -254,7 +254,7 @@ void Hotkey::AddKeycode(uint16 keycode)
HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler) :
global_hotkey_handler(global_hotkey_handler), ini_group(ini_group), items(items)
{
- if (_hotkey_lists == NULL) _hotkey_lists = new std::vector<HotkeyList*>();
+ if (_hotkey_lists == nullptr) _hotkey_lists = new std::vector<HotkeyList*>();
_hotkey_lists->push_back(this);
}
@@ -270,11 +270,11 @@ HotkeyList::~HotkeyList()
void HotkeyList::Load(IniFile *ini)
{
IniGroup *group = ini->GetGroup(this->ini_group);
- for (Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) {
+ for (Hotkey *hotkey = this->items; hotkey->name != nullptr; ++hotkey) {
IniItem *item = group->GetItem(hotkey->name, false);
- if (item != NULL) {
+ if (item != nullptr) {
hotkey->keycodes.clear();
- if (item->value != NULL) ParseHotkeys(hotkey, item->value);
+ if (item->value != nullptr) ParseHotkeys(hotkey, item->value);
}
}
}
@@ -286,7 +286,7 @@ void HotkeyList::Load(IniFile *ini)
void HotkeyList::Save(IniFile *ini) const
{
IniGroup *group = ini->GetGroup(this->ini_group);
- for (const Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) {
+ for (const Hotkey *hotkey = this->items; hotkey->name != nullptr; ++hotkey) {
IniItem *item = group->GetItem(hotkey->name, true);
item->SetValue(SaveKeycodes(hotkey));
}
@@ -300,7 +300,7 @@ void HotkeyList::Save(IniFile *ini) const
*/
int HotkeyList::CheckMatch(uint16 keycode, bool global_only) const
{
- for (const Hotkey *list = this->items; list->name != NULL; ++list) {
+ for (const Hotkey *list = this->items; list->name != nullptr; ++list) {
auto begin = list->keycodes.begin();
auto end = list->keycodes.end();
if (std::find(begin, end, keycode | WKC_GLOBAL_HOTKEY) != end || (!global_only && std::find(begin, end, keycode) != end)) {
@@ -344,7 +344,7 @@ void SaveHotkeysToConfig()
void HandleGlobalHotkeys(WChar key, uint16 keycode)
{
for (HotkeyList *list : *_hotkey_lists) {
- if (list->global_hotkey_handler == NULL) continue;
+ if (list->global_hotkey_handler == nullptr) continue;
int hotkey = list->CheckMatch(keycode, true);
if (hotkey >= 0 && (list->global_hotkey_handler(hotkey) == ES_HANDLED)) return;