Revision: 56697
          http://sourceforge.net/p/brlcad/code/56697
Author:   brlcad
Date:     2013-08-08 18:51:28 +0000 (Thu, 08 Aug 2013)
Log Message:
-----------
check the more general case to future-proof against a signed type.  make log 
messages be less developer-speak.

Modified Paths:
--------------
    brlcad/trunk/src/libicv/decimate.c

Modified: brlcad/trunk/src/libicv/decimate.c
===================================================================
--- brlcad/trunk/src/libicv/decimate.c  2013-08-08 18:34:45 UTC (rev 56696)
+++ brlcad/trunk/src/libicv/decimate.c  2013-08-08 18:51:28 UTC (rev 56697)
@@ -36,8 +36,8 @@
     int x, y, c;
     size_t widthstep =  bif->width*bif->channels;
 
-    if (UNLIKELY(factor == 0)) {
-        bu_log("shrink_image : Cannot shrink image to 0 factor, factor should 
be non zero Unsigned Integer");
+    if (UNLIKELY(factor < 1)) {
+        bu_log("Cannot shrink image to 0 factor, factor should be a positive 
value.");
         return -1;
     }
 
@@ -78,8 +78,8 @@
     double *data_p, *res_p;
     int x, y, widthstep;
 
-    if (UNLIKELY(factor == 0)) {
-        bu_log("under_sample : Cannot shrink image to 0 factor, factor should 
be non zero Unsigned Integer");
+    if (UNLIKELY(factor < 1)) {
+        bu_log("Cannot shrink image to 0 factor, factor should be a positive 
value.");
         return -1;
     }
 
@@ -111,7 +111,7 @@
     ystep = (double) (bif->height-1) / (double) (out_height) - 1.0e-06;
 
     if ((xstep < 1.0 && ystep > 1.0) || (xstep > 1.0 && ystep < 1.0)) {
-        bu_log("ninterp: Can't stretch one way and compress another\n");
+        bu_log("Operation unsupported.  Cannot stretch one dimension while 
compressing the other.\n");
         return -1;
     }
 
@@ -158,7 +158,7 @@
     ystep = (double) (bif->height -1) / (double)out_height - 1.0e-6;
 
     if ((xstep < 1.0 && ystep > 1.0) || (xstep > 1.0 && ystep < 1.0)) {
-        bu_log("binterp: Can't stretch one way and compress another\n");
+        bu_log("Operation unsupported.  Cannot stretch one dimension while 
compressing the other.\n");
         return -1;
     }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to