Bug 784739 - Switch from NULL to nullptr in hal/. r=ehsan
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Fri, 23 Aug 2013 15:51:15 -0400
changeset 144164 5c8591a9369a462c734e168daa0d04e4825c578c
parent 144163 7db2236a37750641eb099a8b11c45ea4601bff11
child 144165 fd99696eb53dc3e7a163286bda4a5d4132186f29
push id2354
push userttaubert@mozilla.com
push dateMon, 26 Aug 2013 06:39:14 +0000
treeherderfx-team@4887845b1142 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone26.0a1
Bug 784739 - Switch from NULL to nullptr in hal/. r=ehsan
hal/Hal.cpp
hal/cocoa/CocoaGamepad.cpp
hal/gonk/GonkFMRadio.cpp
hal/gonk/GonkHal.cpp
hal/gonk/GonkSensor.cpp
hal/gonk/GonkSwitch.cpp
hal/gonk/UeventPoller.cpp
hal/linux/LinuxGamepad.cpp
hal/windows/WindowsSensor.cpp
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -212,17 +212,17 @@ public:
       OnNotificationsDisabled();
 
       delete mObservers;
       mObservers = nullptr;
     }
   }
 
   void BroadcastInformation(const InfoType& aInfo) {
-    // It is possible for mObservers to be NULL here on some platforms,
+    // It is possible for mObservers to be nullptr here on some platforms,
     // because a call to BroadcastInformation gets queued up asynchronously
     // while RemoveObserver is running (and before the notifications are
     // disabled). The queued call can then get run after mObservers has
     // been nulled out. See bug 757025.
     if (!mObservers) {
       return;
     }
     mObservers->Broadcast(aInfo);
@@ -741,37 +741,37 @@ DisableSwitchNotifications(SwitchDevice 
 SwitchState GetCurrentSwitchState(SwitchDevice aDevice)
 {
   AssertMainThread();
   RETURN_PROXY_IF_SANDBOXED(GetCurrentSwitchState(aDevice), SWITCH_STATE_UNKNOWN);
 }
 
 typedef mozilla::ObserverList<SwitchEvent> SwitchObserverList;
 
-static SwitchObserverList *sSwitchObserverLists = NULL;
+static SwitchObserverList *sSwitchObserverLists = nullptr;
 
 static SwitchObserverList&
 GetSwitchObserverList(SwitchDevice aDevice) {
   MOZ_ASSERT(0 <= aDevice && aDevice < NUM_SWITCH_DEVICE); 
-  if (sSwitchObserverLists == NULL) {
+  if (sSwitchObserverLists == nullptr) {
     sSwitchObserverLists = new SwitchObserverList[NUM_SWITCH_DEVICE];
   }
   return sSwitchObserverLists[aDevice];
 }
 
 static void
 ReleaseObserversIfNeeded() {
   for (int i = 0; i < NUM_SWITCH_DEVICE; i++) {
     if (sSwitchObserverLists[i].Length() != 0)
       return;
   }
 
   //The length of every list is 0, no observer in the list.
   delete [] sSwitchObserverLists;
-  sSwitchObserverLists = NULL;
+  sSwitchObserverLists = nullptr;
 }
 
 void
 RegisterSwitchObserver(SwitchDevice aDevice, SwitchObserver *aObserver)
 {
   AssertMainThread();
   SwitchObserverList& observer = GetSwitchObserverList(aDevice);
   observer.AddObserver(aObserver);
--- a/hal/cocoa/CocoaGamepad.cpp
+++ b/hal/cocoa/CocoaGamepad.cpp
@@ -44,55 +44,55 @@ struct Axis {
 
 class Gamepad {
  private:
   IOHIDDeviceRef mDevice;
   vector<Button> buttons;
   vector<Axis> axes;
 
  public:
-  Gamepad() : mDevice(NULL), mSuperIndex(-1) {}
+  Gamepad() : mDevice(nullptr), mSuperIndex(-1) {}
   bool operator==(IOHIDDeviceRef device) const { return mDevice == device; }
-  bool empty() const { return mDevice == NULL; }
+  bool empty() const { return mDevice == nullptr; }
   void clear() {
-    mDevice = NULL;
+    mDevice = nullptr;
     buttons.clear();
     axes.clear();
     mSuperIndex = -1;
   }
   void init(IOHIDDeviceRef device);
   size_t numButtons() { return buttons.size(); }
   size_t numAxes() { return axes.size(); }
 
   // Index given by our superclass.
   uint32_t mSuperIndex;
 
   const Button* lookupButton(IOHIDElementRef element) const {
     for (size_t i = 0; i < buttons.size(); i++) {
       if (buttons[i].element == element)
         return &buttons[i];
     }
-    return NULL;
+    return nullptr;
   }
 
   const Axis* lookupAxis(IOHIDElementRef element) const {
     for (size_t i = 0; i < axes.size(); i++) {
       if (axes[i].element == element)
         return &axes[i];
     }
-    return NULL;
+    return nullptr;
   }
 };
 
 void Gamepad::init(IOHIDDeviceRef device) {
   clear();
   mDevice = device;
 
   CFArrayRef elements = IOHIDDeviceCopyMatchingElements(device,
-                                                        NULL,
+                                                        nullptr,
                                                         kIOHIDOptionsTypeNone);
   CFIndex n = CFArrayGetCount(elements);
   for (CFIndex i = 0; i < n; i++) {
     IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements,
                                                                       i);
     uint32_t usagePage = IOHIDElementGetUsagePage(element);
     uint32_t usage = IOHIDElementGetUsage(element);
 
@@ -242,49 +242,49 @@ static CFMutableDictionaryRef
 MatchingDictionary(UInt32 inUsagePage, UInt32 inUsage)
 {
   CFMutableDictionaryRef dict =
     CFDictionaryCreateMutable(kCFAllocatorDefault,
                               0,
                               &kCFTypeDictionaryKeyCallBacks,
                               &kCFTypeDictionaryValueCallBacks);
   if (!dict)
-    return NULL;
+    return nullptr;
   CFNumberRef number = CFNumberCreate(kCFAllocatorDefault,
                                       kCFNumberIntType,
                                       &inUsagePage);
   if (!number) {
     CFRelease(dict);
-    return NULL;
+    return nullptr;
   }
   CFDictionarySetValue(dict, CFSTR(kIOHIDDeviceUsagePageKey), number);
   CFRelease(number);
 
   number = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &inUsage);
   if (!number) {
     CFRelease(dict);
-    return NULL;
+    return nullptr;
   }
   CFDictionarySetValue(dict, CFSTR(kIOHIDDeviceUsageKey), number);
   CFRelease(number);
 
   return dict;
 }
 
-DarwinGamepadService::DarwinGamepadService() : mManager(NULL) {}
+DarwinGamepadService::DarwinGamepadService() : mManager(nullptr) {}
 
 DarwinGamepadService::~DarwinGamepadService()
 {
-  if (mManager != NULL)
+  if (mManager != nullptr)
     CFRelease(mManager);
 }
 
 void DarwinGamepadService::Startup()
 {
-  if (mManager != NULL)
+  if (mManager != nullptr)
     return;
 
   IOHIDManagerRef manager = IOHIDManagerCreate(kCFAllocatorDefault,
                                                kIOHIDOptionsTypeNone);
 
   CFMutableDictionaryRef criteria_arr[2];
   criteria_arr[0] = MatchingDictionary(GENERIC_DESKTOP_USAGE_PAGE,
                                        JOYSTICK_USAGE_NUMBER);
@@ -297,17 +297,17 @@ void DarwinGamepadService::Startup()
                                        GAMEPAD_USAGE_NUMBER);
   if (!criteria_arr[1]) {
     CFRelease(criteria_arr[0]);
     CFRelease(manager);
     return;
   }
 
   CFArrayRef criteria =
-    CFArrayCreate(kCFAllocatorDefault, (const void**)criteria_arr, 2, NULL);
+    CFArrayCreate(kCFAllocatorDefault, (const void**)criteria_arr, 2, nullptr);
   if (!criteria) {
     CFRelease(criteria_arr[1]);
     CFRelease(criteria_arr[0]);
     CFRelease(manager);
     return;
   }
 
   IOHIDManagerSetDeviceMatchingMultiple(manager, criteria);
@@ -337,26 +337,26 @@ void DarwinGamepadService::Startup()
 }
 
 void DarwinGamepadService::Shutdown()
 {
   IOHIDManagerRef manager = (IOHIDManagerRef)mManager;
   if (manager) {
     IOHIDManagerClose(manager, 0);
     CFRelease(manager);
-    mManager = NULL;
+    mManager = nullptr;
   }
 }
 
 } // namespace
 
 namespace mozilla {
 namespace hal_impl {
 
-DarwinGamepadService* gService = NULL;
+DarwinGamepadService* gService = nullptr;
 
 void StartMonitoringGamepadStatus()
 {
   if (gService)
     return;
 
   gService = new DarwinGamepadService();
   gService->Startup();
@@ -364,13 +364,13 @@ void StartMonitoringGamepadStatus()
 
 void StopMonitoringGamepadStatus()
 {
   if (!gService)
     return;
 
   gService->Shutdown();
   delete gService;
-  gService = NULL;
+  gService = nullptr;
 }
 
 } // namespace hal_impl
 } // namespace mozilla
--- a/hal/gonk/GonkFMRadio.cpp
+++ b/hal/gonk/GonkFMRadio.cpp
@@ -198,17 +198,17 @@ initTavaruaRadio(hal::FMRadioSettings &a
 /* Runs on the radio thread */
 static void *
 runTavaruaRadio(void *)
 {
   initTavaruaRadio(sRadioSettings);
   if (!sRadioEnabled) {
     NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_ENABLE,
                                             hal::FM_RADIO_OPERATION_STATUS_FAIL));
-    return NULL;
+    return nullptr;
   }
 
   uint8_t buf[128];
   struct v4l2_buffer buffer = {0};
   buffer.index = 1;
   buffer.type = V4L2_BUF_TYPE_PRIVATE;
   buffer.length = sizeof(buf);
   buffer.m.userptr = (long unsigned int)buf;
@@ -235,17 +235,17 @@ runTavaruaRadio(void *)
                                                 hal::FM_RADIO_OPERATION_STATUS_SUCCESS));
         break;
       default:
         break;
       }
     }
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /* This runs on the main thread but most of the
  * initialization is pushed to the radio thread. */
 void
 EnableFMRadio(const hal::FMRadioSettings& aInfo)
 {
   if (sRadioEnabled) {
@@ -277,17 +277,17 @@ EnableFMRadio(const hal::FMRadioSettings
     HAL_LOG(("/dev/radio0 doesn't support the tuner interface"));
     return;
   }
   sRadioFD = fd.forget();
   sRadioSettings = aInfo;
 
   // Tavarua specific start
   sTavaruaVersion = cap.version;
-  pthread_create(&sRadioThread, NULL, runTavaruaRadio, NULL);
+  pthread_create(&sRadioThread, nullptr, runTavaruaRadio, nullptr);
   // Tavarua specific end
 }
 
 void
 DisableFMRadio()
 {
   if (!sRadioEnabled)
     return;
@@ -296,17 +296,17 @@ DisableFMRadio()
 
   // Tavarua specific start
   int rc = setControl(V4L2_CID_PRIVATE_TAVARUA_STATE, FM_OFF);
   if (rc < 0) {
     HAL_LOG(("Unable to turn off radio"));
   }
   // Tavarua specific end
 
-  pthread_join(sRadioThread, NULL);
+  pthread_join(sRadioThread, nullptr);
 
   close(sRadioFD);
 
   hal::FMRadioOperationInformation info;
   info.operation() = hal::FM_RADIO_OPERATION_DISABLE;
   info.status() = hal::FM_RADIO_OPERATION_STATUS_SUCCESS;
   hal::NotifyFMRadioStatus(info);
 }
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -178,17 +178,17 @@ VibratorRunnable::Run()
       }
       mIndex++;
       mMonitor.Wait(PR_MillisecondsToInterval(duration));
     }
     else {
       mMonitor.Wait();
     }
   }
