File jpegstream.patch of Package iscan (Revision 5068ae099745f2db562e7f16cbf3e243)

Currently displaying revision 5068ae099745f2db562e7f16cbf3e243 , Show latest

22
 
1
--- a/lib/jpegstream.cc
2
+++ b/lib/jpegstream.cc
3
@@ -33,7 +33,7 @@
4
 
5
 #include "jpegstream.hh"
6
 
7
-#include <cstdlib>
8
+//#include <cstdlib>
9
 #include <ios>
10
 
11
 namespace iscan
12
@@ -82,7 +82,8 @@ namespace iscan
13
         //        only that _bits != 8.
14
         for (unsigned int i = 0; i < _h_sz; ++i)
15
           {
16
-            div_t index = div (i, 8 * sizeof (JSAMPLE));
17
+            div_t index = div (static_cast<int>(i),
18
+                               static_cast<int>(8 * sizeof (JSAMPLE)));
19
             int offset = 8 * sizeof (JSAMPLE) - 1 - index.rem;
20
             _scanline[i] = ((line[index.quot] & (1 << offset))
21
                             ? 0 : ~0);
22