changeset 2800:9aeba8e006a4

[project @ 1997-03-09 09:50:20 by jwe]
author jwe
date Sun, 09 Mar 1997 09:50:39 +0000
parents d77a29e4387f
children a98f5a21f026
files ChangeLog NEWS config.h.bot liboctave/CMatrix.cc liboctave/ChangeLog liboctave/FEGrid.cc liboctave/Range.cc liboctave/dMatrix.cc liboctave/data-conv.cc liboctave/dir-ops.cc liboctave/file-ops.h liboctave/idx-vector.cc liboctave/idx-vector.h liboctave/lo-ieee.cc liboctave/lo-mappers.cc liboctave/oct-alloc.cc src/ChangeLog src/Map.cc src/data.cc src/dirfns.cc src/dynamic-ld.cc src/file-io.cc src/fsolve.cc src/getgrent.cc src/getpwent.cc src/getrusage.cc src/help.cc src/input.cc src/load-save.cc src/mappers.cc src/minmax.cc src/npsol.cc src/oct-fstrm.cc src/oct-procbuf.h src/oct-stdstrm.cc src/oct-stdstrm.h src/oct-stream.cc src/oct-stream.h src/oct-strstrm.cc src/octave.cc src/ov-base.h src/ov-range.cc src/ov-typeinfo.cc src/ov.cc src/pr-output.cc src/pt-cmd.cc src/pt-exp.cc src/pt-fcn.cc src/pt-fvc.cc src/pt-mat.cc src/pt-misc.cc src/pt-plot.cc src/qpsol.cc src/quad.cc src/sort.cc src/strfns.cc src/symtab.cc src/syscalls.cc src/sysdep.cc src/time.cc src/toplev.cc src/unwind-prot.cc src/unwind-prot.h src/variables.cc src/xpow.cc
diffstat 65 files changed, 447 insertions(+), 390 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Mar 08 08:41:00 1997 +0000
+++ b/ChangeLog	Sun Mar 09 09:50:39 1997 +0000
@@ -1,3 +1,7 @@
+Sun Mar  9 03:44:33 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* config.h.bot (STATIC_CAST): Delete definition.
+
 Thu Mar  6 03:26:41 1997  Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
 
 	* emacs/octave-hlp.el: Provide octave-hlp.
--- a/NEWS	Sat Mar 08 08:41:00 1997 +0000
+++ b/NEWS	Sun Mar 09 09:50:39 1997 +0000
@@ -1,3 +1,16 @@
+Summary of changes for version 2.0.6:
+------------------------------------
+
+  * Functions like quad, fsolve, and lsode can take either a function
+    name or a simple function body as a string.  For example,
+
+      quad ("sqrt (x)", 0, 1)
+
+    is equivalent to
+
+      function y = f (x) y = sqrt (x); endfunction
+      quad ("f", 0, 1)
+
 Summary of changes for version 2.0.5:
 ------------------------------------
 
--- a/config.h.bot	Sat Mar 08 08:41:00 1997 +0000
+++ b/config.h.bot	Sun Mar 09 09:50:39 1997 +0000
@@ -7,8 +7,6 @@
 #define GCC_ATTR_UNUSED
 #endif
 
-#define STATIC_CAST(T, E) (T) (E)
-
 #define DYNAMIC_CAST(T, E) (T) (E)
 
 #define REINTERPRET_CAST(T, E) (T) (E)
--- a/liboctave/CMatrix.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/CMatrix.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -1000,7 +1000,7 @@
     F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave);
 
   for (int j = 0; j < npts*nsamples; j++)
-    tmp_data[j] = tmp_data[j] / (double) npts;
+    tmp_data[j] = tmp_data[j] / npts;
 
   return retval;
 }
@@ -1100,7 +1100,7 @@
     F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave);
 
   for (int j = 0; j < npts*nsamples; j++)
-    tmp_data[j] = tmp_data[j] / (double) npts;
+    tmp_data[j] = tmp_data[j] / npts;
 
   npts = nc;
   nsamples = nr;
@@ -1122,7 +1122,7 @@
       F77_FCN (cfftb, CFFTB) (npts, prow, pwsave);
 
       for (int i = 0; i < npts; i++)
-	tmp_data[i*nr + j] = prow[i] / (double) npts;
+	tmp_data[i*nr + j] = prow[i] / npts;
     }
 
   return retval;
@@ -1579,9 +1579,8 @@
     = F77_FCN (zlange, ZLANGE) ("I", nc, nc, m.fortran_vec (), nc,
 				work.fortran_vec ());
 
-  int sqpow = (int) (inf_norm > 0.0
-		     ? (1.0 + log (inf_norm) / log (2.0))
-		     : 0.0);
+  int sqpow = (inf_norm > 0.0
+	       ? static_cast<int> (1.0 + log (inf_norm) / log (2.0)) : 0);
 
   // Check whether we need to square at all.
 
--- a/liboctave/ChangeLog	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/ChangeLog	Sun Mar 09 09:50:39 1997 +0000
@@ -1,3 +1,10 @@
+Sun Mar  9 03:44:52 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* CMatrix.cc, FEGrid.cc, Range.cc, dMatrix.cc, data-conv.cc,
+	dir-ops.cc, file-ops.h, idx-vector.cc, idx-vector.h, lo-ieee.cc,
+	lo-mappers.cc, oct-alloc.cc: Use `static_cast<T> (val)' instead of
+	old C-style `(T) val' casts.
+
 Thu Mar  6 20:20:01 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* dMatrix.cc (operator >>): Return if an error occurs instead of
--- a/liboctave/FEGrid.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/FEGrid.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -73,7 +73,7 @@
 
   elem.resize (nel+1);
 
-  double width = (right - left) / (double) nel;
+  double width = (right - left) / nel;
 
   for (int i = 0; i <= nel; i++)
     elem.elem (i) = i * width + left;
--- a/liboctave/Range.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/Range.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -46,8 +46,8 @@
   // will also be an integer, even if the limit is not.
 
   return (! (xisnan (rng_base) || xisnan (rng_inc))
-	  && (double) NINT (rng_base) == rng_base
-	  && (double) NINT (rng_inc) == rng_inc);
+	  && NINT (rng_base) == rng_base
+	  && NINT (rng_inc) == rng_inc);
 }
 
 Matrix
@@ -237,7 +237,7 @@
 
   double tmp = tfloor ((rng_limit - rng_base + rng_inc) / rng_inc, ct);
 
-  int n_intervals = (int) (tmp > 0.0 ? tmp : 0);
+  int n_intervals = (tmp > 0.0 ? static_cast<int> (tmp) : 0);
 
   return (n_intervals >= INT_MAX - 1) ? -1 : n_intervals;
 }
--- a/liboctave/dMatrix.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/dMatrix.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -708,7 +708,7 @@
     F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave);
 
   for (int j = 0; j < npts*nsamples; j++)
-    tmp_data[j] = tmp_data[j] / (double) npts;
+    tmp_data[j] = tmp_data[j] / npts;
 
   return retval;
 }
@@ -808,7 +808,7 @@
     F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave);
 
   for (int j = 0; j < npts*nsamples; j++)
-    tmp_data[j] = tmp_data[j] / (double) npts;
+    tmp_data[j] = tmp_data[j] / npts;
 
   npts = nc;
   nsamples = nr;
@@ -830,7 +830,7 @@
       F77_FCN (cfftb, CFFTB) (npts, prow, pwsave);
 
       for (int i = 0; i < npts; i++)
-	tmp_data[i*nr + j] = prow[i] / (double) npts;
+	tmp_data[i*nr + j] = prow[i] / npts;
     }
 
   return retval;
