changeset 13113:40f935b15a22

Fix warning about signed/unsigned comparison
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 07 Sep 2011 18:12:26 -0500
parents 969ed305dde5
children 7600200a54c8
files src/utils.cc
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/utils.cc	Tue Sep 06 21:15:16 2011 -0500
+++ b/src/utils.cc	Wed Sep 07 18:12:26 2011 -0500
@@ -1368,7 +1368,9 @@
 
       END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
 
-      if (nchars > -1 && nchars < size)
+      // Cast to avoid signed/unsigned comparison is safe due to
+      // short-circuiting
+      if (nchars > -1 && static_cast<size_t>(nchars) < size)
         break;
       else
         {