mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
@ -230,7 +230,7 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference*
|
||||
, const DeviceQualifier& default_device) const
|
||||
{
|
||||
delete ref->parsed_expression;
|
||||
ref->parsed_expression = NULL;
|
||||
ref->parsed_expression = nullptr;
|
||||
|
||||
ControlFinder finder(*this, default_device, ref->is_input);
|
||||
ref->parse_error = ParseExpression(ref->expression, finder, &ref->parsed_expression);
|
||||
@ -244,7 +244,7 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference*
|
||||
// which is useful for those crazy flightsticks that have certain buttons that are always held down
|
||||
// or some crazy axes or something
|
||||
// upon input, return pointer to detected Control
|
||||
// else return NULL
|
||||
// else return nullptr
|
||||
//
|
||||
Device::Control* ControllerInterface::InputReference::Detect(const unsigned int ms, Device* const device)
|
||||
{
|
||||
@ -252,7 +252,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int
|
||||
std::vector<bool> states(device->Inputs().size());
|
||||
|
||||
if (device->Inputs().size() == 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// get starting state of all inputs,
|
||||
// so we can ignore those that were activated at time of Detect start
|
||||
@ -285,7 +285,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int
|
||||
}
|
||||
|
||||
// no input was detected
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//
|
||||
@ -317,5 +317,5 @@ Device::Control* ControllerInterface::OutputReference::Detect(const unsigned int
|
||||
State(0);
|
||||
device->UpdateOutput();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(NULL) {}
|
||||
ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(nullptr) {}
|
||||
ciface::ExpressionParser::Expression *parsed_expression;
|
||||
};
|
||||
|
||||
@ -113,7 +113,7 @@ public:
|
||||
Device::Control* Detect(const unsigned int ms, Device* const device) override;
|
||||
};
|
||||
|
||||
ControllerInterface() : m_is_init(false), m_hwnd(NULL) {}
|
||||
ControllerInterface() : m_is_init(false), m_hwnd(nullptr) {}
|
||||
|
||||
void SetHwnd(void* const hwnd);
|
||||
void Initialize();
|
||||
|
@ -48,7 +48,7 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
|
||||
void Init(std::vector<Core::Device*>& devices, HWND hwnd)
|
||||
{
|
||||
IDirectInput8* idi8;
|
||||
if (FAILED(DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, NULL)))
|
||||
if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, nullptr)))
|
||||
return;
|
||||
|
||||
InitKeyboardMouse(idi8, devices, hwnd);
|
||||
|
@ -24,47 +24,47 @@ namespace DInput
|
||||
void GetXInputGUIDS( std::vector<DWORD>& guids )
|
||||
{
|
||||
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=nullptr; } }
|
||||
|
||||
IWbemLocator* pIWbemLocator = NULL;
|
||||
IEnumWbemClassObject* pEnumDevices = NULL;
|
||||
IWbemLocator* pIWbemLocator = nullptr;
|
||||
IEnumWbemClassObject* pEnumDevices = nullptr;
|
||||
IWbemClassObject* pDevices[20] = {0};
|
||||
IWbemServices* pIWbemServices = NULL;
|
||||
BSTR bstrNamespace = NULL;
|
||||
BSTR bstrDeviceID = NULL;
|
||||
BSTR bstrClassName = NULL;
|
||||
IWbemServices* pIWbemServices = nullptr;
|
||||
BSTR bstrNamespace = nullptr;
|
||||
BSTR bstrDeviceID = nullptr;
|
||||
BSTR bstrClassName = nullptr;
|
||||
DWORD uReturned = 0;
|
||||
VARIANT var;
|
||||
HRESULT hr;
|
||||
|
||||
// CoInit if needed
|
||||
hr = CoInitialize(NULL);
|
||||
hr = CoInitialize(nullptr);
|
||||
bool bCleanupCOM = SUCCEEDED(hr);
|
||||
|
||||
// Create WMI
|
||||
hr = CoCreateInstance(__uuidof(WbemLocator),
|
||||
NULL,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWbemLocator),
|
||||
(LPVOID*) &pIWbemLocator);
|
||||
if (FAILED(hr) || pIWbemLocator == NULL)
|
||||
if (FAILED(hr) || pIWbemLocator == nullptr)
|
||||
goto LCleanup;
|
||||
|
||||
bstrNamespace = SysAllocString(L"\\\\.\\root\\cimv2");if(bstrNamespace == NULL) goto LCleanup;
|
||||
bstrClassName = SysAllocString(L"Win32_PNPEntity"); if(bstrClassName == NULL) goto LCleanup;
|
||||
bstrDeviceID = SysAllocString(L"DeviceID"); if(bstrDeviceID == NULL) goto LCleanup;
|
||||
bstrNamespace = SysAllocString(L"\\\\.\\root\\cimv2");if(bstrNamespace == nullptr) goto LCleanup;
|
||||
bstrClassName = SysAllocString(L"Win32_PNPEntity"); if(bstrClassName == nullptr) goto LCleanup;
|
||||
bstrDeviceID = SysAllocString(L"DeviceID"); if(bstrDeviceID == nullptr) goto LCleanup;
|
||||
|
||||
// Connect to WMI
|
||||
hr = pIWbemLocator->ConnectServer(bstrNamespace, NULL, NULL, 0L, 0L, NULL, NULL, &pIWbemServices);
|
||||
if (FAILED(hr) || pIWbemServices == NULL)
|
||||
hr = pIWbemLocator->ConnectServer(bstrNamespace, nullptr, nullptr, 0L, 0L, nullptr, nullptr, &pIWbemServices);
|
||||
if (FAILED(hr) || pIWbemServices == nullptr)
|
||||
goto LCleanup;
|
||||
|
||||
// Switch security level to IMPERSONATE.
|
||||
CoSetProxyBlanket(pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL,
|
||||
RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
|
||||
CoSetProxyBlanket(pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr,
|
||||
RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, nullptr, EOAC_NONE);
|
||||
|
||||
hr = pIWbemServices->CreateInstanceEnum(bstrClassName, 0, NULL, &pEnumDevices);
|
||||
if (FAILED(hr) || pEnumDevices == NULL)
|
||||
hr = pIWbemServices->CreateInstanceEnum(bstrClassName, 0, nullptr, &pEnumDevices);
|
||||
if (FAILED(hr) || pEnumDevices == nullptr)
|
||||
goto LCleanup;
|
||||
|
||||
// Loop over all devices
|
||||
@ -78,8 +78,8 @@ void GetXInputGUIDS( std::vector<DWORD>& guids )
|
||||
for (UINT iDevice = 0; iDevice < uReturned; ++iDevice)
|
||||
{
|
||||
// For each device, get its device ID
|
||||
hr = pDevices[iDevice]->Get(bstrDeviceID, 0L, &var, NULL, NULL);
|
||||
if (SUCCEEDED(hr) && var.vt == VT_BSTR && var.bstrVal != NULL)
|
||||
hr = pDevices[iDevice]->Get(bstrDeviceID, 0L, &var, nullptr, nullptr);
|
||||
if (SUCCEEDED(hr) && var.vt == VT_BSTR && var.bstrVal != nullptr)
|
||||
{
|
||||
// Check if the device ID contains "IG_". If it does, then it's an XInput device
|
||||
// This information can not be found from DirectInput
|
||||
@ -140,7 +140,7 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices
|
||||
continue;
|
||||
|
||||
LPDIRECTINPUTDEVICE8 js_device;
|
||||
if (SUCCEEDED(idi8->CreateDevice(joystick.guidInstance, &js_device, NULL)))
|
||||
if (SUCCEEDED(idi8->CreateDevice(joystick.guidInstance, &js_device, nullptr)))
|
||||
{
|
||||
if (SUCCEEDED(js_device->SetDataFormat(&c_dfDIJoystick)))
|
||||
{
|
||||
@ -148,7 +148,7 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices
|
||||
{
|
||||
//PanicAlert("SetCooperativeLevel(DISCL_EXCLUSIVE) failed!");
|
||||
// fall back to non-exclusive mode, with no rumble
|
||||
if (FAILED(js_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
if (FAILED(js_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
{
|
||||
//PanicAlert("SetCooperativeLevel failed!");
|
||||
js_device->Release();
|
||||
|
@ -52,20 +52,20 @@ void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<Core::Device*>& de
|
||||
// if that's dumb, I will make a VirtualDevice class that just uses ranges of inputs/outputs from other devices
|
||||
// so there can be a separated Keyboard and mouse, as well as combined KeyboardMouse
|
||||
|
||||
LPDIRECTINPUTDEVICE8 kb_device = NULL;
|
||||
LPDIRECTINPUTDEVICE8 mo_device = NULL;
|
||||
LPDIRECTINPUTDEVICE8 kb_device = nullptr;
|
||||
LPDIRECTINPUTDEVICE8 mo_device = nullptr;
|
||||
|
||||
if (SUCCEEDED(idi8->CreateDevice( GUID_SysKeyboard, &kb_device, NULL)))
|
||||
if (SUCCEEDED(idi8->CreateDevice( GUID_SysKeyboard, &kb_device, nullptr)))
|
||||
{
|
||||
if (SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard)))
|
||||
{
|
||||
if (SUCCEEDED(kb_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
if (SUCCEEDED(kb_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
{
|
||||
if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, NULL )))
|
||||
if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, nullptr )))
|
||||
{
|
||||
if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)))
|
||||
{
|
||||
if (SUCCEEDED(mo_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
if (SUCCEEDED(mo_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
|
||||
{
|
||||
devices.push_back(new KeyboardMouse(kb_device, mo_device));
|
||||
return;
|
||||
|
@ -46,7 +46,7 @@ Device::Input* Device::FindInput(const std::string &name) const
|
||||
return input;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Device::Output* Device::FindOutput(const std::string &name) const
|
||||
@ -57,7 +57,7 @@ Device::Output* Device::FindOutput(const std::string &name) const
|
||||
return output;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//
|
||||
@ -151,7 +151,7 @@ Device* DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
||||
return d;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Device::Input* DeviceContainer::FindInput(const std::string& name, const Device* def_dev) const
|
||||
@ -171,7 +171,7 @@ Device::Input* DeviceContainer::FindInput(const std::string& name, const Device*
|
||||
return i;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Device::Output* DeviceContainer::FindOutput(const std::string& name, const Device* def_dev) const
|
||||
|
@ -42,8 +42,8 @@ public:
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual ~Control() {}
|
||||
|
||||
virtual Input* ToInput() { return NULL; }
|
||||
virtual Output* ToOutput() { return NULL; }
|
||||
virtual Input* ToInput() { return nullptr; }
|
||||
virtual Output* ToOutput() { return nullptr; }
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -357,7 +357,7 @@ Device::Control *ControlFinder::FindControl(ControlQualifier qualifier)
|
||||
{
|
||||
Device *device = FindDevice(qualifier);
|
||||
if (!device)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (is_input)
|
||||
return device->FindInput(qualifier.control_name);
|
||||
@ -414,7 +414,7 @@ private:
|
||||
case TOK_CONTROL:
|
||||
{
|
||||
Device::Control *control = finder.FindControl(tok.qualifier);
|
||||
if (control == NULL)
|
||||
if (control == nullptr)
|
||||
return EXPRESSION_PARSE_NO_DEVICE;
|
||||
|
||||
*expr_out = new ControlExpression(tok.qualifier, control);
|
||||
@ -539,7 +539,7 @@ ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finde
|
||||
{
|
||||
ExpressionParseStatus status;
|
||||
Expression *expr;
|
||||
*expr_out = NULL;
|
||||
*expr_out = nullptr;
|
||||
|
||||
if (str == "")
|
||||
return EXPRESSION_PARSE_SUCCESS;
|
||||
|
@ -47,7 +47,7 @@ class ExpressionNode;
|
||||
class Expression
|
||||
{
|
||||
public:
|
||||
Expression() : node(NULL) {}
|
||||
Expression() : node(nullptr) {}
|
||||
Expression(ExpressionNode *node);
|
||||
~Expression();
|
||||
ControlState GetValue();
|
||||
|
@ -102,7 +102,7 @@ bool ForceFeedbackDevice::InitForceFeedback(const LPDIRECTINPUTDEVICE8 device, i
|
||||
}
|
||||
|
||||
LPDIRECTINPUTEFFECT pEffect;
|
||||
if (SUCCEEDED(device->CreateEffect(f.guid, &eff, &pEffect, NULL)))
|
||||
if (SUCCEEDED(device->CreateEffect(f.guid, &eff, &pEffect, nullptr)))
|
||||
{
|
||||
m_state_out.push_back(EffectState(pEffect));
|
||||
|
||||
@ -155,7 +155,7 @@ bool ForceFeedbackDevice::UpdateOutput()
|
||||
ok_count += SUCCEEDED(state.iface->Stop());
|
||||
}
|
||||
|
||||
state.params = NULL;
|
||||
state.params = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ class ForceFeedbackDevice : public Core::Device
|
||||
private:
|
||||
struct EffectState
|
||||
{
|
||||
EffectState(LPDIRECTINPUTEFFECT eff) : iface(eff), params(NULL), size(0) {}
|
||||
EffectState(LPDIRECTINPUTEFFECT eff) : iface(eff), params(nullptr), size(0) {}
|
||||
|
||||
LPDIRECTINPUTEFFECT iface;
|
||||
void* params; // null when force hasn't changed
|
||||
|
@ -72,11 +72,11 @@ public:
|
||||
|
||||
HRESULT QueryInterface(REFIID iid, LPVOID *ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
*ppv = nullptr;
|
||||
|
||||
if (CFEqual(&iid, IUnknownUUID))
|
||||
*ppv = this;
|
||||
if (NULL == *ppv)
|
||||
if (nullptr == *ppv)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
((IUnknown*)*ppv)->AddRef();
|
||||
|
@ -18,7 +18,7 @@ namespace OSX
|
||||
{
|
||||
|
||||
|
||||
static IOHIDManagerRef HIDManager = NULL;
|
||||
static IOHIDManagerRef HIDManager = nullptr;
|
||||
static CFStringRef OurRunLoop = CFSTR("DolphinOSXInput");
|
||||
static std::map<std::string, int> kbd_name_counts, joy_name_counts;
|
||||
|
||||
@ -90,7 +90,7 @@ void DeviceElementDebugPrint(const void *value, void *context)
|
||||
type == "collection" ? c_type.c_str() : " ",
|
||||
IOHIDElementGetUsagePage(e),
|
||||
IOHIDElementGetUsage(e),
|
||||
IOHIDElementGetName(e), // usually just NULL
|
||||
IOHIDElementGetName(e), // usually just nullptr
|
||||
IOHIDElementGetLogicalMin(e),
|
||||
IOHIDElementGetLogicalMax(e),
|
||||
IOHIDElementGetPhysicalMin(e),
|
||||
@ -102,7 +102,7 @@ void DeviceElementDebugPrint(const void *value, void *context)
|
||||
CFRange range = {0, CFArrayGetCount(elements)};
|
||||
// this leaks...but it's just debug code, right? :D
|
||||
CFArrayApplyFunction(elements, range,
|
||||
DeviceElementDebugPrint, NULL);
|
||||
DeviceElementDebugPrint, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ static void DeviceMatching_callback(void* inContext,
|
||||
{
|
||||
NSString *pName = (NSString *)
|
||||
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey));
|
||||
std::string name = (pName != NULL) ? [pName UTF8String] : "Unknown device";
|
||||
std::string name = (pName != nullptr) ? [pName UTF8String] : "Unknown device";
|
||||
|
||||
DeviceDebugPrint(inIOHIDDeviceRef);
|
||||
|
||||
@ -178,7 +178,7 @@ void Init(std::vector<Core::Device*>& devices, void *window)
|
||||
|
||||
g_window = window;
|
||||
|
||||
IOHIDManagerSetDeviceMatching(HIDManager, NULL);
|
||||
IOHIDManagerSetDeviceMatching(HIDManager, nullptr);
|
||||
|
||||
// Callbacks for acquisition or loss of a matching device
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(HIDManager,
|
||||
@ -200,7 +200,7 @@ void Init(std::vector<Core::Device*>& devices, void *window)
|
||||
|
||||
// Things should be configured now
|
||||
// Disable hotplugging and other scheduling
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(HIDManager, NULL, NULL);
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(HIDManager, nullptr, nullptr);
|
||||
IOHIDManagerUnscheduleFromRunLoop(HIDManager,
|
||||
CFRunLoopGetCurrent(), OurRunLoop);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index)
|
||||
{
|
||||
IOHIDElementRef e =
|
||||
(IOHIDElementRef)CFArrayGetValueAtIndex(buttons, i);
|
||||
//DeviceElementDebugPrint(e, NULL);
|
||||
//DeviceElementDebugPrint(e, nullptr);
|
||||
|
||||
AddInput(new Button(e, m_device));
|
||||
}
|
||||
@ -62,7 +62,7 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index)
|
||||
{
|
||||
IOHIDElementRef e =
|
||||
(IOHIDElementRef)CFArrayGetValueAtIndex(axes, i);
|
||||
//DeviceElementDebugPrint(e, NULL);
|
||||
//DeviceElementDebugPrint(e, nullptr);
|
||||
|
||||
if (IOHIDElementGetUsage(e) == kHIDUsage_GD_Hatswitch) {
|
||||
AddInput(new Hat(e, m_device, Hat::up));
|
||||
|
@ -40,7 +40,7 @@ Keyboard::Keyboard(IOHIDDeviceRef device, std::string name, int index, void *win
|
||||
{
|
||||
IOHIDElementRef e =
|
||||
(IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
|
||||
//DeviceElementDebugPrint(e, NULL);
|
||||
//DeviceElementDebugPrint(e, nullptr);
|
||||
|
||||
AddInput(new Key(e, m_device));
|
||||
}
|
||||
@ -61,7 +61,7 @@ bool Keyboard::UpdateInput()
|
||||
{
|
||||
CGRect bounds = CGRectZero;
|
||||
uint32_t windowid[1] = { m_windowid };
|
||||
CFArrayRef windowArray = CFArrayCreate(NULL, (const void **) windowid, 1, NULL);
|
||||
CFArrayRef windowArray = CFArrayCreate(nullptr, (const void **) windowid, 1, nullptr);
|
||||
CFArrayRef windowDescriptions = CGWindowListCreateDescriptionFromArray(windowArray);
|
||||
CFDictionaryRef windowDescription = (CFDictionaryRef) CFArrayGetValueAtIndex((CFArrayRef) windowDescriptions, 0);
|
||||
|
||||
@ -69,7 +69,7 @@ bool Keyboard::UpdateInput()
|
||||
{
|
||||
CFDictionaryRef boundsDictionary = (CFDictionaryRef) CFDictionaryGetValue(windowDescription, kCGWindowBounds);
|
||||
|
||||
if (boundsDictionary != NULL)
|
||||
if (boundsDictionary != nullptr)
|
||||
CGRectMakeWithDictionaryRepresentation(boundsDictionary, &bounds);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace XInput2
|
||||
// This function will add zero or more KeyboardMouse objects to devices.
|
||||
void Init(std::vector<Core::Device*>& devices, void* const hwnd)
|
||||
{
|
||||
Display* dpy = XOpenDisplay(NULL);
|
||||
Display* dpy = XOpenDisplay(nullptr);
|
||||
|
||||
// xi_opcode is important; it will be used to identify XInput events by
|
||||
// the polling loop in UpdateInput.
|
||||
@ -129,7 +129,7 @@ KeyboardMouse::KeyboardMouse(Window window, int opcode, int pointer, int keyboar
|
||||
// which it can individually filter to get just the events it's interested
|
||||
// in. So be aware that each KeyboardMouse object actually has its own X11
|
||||
// "context."
|
||||
m_display = XOpenDisplay(NULL);
|
||||
m_display = XOpenDisplay(nullptr);
|
||||
|
||||
int min_keycode, max_keycode;
|
||||
XDisplayKeycodes(m_display, &min_keycode, &max_keycode);
|
||||
@ -326,7 +326,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key
|
||||
// 0x0110ffff is the top of the unicode character range according
|
||||
// to keysymdef.h although it is probably more than we need.
|
||||
if (keysym == NoSymbol || keysym > 0x0110ffff ||
|
||||
XKeysymToString(keysym) == NULL)
|
||||
XKeysymToString(keysym) == nullptr)
|
||||
m_keyname = std::string();
|
||||
else
|
||||
m_keyname = std::string(XKeysymToString(keysym));
|
||||
|
@ -16,7 +16,7 @@ KeyboardMouse::KeyboardMouse(Window window) : m_window(window)
|
||||
{
|
||||
memset(&m_state, 0, sizeof(m_state));
|
||||
|
||||
m_display = XOpenDisplay(NULL);
|
||||
m_display = XOpenDisplay(nullptr);
|
||||
|
||||
int min_keycode, max_keycode;
|
||||
XDisplayKeycodes(m_display, &min_keycode, &max_keycode);
|
||||
@ -107,7 +107,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key
|
||||
// 0x0110ffff is the top of the unicode character range according
|
||||
// to keysymdef.h although it is probably more than we need.
|
||||
if (keysym == NoSymbol || keysym > 0x0110ffff ||
|
||||
XKeysymToString(keysym) == NULL)
|
||||
XKeysymToString(keysym) == nullptr)
|
||||
m_keyname = std::string();
|
||||
else
|
||||
m_keyname = std::string(XKeysymToString(keysym));
|
||||
|
Reference in New Issue
Block a user