harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r482973 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/native: jpegdecoder/shared/JPEGDecoder.h jpegdecoder/shared/JpegDecoder.c lcmm/shared/cmmapi.h lcmm/shared/cmmio.c
Date Wed, 06 Dec 2006 08:51:45 GMT
Author: apetrenko
Date: Wed Dec  6 00:51:44 2006
New Revision: 482973

URL: http://svn.apache.org/viewvc?view=rev&rev=482973
Log:
svn commit r482652 is reverted

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmapi.h
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmio.c

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h?view=diff&rev=482973&r1=482972&r2=482973
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h
Wed Dec  6 00:51:44 2006
@@ -43,4 +43,12 @@
 jfieldID img_JPEG_currScanlineID;
 jfieldID img_JPEG_hNativeDecoderID;
 
+/* MIN(a, b) macro */
+#undef MIN
+#define MIN(a, b) ((a) < (b))?(a):(b)
+
+/* MAX(a, b) macro */
+#undef MAX
+#define MAX(a, b) ((a) > (b))?(a):(b)
+
 #endif

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c?view=diff&rev=482973&r1=482972&r2=482973
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
Wed Dec  6 00:51:44 2006
@@ -20,7 +20,6 @@
  * 
  */
 
-#include <stdlib.h>
 #include "JPEGDecoder.h"
 
 typedef enum TAG_DECODER_STATE{
@@ -91,7 +90,7 @@
     srcmgr = (gl_jpeg_source_mgr*) cinfo->src;
     srcmgr->skip_input_bytes += num_bytes;
   
-    skipbytes = __min(srcmgr->base.bytes_in_buffer, srcmgr->skip_input_bytes);
+    skipbytes = MIN(srcmgr->base.bytes_in_buffer, srcmgr->skip_input_bytes);
 
     if(skipbytes < srcmgr->base.bytes_in_buffer) {
             memmove(srcmgr->jpeg_buffer,
@@ -355,7 +354,7 @@
     }
   }
 
-  consumed = __min(bytesInBuffer, freeInJpegBuffer);
+  consumed = MIN(bytesInBuffer, freeInJpegBuffer);
 
   // filling buffer with the new data  
   buffer = (*env)->GetPrimitiveArrayCritical(env, jbuffer, 0);
@@ -369,7 +368,7 @@
     glDecompress->srcMgr.valid_buffer_length += consumed;
 
     if(glDecompress->srcMgr.skip_input_bytes) {
-        int skipbytes = (int) __min((size_t) glDecompress->srcMgr.valid_buffer_length,
glDecompress->srcMgr.skip_input_bytes);
+        int skipbytes = (int) MIN((size_t) glDecompress->srcMgr.valid_buffer_length, glDecompress->srcMgr.skip_input_bytes);
 
         if(skipbytes < glDecompress->srcMgr.valid_buffer_length) {
             memmove(glDecompress->srcMgr.jpeg_buffer,
@@ -450,7 +449,7 @@
         }
 
     // Calculate output buffer size and allocate memory for it
-    glDecompress->maxScanlines = __max((int)(MAX_BUFFER / glDecompress->scanlineSize),
1);
+    glDecompress->maxScanlines = MAX((int)(MAX_BUFFER / glDecompress->scanlineSize),
1);
     glDecompress->outBufferSize = glDecompress->maxScanlines; // * glDecompress->scanlineSize;
   
 
     glDecompress->outBuffer = malloc(glDecompress->outBufferSize * sizeof(JSAMPROW));

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmapi.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmapi.h?view=diff&rev=482973&r1=482972&r2=482973
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmapi.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmapi.h Wed Dec
 6 00:51:44 2006
@@ -27,6 +27,12 @@
 #endif
 
 
+// Just a useful macro
+#undef MIN
+
+#define MIN(a,b)    ((a) < (b) ? (a) : (b))
+
+
 LPLCMSICCPROFILE cmmOpenProfile(LPBYTE dataPtr, DWORD dwSize);
 
 BOOL cmmCloseProfile(LPLCMSICCPROFILE hProfile);

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmio.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmio.c?view=diff&rev=482973&r1=482972&r2=482973
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmio.c (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/cmmio.c Wed Dec
 6 00:51:44 2006
@@ -20,7 +20,6 @@
  * 
  */
 
-#include <stdlib.h>
 #include "cmmapi.h"
 
 
@@ -544,7 +543,7 @@
     return FALSE;    
   }
 
-  *dataSize = __min(*dataSize, hProfile->TagSizes[idx]);
+  *dataSize = MIN(*dataSize, hProfile->TagSizes[idx]);
 
 
 
@@ -588,7 +587,7 @@
 
 BOOL cmmGetProfileHeader(LPLCMSICCPROFILE hProfile, LPBYTE data, size_t size) {
 
-  size_t bytesToRead = __min(size, sizeof(icHeader));
+  size_t bytesToRead = MIN(size, sizeof(icHeader));
 
   hProfile->Seek(hProfile->stream, 0);
 



Mime
View raw message