Kaydet (Commit) b6f6cf85 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite; Mac-specific code)

Change-Id: Iaa14c583c55c3582e33a1d073ea92b388cd6f3a4
üst b6f1be10
...@@ -97,14 +97,14 @@ namespace /* private */ ...@@ -97,14 +97,14 @@ namespace /* private */
CFStringRef ImplGetAppPreference(const char* pref) CFStringRef ImplGetAppPreference(const char* pref)
{ {
CFStringRef csPref = CFStringCreateWithCString(NULL, pref, kCFStringEncodingASCII); CFStringRef csPref = CFStringCreateWithCString(nullptr, pref, kCFStringEncodingASCII);
CFStringGuard csRefGuard(csPref); CFStringGuard csRefGuard(csPref);
CFTypeRef ref = CFPreferencesCopyAppValue(csPref, kCFPreferencesCurrentApplication); CFTypeRef ref = CFPreferencesCopyAppValue(csPref, kCFPreferencesCurrentApplication);
CFTypeRefGuard refGuard(ref); CFTypeRefGuard refGuard(ref);
if (ref == NULL) if (ref == nullptr)
return NULL; return nullptr;
CFStringRef sref = (CFGetTypeID(ref) == CFArrayGetTypeID()) ? static_cast<CFStringRef>(CFArrayGetValueAtIndex(static_cast<CFArrayRef>(ref), 0)) : static_cast<CFStringRef>(ref); CFStringRef sref = (CFGetTypeID(ref) == CFArrayGetTypeID()) ? static_cast<CFStringRef>(CFArrayGetValueAtIndex(static_cast<CFArrayRef>(ref), 0)) : static_cast<CFStringRef>(ref);
...@@ -122,14 +122,14 @@ namespace /* private */ ...@@ -122,14 +122,14 @@ namespace /* private */
OUStringBuffer aLocaleBuffer; OUStringBuffer aLocaleBuffer;
aLocaleBuffer.append("en-US"); // initialize with fallback value aLocaleBuffer.append("en-US"); // initialize with fallback value
if (sref != NULL) if (sref != nullptr)
{ {
// split the string into substrings; the first two (if there are two) substrings // split the string into substrings; the first two (if there are two) substrings
// are language and country // are language and country
CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(NULL, sref, CFSTR("_")); CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(nullptr, sref, CFSTR("_"));
CFArrayGuard subsGuard(subs); CFArrayGuard subsGuard(subs);
if (subs != NULL) if (subs != nullptr)
{ {
aLocaleBuffer.setLength(0); // clear buffer which still contains fallback value aLocaleBuffer.setLength(0); // clear buffer which still contains fallback value
......
...@@ -72,7 +72,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -72,7 +72,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
CFNumberRef portNum; CFNumberRef portNum;
int portInt; int portInt;
proxyDict = SCDynamicStoreCopyProxies(NULL); proxyDict = SCDynamicStoreCopyProxies(nullptr);
if (!proxyDict) if (!proxyDict)
return false; return false;
...@@ -100,7 +100,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -100,7 +100,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
enableNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict, enableNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
proxiesEnable )); proxiesEnable ));
result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); result = (enableNum != nullptr) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
if (result) if (result)
result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0); result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
...@@ -111,7 +111,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -111,7 +111,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
hostStr = static_cast<CFStringRef>(CFDictionaryGetValue( proxyDict, hostStr = static_cast<CFStringRef>(CFDictionaryGetValue( proxyDict,
proxiesProxy )); proxiesProxy ));
result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); result = (hostStr != nullptr) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
} }
if (result) if (result)
...@@ -123,7 +123,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -123,7 +123,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
portNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict, portNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
proxiesPort )); proxiesPort ));
result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); result = (portNum != nullptr) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
} }
else else
{ {
...@@ -396,10 +396,10 @@ css::uno::Any MacOSXBackend::getPropertyValue( ...@@ -396,10 +396,10 @@ css::uno::Any MacOSXBackend::getPropertyValue(
rtl::OUString aProxyBypassList; rtl::OUString aProxyBypassList;
CFArrayRef rExceptionsList; CFArrayRef rExceptionsList;
CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL); CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(nullptr);
if (!rProxyDict) if (!rProxyDict)
rExceptionsList = 0; rExceptionsList = nullptr;
else else
rExceptionsList = static_cast<CFArrayRef>(CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList)); rExceptionsList = static_cast<CFArrayRef>(CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList));
......
...@@ -43,10 +43,10 @@ static const cppu::ImplementationEntry kImplementations_entries[] = ...@@ -43,10 +43,10 @@ static const cppu::ImplementationEntry kImplementations_entries[] =
MacOSXBackend::getBackendName, MacOSXBackend::getBackendName,
MacOSXBackend::getBackendServiceNames, MacOSXBackend::getBackendServiceNames,
cppu::createSingleComponentFactory, cppu::createSingleComponentFactory,
NULL, nullptr,
0 0
}, },
{ 0, 0, 0, 0, 0, 0 } { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment