changeset 8797:ee3446ca6157

avoid warning in oct-inttypes.cc
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 18 Feb 2009 08:53:45 +0100
parents 9662dfb26652
children 53f8fca6dd69
files liboctave/ChangeLog liboctave/oct-inttypes.cc
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Wed Feb 18 02:08:01 2009 -0500
+++ b/liboctave/ChangeLog	Wed Feb 18 08:53:45 2009 +0100
@@ -1,3 +1,8 @@
+2009-02-18  Jaroslav Hajek  <highegg@gmail.com>
+
+	* oct-inttypes.cc (pow (const octave_int<T>&, const octave_int<T>&)):
+	Use octave_int comparisons to avoid warning for unsigned types.
+
 2009-02-17  Jaroslav Hajek  <highegg@gmail.com>
 
 	* Array.cc (Array<T>::resize (const dim_vector&)): Remove dead branch.
--- a/liboctave/oct-inttypes.cc	Wed Feb 18 02:08:01 2009 -0500
+++ b/liboctave/oct-inttypes.cc	Wed Feb 18 08:53:45 2009 +0100
@@ -538,7 +538,7 @@
   // the is_signed check is inserted twice to avoid compiler warnings
   else if (std::numeric_limits<T>::is_signed && b < zero)
     {
-      if (std::numeric_limits<T>::is_signed && a.value () == -1)
+      if (a == octave_int<int> (-1))
         retval = (b.value () % 2) ? a : one;
       else
         retval = zero;