about summary refs log tree commit diff
path: root/other/pamdepth.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-09-27 21:44:29 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-09-27 21:44:29 +0000
commit43939e66b1d4eeb2f3799c124f3598756755005a (patch)
tree15733092de55d52421a6ea02f5a43d5f8ff24393 /other/pamdepth.c
parent49f4336c9bba33650573ba780b70bc501b38643e (diff)
downloadnetpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.gz
netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.xz
netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.zip
Rebase Stable series to current Advanced: 10.47.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@995 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pamdepth.c')
-rw-r--r--other/pamdepth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/other/pamdepth.c b/other/pamdepth.c
index 0c4490ed..ee59a408 100644
--- a/other/pamdepth.c
+++ b/other/pamdepth.c
@@ -11,8 +11,9 @@
 =============================================================================*/
 #include <assert.h>
 
-#include "shhopt.h"
+#include "pm_c_util.h"
 #include "mallocvar.h"
+#include "shhopt.h"
 #include "pam.h"
 
 struct cmdlineInfo {
@@ -89,7 +90,7 @@ createSampleMap(sample   const oldMaxval,
     MALLOCARRAY_NOFAIL(sampleMap, oldMaxval+1);
 
     for (i = 0; i <= oldMaxval; ++i)
-        sampleMap[i] = (i * newMaxval + oldMaxval / 2) / oldMaxval;
+        sampleMap[i] = ROUNDDIV(i * newMaxval, oldMaxval);
 
     *sampleMapP = sampleMap;
 }