changeset 28223:45763d59cb4f stable

use nullptr instead of NULL or 0 in a few more places * QWinTerminalImpl.cpp, oct-procbuf.cc, audioread.cc, jit-typeinfo.cc, lo-sysdep.cc, url-transfer.cc, shared-fcns.h: Replace NULL and 0 with nullptr where appropriate.
author John W. Eaton <jwe@octave.org>
date Wed, 15 Apr 2020 15:55:32 -0400
parents 6cccc3c82175
children ad9252d7472b
files libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp libinterp/corefcn/oct-procbuf.cc libinterp/dldfcn/audioread.cc libinterp/parse-tree/jit-typeinfo.cc liboctave/system/lo-sysdep.cc liboctave/util/url-transfer.cc src/shared-fcns.h
diffstat 7 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Tue Apr 14 22:53:19 2020 -0400
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Wed Apr 15 15:55:32 2020 -0400
@@ -282,9 +282,9 @@
   : q (parent), m_command (cmd), m_auto_scroll (true), m_cursorBlinking (false),
     m_hasBlinkingCursor (true), m_cursorType (BlockCursor),
     m_beginSelection (0, 0), m_endSelection (0, 0), m_settingSelection (false),
-    m_process (NULL), m_inWheelEvent (false)
+    m_process (nullptr), m_inWheelEvent (false)
 {
-  log (NULL);
+  log (nullptr);
 
   // Possibly detach from any existing console
   log ("Detaching from existing console (if any)...\n");
@@ -299,7 +299,7 @@
 
   // Create new (hidden) console
   hOrigSta = GetProcessWindowStation ();
-  hNewSta = CreateWindowStation (NULL, 0, GENERIC_ALL, NULL);
+  hNewSta = CreateWindowStation (nullptr, 0, GENERIC_ALL, nullptr);
   log ("Current Windows station: %p.\nNew Windows station: %p.\n", hOrigSta,
        hNewSta);
   if (! SetProcessWindowStation (hNewSta))
@@ -328,9 +328,9 @@
 
   log ("POSIX standard streams created.\n");
 
-  setvbuf (stdin, NULL, _IONBF, 0);
-  setvbuf (stdout, NULL, _IONBF, 0);
-  setvbuf (stderr, NULL, _IONBF, 0);
+  setvbuf (stdin, nullptr, _IONBF, 0);
+  setvbuf (stdout, nullptr, _IONBF, 0);
+  setvbuf (stderr, nullptr, _IONBF, 0);
 
   log ("POSIX standard stream buffers adjusted.\n");
 
@@ -1339,14 +1339,14 @@
       si.cb = sizeof (si);
       ZeroMemory (&pi, sizeof (pi));
 
-      if (CreateProcessW (NULL,
+      if (CreateProcessW (nullptr,
                           (LPWSTR)cmd.unicode (),
-                          NULL,
-                          NULL,
+                          nullptr,
+                          nullptr,
                           TRUE,
                           0,
-                          NULL,
-                          NULL,
+                          nullptr,
+                          nullptr,
                           &si,
                           &pi))
         {
@@ -1354,7 +1354,7 @@
           m_process = pi.hProcess;
           WaitForSingleObject (m_process, INFINITE);
           CloseHandle (m_process);
-          m_process = NULL;
+          m_process = nullptr;
         }
     }
 }
--- a/libinterp/corefcn/oct-procbuf.cc	Tue Apr 14 22:53:19 2020 -0400
+++ b/libinterp/corefcn/oct-procbuf.cc	Wed Apr 15 15:55:32 2020 -0400
@@ -93,7 +93,7 @@
   open_p = true;
 
   if (mode & std::ios::out)
-    ::setvbuf (f, 0, _IOLBF, BUFSIZ);
+    ::setvbuf (f, nullptr, _IOLBF, BUFSIZ);
 
   return this;
 
--- a/libinterp/dldfcn/audioread.cc	Tue Apr 14 22:53:19 2020 -0400
+++ b/libinterp/dldfcn/audioread.cc	Wed Apr 15 15:55:32 2020 -0400
@@ -435,8 +435,8 @@
 
   frame.add_fcn (safe_close, file);
 
-  sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE);
-  sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ;
+  sf_command (file, SFC_SET_NORM_DOUBLE, nullptr, SF_TRUE);
+  sf_command (file, SFC_SET_CLIPPING, nullptr, SF_TRUE) ;
   sf_command (file, SFC_SET_VBR_ENCODING_QUALITY, &quality, sizeof (quality));
 
   if (title != "")
--- a/libinterp/parse-tree/jit-typeinfo.cc	Tue Apr 14 22:53:19 2020 -0400
+++ b/libinterp/parse-tree/jit-typeinfo.cc	Wed Apr 15 15:55:32 2020 -0400
@@ -1665,7 +1665,7 @@
       llvm::Value *dzero = llvm::ConstantFP::get (m_scalar_t, 0);
       llvm::Value *izero = llvm::ConstantInt::get (m_index_t, 0);
       llvm::Value *rng = llvm::ConstantStruct::get (m_range_t, dzero, dzero,
-                                                    dzero, izero, NULL);
+                                                    dzero, izero, nullptr);
       rng = m_builder.CreateInsertValue (rng, base, 0);
       rng = m_builder.CreateInsertValue (rng, limit, 1);
       rng = m_builder.CreateInsertValue (rng, inc, 2);
--- a/liboctave/system/lo-sysdep.cc	Tue Apr 14 22:53:19 2020 -0400
+++ b/liboctave/system/lo-sysdep.cc	Wed Apr 15 15:55:32 2020 -0400
@@ -212,7 +212,7 @@
                          });
 
       if (set_nonbuffered_mode)
-        ::setvbuf (fptr, 0, _IONBF, 0);
+        ::setvbuf (fptr, nullptr, _IONBF, 0);
 
       while (true)
         {
@@ -341,7 +341,7 @@
 
       if (fseek_ftell_bug_workaround_needed
           && mode.find ('t') != std::string::npos)
-        ::setvbuf (fptr, 0, _IONBF, 0);
+        ::setvbuf (fptr, nullptr, _IONBF, 0);
 
       return fptr;
 
--- a/liboctave/util/url-transfer.cc	Tue Apr 14 22:53:19 2020 -0400
+++ b/liboctave/util/url-transfer.cc	Wed Apr 15 15:55:32 2020 -0400
@@ -732,7 +732,7 @@
     // path of the file as its value.
     void form_data_post (const Array<std::string>& param)
     {
-      struct curl_httppost *post = NULL, *last = NULL;
+      struct curl_httppost *post = nullptr, *last = nullptr;
 
       SETOPT (CURLOPT_URL, m_host_or_url.c_str ());
 
--- a/src/shared-fcns.h	Tue Apr 14 22:53:19 2020 -0400
+++ b/src/shared-fcns.h	Wed Apr 15 15:55:32 2020 -0400
@@ -50,7 +50,7 @@
   std::string bin_dir;
 
   char namebuf[MAX_PATH+1];
-  if (GetModuleFileName (GetModuleHandle (NULL), namebuf, MAX_PATH))
+  if (GetModuleFileName (GetModuleHandle (nullptr), namebuf, MAX_PATH))
     {
       namebuf[MAX_PATH] = '\0';