@@ -2639,7 +2639,7 @@
 static void
 read_int (istream& is, bool swap_bytes, T& val)
 {
-  is.read ((char *) &val, sizeof (T));
+  is.read (static_cast<char *> (&val), sizeof (T));
 
   if (swap_bytes)
     {
@@ -2649,15 +2649,15 @@
 	  break;
 
 	case 2:
-	  swap_2_bytes ((char *) &val);
+	  swap_2_bytes (static_cast<char *> (&val));
 	  break;
 
 	case 4:
-	  swap_4_bytes ((char *) &val);
+	  swap_4_bytes (static_cast<char *> (&val));
 	  break;
 
 	case 8:
-	  swap_8_bytes ((char *) &val);
+	  swap_8_bytes (static_cast<char *> (&val));
 	  break;
 
 	default:
@@ -2762,7 +2762,7 @@
       {
 	float f;
 
-	is.read ((char *) &f, sizeof (float));
+	is.read (static_cast<char *> (&f), sizeof (float));
 
 	if (do_float_conversion)
 	  do_float_format_conversion (&f, 1, flt_fmt);
@@ -2773,7 +2773,7 @@
 
     case oct_data_conv::dt_double:
       {
-	is.read ((char *) &val, sizeof (double));
+	is.read (static_cast<char *> (&val), sizeof (double));
 
 	if (do_float_conversion)
 	  do_double_format_conversion (&val, 1, flt_fmt);
@@ -2953,15 +2953,15 @@
 	  break;
 
 	case 2:
-	  swap_2_bytes ((char *) &val);
+	  swap_2_bytes (static_cast<char *> (&val));
 	  break;
 
 	case 4:
-	  swap_4_bytes ((char *) &val);
+	  swap_4_bytes (static_cast<char *> (&val));
 	  break;
 
 	case 8:
-	  swap_8_bytes ((char *) &val);
+	  swap_8_bytes (static_cast<char *> (&val));
 	  break;
 
 	default:
@@ -2970,7 +2970,7 @@
 	}
     }
 
-  os.write ((char *) &val, sizeof (T));
+  os.write (static_cast<char *> (&val), sizeof (T));
 }
 
 template void write_int (ostream&, bool, char);
@@ -2993,49 +2993,49 @@
   switch (dt)
     {
     case oct_data_conv::dt_char:
-      write_int (os, swap_bytes, (char) d);
+      write_int (os, swap_bytes, static_cast<char> (d));
       break;
 
     case oct_data_conv::dt_schar:
-      write_int (os, swap_bytes, (signed char) d);
+      write_int (os, swap_bytes, static_cast<signed char> (d));
       break;
 
     case oct_data_conv::dt_uchar:
-      write_int (os, swap_bytes, (unsigned char) d);
+      write_int (os, swap_bytes, static_cast<unsigned char> (d));
       break;
 
     case oct_data_conv::dt_short:
-      write_int (os, swap_bytes, (short) d);
+      write_int (os, swap_bytes, static_cast<short> (d));
       break;
 
     case oct_data_conv::dt_ushort:
-      write_int (os, swap_bytes, (unsigned short) d);
+      write_int (os, swap_bytes, static_cast<unsigned short> (d));
       break;
 
     case oct_data_conv::dt_int:
-      write_int (os, swap_bytes, (int) d);
+      write_int (os, swap_bytes, static_cast<int> (d));
       break;
 
     case oct_data_conv::dt_uint:
-      write_int (os, swap_bytes, (unsigned int) d);
+      write_int (os, swap_bytes, static_cast<unsigned int> (d));
       break;
 
     case oct_data_conv::dt_long:
-      write_int (os, swap_bytes, (long) d);
+      write_int (os, swap_bytes, static_cast<long> (d));
       break;
 
     case oct_data_conv::dt_ulong:
-      write_int (os, swap_bytes, (unsigned long) d);
+      write_int (os, swap_bytes, static_cast<unsigned long> (d));
       break;
 
     case oct_data_conv::dt_float:
       {
-	float f = (float) d;
+	float f = d;
 
 	if (do_float_conversion)
 	  do_float_format_conversion (&f, 1, flt_fmt);
 
-	os.write ((char *) &f, sizeof (float));
+	os.write (static_cast<char *> (&f), sizeof (float));
       }
       break;
 
@@ -3044,7 +3044,7 @@
 	if (do_float_conversion)
 	  do_double_format_conversion (&d, 1, flt_fmt);
 
-	os.write ((char *) &d, sizeof (double));
+	os.write (static_cast<char *> (&d), sizeof (double));
       }
       break;
 
--- a/liboctave/data-conv.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/data-conv.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -109,7 +109,7 @@
       volatile TYPE *ptr = (TYPE *) data; \
       stream.read ((TYPE *) ptr, size * len); \
       if (swap) \
-        swap_ ## size ## _bytes ((char *) ptr, len); \
+        swap_ ## size ## _bytes (static_cast<char *> (ptr), len); \
       TYPE tmp = ptr[0]; \
       for (int i = len - 1; i > 0; i--) \
         data[i] = ptr[i]; \
@@ -123,7 +123,7 @@
 #define LS_DO_WRITE(TYPE,data,size,len,stream) \
   do \
     { \
-      char tmp_type = (char) type; \
+      char tmp_type = static_cast<char> (type); \
       stream.write (&tmp_type, 1); \
       TYPE *ptr = new TYPE [len]; \
       for (int i = 0; i < len; i++) \
@@ -161,7 +161,7 @@
 static void
 IEEE_big_double_to_IEEE_little_double (double *d, int len)
 {
-  swap_8_bytes ((char *) d, len);
+  swap_8_bytes (static_cast<char *> (d), len);
 }
 
 static void
@@ -185,7 +185,7 @@
 static void
 IEEE_big_float_to_IEEE_little_float (float *d, int len)
 {
-  swap_4_bytes ((char *) d, len);
+  swap_4_bytes (static_cast<char *> (d), len);
 }
 
 static void
@@ -209,7 +209,7 @@
 static void
 IEEE_little_double_to_IEEE_big_double (double *d, int len)
 {
-  swap_8_bytes ((char *) d, len);
+  swap_8_bytes (static_cast<char *> (d), len);
 }
 
 static void
@@ -233,7 +233,7 @@
 static void
 IEEE_little_float_to_IEEE_big_float (float *d, int len)
 {
-  swap_4_bytes ((char *) d, len);
+  swap_4_bytes (static_cast<char *> (d), len);
 }
 
 static void
@@ -634,9 +634,9 @@
 
     case LS_FLOAT:
       {
-	volatile float *ptr = (float *) data;
+	volatile float *ptr = static_cast<float *> (data);
 	is.read (data, 4 * len);
-	do_float_format_conversion ((float *) data, len, fmt);
+	do_float_format_conversion (static_cast<float *> (data), len, fmt);
 	float tmp = ptr[0];
 	for (int i = len - 1; i > 0; i--)
 	  data[i] = ptr[i];
@@ -690,7 +690,7 @@
 
     case LS_DOUBLE:
       {
-	char tmp_type = (char) type;
+	char tmp_type = static_cast<char> (type);
 	os.write (&tmp_type, 1);
 	os.write (data, 8 * len);
       }
--- a/liboctave/dir-ops.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/dir-ops.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -44,7 +44,7 @@
     {
       close ();
 
-      dir = (void *) opendir (name.c_str ());
+      dir = static_cast<void *> (opendir (name.c_str ()));
 
       if (dir)
 	fail = false;
@@ -68,16 +68,16 @@
 
       struct dirent *dir_ent;
 
-      while ((dir_ent = readdir ((DIR *) dir)))
+      while ((dir_ent = readdir (static_cast<DIR *> (dir))))
 	count++;
 
-      rewinddir ((DIR *) dir);
+      rewinddir (static_cast<DIR *> (dir));
 
       dirlist.resize (count);
 
       for (int i = 0; i < count; i++)
 	{
-	  dir_ent = readdir ((DIR *) dir);
+	  dir_ent = readdir (static_cast<DIR *> (dir));
 
 	  if (dir_ent)
 	    dirlist[i] = dir_ent->d_name;
@@ -93,7 +93,7 @@
 dir_entry::close (void)
 {
   if (dir)
-    closedir ((DIR *) dir);
+    closedir (static_cast<DIR *> (dir));
 
   dir = 0;
 }
--- a/liboctave/file-ops.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/file-ops.h	Sun Mar 09 09:50:39 1997 +0000
@@ -112,7 +112,9 @@
 
   bool ok (void) const { return initialized && ! fail; }
 
-  operator void* () const { return ok () ? (void *) -1 : (void *) 0; }
+  operator void* () const
+    { return ok ()
+	? static_cast<void *> (-1) : static_cast<void *> (0); }
 
   bool exists (void) const { return ok (); }
 
--- a/liboctave/idx-vector.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/idx-vector.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -410,8 +410,7 @@
 static inline void
 sort_data (int *d, int l)
 {
-  qsort ((void *) d, l, sizeof (int),
-	 (int (*)(const void*, const void*)) intcmp);
+  qsort (d, l, sizeof (int), intcmp);
 }
 
 static inline int
--- a/liboctave/idx-vector.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/idx-vector.h	Sun Mar 09 09:50:39 1997 +0000
@@ -194,7 +194,8 @@
       return *this;
     }
 
-  idx_vector::operator void * () const { return (void *) rep->ok (); }
+  idx_vector::operator void * () const
+    { return static_cast<void *> (rep->ok ()); }
 
   int idx_vector::capacity (void) const { return rep->capacity (); }
   int idx_vector::length (int cl) const { return rep->length (cl); }
--- a/liboctave/lo-ieee.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/lo-ieee.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -70,7 +70,7 @@
   octave_Inf = 1.0 / (tmp - tmp);
 #elif defined (__alpha__)
   extern unsigned int DINFINITY[2];
-  octave_Inf =  (*((double *) (DINFINITY)));
+  octave_Inf =  (*(static_cast<double *> (DINFINITY)));
 #elif defined (HAVE_INFINITY)
   octave_Inf = infinity ();
 #elif defined (linux)
@@ -95,7 +95,7 @@
   octave_NaN = NAN;
 #elif defined (__alpha__)
   extern unsigned int DQNAN[2];
-  octave_NaN = (*((double *) (DQNAN)));
+  octave_NaN = (*(static_cast<double *> (DQNAN)));
 #elif defined (HAVE_QUIET_NAN)
   octave_NaN = quiet_nan (0L);
 #else
--- a/liboctave/lo-mappers.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/lo-mappers.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -83,9 +83,7 @@
 double
 fix (double x)
 {
-  int tmp;
-  tmp = (int) x;
-  return (double) tmp;
+  return static_cast<int> (x);
 }
 
 double
@@ -152,7 +150,7 @@
 xisnan (double x)
 {
 #if defined (HAVE_ISNAN)
-  return (double) isnan (x);
+  return isnan (x);
 #else
   return 0;
 #endif
@@ -162,9 +160,9 @@
 xfinite (double x)
 {
 #if defined (HAVE_FINITE)
-  return (double) finite (x);
+  return finite (x);
 #elif defined (HAVE_ISINF) && defined (HAVE_ISNAN)
-  return (double) (! isinf (x) && ! isnan (x));
+  return (! isinf (x) && ! isnan (x));
 #else
   return 1;
 #endif
@@ -180,9 +178,9 @@
 xisinf (double x)
 {
 #if defined (HAVE_ISINF)
-  return (double) isinf (x);
+  return isinf (x);
 #elif defined (HAVE_FINITE) && defined (HAVE_ISNAN)
-  return (double) (! (finite (x) || isnan (x)));
+  return (! (finite (x) || isnan (x)));
 #else
   return 0;
 #endif
@@ -205,9 +203,7 @@
 xisnan (const Complex& x)
 {
 #if defined (HAVE_ISNAN)
-  double rx = real (x);
-  double ix = imag (x);
-  return (double) (isnan (rx) || isnan (ix));
+  return (isnan (real (x)) || isnan (imag (x)));
 #else
   return 0;
 #endif
@@ -216,15 +212,13 @@
 double
 xfinite (const Complex& x)
 {
-  double rx = real (x);
-  double ix = imag (x);
-  return (double) (! ((int) xisinf (rx) || (int) xisinf (ix)));
+  return (! (xisinf (real (x)) || xisinf (imag (x))));
 }
 
 double
 xisinf (const Complex& x)
 {
-  return (double) (! (int) xfinite (x));
+  return (! xfinite (x));
 }
 
 // Complex -> complex mappers.
@@ -278,25 +272,19 @@
 Complex
 ceil (const Complex& x)
 {
-  int re = (int) ceil (real (x));
-  int im = (int) ceil (imag (x));
-  return Complex (re, im);
+  return Complex (ceil (real (x)), ceil (imag (x)));
 }
 
 Complex
 fix (const Complex& x)
 {
-  int re = (int) real (x);
-  int im = (int) imag (x);
-  return Complex (re, im);
+  return Complex (real (x), imag (x));
 }
 
 Complex
 floor (const Complex& x)
 {
-  int re = (int) floor (real (x));
-  int im = (int) floor (imag (x));
-  return Complex (re, im);
+  return Complex (floor (real (x)), floor (imag (x)));
 }
 
 Complex
@@ -308,9 +296,7 @@
 Complex
 round (const Complex& x)
 {
-  double re = D_NINT (real (x));
-  double im = D_NINT (imag (x));
-  return Complex (re, im);
+  return Complex (D_NINT (real (x)), D_NINT (imag (x)));
 }
 
 Complex
--- a/liboctave/oct-alloc.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/liboctave/oct-alloc.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -53,10 +53,10 @@
 octave_allocator::free (void *p, size_t size)
 {
   if (size != item_size)
-    ::delete [] ((char *) p);
+    ::delete [] (static_cast<char *> (p));
   else
     {
-      link *tmp = (link *) p;
+      link *tmp = static_cast<link *> (p);
       tmp->next = head;
       head = tmp;
     }
@@ -79,13 +79,13 @@
       while (p < last)
 	{
 	  char *next = p + item_size;
-	  ((link *) p) -> next = (link *) next;
+	  (static_cast<link *> (p)) -> next = static_cast<link *> (next);
 	  p = next;
 	}
 
-      ((link *) last) -> next = 0;
+      (static_cast<link *> (last)) -> next = 0;
 
-      head = (link *) start;
+      head = static_cast<link *> (start);
     }
   else
     {
--- a/src/ChangeLog	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/ChangeLog	Sun Mar 09 09:50:39 1997 +0000
@@ -1,3 +1,17 @@
+Sun Mar  9 03:46:45 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	 * Map.cc, data.cc, dirfns.cc, dynamic-ld.cc, file-io.cc,
+	 fsolve.cc, getgrent.cc, getpwent.cc, getrusage.cc, help.cc,
+	 input.cc, load-save.cc, mappers.cc, minmax.cc, npsol.cc,
+	 oct-fstrm.cc, oct-procbuf.h, oct-stdstrm.cc, oct-stdstrm.h,
+	 oct-stream.cc, oct-stream.h, oct-strstrm.cc, octave.cc,
+	 ov-base.h, ov-range.cc, ov-typeinfo.cc, ov.cc, pr-output.cc,
+	 pt-cmd.cc, pt-exp.cc, pt-fcn.cc, pt-fvc.cc, pt-mat.cc,
+	 pt-misc.cc, pt-plot.cc, qpsol.cc, quad.cc, sort.cc, strfns.cc,
+	 symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc,
+	 unwind-prot.cc, unwind-prot.h, variables.cc, xpow.cc:
+	 Use `static_cast<T> (val)' instead of old C-style `(T) val' casts.
+
 Sat Mar  8 02:35:13 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* load-save.cc (save_ascii_data, save_three_d): Where appropriate,
--- a/src/Map.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/Map.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -116,7 +116,7 @@
 static int
 goodCHptr (CHNode<C> *t)
 {
-  return ((((unsigned) t) & 1) == 0);
+  return (((static_cast<unsigned> (t)) & 1) == 0);
 }
 
 // This sucks, but avoids g++ 2.6.0 `type unification failed' errors.
@@ -124,14 +124,14 @@
 static void *
 index_to_CHptr (int i)
 {
-  return (void *) ((i << 1) + 1);
+  return static_cast<void *> ((i << 1) + 1);
 }
 
 template <class C>
 static unsigned int
 CHptr_to_index (CHNode<C> *t)
 {
-  return ((unsigned) t) >> 1;
+  return (static_cast<unsigned> (t)) >> 1;
 }
 
 template <class C>
@@ -139,7 +139,7 @@
 {
   tab = new CHNode<C>* [size = sz];
   for (unsigned int i = 0; i < size; ++i)
-    tab[i] = (CHNode<C> *) index_to_CHptr (i+1);
+    tab[i] = static_cast<CHNode<C> *> (index_to_CHptr (i+1));
   count = 0;
 }
 
@@ -148,7 +148,7 @@
 {
   tab = new CHNode<C>* [size = a.size];
   for (unsigned int i = 0; i < size; ++i)
-    tab[i] = (CHNode<C> *) index_to_CHptr (i+1);
+    tab[i] = static_cast<CHNode<C> *> (index_to_CHptr (i+1));
   count = 0;
   for (Pix p = a.first (); p; a.next (p))
     (*this) [a.key (p)] = a.contents (p);
@@ -216,7 +216,7 @@
   for (unsigned int i = 0; i < size; ++i)
     {
       CHNode<C> *p = tab[i];
-      tab[i] = (CHNode<C> *) index_to_CHptr (i+1);
+      tab[i] = static_cast<CHNode<C> *> (index_to_CHptr (i+1));
       while (goodCHptr (p))
 	{
 	  CHNode<C> *nxt = p->tl;
@@ -241,7 +241,7 @@
 void
 CHMap<C>::next (Pix& p) const
 {
-  CHNode<C> *t = ((CHNode<C> *) p)->tl;
+  CHNode<C> *t = (static_cast<CHNode<C> *> (p))->tl;
   if (goodCHptr (t))
     p = Pix (t);
   else
--- a/src/data.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/data.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -633,8 +633,8 @@
 	}
       else if (nargout == 2)
 	{
-	  retval(1) = (double) nc;
-	  retval(0) = (double) nr;
+	  retval(1) = static_cast<double> (nc);
+	  retval(0) = static_cast<double> (nr);
 	}
     }
   else if (nargin == 2 && nargout < 2)
@@ -646,9 +646,9 @@
       else
 	{
 	  if (nd == 1)
-	    retval(0) = (double) (args(0).rows ());
+	    retval(0) = static_cast<double> (args(0).rows ());
 	  else if (nd == 2)
-	    retval(0) = (double) (args(0).columns ());
+	    retval(0) = static_cast<double> (args(0).columns ());
 	  else
 	    error ("size: invalid second argument -- expecting 1 or 2");
 	}
@@ -798,7 +798,7 @@
 	{
 	  string s = args(1).string_value ();
 	  octave_value tmp = args(0).struct_elt_val (s, true);
-	  retval = (double) tmp.is_defined ();
+	  retval = static_cast<double> (tmp.is_defined ());
 	}
       else
 	print_usage ("struct_contains");
--- a/src/dirfns.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/dirfns.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -365,7 +365,7 @@
 static void
 cleanup_iprocstream (void *p)
 {
-  delete (iprocstream *) p;
+  delete static_cast <iprocstream *> (p);
 }
 
 DEFUN_TEXT (ls, args, ,
@@ -512,7 +512,7 @@
 	  int status = oct_mkdir (oct_tilde_expand (dirname),
 				  0777, msg);
 
-	  retval(0) = (double) status;
+	  retval(0) = static_cast<double> (status);
 
 	  if (status < 0)
 	    retval(1) = msg;
@@ -549,7 +549,7 @@
 
 	  int status = oct_rmdir (oct_tilde_expand (dirname), msg);
 
-	  retval(0) = (double) status;
+	  retval(0) = static_cast<double> (status);
 
 	  if (status < 0)
 	    retval(1) = msg;
@@ -592,7 +592,7 @@
 
 	      int status = oct_rename (from, to, msg);
 
-	      retval(0) = (double) status;
+	      retval(0) = static_cast<double> (status);
 
 	      if (status < 0)
 		retval(1) = msg;
--- a/src/dynamic-ld.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/dynamic-ld.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -118,11 +118,11 @@
   // specification of the libraries at runtime.  Instead, they are
   // specified when the .oct file is created.
 
-  void *handle = shl_load (file.c_str (), BIND_DEFERRED, 0L);
+  shl_t handle = shl_load (file.c_str (), BIND_DEFERRED, 0L);
 
   if (handle)
     {
-      int status = shl_findsym ((shl_t *) &handle, name.c_str (),
+      int status = shl_findsym (&handle, name.c_str (),
 				TYPE_UNDEFINED, retval);
 
       if (status < 0)
--- a/src/file-io.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/file-io.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -147,7 +147,7 @@
 
   if (nargin == 1)
     {
-      retval = (double) octave_stream_list::remove (args(0));
+      retval = static_cast<double> (octave_stream_list::remove (args(0)));
 
       if (retval < 0)
 	gripe_invalid_file_id ("fclose");
@@ -182,7 +182,7 @@
 	  octave_stream *os = octave_stream_list::lookup (fid);
 
 	  if (os)
-	    retval = (double) os->flush ();
+	    retval = static_cast<double> (os->flush ());
 	  else
 	    gripe_invalid_file_id ("fflush");
 	}
@@ -212,7 +212,7 @@
       if (os)
 	{
 	  octave_value len_arg = (nargin == 2)
-	    ? args(1) : octave_value ((double) INT_MAX);
+	    ? args(1) : octave_value (static_cast<double> (INT_MAX));
 
 	  bool err = false;
 
@@ -220,7 +220,7 @@
 
 	  if (! err)
 	    {
-	      retval(1) = (double) tmp.length ();
+	      retval(1) = static_cast<double> (tmp.length ());
 	      retval(0) = tmp;
 	    }
 	}
@@ -252,7 +252,7 @@
       if (os)
 	{
 	  octave_value len_arg = (nargin == 2)
-	    ? args(1) : octave_value ((double) INT_MAX);
+	    ? args(1) : octave_value (static_cast<double> (INT_MAX));
 
 	  bool err = false;
 
@@ -260,7 +260,7 @@
 
 	  if (! err)
 	    {
-	      retval(1) = (double) tmp.length ();
+	      retval(1) = static_cast<double> (tmp.length ());
 	      retval(0) = tmp;
 	    }
 	}
@@ -405,7 +405,8 @@
 	  if (os->ok () && ! error_state)
 	    {
 	      retval(1) = "";
-	      retval(0) = (double) octave_stream_list::insert (os);
+	      retval(0)
+		= static_cast<double> (octave_stream_list::insert (os));
 	    }
 	  else
 	    {
@@ -450,7 +451,7 @@
       octave_stream *os = octave_stream_list::lookup (args(0));
 
       if (os)
-	retval = (double) os->rewind ();
+	retval = static_cast<double> (os->rewind ());
       else
 	gripe_invalid_file_id ("frewind");
     }
@@ -484,7 +485,7 @@
 	  octave_value origin_arg = (nargin == 3)
 	    ? args(2) : octave_value (-1.0);
 
-	  retval = (double) os->seek (args(1), origin_arg);
+	  retval = static_cast<double> (os->seek (args(1), origin_arg));
 	}
       else
 	::error ("fseek: invalid file id");
@@ -507,7 +508,7 @@
       octave_stream *os = octave_stream_list::lookup (args(0));
 
       if (os)
-	retval = (double) os->tell ();
+	retval = static_cast<double> (os->tell ());
       else
 	gripe_invalid_file_id ("ftell");
     }
@@ -700,7 +701,7 @@
 		    {
 		      octave_value tmp = os->scanf (fmt, size, count);
 
-		      retval(1) = (double) count;
+		      retval(1) = static_cast<double> (count);
 		      retval(0) = tmp;
 		    }
 		}
@@ -809,9 +810,9 @@
 		      // position will clear it.
 		      string errmsg = os.error ();
 
-		      retval(3) = (double) (os.tell () + 1);
+		      retval(3) = static_cast<double> (os.tell () + 1);
 		      retval(2) = errmsg;
-		      retval(1) = (double) count;
+		      retval(1) = static_cast<double> (count);
 		      retval(0) = tmp;
 		    }
 		  else
@@ -980,7 +981,7 @@
 
 	  octave_value tmp = do_fread (*os, size, prec, skip, arch, count);
 
-	  retval(1) = (double) count;
+	  retval(1) = static_cast<double> (count);
 	  retval(0) = tmp;
 	}
       else
@@ -1175,7 +1176,7 @@
 
 	  string error_message = os->error (clear, error_number);
 
-	  retval(1) = (double) error_number;
+	  retval(1) = static_cast<double> (error_number);
 	  retval(0) = error_message;
 	}
       else
@@ -1247,7 +1248,7 @@
 
   if (nargin == 1)
     {
-      retval = (double) octave_stream_list::remove (args(0));
+      retval = static_cast<double> (octave_stream_list::remove (args(0)));
 
       if (retval < 0)
 	gripe_invalid_file_id ("pclose");
@@ -1329,7 +1330,7 @@
 	{
 	  int mask = NINT (dmask);
 
-	  if ((double) mask != dmask || mask < 0)
+	  if (mask != dmask || mask < 0)
 	    {
 	      status = -1;
 	      ::error ("umask: MASK must be a positive integer value");
@@ -1347,7 +1348,7 @@
     print_usage ("umask");
 
   if (status >= 0)
-    retval(0) = (double) status;
+    retval(0) = static_cast<double> (status);
 
   return retval;
 }
--- a/src/fsolve.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/fsolve.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -176,7 +176,7 @@
   retval(0) = soln, 1;
 
   if (nargout > 1)
-    retval(1) = (double) info;
+    retval(1) = static_cast<double> (info);
 
   return retval;
 }
--- a/src/getgrent.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/getgrent.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -60,7 +60,7 @@
 #else
       m ["passwd"] = "";
 #endif
-      m ["gid"] = STATIC_CAST (double, gr->gr_gid);
+      m ["gid"] = static_cast<double> (gr->gr_gid);
 
       if (gr->gr_mem)
 	{
@@ -138,7 +138,7 @@
 	{
 	  if (D_NINT (dval) == dval)
 	    {
-	      gid_t gid = STATIC_CAST (gid_t, dval);
+	      gid_t gid = static_cast<gid_t> (dval);
 
 	      retval = mk_gr_map (getgrgid (gid));
 	    }
--- a/src/getpwent.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/getpwent.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -56,8 +56,8 @@
 
       m ["name"] = pw->pw_name;
       m ["passwd"] = pw->pw_passwd;
-      m ["uid"] = STATIC_CAST (double, pw->pw_uid);
-      m ["gid"] = STATIC_CAST (double, pw->pw_gid);
+      m ["uid"] = static_cast<double> (pw->pw_uid);
+      m ["gid"] = static_cast<double> (pw->pw_gid);
       m ["gecos"] = pw->pw_gecos;
       m ["dir"] = pw->pw_dir;
       m ["shell"] = pw->pw_shell;
@@ -111,7 +111,7 @@
 	{
 	  if (D_NINT (dval) == dval)
 	    {
-	      uid_t uid = STATIC_CAST (uid_t, dval);
+	      uid_t uid = static_cast<uid_t> (dval);
 
 	      retval = mk_pw_map (getpwuid (uid));
 	    }
--- a/src/getrusage.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/getrusage.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -77,29 +77,29 @@
 
   getrusage (RUSAGE_SELF, &ru);
 
-  tv_tmp ["sec"] = (double) ru.ru_utime.tv_sec;
-  tv_tmp ["usec"] = (double) ru.ru_utime.tv_usec;
+  tv_tmp ["sec"] = static_cast<double> (ru.ru_utime.tv_sec);
+  tv_tmp ["usec"] = static_cast<double> (ru.ru_utime.tv_usec);
   m ["utime"] = octave_value (tv_tmp);
 
-  tv_tmp ["sec"] = (double) ru.ru_stime.tv_sec;
-  tv_tmp ["usec"] = (double) ru.ru_stime.tv_usec;
+  tv_tmp ["sec"] = static_cast<double> (ru.ru_stime.tv_sec);
+  tv_tmp ["usec"] = static_cast<double> (ru.ru_stime.tv_usec);
   m ["stime"] = octave_value (tv_tmp);
 
 #if ! defined (RUSAGE_TIMES_ONLY)
-  m ["maxrss"] = (double) ru.ru_maxrss;
-  m ["ixrss"] = (double) ru.ru_ixrss;
-  m ["idrss"] = (double) ru.ru_idrss;
-  m ["isrss"] = (double) ru.ru_isrss;
-  m ["minflt"] = (double) ru.ru_minflt;
-  m ["majflt"] = (double) ru.ru_majflt;
-  m ["nswap"] = (double) ru.ru_nswap;
-  m ["inblock"] = (double) ru.ru_inblock;
-  m ["oublock"] = (double) ru.ru_oublock;
-  m ["msgsnd"] = (double) ru.ru_msgsnd;
-  m ["msgrcv"] = (double) ru.ru_msgrcv;
-  m ["nsignals"] = (double) ru.ru_nsignals;
-  m ["nvcsw"] = (double) ru.ru_nvcsw;
-  m ["nivcsw"] = (double) ru.ru_nivcsw;
+  m ["maxrss"] = static_cast<double> (ru.ru_maxrss);
+  m ["ixrss"] = static_cast<double> (ru.ru_ixrss);
+  m ["idrss"] = static_cast<double> (ru.ru_idrss);
+  m ["isrss"] = static_cast<double> (ru.ru_isrss);
+  m ["minflt"] = static_cast<double> (ru.ru_minflt);
+  m ["majflt"] = static_cast<double> (ru.ru_majflt);
+  m ["nswap"] = static_cast<double> (ru.ru_nswap);
+  m ["inblock"] = static_cast<double> (ru.ru_inblock);
+  m ["oublock"] = static_cast<double> (ru.ru_oublock);
+  m ["msgsnd"] = static_cast<double> (ru.ru_msgsnd);
+  m ["msgrcv"] = static_cast<double> (ru.ru_msgrcv);
+  m ["nsignals"] = static_cast<double> (ru.ru_nsignals);
+  m ["nvcsw"] = static_cast<double> (ru.ru_nvcsw);
+  m ["nivcsw"] = static_cast<double> (ru.ru_nivcsw);
 #endif
 
 #else
@@ -117,16 +117,16 @@
   fraction = ticks % HZ;
   seconds = ticks / HZ;
 
-  tv_tmp ["sec"] = (double) seconds;
-  tv_tmp ["usec"] = (double) (fraction * 1e6 / HZ);
+  tv_tmp ["sec"] = static_cast<double> (seconds);
+  tv_tmp ["usec"] = static_cast<double> (fraction * 1e6 / HZ);
   m ["utime"] = octave_value (tv_tmp);
 
   ticks = t.tms_stime + t.tms_cstime;
   fraction = ticks % HZ;
   seconds = ticks / HZ;
 
-  tv_tmp ["sec"] = (double) seconds;
-  tv_tmp ["usec"] = (double) (fraction * 1e6 / HZ);
+  tv_tmp ["sec"] = static_cast<double> (seconds);
+  tv_tmp ["usec"] = static_cast<double> (fraction * 1e6 / HZ);
   m ["stime"] = octave_value (tv_tmp);
 
 #else
--- a/src/help.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/help.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -833,7 +833,7 @@
 
 		  assert (defn && defn->is_constant ());
 
-		  tree_constant *tmp = (tree_constant *) defn;
+		  tree_constant *tmp = static_cast<tree_constant *> (defn);
 
 		  int var_ok = 1;
 		  if (tmp && tmp->is_map ())
--- a/src/input.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/input.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -422,7 +422,7 @@
 
       if (tmp && strlen (tmp) == 0)
 	{
-	  retval = (char *) malloc (2);
+	  retval = static_cast<char *> (malloc (2));
 	  retval[0] = '\n';
 	  retval[1] = '\0';
 	}
@@ -442,7 +442,7 @@
       int grow_size = 1024;
       int max_size = grow_size;
 
-      char *buf = (char *) malloc (max_size);
+      char *buf = static_cast<char *> (malloc (max_size));
       char *bufptr = buf;
 
       do
@@ -456,7 +456,7 @@
 		  int tmp = bufptr - buf + grow_size - 1;
 		  grow_size *= 2;
 		  max_size += grow_size;
-		  buf = (char *) realloc (buf, max_size);
+		  buf = static_cast<char *> (realloc (buf, max_size));
 		  bufptr = buf + tmp;
 
 		  if (*(bufptr-1) == '\n')
@@ -538,7 +538,7 @@
     {
       size_t len = current_eval_string.length ();
 
-      retval = (char *) malloc (len + 2);
+      retval = static_cast<char *> (malloc (len + 2));
 
       strcpy (retval, current_eval_string.c_str ());
 
@@ -683,7 +683,7 @@
 
       tree_constant *def = 0;
       if (tmp_fvc->is_constant ())
-	def = (tree_constant *) tmp_fvc;
+	def = static_cast<tree_constant *> (tmp_fvc);
 
       if (def && def->is_map ())
 	{
@@ -777,7 +777,7 @@
 
       tree_constant *def = 0;
       if (tmp_fvc->is_constant ())
-	def = (tree_constant *) tmp_fvc;
+	def = static_cast<tree_constant *> (tmp_fvc);
 
       if (def && def->is_map ())
 	{
@@ -858,7 +858,7 @@
 	  if (strncmp (name, hint, hint_len) == 0)
 	    {
 	      int len = 2 + prefix_len + strlen (name);
-	      char *buf = (char *) malloc (len);
+	      char *buf = static_cast<char *> (malloc (len));
 
 	      if (prefix)
 		{
@@ -952,7 +952,7 @@
     saved_history_line_to_use = where + 1;
 
   old_rl_startup_hook = rl_startup_hook;
-  rl_startup_hook = (Function *) set_saved_history;
+  rl_startup_hook = static_cast<Function *> (set_saved_history);
 }
 
 void
@@ -969,21 +969,21 @@
 
   // Tell the completer that we want to try first.
 
-  rl_attempted_completion_function = (CPPFunction *) command_completer;
+  rl_attempted_completion_function
+    = static_cast<CPPFunction *> (command_completer);
 
   // Bind operate-and-get-next.
 
-  rl_add_defun ("operate-and-get-next",
-		(Function *) operate_and_get_next, CTRL ('O'));
+  rl_add_defun ("operate-and-get-next", operate_and_get_next, CTRL ('O'));
 
 
   // And the history search functions.
 
-  rl_add_defun ("history-search-backward",
-		(Function *) rl_history_search_backward, META ('p'));
+  rl_add_defun ("history-search-backward", rl_history_search_backward,
+		META ('p'));
 
-  rl_add_defun ("history-search-forward",
-		(Function *) rl_history_search_forward, META ('n'));
+  rl_add_defun ("history-search-forward", rl_history_search_forward,
+		META ('n'));
 
   // Don't treat single quotes as string delimiters when doing paren
   // matching.
@@ -1161,10 +1161,10 @@
 	if ((Vecho_executing_commands & ECHO_SCRIPTS)
 	    || (Vecho_executing_commands & ECHO_FUNCTIONS))
 	  bind_builtin_variable ("echo_executing_commands",
-				 (double) ECHO_OFF);
+				 static_cast<double> (ECHO_OFF));
 	else
 	  bind_builtin_variable ("echo_executing_commands",
-				 (double) ECHO_SCRIPTS);
+				 static_cast<double> (ECHO_SCRIPTS));
       }
       break;
 
@@ -1174,10 +1174,10 @@
 
 	if (arg == "on")
 	  bind_builtin_variable ("echo_executing_commands",
-				 (double) ECHO_SCRIPTS);
+				 static_cast<double> (ECHO_SCRIPTS));
 	else if (arg == "off")
 	  bind_builtin_variable ("echo_executing_commands",
-				 (double) ECHO_OFF);
+				 static_cast<double> (ECHO_OFF));
 	else
 	  print_usage ("echo");
       }
@@ -1188,11 +1188,14 @@
 	string arg = argv[1];
 
 	if (arg == "on" && argv[2] == "all")
-	  bind_builtin_variable ("echo_executing_commands",
-				 (double) (ECHO_SCRIPTS | ECHO_FUNCTIONS));
+	  {
+	    int tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS);
+	    bind_builtin_variable ("echo_executing_commands",
+				   static_cast<double> (tmp));
+	  }
 	else if (arg == "off" && argv[2] == "all")
 	  bind_builtin_variable ("echo_executing_commands",
-				 (double) ECHO_OFF);
+				 static_cast<double> (ECHO_OFF));
 	else
 	  print_usage ("echo");
       }
--- a/src/load-save.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/load-save.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -725,7 +725,7 @@
   if (! is)
     return 0;
   if (swap)
-    swap_4_bytes ((char *) &name_len);
+    swap_4_bytes (static_cast<char *> (&name_len));
 
   name = new char [name_len+1];
   name[name_len] = '\0';
@@ -736,7 +736,7 @@
   if (! is)
     goto data_read_error;
   if (swap)
-    swap_4_bytes ((char *) &doc_len);
+    swap_4_bytes (static_cast<char *> (&doc_len));
 
   doc = new char [doc_len+1];
   doc[doc_len] = '\0';
@@ -758,7 +758,7 @@
 	if (! is.read (&tmp, 1))
 	  goto data_read_error;
 	double dtmp;
-	read_doubles (is, &dtmp, (save_type) tmp, 1, swap, fmt);
+	read_doubles (is, &dtmp, static_cast<save_type> (tmp), 1, swap, fmt);
 	if (error_state || ! is)
 	  goto data_read_error;
 	tc = dtmp;
@@ -771,17 +771,17 @@
 	if (! is.read (&nr, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &nr);
+	  swap_4_bytes (static_cast<char *> (&nr));
 	if (! is.read (&nc, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &nc);
+	  swap_4_bytes (static_cast<char *> (&nc));
 	if (! is.read (&tmp, 1))
 	  goto data_read_error;
 	Matrix m (nr, nc);
 	double *re = m.fortran_vec ();
 	int len = nr * nc;
-	read_doubles (is, re, (save_type) tmp, len, swap, fmt);
+	read_doubles (is, re, static_cast<save_type> (tmp), len, swap, fmt);
 	if (error_state || ! is)
 	  goto data_read_error;
 	tc = m;
@@ -793,7 +793,8 @@
 	if (! is.read (&tmp, 1))
 	  goto data_read_error;
 	Complex ctmp;
-	read_doubles (is, (double *) &ctmp, (save_type) tmp, 2, swap, fmt);
+	read_doubles (is, static_cast<double *> (&ctmp),
+		      static_cast<save_type> (tmp), 2, swap, fmt);
 	if (error_state || ! is)
 	  goto data_read_error;
 	tc = ctmp;
@@ -806,18 +807,18 @@
 	if (! is.read (&nr, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &nr);
+	  swap_4_bytes (static_cast<char *> (&nr));
 	if (! is.read (&nc, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &nc);
+	  swap_4_bytes (static_cast<char *> (&nc));
 	if (! is.read (&tmp, 1))
 	  goto data_read_error;
 	ComplexMatrix m (nr, nc);
 	Complex *im = m.fortran_vec ();
 	int len = nr * nc;
-	read_doubles (is, (double *) im, (save_type) tmp, 2*len,
-		      swap, fmt);
+	read_doubles (is, static_cast<double *> (im),
+		      static_cast<save_type> (tmp), 2*len, swap, fmt);
 	if (error_state || ! is)
 	  goto data_read_error;
 	tc = m;
@@ -830,7 +831,7 @@
 	if (! is.read (&len, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &len);
+	  swap_4_bytes (static_cast<char *> (&len));
 	char *s = new char [len+1];
 	if (! is.read (s, len))
 	  {
@@ -850,15 +851,15 @@
 	if (! is.read (&bas, 8))
 	  goto data_read_error;
 	if (swap)
-	  swap_8_bytes ((char *) &bas);
+	  swap_8_bytes (static_cast<char *> (&bas));
 	if (! is.read (&lim, 8))
 	  goto data_read_error;
 	if (swap)
-	  swap_8_bytes ((char *) &lim);
+	  swap_8_bytes (static_cast<char *> (&lim));
 	if (! is.read (&inc, 8))
 	  goto data_read_error;
 	if (swap)
-	  swap_8_bytes ((char *) &inc);
+	  swap_8_bytes (static_cast<char *> (&inc));
 	Range r (bas, lim, inc);
 	tc = r;
       }
@@ -870,7 +871,7 @@
 	if (! is.read (&elements, 4))
 	  goto data_read_error;
 	if (swap)
-	  swap_4_bytes ((char *) &elements);
+	  swap_4_bytes (static_cast<char *> (&elements));
 	charMatrix chm (elements, 0);
 	int max_len = 0;
 	for (int i = 0; i < elements; i++)
@@ -879,7 +880,7 @@
 	    if (! is.read (&len, 4))
 	      goto data_read_error;
 	    if (swap)
-	      swap_4_bytes ((char *) &len);
+	      swap_4_bytes (static_cast<char *> (&len));
 	    char *tmp = new char [len+1];
 	    if (! is.read (tmp, len))
 	      {
@@ -1122,11 +1123,11 @@
 
   if (swap)
     {
-      swap_4_bytes ((char *) &mopt);
-      swap_4_bytes ((char *) &nr);
-      swap_4_bytes ((char *) &nc);
-      swap_4_bytes ((char *) &imag);
-      swap_4_bytes ((char *) &len);
+      swap_4_bytes (static_cast<char *> (&mopt));
+      swap_4_bytes (static_cast<char *> (&nr));
+      swap_4_bytes (static_cast<char *> (&nc));
+      swap_4_bytes (static_cast<char *> (&imag));
+      swap_4_bytes (static_cast<char *> (&len));
     }
 
   if (mopt > 9999 || mopt < 0 || imag > 1 || imag < 0)
@@ -1866,7 +1867,7 @@
 	    st = get_save_type (max_val, min_val);
 	}
       const Complex *mtmp = m.data ();
-      write_doubles (os, (const double *) mtmp, st, 2*len);
+      write_doubles (os, static_cast<const double *> (mtmp), st, 2*len);
     }
   else if (tc.is_string ())
     {
@@ -2575,7 +2576,7 @@
       && ! xisnan (val))
     {
       int ival = NINT (val);
-      if (ival >= 0 && (double) ival == val)
+      if (ival >= 0 && ival == val)
 	{
 	  Vsave_precision = ival;
 	  return 0;
--- a/src/mappers.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/mappers.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -86,9 +86,7 @@
 double
 fix (double x)
 {
-  int tmp;
-  tmp = (int) x;
-  return (double) tmp;
+  return static_cast<int> (x);
 }
 
 double
@@ -153,7 +151,7 @@
 xisnan (double x)
 {
 #if defined (HAVE_ISNAN)
-  return (double) isnan (x);
+  return isnan (x);
 #else
   return 0;
 #endif
@@ -163,9 +161,9 @@
 xfinite (double x)
 {
 #if defined (HAVE_FINITE)
-  return (double) finite (x);
+  return finite (x);
 #elif defined (HAVE_ISINF) && defined (HAVE_ISNAN)
-  return (double) (! isinf (x) && ! isnan (x));
+  return (! isinf (x) && ! isnan (x));
 #else
   return 1;
 #endif
@@ -181,9 +179,9 @@
 xisinf (double x)
 {
 #if defined (HAVE_ISINF)
-  return (double) isinf (x);
+  return isinf (x);
 #elif defined (HAVE_FINITE) && defined (HAVE_ISNAN)
-  return (double) (! (finite (x) || isnan (x)));
+  return (! (finite (x) || isnan (x)));
 #else
   return 0;
 #endif
@@ -208,7 +206,7 @@
 #if defined (HAVE_ISNAN)
   double rx = real (x);
   double ix = imag (x);
-  return (double) (isnan (rx) || isnan (ix));
+  return (isnan (rx) || isnan (ix));
 #else
   return 0;
 #endif
@@ -219,13 +217,13 @@
 {
   double rx = real (x);
   double ix = imag (x);
-  return (double) (! ((int) xisinf (rx) || (int) xisinf (ix)));
+  return (! (xisinf (rx) || xisinf (ix)));
 }
 
 double
 xisinf (const Complex& x)
 {
-  return (double) (! (int) xfinite (x));
+  return (! xfinite (x));
 }
 
 // Complex -> complex mappers.
@@ -279,25 +277,19 @@
 Complex
 ceil (const Complex& x)
 {
-  int re = (int) ceil (real (x));
-  int im = (int) ceil (imag (x));
-  return Complex (re, im);
+  return Complex (real (x), imag (x));
 }
 
 Complex
 fix (const Complex& x)
 {
-  int re = (int) real (x);
-  int im = (int) imag (x);
-  return Complex (re, im);
+  return Complex (real (x), imag (x));
 }
 
 Complex
 floor (const Complex& x)
 {
-  int re = (int) floor (real (x));
-  int im = (int) floor (imag (x));
-  return Complex (re, im);
+  return Complex (floor (real (x)), floor (imag (x)));
 }
 
 Complex
@@ -309,9 +301,7 @@
 Complex
 round (const Complex& x)
 {
-  double re = D_NINT (real (x));
-  double im = D_NINT (imag (x));
-  return Complex (re, im);
+  return Complex (D_NINT (real (x)), D_NINT (imag (x)));
 }
 
 Complex
--- a/src/minmax.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/minmax.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -466,7 +466,8 @@
 	  for (int i = 0; i < len; i++)
 	    {
 	      int tmp = index.elem (i) + 1;
-	      idx.elem (i) = (tmp <= 0) ? octave_NaN : (double) tmp;
+	      idx.elem (i) = (tmp <= 0)
+		? octave_NaN : static_cast<double> (tmp);
 	    }
 
 	  retval(1) = octave_value (idx, 0);
@@ -679,7 +680,8 @@
 	  for (int i = 0; i < len; i++)
 	    {
 	      int tmp = index.elem (i) + 1;
-	      idx.elem (i) = (tmp <= 0) ? octave_NaN : (double) tmp;
+	      idx.elem (i) = (tmp <= 0)
+		? octave_NaN : static_cast<double> (tmp);
 	    }
 
 	  retval(1) = octave_value (idx, 0);
--- a/src/npsol.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/npsol.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -522,7 +522,7 @@
   if (nargout > 1)
     retval(1) = objf;
   if (nargout > 2)
-    retval(2) = (double) inform;
+    retval(2) = static_cast<double> (inform);
   if (nargout > 3)
     retval(3) = lambda;
 
--- a/src/oct-fstrm.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-fstrm.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -77,7 +77,7 @@
   if (fs)
     {
       filebuf *fb = fs.rdbuf ();
-      retval = (long) fb->seekoff (0, ios::cur);
+      retval = static_cast<long> (fb->seekoff (0, ios::cur));
     }
 
   return retval;
--- a/src/oct-procbuf.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-procbuf.h	Sun Mar 09 09:50:39 1997 +0000
@@ -48,7 +48,7 @@
   octave_procbuf *open (const char *command, int mode);
 
   octave_procbuf *close (void)
-    { return (octave_procbuf *) filebuf::close (); }
+    { return static_cast<octave_procbuf *> (filebuf::close ()); }
 
   virtual int sys_close (void);
 
--- a/src/oct-stdstrm.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-stdstrm.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -73,7 +73,7 @@
 
       if (sb)
 	{
-	  retval = (long) sb->seekoff (0, ios::cur);
+	  retval = static_cast<long> (sb->seekoff (0, ios::cur));
 
 	  if (bad ())
 	    retval = -1;
--- a/src/oct-stdstrm.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-stdstrm.h	Sun Mar 09 09:50:39 1997 +0000
@@ -93,7 +93,7 @@
 
   // XXX FIXME XXX -- should not have to cast away const here.
   stdiobuf *rdbuf (void) const
-    { return is ? ((istdiostream *) is)->rdbuf () : 0; }
+    { return is ? (const_cast<istdiostream *> (is))->rdbuf () : 0; }
 
   bool bad (void) const { return is ? is->bad () : true; }
 
@@ -138,7 +138,7 @@
 
   // XXX FIXME XXX -- should not have to cast away const here.
   stdiobuf *rdbuf (void) const
-    { return os ? ((ostdiostream *) os)->rdbuf () : 0; }
+    { return os ? (const_cast<ostdiostream *> (os))->rdbuf () : 0; }
 
   bool bad (void) const { return os ? os->bad () : true; }
 
--- a/src/oct-stream.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-stream.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -62,7 +62,7 @@
 	    {
 	      int ival = NINT (dval);
 
-	      if ((double) ival == dval)
+	      if (ival == dval)
 		retval = ival;
 	      else
 		conv_err = 4;
@@ -1260,7 +1260,7 @@
 		if (is.scan (fmt, &tmp))
 		  {
 		    if (! discard)
-		      retval = (double) tmp;
+		      retval = static_cast<double> (tmp);
 		  }
 		else
 		  quit = true;
@@ -1547,7 +1547,10 @@
   string string_value (void);
 
   operator void* () const
-    { return (curr_state == ok) ? (void *) -1 : (void *) 0; }
+    {
+      return (curr_state == ok)
+	? static_cast<void *> (-1) : static_cast<void *> (0);
+    }
 
   bool no_more_values (void) { return curr_state == list_exhausted; }
 
@@ -1814,10 +1817,12 @@
 			      {
 				if (elt->modifier == 'l')
 				  do_printf_conv (os, fmt, nsa, sa_1,
-						  sa_2, true, (long) val);
+						  sa_2, true,
+						  static_cast<long> (val));
 				else
 				  do_printf_conv (os, fmt, nsa, sa_1,
-						  sa_2, true, (int) val);
+						  sa_2, true,
+						  static_cast<int> (val));
 			      }
 			      break;
 
--- a/src/oct-stream.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-stream.h	Sun Mar 09 09:50:39 1997 +0000
@@ -90,7 +90,11 @@
 
   bool ok (void) const { return (nconv >= 0); }
 
-  operator void* () const { return ok () ? (void *) -1 : (void *) 0; }
+  operator void* () const
+    {
+      return ok ()
+	? static_cast<void *> (-1) : static_cast<void *> (0);
+    }
 
   bool all_character_conversions (void);
 
@@ -175,7 +179,11 @@
 
   bool ok (void) const { return (nconv >= 0); }
 
-  operator void* () const { return ok () ? (void *) -1 : (void *) 0; }
+  operator void* () const
+    {
+      return ok ()
+	? static_cast<void *> (-1) : static_cast<void *> (0);
+    }
 
 private:
 
@@ -409,7 +417,11 @@
 
   bool ok (void) const { return rep && rep->ok (); }
 
-  operator void* () const { return ok () ? (void *) -1 : (void *) 0; }
+  operator void* () const
+    {
+      return ok ()
+	? static_cast<void *> (-1) : static_cast<void *> (0);
+    }
 
   string name (void);
 
--- a/src/oct-strstrm.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/oct-strstrm.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -60,11 +60,11 @@
     {
       // XXX FIXME XXX -- shouldn't have to do this!
 
-      streambuf *sb = ((octave_base_strstream *)this)->rdbuf ();
+      streambuf *sb = (static_cast<octave_base_strstream *>(this))->rdbuf ();
 
       if (sb)
 	{
-	  retval = (long) sb->seekoff (0, ios::cur);
+	  retval = static_cast<long> (sb->seekoff (0, ios::cur));
 
 	  if (bad ())
 	    retval = -1;
--- a/src/octave.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/octave.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -178,7 +178,7 @@
       bind_builtin_variable ("__argv__", octave_argv, 1, 1, 0);
     }
 
-  bind_builtin_variable ("nargin", (double) argc-1, 1, 1, 0);
+  bind_builtin_variable ("nargin", static_cast<double> (argc-1), 1, 1, 0);
 }
 
 // Initialize some global variables for later use.
@@ -600,7 +600,7 @@
       // XXX FIXME XXX -- is this the right thing to do?
 
       bind_builtin_variable ("echo_executing_commands",
-			     (double) ECHO_CMD_LINE);
+			     static_cast<double> (ECHO_CMD_LINE));
     }
 
   if (! interactive)
--- a/src/ov-base.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/ov-base.h	Sun Mar 09 09:50:39 1997 +0000
@@ -65,10 +65,10 @@
   octave_value *clone (void) { return new octave_base_value (*this); }
 
   type_conv_fcn numeric_conversion_function (void) const
-    { return (type_conv_fcn) 0; }
+    { return static_cast<type_conv_fcn> (0); }
 
   octave_value *try_narrowing_conversion (void)
-    { return (octave_value *) 0; }
+    { return static_cast<octave_value *> (0); }
 
   octave_value index (const octave_value_list& idx) const;
 
--- a/src/ov-range.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/ov-range.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -129,7 +129,7 @@
 octave_value
 octave_range::any (void) const
 {
-  return (double) (range.base () != 0.0 || range.nelem () > 1);
+  return static_cast<double> (range.base () != 0.0 || range.nelem () > 1);
 }
 
 bool
--- a/src/ov-typeinfo.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/ov-typeinfo.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -122,14 +122,14 @@
 
       types.resize (len, string ());
 
-      binary_ops.resize ((int) octave_value::num_binary_ops, len, len,
-			 (binary_op_fcn) 0);
+      binary_ops.resize (static_cast<int> (octave_value::num_binary_ops),
+			 len, len, static_cast<binary_op_fcn> (0));
 
-      assign_ops.resize (len, len, (assign_op_fcn) 0);
+      assign_ops.resize (len, len, static_cast<assign_op_fcn> (0));
 
       pref_assign_conv.resize (len, len, -1);
 
-      widening_ops.resize (len, len, (type_conv_fcn) 0);
+      widening_ops.resize (len, len, static_cast<type_conv_fcn> (0));
     }
 
   types (i) = name;
@@ -144,7 +144,7 @@
 					      int t1, int t2,
 					      binary_op_fcn f)
 {
-  binary_ops.checkelem ((int) op, t1, t2) = f;
+  binary_ops.checkelem (static_cast<int> (op), t1, t2) = f;
 
   return false;
 }
@@ -182,7 +182,7 @@
 octave_value_typeinfo::do_lookup_binary_op (octave_value::binary_op op,
 					    int t1, int t2)
 {
-  return binary_ops.checkelem ((int) op, t1, t2);
+  return binary_ops.checkelem (static_cast<int> (op), t1, t2);
 }
 
 assign_op_fcn
--- a/src/ov.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/ov.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -849,7 +849,7 @@
       && ! xisnan (val))
     {
       int ival = NINT (val);
-      if (ival >= 0 && (double) ival == val)
+      if (ival >= 0 && ival == val)
 	{
 	  Vstruct_levels_to_print = ival;
 	  return 0;
--- a/src/pr-output.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pr-output.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -246,8 +246,8 @@
 
   double d_abs = d < 0.0 ? -d : d;
 
-  int digits = (inf_or_nan || d_abs == 0.0) ? 0
-    : (int) floor (log10 (d_abs) + 1.0);
+  int digits = (inf_or_nan || d_abs == 0.0)
+    ? 0 : static_cast<int> (floor (log10 (d_abs) + 1.0));
 
   set_real_format (sign, digits, inf_or_nan, nan_or_int, fw);
 }
@@ -380,8 +380,11 @@
   double max_abs = pr_max_internal (m_abs);
   double min_abs = pr_min_internal (m_abs);
 
-  int x_max = max_abs == 0.0 ? 0 : (int) floor (log10 (max_abs) + 1.0);
-  int x_min = min_abs == 0.0 ? 0 : (int) floor (log10 (min_abs) + 1.0);
+  int x_max = max_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (max_abs) + 1.0));
+
+  int x_min = min_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (min_abs) + 1.0));
 
   set_real_matrix_format (sign, x_max, x_min, inf_or_nan,
 			  int_or_inf_or_nan, fw);
@@ -529,8 +532,11 @@
   double r_abs = rp < 0.0 ? -rp : rp;
   double i_abs = ip < 0.0 ? -ip : ip;
 
-  int r_x = r_abs == 0.0 ? 0 : (int) floor (log10 (r_abs) + 1.0);
-  int i_x = i_abs == 0.0 ? 0 : (int) floor (log10 (i_abs) + 1.0);
+  int r_x = r_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (r_abs) + 1.0));
+
+  int i_x = i_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (i_abs) + 1.0));
 
   int x_max, x_min;
 
@@ -698,11 +704,17 @@
   double i_max_abs = pr_max_internal (i_m_abs);
   double i_min_abs = pr_min_internal (i_m_abs);
 
-  int r_x_max = r_max_abs == 0.0 ? 0 : (int) floor (log10 (r_max_abs) + 1.0);
-  int r_x_min = r_min_abs == 0.0 ? 0 : (int) floor (log10 (r_min_abs) + 1.0);
+  int r_x_max = r_max_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (r_max_abs) + 1.0));
+
+  int r_x_min = r_min_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (r_min_abs) + 1.0));
 
