diff options
Diffstat (limited to 'src/djvulibre-3-precision.patch')
-rw-r--r-- | src/djvulibre-3-precision.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/djvulibre-3-precision.patch b/src/djvulibre-3-precision.patch new file mode 100644 index 0000000..0d63f2b --- /dev/null +++ b/src/djvulibre-3-precision.patch @@ -0,0 +1,93 @@ +This file is part of MXE. +See index.html for further information. + +Source: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-djvulibre + +--- a/libdjvu/DjVuPort.cpp ++++ b/libdjvu/DjVuPort.cpp +@@ -466,11 +466,11 @@ + // Sort in depth order + int max_dist=0; + for(pos=set;pos;++pos) +- if (max_dist < (int)(long)set[pos]) +- max_dist = (int)(long)set[pos]; ++ if (max_dist < (int)(size_t)set[pos]) ++ max_dist = (int)(size_t)set[pos]; + GArray<GList<const void*> > lists(0,max_dist); + for(pos=set;pos;++pos) +- lists[(int)(long)set[pos]].append(set.key(pos)); ++ lists[(int)(size_t)set[pos]].append(set.key(pos)); + for(int dist=0;dist<=max_dist;dist++) + for(pos=lists[dist];pos;++pos) + { +--- a/libdjvu/GBitmap.cpp ++++ b/libdjvu/GBitmap.cpp +@@ -469,7 +469,7 @@ + { + if (!monitorptr) + { +- unsigned long x = (unsigned long)this; ++ size_t x = (size_t)this; + monitorptr = &monitors[(x^(x>>5)) % NMONITORS]; + } + } +--- a/libdjvu/GContainer.h ++++ b/libdjvu/GContainer.h +@@ -178,7 +178,7 @@ + static inline unsigned int + hash(const void * const & x) + { +- return (unsigned long) x; ++ return (unsigned long)((size_t) x); + } + + /** Hashing function (float). */ +--- a/libdjvu/IW44EncodeCodec.cpp ++++ b/libdjvu/IW44EncodeCodec.cpp +@@ -310,7 +310,7 @@ + static inline void + mmx_fv_1 ( short* &q, short* e, int s, int s3 ) + { +- while (q<e && (((long)q)&0x7)) ++ while (q<e && (((intptr_t)q)&0x7)) + { + int a = (int)q[-s] + (int)q[s]; + int b = (int)q[-s3] + (int)q[s3]; +@@ -353,7 +353,7 @@ + static inline void + mmx_fv_2 ( short* &q, short* e, int s, int s3 ) + { +- while (q<e && (((long)q)&0x7)) ++ while (q<e && (((intptr_t)q)&0x7)) + { + int a = (int)q[-s] + (int)q[s]; + int b = (int)q[-s3] + (int)q[s3]; +--- a/libdjvu/IW44Image.cpp ++++ b/libdjvu/IW44Image.cpp +@@ -167,7 +167,7 @@ + static void + mmx_bv_1 ( short* &q, short* e, int s, int s3 ) + { +- while (q<e && (((long)q)&0x7)) ++ while (q<e && (((intptr_t)q)&0x7)) + { + int a = (int)q[-s] + (int)q[s]; + int b = (int)q[-s3] + (int)q[s3]; +@@ -211,7 +211,7 @@ + static void + mmx_bv_2 ( short* &q, short* e, int s, int s3 ) + { +- while (q<e && (((long)q)&0x7)) ++ while (q<e && (((intptr_t)q)&0x7)) + { + int a = (int)q[-s] + (int)q[s]; + int b = (int)q[-s3] + (int)q[s3]; +@@ -649,7 +649,7 @@ + // Allocate enough room for pointers plus alignment + short *p = alloc( (n+1) * sizeof(short*) / sizeof(short) ); + // Align on pointer size +- while ( ((long)p) & (sizeof(short*)-1) ) ++ while ( ((size_t)p) & (sizeof(short*)-1) ) + p += 1; + // Cast and return + return (short**)p; |