-  sVibratorRunnable = NULL;
+  sVibratorRunnable = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 VibratorRunnable::Observe(nsISupports *subject, const char *topic,
                           const PRUnichar *data)
 {
   MOZ_ASSERT(strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0);
@@ -340,17 +340,17 @@ EnableBatteryNotifications()
 
 static void
 UnregisterBatteryObserverIOThread()
 {
   MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
   MOZ_ASSERT(sBatteryObserver);
 
   UnregisterUeventListener(sBatteryObserver);
-  sBatteryObserver = NULL;
+  sBatteryObserver = nullptr;
 }
 
 void
 DisableBatteryNotifications()
 {
   XRE_GetIOMessageLoop()->PostTask(
       FROM_HERE,
       NewRunnableFunction(UnregisterBatteryObserverIOThread));
@@ -588,34 +588,34 @@ GetCpuSleepAllowed()
 void
 SetCpuSleepAllowed(bool aAllowed)
 {
   MonitorAutoLock monitor(*sInternalLockCpuMonitor);
   sCpuSleepAllowed = aAllowed;
   UpdateCpuSleepState();
 }
 
-static light_device_t* sLights[hal::eHalLightID_Count];	// will be initialized to NULL
+static light_device_t* sLights[hal::eHalLightID_Count];	// will be initialized to nullptr
 
 light_device_t* GetDevice(hw_module_t* module, char const* name)
 {
   int err;
   hw_device_t* device;
   err = module->methods->open(module, name, &device);
   if (err == 0) {
     return (light_device_t*)device;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 
 void
 InitLights()
 {
-  // assume that if backlight is NULL, nothing has been set yet
+  // assume that if backlight is nullptr, nothing has been set yet
   // if this is not true, the initialization will occur everytime a light is read or set!
   if (!sLights[hal::eHalLightID_Backlight]) {
     int err;
     hw_module_t* module;
 
     err = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
     if (err == 0) {
       sLights[hal::eHalLightID_Backlight]
@@ -646,17 +646,18 @@ static light_state_t sStoredLightState[h
 
 bool
 SetLight(hal::LightType light, const hal::LightConfiguration& aConfig)
 {
   light_state_t state;
 
   InitLights();
 
-  if (light < 0 || light >= hal::eHalLightID_Count || sLights[light] == NULL) {
+  if (light < 0 || light >= hal::eHalLightID_Count ||
+      sLights[light] == nullptr) {
     return false;
   }
 
   memset(&state, 0, sizeof(light_state_t));
   state.color = aConfig.color();
   state.flashMode = aConfig.flash();
   state.flashOnMS = aConfig.flashOnMS();
   state.flashOffMS = aConfig.flashOffMS();
@@ -671,17 +672,18 @@ bool
 GetLight(hal::LightType light, hal::LightConfiguration* aConfig)
 {
   light_state_t state;
 
 #ifdef HAVEGETLIGHT
   InitLights();
 #endif
 
-  if (light < 0 || light >= hal::eHalLightID_Count || sLights[light] == NULL) {
+  if (light < 0 || light >= hal::eHalLightID_Count ||
+      sLights[light] == nullptr) {
     return false;
   }
 
   memset(&state, 0, sizeof(light_state_t));
 
 #ifdef HAVEGETLIGHT
   sLights[light]->get_light(sLights[light], &state);
 #else
@@ -843,17 +845,17 @@ public:
   bool mShuttingDown;
 
   static int sNextGeneration;
 
 };
 
 int AlarmData::sNextGeneration = 0;
 
-AlarmData* sAlarmData = NULL;
+AlarmData* sAlarmData = nullptr;
 
 class AlarmFiredEvent : public nsRunnable {
 public:
   AlarmFiredEvent(int aGeneration) : mGeneration(aGeneration) {}
 
   NS_IMETHOD Run() {
     // Guard against spurious notifications caused by an alarm firing
     // concurrently with it being disabled.
@@ -915,17 +917,17 @@ WaitForAlarm(void* aData)
       InternalLockCpu();
       nsRefPtr<AlarmFiredEvent> event =
         new AlarmFiredEvent(alarmData->mGeneration);
       NS_DispatchToMainThread(event);
     }
   }
 
   pthread_cleanup_pop(1);
-  return NULL;
+  return nullptr;
 }
 
 bool
 EnableAlarm()
 {
   MOZ_ASSERT(!sAlarmData);
 
   int alarmFd = open("/dev/alarm", O_RDWR);
@@ -936,32 +938,32 @@ EnableAlarm()
 
   nsAutoPtr<AlarmData> alarmData(new AlarmData(alarmFd));
 
   struct sigaction actions;
   memset(&actions, 0, sizeof(actions));
   sigemptyset(&actions.sa_mask);
   actions.sa_flags = 0;
   actions.sa_handler = ShutDownAlarm;
-  if (sigaction(SIGUSR1, &actions, NULL)) {
+  if (sigaction(SIGUSR1, &actions, nullptr)) {
     HAL_LOG(("Failed to set SIGUSR1 signal for alarm-watcher thread."));
     return false;
   }
 
   pthread_attr_t attr;
   pthread_attr_init(&attr);
   pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
   // Initialize the monitor for internally locking CPU to ensure thread-safe
   // before running the alarm-watcher thread.
   sInternalLockCpuMonitor = new Monitor("sInternalLockCpuMonitor");
   int status = pthread_create(&sAlarmFireWatcherThread, &attr, WaitForAlarm,
                               alarmData.get());
   if (status) {
-    alarmData = NULL;
+    alarmData = nullptr;
     delete sInternalLockCpuMonitor;
     HAL_LOG(("Failed to create alarm-watcher thread. Status: %d.", status));
     return false;
   }
 
   pthread_attr_destroy(&attr);
 
   // The thread owns this now.  We only hold a pointer.
@@ -970,17 +972,17 @@ EnableAlarm()
 }
 
 void
 DisableAlarm()
 {
   MOZ_ASSERT(sAlarmData);
 
   // NB: this must happen-before the thread cancellation.
-  sAlarmData = NULL;
+  sAlarmData = nullptr;
 
   // The cancel will interrupt the thread and destroy it, freeing the
   // data pointed at by sAlarmData.
   DebugOnly<int> err = pthread_kill(sAlarmFireWatcherThread, SIGUSR1);
   MOZ_ASSERT(!err);
 
   delete sInternalLockCpuMonitor;
 }
--- a/hal/gonk/GonkSensor.cpp
+++ b/hal/gonk/GonkSensor.cpp
@@ -224,17 +224,17 @@ SwitchSensor(bool aActivate, sensor_t aS
     sSensorRefCount[index]--;
   }
 }
 
 static void
 SetSensorState(SensorType aSensor, bool activate)
 {
   int type = HalSensorToHardwareSensor(aSensor);
-  const sensor_t* sensors = NULL;
+  const sensor_t* sensors = nullptr;
 
   int size = sSensorModule->get_sensors_list(sSensorModule, &sensors);
   for (ssize_t i = 0; i < size; i++) {
     if (sensors[i].type == type) {
       SwitchSensor(activate, sensors[i], pthread_self());
       break;
     }
   }
@@ -248,17 +248,17 @@ EnableSensorNotifications(SensorType aSe
                        (hw_module_t const**)&sSensorModule);
     if (!sSensorModule) {
       LOGE("Can't get sensor HAL module\n");
       return;
     }
 
     sensors_open(&sSensorModule->common, &sSensorDevice);
     if (!sSensorDevice) {
-      sSensorModule = NULL;
+      sSensorModule = nullptr;
       LOGE("Can't get sensor poll device from module \n");
       return;
     }
 
     sensor_t const* sensors;
     int count = sSensorModule->get_sensors_list(sSensorModule, &sensors);
     for (size_t i=0 ; i<size_t(count) ; i++) {
       sSensorDevice->activate(sSensorDevice, sensors[i].handle, 0);
--- a/hal/gonk/GonkSwitch.cpp
+++ b/hal/gonk/GonkSwitch.cpp
@@ -354,17 +354,17 @@ InitializeResourceIfNeed()
   }
 }
 
 static void
 ReleaseResourceIfNeed()
 {
   if (sSwitchObserver->GetEnableCount() == 0) {
     UnregisterUeventListener(sSwitchObserver);
-    sSwitchObserver = NULL;
+    sSwitchObserver = nullptr;
   }
 }
 
 static void
 EnableSwitchNotificationsIOThread(SwitchDevice aDevice, Monitor *aMonitor)
 {
   InitializeResourceIfNeed();
   sSwitchObserver->EnableSwitch(aDevice);
--- a/hal/gonk/UeventPoller.cpp
+++ b/hal/gonk/UeventPoller.cpp
@@ -178,17 +178,17 @@ InitializeUevent()
   sPoller = new NetlinkPoller();
   sPoller->GetIOLoop()->PostTask(FROM_HERE, new UeventInitTask());
 
 }
 
 static void
 ShutdownUevent()
 {
-  sPoller = NULL;
+  sPoller = nullptr;
 }
 
 void
 RegisterUeventListener(IUeventObserver *aObserver)
 {
   MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
 
   if (!sPoller)
--- a/hal/linux/LinuxGamepad.cpp
+++ b/hal/linux/LinuxGamepad.cpp
@@ -115,17 +115,19 @@ LinuxGamepadService::AddDevice(struct ud
     strcpy(name, "unknown");
   }
   const char* vendor_id =
     mUdev.udev_device_get_property_value(dev, "ID_VENDOR_ID");
   const char* model_id =
     mUdev.udev_device_get_property_value(dev, "ID_MODEL_ID");
   if (!vendor_id || !model_id) {
     struct udev_device* parent =
-      mUdev.udev_device_get_parent_with_subsystem_devtype(dev, "input", NULL);
+      mUdev.udev_device_get_parent_with_subsystem_devtype(dev,
+                                                          "input",
+                                                          nullptr);
     if (parent) {
       vendor_id = mUdev.udev_device_get_sysattr_value(parent, "id/vendor");
       model_id = mUdev.udev_device_get_sysattr_value(parent, "id/product");
     }
   }
   snprintf(gamepad.idstring, sizeof(gamepad.idstring),
            "%s-%s-%s",
            vendor_id ? vendor_id : "unknown",
--- a/hal/windows/WindowsSensor.cpp
+++ b/hal/windows/WindowsSensor.cpp
@@ -110,18 +110,20 @@ EnableSensorNotifications(SensorType aSe
     return;
   }
 
   if (sAccelerometer) {
     return;
   }
 
   nsRefPtr<ISensorManager> manager;
-  if (FAILED(CoCreateInstance(CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER,
-                              IID_ISensorManager, getter_AddRefs(manager)))) {
+  if (FAILED(CoCreateInstance(CLSID_SensorManager, nullptr,
+                              CLSCTX_INPROC_SERVER,
+                              IID_ISensorManager, 
+                              getter_AddRefs(manager)))) {
     return;
   }
 
   // accelerometer event
 
   nsRefPtr<ISensorCollection> collection;
   if (FAILED(manager->GetSensorsByType(SENSOR_TYPE_ACCELEROMETER_3D,
                                        getter_AddRefs(collection)))) {
@@ -138,17 +140,17 @@ EnableSensorNotifications(SensorType aSe
   collection->GetAt(0, getter_AddRefs(sensor));
   if (!sensor) {
     return;
   }
 
   // Set report interval to 100ms if possible. 
   // Default value depends on drivers.
   nsRefPtr<IPortableDeviceValues> values;
-  if (SUCCEEDED(CoCreateInstance(CLSID_PortableDeviceValues, NULL,
+  if (SUCCEEDED(CoCreateInstance(CLSID_PortableDeviceValues, nullptr,
                                  CLSCTX_INPROC_SERVER,
                                  IID_IPortableDeviceValues,
                                  getter_AddRefs(values)))) {
     if (SUCCEEDED(values->SetUnsignedIntegerValue(
                     SENSOR_PROPERTY_CURRENT_REPORT_INTERVAL,
                     DEFAULT_SENSOR_POLL))) {
       nsRefPtr<IPortableDeviceValues> returns;
       sensor->SetProperties(values, getter_AddRefs(returns));
@@ -168,15 +170,15 @@ EnableSensorNotifications(SensorType aSe
 
   sAccelerometer = sensor;
 }
 
 void
 DisableSensorNotifications(SensorType aSensor)
 {
   if (aSensor == SENSOR_ACCELERATION && sAccelerometer) {
-    sAccelerometer->SetEventSink(NULL);
+    sAccelerometer->SetEventSink(nullptr);
     sAccelerometer = nullptr;
   }
 }
 
 } // hal_impl
 } // mozilla