]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagjpeg.cpp
Docstring tweaks
[wxWidgets.git] / src / common / imagjpeg.cpp
index c10f764da40d3b53794d166fb056d392876d0454..0111e42ce1162725317bde3e822837eaf6cf73a1 100644 (file)
     #include "wx/log.h"
     #include "wx/app.h"
     #include "wx/intl.h"
+    #include "wx/bitmap.h"
+    #include "wx/module.h"
 #endif
 
-#include "wx/bitmap.h"
-
 // NB: Some compilers define boolean type in Windows headers
-//     (e.g. Watcom C++, but not Open Watcom).
+//     (e.g. Watcom C++, but not some Open Watcom versions).
 //     This causes a conflict with jmorecfg.h header from libjpeg, so we have
 //     to make sure libjpeg won't try to define boolean itself. This is done by
 //     defining HAVE_BOOLEAN.
-#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__))
+#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__) || \
+       (defined(__WATCOMC__) && !wxONLY_WATCOM_EARLIER_THAN(1,6)))
     #define HAVE_BOOLEAN
     #include "wx/msw/wrapwin.h"
 #endif
@@ -46,7 +47,6 @@ extern "C"
 
 #include "wx/filefn.h"
 #include "wx/wfstream.h"
-#include "wx/module.h"
 
 // For memcpy
 #include <string.h>
@@ -209,13 +209,13 @@ static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk)
     register int c;
 
     c = k + k2 * (255 - cmyk[0]) / 255;
-    rgb[0] = (c > 255) ? 0 : (255 - c);
+    rgb[0] = (unsigned char)((c > 255) ? 0 : (255 - c));
 
     c = k + k2 * (255 - cmyk[1]) / 255;
-    rgb[1] = (c > 255) ? 0 : (255 - c);
+    rgb[1] = (unsigned char)((c > 255) ? 0 : (255 - c));
 
     c = k + k2 * (255 - cmyk[2]) / 255;
-    rgb[2] = (c > 255) ? 0 : (255 - c);
+    rgb[2] = (unsigned char)((c > 255) ? 0 : (255 - c));
 }
 
 // temporarily disable the warning C4611 (interaction between '_setjmp' and