am 31b3a825: am 0e1c7ef1: Fix bugs in jmem-ashmem.

* commit '31b3a825a1934d9635e4b674dda9025465d35b69':
  Fix bugs in jmem-ashmem.
diff --git a/Android.mk b/Android.mk
index 6e78c74..b5905d1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -35,7 +35,7 @@
 # enable tile based decode
 LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE
 
-ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
+ifeq ($(TARGET_ARCH),x86)
   LOCAL_CFLAGS += -DANDROID_INTELSSE2_IDCT
   LOCAL_SRC_FILES += jidctintelsse.c
 endif
diff --git a/jccolor.c b/jccolor.c
index 57a76c3..6a8b48f 100644
--- a/jccolor.c
+++ b/jccolor.c
@@ -302,7 +302,7 @@
 
 #ifdef ENABLE_ANDROID_NULL_CONVERT
 
-typedef unsigned long UINT32;
+typedef unsigned int UINT32;
 
 #define B0(n)   ((n) & 0xFF)
 #define B1(n)   (((n) >> 8) & 0xFF)
diff --git a/jmorecfg.h b/jmorecfg.h
index 71cb393..f878ed7 100644
--- a/jmorecfg.h
+++ b/jmorecfg.h
@@ -10,6 +10,11 @@
  * optimizations.  Most users will not need to touch this file.
  */
 
+#ifndef JMORECFG_H
+#define JMORECFG_H
+
+#include <stdint.h>
+
 /*
  * Define ANDROID_RGB to enable specific optimizations for Android
  *   JCS_RGBA_8888 support
@@ -22,7 +27,7 @@
 #ifdef ANDROID_RGB
 #define PACK_SHORT_565(r,g,b)  ((((r)<<8)&0xf800)|(((g)<<3)&0x7E0)|((b)>>3))
 #define PACK_TWO_PIXELS(l,r)   ((r<<16) | l)
-#define PACK_NEED_ALIGNMENT(ptr) (((int)(ptr))&3)
+#define PACK_NEED_ALIGNMENT(ptr) (((uintptr_t)(ptr))&3)
 #define WRITE_TWO_PIXELS(addr, pixels) do {     \
          ((INT16*)(addr))[0] = (pixels);        \
          ((INT16*)(addr))[1] = (pixels)>>16;    \
@@ -78,7 +83,7 @@
 
 #ifdef HAVE_UNSIGNED_CHAR
 
-typedef unsigned char JSAMPLE;
+typedef uint8_t JSAMPLE;
 #define GETJSAMPLE(value)  ((int) (value))
 
 #else /* not HAVE_UNSIGNED_CHAR */
@@ -103,7 +108,7 @@
  * On nearly all machines "short" will do nicely.
  */
 
-typedef short JSAMPLE;
+typedef int16_t JSAMPLE;
 #define GETJSAMPLE(value)  ((int) (value))
 
 #define MAXJSAMPLE	4095
@@ -118,7 +123,7 @@
  * if you have memory to burn and "short" is really slow.
  */
 
-typedef short JCOEF;
+typedef int16_t JCOEF;
 
 
 /* Compressed datastreams are represented as arrays of JOCTET.
@@ -129,7 +134,7 @@
 
 #ifdef HAVE_UNSIGNED_CHAR
 
-typedef unsigned char JOCTET;
+typedef uint8_t JOCTET;
 #define GETJOCTET(value)  (value)
 
 #else /* not HAVE_UNSIGNED_CHAR */
@@ -154,7 +159,7 @@
 /* UINT8 must hold at least the values 0..255. */
 
 #ifdef HAVE_UNSIGNED_CHAR
-typedef unsigned char UINT8;
+typedef uint8_t UINT8;
 #else /* not HAVE_UNSIGNED_CHAR */
 #ifdef CHAR_IS_UNSIGNED
 typedef char UINT8;
@@ -166,7 +171,7 @@
 /* UINT16 must hold at least the values 0..65535. */
 
 #ifdef HAVE_UNSIGNED_SHORT
-typedef unsigned short UINT16;
+typedef uint16_t UINT16;
 #else /* not HAVE_UNSIGNED_SHORT */
 typedef unsigned int UINT16;
 #endif /* HAVE_UNSIGNED_SHORT */
@@ -174,13 +179,13 @@
 /* INT16 must hold at least the values -32768..32767. */
 
 #ifndef XMD_H			/* X11/xmd.h correctly defines INT16 */
-typedef short INT16;
+typedef int16_t INT16;
 #endif
 
 /* INT32 must hold at least signed 32-bit values. */
 
 #ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
-typedef long INT32;
+typedef int32_t INT32;
 #endif
 
 /* Datatype used for image dimensions.  The JPEG standard only supports
@@ -393,3 +398,5 @@
 #endif
 
 #endif /* JPEG_INTERNAL_OPTIONS */
+
+#endif /* JMORECFG_H */