diff liboctave/lo-utils.h @ 15221:a83b7b2f95ee

avoid C-style cast warnings from GCC for wait-related macros * lo-utils.h (octave_wait): New class. * lo-cutils.h, lo-cutils.c (octave_wifexited, octave_wexitstatus, octave_wifsignaled, octave_wtermsig, octave_wcoredump, octave_wifstopped, octave_wstopsig, octave_wifcontinued): New functions. * toplev.cc, pager.cc, syscalls.cc: Use octave_wait functions instead of WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED macros.
author John W. Eaton <jwe@octave.org>
date Thu, 23 Aug 2012 12:18:08 -0400
parents 4bbd3bbb8912
children
line wrap: on
line diff
--- a/liboctave/lo-utils.h
+++ b/liboctave/lo-utils.h
@@ -135,4 +135,52 @@
 extern OCTAVE_API void
 octave_write_float_complex (std::ostream& os, const FloatComplex& cval);
 
+// Maybe this is overkill, but it allos
+
+class
+octave_wait
+{
+public:
+
+  static bool ifexited (int status)
+  {
+    return octave_wifexited (status);
+  }
+
+  static int exitstatus (int status)
+  {
+    return octave_wexitstatus (status);
+  }
+
+  static bool ifsignaled (int status)
+  {
+    return octave_wifsignaled (status);
+  }
+
+  static int termsig (int status)
+  {
+    return octave_wtermsig (status);
+  }
+
+  static bool coredump (int status)
+  {
+    return octave_wcoredump (status);
+  }
+
+  static bool ifstopped (int status)
+  {
+    return octave_wifstopped (status);
+  }
+
+  static int stopsig (int status)
+  {
+    return octave_wstopsig (status);
+  }
+
+  static bool ifcontinued (int status)
+  {
+    return octave_wifcontinued (status);
+  }
+};
+
 #endif