-  int i_x_max = i_max_abs == 0.0 ? 0 : (int) floor (log10 (i_max_abs) + 1.0);
-  int i_x_min = i_min_abs == 0.0 ? 0 : (int) floor (log10 (i_min_abs) + 1.0);
+  int i_x_max = i_max_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (i_max_abs) + 1.0));
+
+  int i_x_min = i_min_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (i_min_abs) + 1.0));
 
   int x_max = r_x_max > i_x_max ? r_x_max : i_x_max;
   int x_min = r_x_min > i_x_min ? r_x_min : i_x_min;
@@ -833,8 +845,11 @@
   double max_abs = r_max < 0.0 ? -r_max : r_max;
   double min_abs = r_min < 0.0 ? -r_min : r_min;
 
-  int x_max = max_abs == 0.0 ? 0 : (int) floor (log10 (max_abs) + 1.0);
-  int x_min = min_abs == 0.0 ? 0 : (int) floor (log10 (min_abs) + 1.0);
+  int x_max = max_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (max_abs) + 1.0));
+
+  int x_min = min_abs == 0.0
+    ? 0 : static_cast<int> (floor (log10 (min_abs) + 1.0));
 
   set_range_format (sign, x_max, x_min, all_ints, fw);
 }
@@ -922,12 +937,12 @@
 	      || flt_fmt == oct_mach_info::unknown)
 	    {
 	      for (size_t i = 0; i < sizeof (double); i++)
-		os.form ("%02x", (int) tmp.i[i]);
+		os.form ("%02x", static_cast<int> (tmp.i[i]));
 	    }
 	  else
 	    {
 	      for (int i = sizeof (double) - 1; i >= 0; i--)
-		os.form ("%02x", (int) tmp.i[i]);
+		os.form ("%02x", static_cast<int> (tmp.i[i]));
 	    }
 	}
       else if (bit_format)
@@ -1548,8 +1563,8 @@
 static void
 set_output_prec_and_fw (int prec, int fw)
 {
-  bind_builtin_variable ("output_precision", (double) prec);
-  bind_builtin_variable ("output_max_field_width", (double) fw);
+  bind_builtin_variable ("output_precision", static_cast<double> (prec));
+  bind_builtin_variable ("output_max_field_width", static_cast<double> (fw));
 }
 
 static void
@@ -1704,7 +1719,7 @@
       && ! xisnan (val))
     {
       int ival = NINT (val);
-      if (ival > 0 && (double) ival == val)
+      if (ival > 0 && ival == val)
 	{
 	  Voutput_max_field_width = ival;
 	  return 0;
@@ -1722,7 +1737,7 @@
       && ! xisnan (val))
     {
       int ival = NINT (val);
-      if (ival >= 0 && (double) ival == val)
+      if (ival >= 0 && ival == val)
 	{
 	  Voutput_precision = ival;
 	  return 0;
--- a/src/pt-cmd.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-cmd.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -572,7 +572,7 @@
 static void
 do_catch_code (void *ptr)
 {
-  tree_statement_list *list = (tree_statement_list *) ptr;
+  tree_statement_list *list = static_cast<tree_statement_list *> (ptr);
 
   // Set up for letting the user print any messages from errors that
   // occurred in the body of the try_catch statement.
@@ -661,7 +661,7 @@
 static void
 do_unwind_protect_cleanup_code (void *ptr)
 {
-  tree_statement_list *list = (tree_statement_list *) ptr;
+  tree_statement_list *list = static_cast<tree_statement_list *> (ptr);
 
   // We want to run the cleanup code without error_state being set,
   // but we need to restore its value, so that any errors encountered
--- a/src/pt-exp.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-exp.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -611,7 +611,7 @@
 	    done:
 
 	      if (! error_state)
-		retval = octave_value ((double) result);
+		retval = octave_value (static_cast<double> (result));
 	    }
 	}
     }
--- a/src/pt-fcn.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-fcn.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -79,8 +79,8 @@
 void
 tree_function::bind_nargin_and_nargout (int nargin, int nargout)
 {
-  nargin_sr->define ((double) nargin);
-  nargout_sr->define ((double) nargout);
+  nargin_sr->define (static_cast<double> (nargin));
+  nargout_sr->define (static_cast<double> (nargout));
 }
 
 tree_function::~tree_function (void)
@@ -225,14 +225,14 @@
 static void
 pop_symbol_table_context (void *table)
 {
-  symbol_table *tmp = (symbol_table *) table;
+  symbol_table *tmp = static_cast<symbol_table *> (table);
   tmp->pop_context ();
 }
 
 static void
 delete_vr_list (void *list)
 {
-  tree_va_return_list *tmp = (tree_va_return_list *) list;
+  tree_va_return_list *tmp = static_cast<tree_va_return_list *> (list);
   tmp->clear ();
   delete tmp;
 }
@@ -240,19 +240,20 @@
 static void
 clear_symbol_table (void *table)
 {
-  symbol_table *tmp = (symbol_table *) table;
+  symbol_table *tmp = static_cast<symbol_table *> (table);
   tmp->clear ();
 }
 
 static void
 unprotect_function (void *sr_arg)
 {
-  symbol_record *sr = (symbol_record *) sr_arg;
+  symbol_record *sr = static_cast<symbol_record *> (sr_arg);
   sr->unprotect ();
 }
 
 octave_value_list
-tree_function::eval (bool /* print */, int nargout, const octave_value_list& args)
+tree_function::eval (bool /* print */, int nargout,
+		     const octave_value_list& args)
 {
   octave_value_list retval;
 
@@ -272,13 +273,13 @@
   if (symtab_entry && ! symtab_entry->is_read_only ())
     {
       symtab_entry->protect ();
-      add_unwind_protect (unprotect_function, (void *) symtab_entry);
+      add_unwind_protect (unprotect_function, symtab_entry);
     }
 
   if (call_depth > 1)
     {
       sym_tab->push_context ();
-      add_unwind_protect (pop_symbol_table_context, (void *) sym_tab);
+      add_unwind_protect (pop_symbol_table_context, sym_tab);
 
       if (vr_list)
 	{
@@ -290,7 +291,7 @@
 	  // Clear and delete the new one before restoring the old
 	  // one.
 
-	  add_unwind_protect (delete_vr_list, (void *) vr_list);
+	  add_unwind_protect (delete_vr_list, vr_list);
 	}
     }
 
@@ -299,7 +300,7 @@
 
   // Force symbols to be undefined again when this function exits.
 
-  add_unwind_protect (clear_symbol_table, (void *) sym_tab);
+  add_unwind_protect (clear_symbol_table, sym_tab);
 
   // Save old and set current symbol table context, for
   // eval_undefined_error().
--- a/src/pt-fvc.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-fvc.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -177,7 +177,7 @@
 
       if (sym->is_variable () && sym->is_defined ())
 	{
-	  tree_constant *tmp = (tree_constant *) sym->def ();
+	  tree_constant *tmp = static_cast<tree_constant *> (sym->def ());
 	  retval = tmp->assign (args, rhs);
 	}
       else
--- a/src/pt-mat.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-mat.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -158,7 +158,8 @@
   
   operator void* () const
     {
-      return (rep && rep->ok) ? (void *) -1 : (void *) 0;
+      return (rep && rep->ok)
+	? static_cast<void *> (-1) : static_cast<void *> (0);
     }
 
 private:
@@ -276,7 +277,8 @@
   bool is_complex (void) const { return is_cmplx; }
   bool all_empty (void) const { return all_mt; }
 
-  operator void* () const { return ok ? (void *) -1 : (void *) 0; }
+  operator void* () const
+    { return ok ? static_cast<void *> (-1) : static_cast<void *> (0); }
 
 private:
 
@@ -416,11 +418,11 @@
 
 	  if (is_id)
 	    {
-	      tree_identifier *id = (tree_identifier *) elt;
+	      tree_identifier *id = static_cast<tree_identifier *> (elt);
 	      idx_expr = new tree_index_expression (id);
 	    }
 	  else
-	    idx_expr = (tree_index_expression *) elt;
+	    idx_expr = static_cast<tree_index_expression *> (elt);
 
 	  if (first_elem)
 	    {
--- a/src/pt-misc.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-misc.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -180,7 +180,8 @@
 		  if (expr->is_multi_val_ret_expression ())
 		    {
 		      octave_value_list args;
-		      tree_multi_val_ret *t = (tree_multi_val_ret *) expr;
+		      tree_multi_val_ret *t;
+		      t = static_cast<tree_multi_val_ret *> (expr);
 		      retval = t->eval (pf, nargout, args);
 		    }
 		  else
--- a/src/pt-plot.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/pt-plot.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -1003,7 +1003,7 @@
 \n\
 Return 1 if hold is on, otherwise return 0.")
 {
-  return (double) (! clear_before_plotting);
+  return static_cast<double> (! clear_before_plotting);
 }
 
 DEFUN (purge_tmp_files, , ,
--- a/src/qpsol.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/qpsol.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -252,7 +252,7 @@
   if (nargout > 1)
     retval(1) = objf;
   if (nargout > 2)
-    retval(2) = (double) inform;
+    retval(2) = static_cast<double> (inform);
   if (nargout > 3)
     retval(3) = lambda;
 
--- a/src/quad.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/quad.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -145,18 +145,18 @@
   int indefinite = 0;
   IndefQuad::IntegralType indef_type = IndefQuad::doubly_infinite;
   double bound = 0.0;
-  if ((int) xisinf (a) && (int) xisinf (b))
+  if (xisinf (a) && xisinf (b))
     {
       indefinite = 1;
       indef_type = IndefQuad::doubly_infinite;
     }
-  else if ((int) xisinf (a))
+  else if (xisinf (a))
     {
       indefinite = 1;
       bound = b;
       indef_type = IndefQuad::neg_inf_to_bound;
     }
-  else if ((int) xisinf (b))
+  else if (xisinf (b))
     {
       indefinite = 1;
       bound = a;
--- a/src/sort.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/sort.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -136,7 +136,7 @@
   vs (0) = v (k-1); \
   for (int i = 1; i < n; i++) \
     { \
-      k = l ((int) idx (i-1)); \
+      k = l (static_cast<int> (idx (i-1))); \
       idx (i) = k; \
       vs (i) = v (k-1); \
     }
@@ -147,7 +147,7 @@
   ms (0, j) = m (k-1, j); \
   for (int i = 1; i < nr; i++) \
     { \
-      k = l ((int) idx (i-1, j)); \
+      k = l (static_cast<int> (idx (i-1, j))); \
       idx (i, j) = k; \
       ms (i, j) = m (k-1, j); \
     }
--- a/src/strfns.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/strfns.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -44,7 +44,7 @@
   int nargin = args.length ();
 
   if (nargin == 1 && args(0).is_defined ())
-    retval = (double) args(0).is_string ();
+    retval = static_cast<double> (args(0).is_string ());
   else
     print_usage ("isstr");
 
--- a/src/symtab.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/symtab.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -415,7 +415,7 @@
     {
       // Would be nice to be able to avoid this cast.  XXX FIXME XXX
 
-      definition->define ((tree_constant *) saved_def);
+      definition->define (static_cast<tree_constant *> (saved_def));
       return 0;
     }
 
@@ -604,7 +604,7 @@
 
   if (is_variable ())
     {
-      tree_constant *tmp = (tree_constant *) def ();
+      tree_constant *tmp = static_cast<tree_constant *> (def ());
       retval = tmp->value ();
     }
 
@@ -629,7 +629,7 @@
 	}
     }
 
-  tree_constant *tmp = (tree_constant *) def ();
+  tree_constant *tmp = static_cast<tree_constant *> (def ());
 
   return tmp->reference ();
 }
@@ -652,7 +652,7 @@
   context.push (definition);
   definition = 0;
 
-  global_link_context.push ((unsigned) linked_to_global);
+  global_link_context.push (static_cast<unsigned> (linked_to_global));
   linked_to_global = 0;
 }
 
@@ -741,7 +741,7 @@
     {
       // Would be nice to avoid this cast.  XXX FIXME XXX
 
-      tree_constant *tmp = (tree_constant *) sr.def ();
+      tree_constant *tmp = static_cast<tree_constant *> (sr.def ());
 
       const_type = tmp->type_name ();
 
@@ -1058,8 +1058,8 @@
   symbols[count] = symbol_record_info ();
 
   if (sort && symbols)
-    qsort ((void *) symbols, count, sizeof (symbol_record_info),
-	   (int (*)(const void*, const void*)) symbol_record_info_cmp);
+    qsort (symbols, count, sizeof (symbol_record_info),
+	   symbol_record_info_cmp);
 
   return symbols;
 }
--- a/src/syscalls.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/syscalls.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -64,24 +64,24 @@
 {
   Octave_map m;
 
-  m["dev"] = (double) fs.dev ();
-  m["ino"] = (double) fs.ino ();
+  m["dev"] = static_cast<double> (fs.dev ());
+  m["ino"] = static_cast<double> (fs.ino ());
   m["modestr"] = fs.mode_as_string ();
-  m["nlink"] = (double) fs.nlink ();
-  m["uid"] = (double) fs.uid ();
-  m["gid"] = (double) fs.gid ();
+  m["nlink"] = static_cast<double> (fs.nlink ());
+  m["uid"] = static_cast<double> (fs.uid ());
+  m["gid"] = static_cast<double> (fs.gid ());
 #if defined (HAVE_ST_RDEV)
-  m["rdev"] = (double) fs.rdev ();
+  m["rdev"] = static_cast<double> (fs.rdev ());
 #endif
-  m["size"] = (double) fs.size ();
-  m["atime"] = (double) fs.atime ();
-  m["mtime"] = (double) fs.mtime ();
-  m["ctime"] = (double) fs.ctime ();
+  m["size"] = static_cast<double> (fs.size ());
+  m["atime"] = static_cast<double> (fs.atime ());
+  m["mtime"] = static_cast<double> (fs.mtime ());
+  m["ctime"] = static_cast<double> (fs.ctime ());
 #if defined (HAVE_ST_BLKSIZE)
-  m["blksize"] = (double) fs.blksize ();
+  m["blksize"] = static_cast<double> (fs.blksize ());
 #endif
 #if defined (HAVE_ST_BLOCKS)
-  m["blocks"] = (double) fs.blocks ();
+  m["blocks"] = static_cast<double> (fs.blocks ());
 #endif
 
   return m;
@@ -120,7 +120,7 @@
 		{
 		  int status = dup2 (i_old, i_new);
 
-		  retval(0) = (double) status;
+		  retval(0) = static_cast<double> (status);
 
 		  if (status < 0)
 		    retval(1) = strerror (errno);
@@ -206,7 +206,7 @@
 	    {
 	      int status = execvp (exec_file.c_str (), exec_args);
 
-	      retval(0) = (double) status;
+	      retval(0) = static_cast<double> (status);
 
 	      if (status < 0)
 		retval(1) = strerror (errno);
@@ -262,7 +262,7 @@
 	    {
 	      int status = fcntl (fid, req, arg);
 
-	      retval(0) = (double) status;
+	      retval(0) = static_cast<double> (status);
 
 	      if (status < 0)
 		retval(1) = strerror (errno);
@@ -301,7 +301,7 @@
 #if defined (HAVE_FORK)
       pid_t pid = fork ();
 
-      retval(0) = (double) pid;
+      retval(0) = static_cast<double> (pid);
 
       if (pid < 0)
 	retval(1) = strerror (errno);
@@ -522,13 +522,13 @@
 
 	  if (args(1).is_scalar_type ())
 	    {
-	      long mode = (long) args(1).double_value ();
+	      long mode = static_cast<long> (args(1).double_value ());
 
 	      string msg;
 
 	      int status = oct_mkfifo (name, mode, msg);
 
-	      retval(0) = (double) status;
+	      retval(0) = static_cast<double> (status);
 
 	      if (status < 0)
 		retval(1) = msg;
@@ -591,7 +591,7 @@
 	  file_ids (0, 1) = octave_stream_list::insert (os);
 
           retval(0) = file_ids;
-	  retval(1) = (double) status;
+	  retval(1) = static_cast<double> (status);
 	}
 #else
       gripe_not_supported ("pipe");
@@ -684,7 +684,7 @@
 
 	  int status = oct_unlink (name, msg);
 
-	  retval(0) = (double) status;
+	  retval(0) = static_cast<double> (status);
 
 	  if (status < 0)
 	    retval(1) = msg;	    
@@ -768,7 +768,7 @@
 		{
 		  pid_t status = waitpid (pid, 0, options);
 
-		  retval(0) = (double) status;
+		  retval(0) = static_cast<double> (status);
 
 		  if (status < 0)
 		    retval(1) = strerror (errno);
@@ -793,77 +793,77 @@
 symbols_of_syscalls (void)
 {
 #if defined (F_DUPFD)
-  DEFCONST (F_DUPFD, (double) F_DUPFD, 0, 0,
+  DEFCONST (F_DUPFD, static_cast<double> (F_DUPFD), 0, 0,
     "");
 #endif
 
 #if defined (F_GETFD)
-  DEFCONST (F_GETFD, (double) F_GETFD, 0, 0,
+  DEFCONST (F_GETFD, static_cast<double> (F_GETFD), 0, 0,
     "");
 #endif
 
 #if defined (F_GETFL)
-  DEFCONST (F_GETFL, (double) F_GETFL, 0, 0,
+  DEFCONST (F_GETFL, static_cast<double> (F_GETFL), 0, 0,
     "");
 #endif
 
 #if defined (F_SETFD)
-  DEFCONST (F_SETFD, (double) F_SETFD, 0, 0,
+  DEFCONST (F_SETFD, static_cast<double> (F_SETFD), 0, 0,
     "");
 #endif
 
 #if defined (F_SETFL)
-  DEFCONST (F_SETFL, (double) F_SETFL, 0, 0,
+  DEFCONST (F_SETFL, static_cast<double> (F_SETFL), 0, 0,
     "");
 #endif
 
 #if defined (O_APPEND)
-  DEFCONST (O_APPEND, (double) O_APPEND, 0, 0,
+  DEFCONST (O_APPEND, static_cast<double> (O_APPEND), 0, 0,
     "");
 #endif
 
 #if defined (O_ASYNC)
-  DEFCONST (O_ASYNC, (double) O_ASYNC, 0, 0,
+  DEFCONST (O_ASYNC, static_cast<double> (O_ASYNC), 0, 0,
     "");
 #endif
 
 #if defined (O_CREAT)
-  DEFCONST (O_CREAT, (double) O_CREAT, 0, 0,
+  DEFCONST (O_CREAT, static_cast<double> (O_CREAT), 0, 0,
     "");
 #endif
 
 #if defined (O_EXCL)
-  DEFCONST (O_EXCL, (double) O_EXCL, 0, 0,
+  DEFCONST (O_EXCL, static_cast<double> (O_EXCL), 0, 0,
     "");
 #endif
 
 #if defined (O_NONBLOCK)
-  DEFCONST (O_NONBLOCK, (double) O_NONBLOCK, 0, 0,
+  DEFCONST (O_NONBLOCK, static_cast<double> (O_NONBLOCK), 0, 0,
     "");
 #endif
 
 #if defined (O_RDONLY)
-  DEFCONST (O_RDONLY, (double) O_RDONLY, 0, 0,
+  DEFCONST (O_RDONLY, static_cast<double> (O_RDONLY), 0, 0,
     "");
 #endif
 
 #if defined (O_RDWR)
-  DEFCONST (O_RDWR, (double) O_RDWR, 0, 0,
+  DEFCONST (O_RDWR, static_cast<double> (O_RDWR), 0, 0,
     "");
 #endif
 
 #if defined (O_SYNC)
-  DEFCONST (O_SYNC, (double) O_SYNC, 0, 0,
+  DEFCONST (O_SYNC, static_cast<double> (O_SYNC), 0, 0,
     "");
 #endif
 
 #if defined (O_TRUNC)
-  DEFCONST (O_TRUNC, (double) O_TRUNC, 0, 0,
+  DEFCONST (O_TRUNC, static_cast<double> (O_TRUNC), 0, 0,
     "");
 #endif
 
 #if defined (O_WRONLY)
-  DEFCONST (O_WRONLY, (double) O_WRONLY, 0, 0,
+  DEFCONST (O_WRONLY, static_cast<double> (O_WRONLY), 0, 0,
     "");
 #endif
 }
--- a/src/sysdep.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/sysdep.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -608,8 +608,8 @@
   oct_mach_info::float_format flt_fmt =
     oct_mach_info::native_float_format ();
 
-  return (double) (flt_fmt == oct_mach_info::ieee_little_endian
-		   || flt_fmt == oct_mach_info::ieee_big_endian);
+  return static_cast<double> (flt_fmt == oct_mach_info::ieee_little_endian
+			      || flt_fmt == oct_mach_info::ieee_big_endian);
 }
 
 #if !defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H)
--- a/src/time.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/time.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -45,15 +45,15 @@
   Octave_map m;
 
   m ["usec"] = fraction * 1e6;
-  m ["sec"] = (double) tm->tm_sec;
-  m ["min"] = (double) tm->tm_min;
-  m ["hour"] = (double) tm->tm_hour;
-  m ["mday"] = (double) tm->tm_mday;
-  m ["mon"] = (double) tm->tm_mon;
-  m ["year"] = (double) tm->tm_year;
-  m ["wday"] = (double) tm->tm_wday;
-  m ["yday"] = (double) tm->tm_yday;
-  m ["isdst"] = (double) tm->tm_isdst;
+  m ["sec"] = static_cast<double> (tm->tm_sec);
+  m ["min"] = static_cast<double> (tm->tm_min);
+  m ["hour"] = static_cast<double> (tm->tm_hour);
+  m ["mday"] = static_cast<double> (tm->tm_mday);
+  m ["mon"] = static_cast<double> (tm->tm_mon);
+  m ["year"] = static_cast<double> (tm->tm_year);
+  m ["wday"] = static_cast<double> (tm->tm_wday);
+  m ["yday"] = static_cast<double> (tm->tm_yday);
+  m ["isdst"] = static_cast<double> (tm->tm_isdst);
 #if defined (HAVE_TM_ZONE)
   m ["zone"]  = tm->tm_zone;
 #elif defined (HAVE_TZNAME)
@@ -118,7 +118,7 @@
 
 #endif
  
-  return (double) now + fraction;
+  return static_cast<double> (now + fraction);
 }
 
 DEFUN_DLD (gmtime, args, ,
@@ -202,7 +202,7 @@
       struct tm *tm = extract_tm (map, fraction);
 
       if (! error_state)
-	retval = (double) mktime (tm) + fraction;
+	retval = static_cast<double> (mktime (tm) + fraction);
     }
   else
     print_usage ("mktime");
--- a/src/toplev.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/toplev.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -144,8 +144,8 @@
   YY_BUFFER_STATE old_buf = current_buffer ();
   YY_BUFFER_STATE new_buf = create_buffer (f);
 
-  add_unwind_protect (restore_input_buffer, (void *) old_buf);
-  add_unwind_protect (delete_input_buffer, (void *) new_buf);
+  add_unwind_protect (restore_input_buffer, old_buf);
+  add_unwind_protect (delete_input_buffer, new_buf);
 
   switch_to_buffer (new_buf);
 
@@ -201,7 +201,7 @@
 safe_fclose (void *f)
 {
   if (f)
-    fclose ((FILE *) f);
+    fclose (static_cast<FILE *> (f));
 }
 
 void
@@ -220,7 +220,7 @@
 
   if (f)
     {
-      add_unwind_protect (safe_fclose, (void *) f);
+      add_unwind_protect (safe_fclose, f);
 
       unwind_protect_int (input_line_number);
       unwind_protect_int (current_input_column);
@@ -541,8 +541,8 @@
   YY_BUFFER_STATE old_buf = current_buffer ();
   YY_BUFFER_STATE new_buf = create_buffer (0);
 
-  add_unwind_protect (restore_input_buffer, (void *) old_buf);
-  add_unwind_protect (delete_input_buffer, (void *) new_buf);
+  add_unwind_protect (restore_input_buffer, old_buf);
+  add_unwind_protect (delete_input_buffer, new_buf);
 
   switch_to_buffer (new_buf);
 
@@ -652,7 +652,7 @@
 static void
 cleanup_iprocstream (void *p)
 {
-  delete (iprocstream *) p;
+  delete static_cast<iprocstream *> (p);
 }
 
 static octave_value_list
@@ -687,7 +687,7 @@
 
       char *msg = output_buf.str ();
 
-      retval(1) = (double) status;
+      retval(1) = static_cast<double> (status);
       retval(0) = msg;
 
       delete [] msg;
@@ -774,7 +774,7 @@
 		  retval(0) = 0.0;
 		}
 	      else
-		retval(0) = (double) pid;
+		retval(0) = static_cast<double> (pid);
 	    }
 	  else if (return_output)
 	    retval = run_command_and_return_output (cmd_str);
@@ -790,7 +790,7 @@
 	      if (WIFEXITED (status))
 		status = WEXITSTATUS (status);
 
-	      retval = (double) status;
+	      retval = static_cast<double> (status);
 	    }
 	}
     }
@@ -869,7 +869,7 @@
   m ["prefix"] = OCTAVE_PREFIX;
   m ["exec_prefix"] = OCTAVE_EXEC_PREFIX;
   m ["datadir"] = OCTAVE_DATADIR;
-  m ["dld"] = (double) octave_supports_dynamic_linking;
+  m ["dld"] = static_cast<double> (octave_supports_dynamic_linking);
   m ["libdir"] = OCTAVE_LIBDIR;
   m ["bindir"] = OCTAVE_BINDIR;
   m ["infodir"] = OCTAVE_INFODIR;
@@ -942,11 +942,11 @@
   /* malloc (0) is unpredictable; avoid it.  */
   if (sz == 0)
     sz = 1;
-  p = (void *) malloc (sz);
+  p = malloc (sz);
   while (p == 0)
     {
       (*__new_handler) ();
-      p = (void *) malloc (sz);
+      p = malloc (sz);
     }
 
   if (debug_new_delete)
--- a/src/unwind-prot.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/unwind-prot.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -215,7 +215,7 @@
       break;
 
     case string_type:
-      ((string *) gen_ptr) -> assign (*str_value);
+      (static_cast<string *> (gen_ptr)) -> assign (*str_value);
       break;
 
     case generic_ptr:
@@ -235,7 +235,7 @@
 static void
 restore_saved_variable (void *s)
 {
-  saved_variable *sv = (saved_variable *) s;
+  saved_variable *sv = static_cast<saved_variable *> (s);
   sv->restore_value ();
   delete sv;
 }
@@ -244,21 +244,21 @@
 unwind_protect_int_internal (int *ptr, int value)
 {
   saved_variable *s = new saved_variable (ptr, value);
-  add_unwind_protect (restore_saved_variable, (void *) s);
+  add_unwind_protect (restore_saved_variable, s);
 }
 
 void
 unwind_protect_str_internal (string *ptr, const string& value)
 {
   saved_variable *s = new saved_variable (ptr, value);
-  add_unwind_protect (restore_saved_variable, (void *) s);
+  add_unwind_protect (restore_saved_variable, s);
 }
 
 void
 unwind_protect_ptr_internal (void **ptr, void *value)
 {
   saved_variable *s = new saved_variable (ptr, value);
-  add_unwind_protect (restore_saved_variable, (void *) s);
+  add_unwind_protect (restore_saved_variable, s);
 }
 
 /*
--- a/src/unwind-prot.h	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/unwind-prot.h	Sun Mar 09 09:50:39 1997 +0000
@@ -54,7 +54,8 @@
   unwind_protect_str_internal (&(s), (s))
 
 #define unwind_protect_ptr(p) \
-  unwind_protect_ptr_internal ((void **) &(p), (void *) (p))
+  unwind_protect_ptr_internal (static_cast<void **> (&(p)), \
+			       static_cast<void *> (p))
 
 class
 unwind_elem
--- a/src/variables.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/variables.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -343,7 +343,7 @@
 
   symbol_record *sr = curr_sym_tab->lookup (name, 0, 0);
 
-  retval = (double) (sr && sr->is_linked_to_global ());
+  retval = static_cast<double> (sr && sr->is_linked_to_global ());
 
   return retval;
 }
@@ -642,7 +642,7 @@
 safe_fclose (void *f)
 {
   if (f)
-    fclose ((FILE *) f);
+    fclose (static_cast<FILE *> (f));
 }
 
 static int
@@ -671,7 +671,7 @@
 
   FILE *ffile = get_input_from_file (ff, 0);
 
-  add_unwind_protect (safe_fclose, (void *) ffile);
+  add_unwind_protect (safe_fclose, ffile);
 
   if (ffile)
     {
@@ -1542,7 +1542,7 @@
       && ! xisnan (val))
     {
       int ival = NINT (val);
-      if (ival >= 0 && (double) ival == val)
+      if (ival >= 0 && ival == val)
 	{
 	  Vhistory_size = ival;
 	  octave_command_history.set_size (ival);
@@ -1616,7 +1616,7 @@
   DEFCONST (argv, , 0, 0,
     "the command line arguments this program was invoked with");
 
-  DEFVAR (echo_executing_commands, (double) ECHO_OFF, 0,
+  DEFVAR (echo_executing_commands, static_cast<double> (ECHO_OFF), 0,
 	  echo_executing_commands,
     "echo commands as they are executed");
 
--- a/src/xpow.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/xpow.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -65,7 +65,7 @@
 octave_value
 xpow (double a, double b)
 {
-  if (a < 0.0 && (int) b != b)
+  if (a < 0.0 && static_cast<int> (b) != b)
     {
       Complex atmp (a);
       return pow (atmp, b);
@@ -163,9 +163,9 @@
     error ("for A^b, A must be square");
   else
     {
-      if ((int) b == b)
+      if (static_cast<int> (b) == b)
 	{
-	  int btmp = (int) b;
+	  int btmp = b;
 	  if (btmp == 0)
 	    {
 	      retval = DiagMatrix (nr, nr, 1.0);
@@ -253,7 +253,7 @@
   Complex result;
 
   if (xisint (b))
-    result = pow (a, (int) b);
+    result = pow (a, static_cast<int> (b));
   else
     result = pow (a, b);
 
@@ -348,9 +348,9 @@
     error ("for A^b, A must be square");
   else
     {
-      if ((int) b == b)
+      if (static_cast<int> (b) == b)
 	{
-	  int btmp = (int) b;
+	  int btmp = b;
 	  if (btmp == 0)
 	    {
 	      retval = DiagMatrix (nr, nr, 1.0);
@@ -504,7 +504,7 @@
   int nr = a.rows ();
   int nc = a.cols ();
 
-  if ((int) b != b && a.any_element_is_negative ())
+  if (static_cast<int> (b) != b && a.any_element_is_negative ())
     {
       ComplexMatrix result (nr, nc);
       for (int j = 0; j < nc; j++)
@@ -553,7 +553,7 @@
       {
 	double atmp = a (i, j);
 	double btmp = b (i, j);
-	if (atmp < 0.0 && (int) btmp != btmp)
+	if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
 	  {
 	    convert_to_complex = 1;
 	    goto done;
@@ -642,7 +642,7 @@
       {
 	double btmp = b (i, j);
 	if (xisint (btmp))
-	  result (i, j) = pow (a, (int) btmp);
+	  result (i, j) = pow (a, static_cast<int> (btmp));
 	else
 	  result (i, j) = pow (a, btmp);
       }
@@ -678,7 +678,7 @@
     {
       for (int j = 0; j < nc; j++)
 	for (int i = 0; i < nr; i++)
-	  result (i, j) = pow (a (i, j), (int) b);
+	  result (i, j) = pow (a (i, j), static_cast<int> (b));
     }
   else
     {
@@ -712,7 +712,7 @@
       {
 	double btmp = b (i, j);
 	if (xisint (btmp))
-	  result (i, j) = pow (a (i, j), (int) btmp);
+	  result (i, j) = pow (a (i, j), static_cast<int> (btmp));
 	else
 	  result (i, j) = pow (a (i, j), btmp);
       }