Index: /trunk/openjdk/hotspot/make/os2/makefiles/compile.make
===================================================================
--- /trunk/openjdk/hotspot/make/os2/makefiles/compile.make	(revision 332)
+++ /trunk/openjdk/hotspot/make/os2/makefiles/compile.make	(revision 333)
@@ -101,5 +101,5 @@
 CPP_FLAGS += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
              -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
-        	 -D_SVID_SOURCE
+        	 -D_SVID_SOURCE -DOS2EMX_PLAIN_CHAR
 CPP_FLAGS += -I$(ALT_ODINSDK_HEADERS_PATH)/Win -I$(ALT_ODINSDK_HEADERS_PATH)
 
Index: /trunk/openjdk/jdk/make/common/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 332)
+++ /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 333)
@@ -124,6 +124,6 @@
 
 # We compile a lot of MSVC code which seems to silently tolerate this
-GCC_WARNINGS += -Wno-sign-compare
-GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-missing-field-initializers
+GCC_WARNINGS += -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-missing-braces
+GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
 GCC_WARNINGS_CXX += -Wno-write-strings
 
@@ -146,4 +146,8 @@
 CXXFLAGS_DBG	= $(CFLAGS_DBG)
 
+# Some code uses very unstrict aliasing turn this optimization off
+CFLAGS_COMMON += -fno-strict-aliasing
+CXXFLAGS_COMMON += -fno-strict-aliasing
+
 #
 # Preprocessor macro definitions
@@ -173,5 +177,5 @@
 CPPFLAGS_COMMON += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
                    -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
-				   -D_SVID_SOURCE
+				   -D_SVID_SOURCE -DOS2EMX_PLAIN_CHAR
 CPPFLAGS_COMMON += -I$(ODINSDK_HEADERS_PATH)/Win -I$(ODINSDK_HEADERS_PATH) \
                    -DWINE_LARGE_INTEGER
Index: /trunk/openjdk/jdk/src/share/bin/java.c
===================================================================
--- /trunk/openjdk/jdk/src/share/bin/java.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/bin/java.c	(revision 333)
@@ -205,5 +205,5 @@
     int ret;
     InvocationFunctions ifn;
-    jlong start, end;
+    jlong start = 0, end;
     char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
     char ** original_argv = argv;
@@ -389,5 +389,5 @@
     jobjectArray mainArgs;
     int ret = 0;
-    jlong start, end;
+    jlong start = 0, end;
 
     /*
@@ -1390,5 +1390,5 @@
     char *s = buf, *t = name, c;
     jclass cls;
-    jlong start, end;
+    jlong start = 0, end;
 
     if (_launcher_debug)
@@ -1809,5 +1809,5 @@
     int cnt = 0;
     int lineno = 0;
-    jlong start, end;
+    jlong start = 0, end;
     int vmType;
     char *tmpPtr;
Index: /trunk/openjdk/jdk/src/share/instrument/InvocationAdapter.c
===================================================================
--- /trunk/openjdk/jdk/src/share/instrument/InvocationAdapter.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/instrument/InvocationAdapter.c	(revision 333)
@@ -30,4 +30,8 @@
 #include    <string.h>
 #include    <stdlib.h>
+
+#ifdef __EMX__
+#include <strings.h> // strcasecmp
+#endif
 
 #include    "jni.h"
Index: /trunk/openjdk/jdk/src/share/instrument/JarFacade.c
===================================================================
--- /trunk/openjdk/jdk/src/share/instrument/JarFacade.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/instrument/JarFacade.c	(revision 333)
@@ -26,4 +26,8 @@
 #include <string.h>
 #include <stdlib.h>
+
+#ifdef __EMX__
+#include <strings.h> // strcasecmp
+#endif
 
 #include "jni.h"
Index: /trunk/openjdk/jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	(revision 333)
@@ -49,5 +49,5 @@
     int isSigned;
     int isBigEndian;
-    UINT8* conversionBuffer;
+    char* conversionBuffer;
     int conversionBufferSize;
 } DAUDIO_Info;
@@ -173,5 +173,5 @@
  * as conversionSize
  */
-void handleSignEndianConversion(INT8* data, INT8* output, int byteSize, int conversionSize) {
+static void handleSignEndianConversion(char* data, char* output, int byteSize, int conversionSize) {
     TRACE1("conversion with size %d\n", conversionSize);
     switch (conversionSize) {
@@ -186,5 +186,5 @@
     }
     case 2: {
-        INT8 h;
+        char h;
         byteSize = byteSize / 2;
         while (byteSize > 0) {
@@ -200,5 +200,5 @@
     }
     case 3: {
-        INT8 h;
+        char h;
         byteSize = byteSize / 3;
         while (byteSize > 0) {
@@ -215,5 +215,5 @@
     }
     case 4: {
-        INT8 h1, h2;
+        char h1, h2;
         byteSize = byteSize / 4;
         while (byteSize > 0) {
@@ -312,5 +312,5 @@
 
 
-void handleGainAndConversion(DAUDIO_Info* info, UINT8* input, UINT8* output,
+void handleGainAndConversion(DAUDIO_Info* info, char* input, char* output,
                              int len, float leftGain, float rightGain,
                              int conversionSize) {
@@ -585,8 +585,8 @@
  jint offset, jint len, jint conversionSize, jfloat leftGain, jfloat rightGain) {
     int ret = -1;
-#if USE_DAUDIO == TRUE
-    UINT8* data;
-    UINT8* dataOffset;
-    UINT8* convertedData;
+#if USE_DAUDIO != TRUE
+    char* data;
+    char* dataOffset;
+    char* convertedData;
     jboolean didCopy;
     DAUDIO_Info* info = (DAUDIO_Info*) (UINT_PTR) id;
@@ -599,5 +599,5 @@
     if (len == 0) return 0;
     if (info && info->handle) {
-        data = (UINT8*) ((*env)->GetByteArrayElements(env, jData, &didCopy));
+        data = ((*env)->GetByteArrayElements(env, jData, &didCopy));
         dataOffset = data;
         dataOffset += (int) offset;
@@ -615,5 +615,5 @@
                 }
                 if (!info->conversionBuffer) {
-                    info->conversionBuffer = (UINT8*) malloc(len);
+                    info->conversionBuffer = (char*) malloc(len);
                     if (!info->conversionBuffer) {
                         // do not commit the native array
@@ -630,5 +630,5 @@
                 || ((info->channels * info->sampleSizeInBits / 8) != info->frameSize)
                 || (info->sampleSizeInBits != 8 && info->sampleSizeInBits != 16)) {
-                handleSignEndianConversion((INT8*) dataOffset, (INT8*) convertedData, (int) len,
+                handleSignEndianConversion(dataOffset, convertedData, (int) len,
                                            (int) conversionSize);
             } else {
@@ -639,5 +639,5 @@
         }
 
-        ret = DAUDIO_Write(info->handle, (INT8*) convertedData, (int) len);
+        ret = DAUDIO_Write(info->handle, convertedData, (int) len);
 
         // do not commit the native array
Index: /trunk/openjdk/jdk/src/share/native/java/util/zip/zlib-1.1.3/inftrees.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/java/util/zip/zlib-1.1.3/inftrees.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/java/util/zip/zlib-1.1.3/inftrees.c	(revision 333)
@@ -153,5 +153,5 @@
   register uIntf *p;            /* pointer into c[], b[], or v[] */
   inflate_huft *q;              /* points to current table */
-  struct inflate_huft_s r;      /* table entry for structure assignment */
+  struct inflate_huft_s r = {0};/* table entry for structure assignment */
   inflate_huft *u[BMAX];        /* table stack */
   register int w;               /* bits before this table == (l * h) */
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffine.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffine.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffine.c	(revision 333)
@@ -155,5 +155,5 @@
   mlib_status res;
   mlib_type type;
-  mlib_s32 nchan, t_ind, kw, kw1;
+  mlib_s32 nchan, t_ind = 0, kw, kw1;
   mlib_addr align;
   mlib_d64 buff_lcl[BUFF_SIZE / 8];
@@ -319,4 +319,7 @@
 
         break;
+
+      default:
+        break;
     }
 
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffineEdge.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffineEdge.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageAffineEdge.c	(revision 333)
@@ -617,4 +617,7 @@
         break;
       }
+
+    default:
+      break;
   }
 }
@@ -643,4 +646,7 @@
     case MLIB_DOUBLE:
       MLIB_PROCESS_EDGES(MLIB_EDGE_NEAREST_LINE, mlib_d64);
+      break;
+
+    default:
       break;
   }
@@ -692,4 +698,7 @@
             MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_u8i, mlib_s16);
             break;
+
+          default:
+            break;
         }
 
@@ -706,6 +715,12 @@
             MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_s16i, mlib_s16);
             break;
+
+          default:
+            break;
         }
 
+        break;
+
+      default:
         break;
     }
@@ -744,4 +759,7 @@
       srcStride >>= 3;
       MLIB_PROCESS_EDGES(MLIB_EDGE_BL, mlib_d64);
+      break;
+
+    default:
       break;
   }
@@ -822,4 +840,7 @@
             MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_u8i, mlib_s16);
             break;
+
+          default:
+            break;
         }
 
@@ -836,6 +857,12 @@
             MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_s16i, mlib_s16);
             break;
+
+          default:
+            break;
         }
 
+        break;
+
+      default:
         break;
     }
@@ -896,4 +923,7 @@
 
       break;
+
+    default:
+      break;
   }
 
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageColorTrue2Index.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageColorTrue2Index.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageColorTrue2Index.c	(revision 333)
@@ -2624,4 +2624,7 @@
               }
             }
+
+          default:
+            break;
         }
 
@@ -2679,4 +2682,7 @@
               }
             }
+
+          default:
+            break;
         }
 
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConvMxN.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConvMxN.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConvMxN.c	(revision 333)
@@ -212,4 +212,6 @@
           ret = mlib_convMxNnw_d64(dst_i, src_i, kernel, m, n, dm, dn, cmask);
           break;
+        default:
+          break;
       }
     }
@@ -221,4 +223,6 @@
       case MLIB_EDGE_DST_COPY_SRC:
         mlib_ImageConvCopyEdge(dst_e, src_e, dx_l, dx_r, dy_t, dy_b, cmask);
+        break;
+      default:
         break;
     }
@@ -280,4 +284,6 @@
         mlib_convMxNext_d64(dst_e, src_e, kernel, m, n, dx_l, dx_r, dy_t, dy_b, cmask);
         break;
+      default:
+        break;
     }
   }
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	(revision 333)
@@ -1870,6 +1870,6 @@
 mlib_status CONV_FUNC_MxN
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   FTYPE    buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   FTYPE    **buffs = buffs_arr, *buffd;
@@ -2333,6 +2333,6 @@
 mlib_status CONV_FUNC_MxN_I
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   mlib_s32 *pbuff = buff;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	(revision 333)
@@ -149,6 +149,6 @@
 /***************************************************************/
 #define DEF_VARS(type)                                          \
-  type     *adr_src, *sl, *sp;                                  \
-  type     *adr_dst, *dl, *dp;                                  \
+  type     *adr_src, *sl, *sp = 0;                              \
+  type     *adr_dst, *dl, *dp = 0;                              \
   FTYPE    *pbuff = buff;                                       \
   mlib_s32 wid, hgt, sll, dll;                                  \
@@ -2061,6 +2061,6 @@
   mlib_s32 k0, k1, k2, k3, k4, k5, k6;
   mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 wid, hgt, sll, dll;
   mlib_s32 nchannel, chan1;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_32nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_32nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_32nw.c	(revision 333)
@@ -71,5 +71,5 @@
 #define DEF_VARS(type)                                          \
   GET_SRC_DST_PARAMETERS(type);                                 \
-  type     *sl, *sp, *sl1, *dl, *dp;                            \
+  type     *sl, *sp = 0, *sl1, *dl, *dp = 0;                    \
   mlib_d64 *pbuff = buff, *buff0, *buff1, *buff2, *buffT;       \
   mlib_s32 i, j, c;                                             \
@@ -79,5 +79,5 @@
 #define DEF_VARS_MxN(type)                                      \
   GET_SRC_DST_PARAMETERS(type);                                 \
-  type     *sl, *sp, *dl, *dp;                                  \
+  type     *sl, *sp = 0, *dl, *dp = 0;                          \
   mlib_d64 *pbuff = buff;                                       \
   mlib_s32 i, j, c
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	(revision 333)
@@ -1870,6 +1870,6 @@
 mlib_status CONV_FUNC_MxN
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   FTYPE    buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   FTYPE    **buffs = buffs_arr, *buffd;
@@ -2333,6 +2333,6 @@
 mlib_status CONV_FUNC_MxN_I
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   mlib_s32 *pbuff = buff;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	(revision 333)
@@ -150,6 +150,6 @@
 /***************************************************************/
 #define DEF_VARS(type)                                          \
-  type     *adr_src, *sl, *sp;                                  \
-  type     *adr_dst, *dl, *dp;                                  \
+  type     *adr_src, *sl, *sp = 0;                              \
+  type     *adr_dst, *dl, *dp = 0;                              \
   FTYPE    *pbuff = buff;                                       \
   mlib_s32 wid, hgt, sll, dll;                                  \
@@ -2062,6 +2062,6 @@
   mlib_s32 k0, k1, k2, k3, k4, k5, k6;
   mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 wid, hgt, sll, dll;
   mlib_s32 nchannel, chan1;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_D64nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_D64nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_D64nw.c	(revision 333)
@@ -72,6 +72,6 @@
   GET_SRC_DST_PARAMETERS(type);                                 \
   type     *sl;                                                 \
-  type     *dl, *dp;                                            \
-  mlib_s32 i, j, c
+  type     *dl, *dp = 0;                                        \
+  mlib_s32 i = 0, j, c
 
 /***************************************************************/
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_F32nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_F32nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_F32nw.c	(revision 333)
@@ -72,5 +72,5 @@
   GET_SRC_DST_PARAMETERS(type);                                 \
   type     *sl;                                                 \
-  type     *dl, *dp;                                            \
+  type     *dl, *dp = 0;                                        \
   mlib_s32 i, j, c
 
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	(revision 333)
@@ -1870,6 +1870,6 @@
 mlib_status CONV_FUNC_MxN
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   FTYPE    buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   FTYPE    **buffs = buffs_arr, *buffd;
@@ -2333,6 +2333,6 @@
 mlib_status CONV_FUNC_MxN_I
 {
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
   mlib_s32 *pbuff = buff;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	(revision 333)
@@ -149,6 +149,6 @@
 /***************************************************************/
 #define DEF_VARS(type)                                          \
-  type     *adr_src, *sl, *sp;                                  \
-  type     *adr_dst, *dl, *dp;                                  \
+  type     *adr_src, *sl, *sp = 0;                              \
+  type     *adr_dst, *dl, *dp = 0;                              \
   FTYPE    *pbuff = buff;                                       \
   mlib_s32 wid, hgt, sll, dll;                                  \
@@ -2061,6 +2061,6 @@
   mlib_s32 k0, k1, k2, k3, k4, k5, k6;
   mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
-  DTYPE    *adr_src, *sl, *sp;
-  DTYPE    *adr_dst, *dl, *dp;
+  DTYPE    *adr_src, *sl, *sp = 0;
+  DTYPE    *adr_dst, *dl, *dp = 0;
   mlib_s32 wid, hgt, sll, dll;
   mlib_s32 nchannel, chan1;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	(revision 333)
@@ -205,7 +205,7 @@
   mlib_u64 *sp;          /* 8-byte aligned start point in src */
   mlib_s32 j;            /* offset of address in dst */
-  mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFF;
+  mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFFLL;
   mlib_u64 dmask;
-  mlib_u64 lsrc, lsrc0, lsrc1, ldst;
+  mlib_u64 lsrc, lsrc0, lsrc1 = 0, ldst;
   mlib_s32 ls_offset, ld_offset, shift;
 
@@ -428,7 +428,7 @@
   mlib_u64 *sp;          /* 8-byte aligned start point in src */
   mlib_s32 j;            /* offset of address in dst */
-  mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFF;
+  mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFFLL;
   mlib_u64 dmask;
-  mlib_u64 lsrc, lsrc0, lsrc1, ldst;
+  mlib_u64 lsrc, lsrc0, lsrc1 = 0, ldst;
   mlib_s32 ls_offset, ld_offset, shift;
 
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c	(revision 333)
@@ -335,5 +335,5 @@
   mlib_s32       height;                /* for parent image */
   mlib_s32       stride;
-  mlib_s32       bitoffset;
+  mlib_s32       bitoffset = 0;
   void           *data;
 
@@ -424,5 +424,5 @@
   mlib_s32   stride   = src -> stride;
   mlib_u8    *data    = src -> data;
-  mlib_s32   bitoffset;
+  mlib_s32   bitoffset = 0;
 
   data += y * stride;
Index: /trunk/openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c	(revision 333)
@@ -290,5 +290,5 @@
            int alphaMask)
 {
-    int i, shift, numBits;
+    int i, shift = 0, numBits = 0;
 
     format->byteOrder = BYTE_ORDER_NATIVE;
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/AnyByteBinary.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/AnyByteBinary.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/AnyByteBinary.h	(revision 333)
@@ -151,5 +151,5 @@
 #define DeclareByteBinaryAlphaLoadData(TYPE, PREFIX) \
     jint *PREFIX ## Lut; \
-    jint PREFIX ## rgb;
+    jint PREFIX ## rgb = 0;
 
 #define InitByteBinaryAlphaLoadData(TYPE, PREFIX, pRasInfo) \
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/ByteIndexed.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/ByteIndexed.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/ByteIndexed.h	(revision 333)
@@ -200,5 +200,5 @@
 #define DeclareByteIndexedAlphaLoadData(PREFIX) \
     jint *PREFIX ## Lut; \
-    jint PREFIX ## rgb;
+    jint PREFIX ## rgb = 0;
 
 #define InitByteIndexedAlphaLoadData(PREFIX, pRasInfo) \
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgb.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgb.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgb.h	(revision 333)
@@ -119,5 +119,5 @@
 
 #define DeclareIntArgbAlphaLoadData(PREFIX) \
-    jint PREFIX;
+    jint PREFIX = 0;
 
 #define InitIntArgbAlphaLoadData(PREFIX, pRasInfo)
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbBm.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbBm.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbBm.h	(revision 333)
@@ -130,5 +130,5 @@
 
 #define DeclareIntArgbBmAlphaLoadData(PREFIX) \
-    jint PREFIX;
+    jint PREFIX = 0;
 
 #define InitIntArgbBmAlphaLoadData(PREFIX, pRasInfo)
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbPre.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbPre.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/IntArgbPre.h	(revision 333)
@@ -150,5 +150,5 @@
 
 #define DeclareIntArgbPreAlphaLoadData(PREFIX) \
-    jint PREFIX;
+    jint PREFIX = 0;
 
 #define InitIntArgbPreAlphaLoadData(PREFIX, pRasInfo)
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/TransformHelper.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/TransformHelper.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/TransformHelper.c	(revision 333)
@@ -281,7 +281,7 @@
     RegionData clipInfo;
     TransformInfo itxInfo;
-    jint maxlinepix;
-    TransformHelperFunc *pHelperFunc;
-    TransformInterpFunc *pInterpFunc;
+    jint maxlinepix = 0;
+    TransformHelperFunc *pHelperFunc = NULL;
+    TransformInterpFunc *pInterpFunc = NULL;
     jdouble xorig, yorig;
     jlong numedges;
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/Ushort4444Argb.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/Ushort4444Argb.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/Ushort4444Argb.h	(revision 333)
@@ -117,5 +117,5 @@
 
 #define DeclareUshort4444ArgbAlphaLoadData(PREFIX) \
-    jint PREFIX;
+    jint PREFIX = 0;
 
 #define InitUshort4444ArgbAlphaLoadData(PREFIX, pRasInfo)
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/UshortIndexed.h
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/UshortIndexed.h	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/loops/UshortIndexed.h	(revision 333)
@@ -168,5 +168,5 @@
 #define DeclareUshortIndexedAlphaLoadData(PREFIX) \
     jint *PREFIX ## Lut; \
-    jint PREFIX ## rgb;
+    jint PREFIX ## rgb = 0;
 
 #define InitUshortIndexedAlphaLoadData(PREFIX, pRasInfo) \
Index: /trunk/openjdk/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	(revision 333)
@@ -629,5 +629,5 @@
     GLfloat foff;
     GLint loc;
-    void *bands[4];
+    void *bands[4] = {0};
     int i;
     jint flags = 0;
Index: /trunk/openjdk/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
===================================================================
--- /trunk/openjdk/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c	(revision 332)
+++ /trunk/openjdk/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c	(revision 333)
@@ -218,5 +218,5 @@
     CK_OBJECT_HANDLE ckWrappingKeyHandle;
     CK_OBJECT_HANDLE ckKeyHandle;
-    jbyteArray jWrappedKey;
+    jbyteArray jWrappedKey = 0;
     CK_RV rv;
     CK_BYTE BUF[MAX_STACK_BUFFER_LEN];
Index: /trunk/openjdk/jdk/src/windows/bin/java_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/bin/java_md.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/bin/java_md.c	(revision 333)
@@ -403,5 +403,5 @@
         && type == REG_SZ
         && (size < (unsigned int)bufsize)) {
-        if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) {
+        if (RegQueryValueEx(key, name, 0, 0, (LPBYTE)buf, &size) == 0) {
             return JNI_TRUE;
         }
@@ -693,5 +693,6 @@
         JLI_MemFree(best);
         len = MAXNAMELEN;
-        if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len)
+        if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name,
+                            (LPDWORD)&len)
           != ERROR_SUCCESS) {
             if (ver_key != NULL)
@@ -975,5 +976,5 @@
         char    *p;
         char    *np;
-        char    *ocl;
+        const char *ocl;
         char    *ccl;
         char    *unquoted;
@@ -1191,5 +1192,5 @@
     if (thread_handle) {
       WaitForSingleObject(thread_handle, INFINITE);
-      GetExitCodeThread(thread_handle, &rslt);
+      GetExitCodeThread(thread_handle, (LPDWORD)&rslt);
       CloseHandle(thread_handle);
     } else {
Index: /trunk/openjdk/jdk/src/windows/instrument/FileSystemSupport_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/instrument/FileSystemSupport_md.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/instrument/FileSystemSupport_md.c	(revision 333)
@@ -27,4 +27,8 @@
 #include <string.h>
 #include <malloc.h>
+
+#ifdef __EMX__
+#include <strings.h> // strcasecmp
+#endif
 
 #include "FileSystemSupport_md.h"
Index: /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	(revision 333)
@@ -795,5 +795,5 @@
     DSCBUFFERDESC dscbdesc;
 #endif
-    HRESULT res;
+    HRESULT res = 0;
     WAVEFORMATEXTENSIBLE format;
     void* buffer;
@@ -1076,5 +1076,5 @@
                     DWORD* playCursor, DWORD* writeCursor,
                     int* bufferSize, BOOL fromPlayCursor) {
-    int available;
+    int available = 0;
     int newReadPos;
 
Index: /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_Util.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_Util.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_Util.c	(revision 333)
@@ -94,5 +94,5 @@
     SysExQueue* sysex;
     int i;
-    UBYTE* dataPtr;
+    char* dataPtr;
     int structSize = sizeof(SysExQueue) + ((count - 1) * sizeof(MIDIHDR));
 
@@ -116,5 +116,5 @@
 
     // set up headers
-    dataPtr = preAllocatedMem;
+    dataPtr = (char*)preAllocatedMem;
     for (i=0; i<count; i++) {
         sysex->header[i].lpData = dataPtr;
Index: /trunk/openjdk/jdk/src/windows/native/java/net/NetworkInterface.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/NetworkInterface.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/NetworkInterface.c	(revision 333)
@@ -332,5 +332,5 @@
          */
         strcpy(curr->name, dev_name);
-        strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
+        strncpy(curr->displayName, (char*)ifrowP->bDescr, ifrowP->dwDescrLen);
         curr->displayName[ifrowP->dwDescrLen] = '\0';
         curr->dwIndex = ifrowP->dwIndex;
Index: /trunk/openjdk/jdk/src/windows/native/java/net/SocketOutputStream.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/SocketOutputStream.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/SocketOutputStream.c	(revision 333)
@@ -31,8 +31,4 @@
 #include <malloc.h>
 #include <sys/types.h>
-
-#ifdef __EMX__
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
 
 #include "java_net_SocketOutputStream.h"
Index: /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	(revision 333)
@@ -430,5 +430,5 @@
     jobject fd1Obj = (*env)->GetObjectField(env, this, pdsi_fd1ID);
 
-    int fd, fd1, family;
+    int fd, fd1 = -1, family;
     int ipv6_supported = ipv6_available();
 
@@ -935,5 +935,5 @@
     jint packetBufferOffset, packetBufferLen;
 
-    int fd, fd1, fduse, nsockets=0, errorCode;
+    int fd = -1, fd1 = -1, fduse, nsockets=0, errorCode;
     int port;
     jbyteArray data;
@@ -1210,5 +1210,5 @@
      * must be called prior to receive() so that fduse can be set.
      */
-    int fd, fd1, fduse, errorCode;
+    int fd = -1, fd1 = -1, fduse, errorCode;
     jbyteArray data;
 
Index: /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	(revision 333)
@@ -196,5 +196,5 @@
     /* family and localport are int fields of iaObj */
     int family;
-    jint fd, fd1=-1;
+    jint fd = -1, fd1 = -1;
     jint len;
     int  ipv6_supported = ipv6_available();
@@ -269,5 +269,5 @@
         }
     } else {
-        int optval;
+        u_long optval;
         int optlen = sizeof(optval);
 
@@ -405,5 +405,5 @@
     jobject fdObj, fd1Obj;
     /* fd is an int field on fdObj */
-    int fd, fd1, len;
+    int fd = -1, fd1 = -1, len;
     int ipv6_supported = ipv6_available();
 
@@ -524,5 +524,5 @@
     jobject address;
     /* fdObj's int fd field */
-    int fd, fd1;
+    int fd = -1, fd1;
     SOCKETADDRESS addr; int addrlen;
 
@@ -790,5 +790,5 @@
 Java_java_net_TwoStacksPlainSocketImpl_socketAvailable(JNIEnv *env, jobject this) {
 
-    jint available = -1;
+    u_long available = -1;
     jint res;
     jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
@@ -1023,5 +1023,5 @@
     int level, optname, optlen;
     union {
-        int i;
+        u_long i;
         struct linger ling;
     } optval;
Index: /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.c	(revision 333)
@@ -590,6 +590,6 @@
     if (family == AF_INET) {
         struct sockaddr_in *him = (struct sockaddr_in *)addr;
-        printf ("AF_INET: port %d: %x\n", ntohs(him->sin_port),
-                                          ntohl(him->sin_addr.s_addr));
+        printf ("AF_INET: port %d: %lx\n", ntohs(him->sin_port),
+                                            ntohl(him->sin_addr.s_addr));
     } else {
         int i;
@@ -597,5 +597,5 @@
         printf ("AF_INET6 ");
         printf ("port %d ", ntohs (a->sin6_port));
-        printf ("flow %d ", a->sin6_flowinfo);
+        printf ("flow %ld ", a->sin6_flowinfo);
         printf ("addr ");
         for (i=0; i<7; i++) {
@@ -603,5 +603,5 @@
         }
         printf ("%04x", ntohs(in->s6_words[7]));
-        printf (" scope %d\n", a->sin6_scope_id);
+        printf (" scope %ld\n", a->sin6_scope_id);
     }
 }
Index: /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.h	(revision 333)
@@ -342,4 +342,5 @@
 extern jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
 extern int NET_Socket (int domain, int type, int protocol);
+extern void NET_ThrowSocketException(JNIEnv *env, char* msg);
 extern void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
                                          const char *defaultDetail);
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/j2d_md.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/j2d_md.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/j2d_md.h	(revision 333)
@@ -27,6 +27,8 @@
 #define j2d_md_h_Included
 
+#ifdef _MSC_VER
 #ifndef DEBUG
 #pragma optimize("t", on)
+#endif
 #endif
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.c	(revision 333)
@@ -202,5 +202,5 @@
     int pixfmts[32];
     int chosenPixFmt = 0;
-    int nfmts, i;
+    UINT nfmts, i;
 
     // this is the initial minimum value for the combined depth+stencil size
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp	(revision 333)
@@ -321,5 +321,5 @@
     }
 
-    long sx, sy, ex, ey;
+    jint sx, sy, ex, ey;
     if (angleExtent >= 360 || angleExtent <= -360) {
         sx = ex = x + w;
@@ -594,6 +594,6 @@
         return;
     }
-    long sx, sy, ex, ey;
-    int angleEnd;
+    jint sx, sy, ex, ey;
+    jint angleEnd;
     if (angleExtent < 0) {
         angleEnd = angleStart;
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32OffScreenSurfaceData.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32OffScreenSurfaceData.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32OffScreenSurfaceData.cpp	(revision 333)
@@ -467,5 +467,5 @@
     if (wsdo->lockFlags & SD_LOCK_LUT) {
         pRasInfo->lutBase =
-            (long *) wsdo->device->GetSystemPaletteEntries();
+            (jint *) wsdo->device->GetSystemPaletteEntries();
         pRasInfo->lutSize = 256;
     } else {
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32SurfaceData.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32SurfaceData.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32SurfaceData.cpp	(revision 333)
@@ -940,5 +940,5 @@
     if (wsdo->lockFlags & SD_LOCK_LUT) {
         pRasInfo->lutBase =
-            (long *) wsdo->device->GetSystemPaletteEntries();
+            (jint *) wsdo->device->GetSystemPaletteEntries();
         pRasInfo->lutSize = 256;
     } else {
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp	(revision 333)
@@ -439,5 +439,5 @@
 
     DXSurface *dxSurface;
-    DWORD dwFlags, ddsCaps;
+    DWORD dwFlags, ddsCaps = 0;
 
     // Create the offscreen surface
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp	(revision 333)
@@ -1800,7 +1800,7 @@
         break;
     default:
-        sprintf(buffer, "DirectX Error Unknown 0x%x", errNum);
-        break;
-    }
-
-}
+        sprintf(buffer, "DirectX Error Unknown 0x%lx", errNum);
+        break;
+    }
+
+}
Index: /trunk/openjdk/jdk/src/windows/native/sun/management/FileSystemImpl.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/management/FileSystemImpl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/management/FileSystemImpl.c	(revision 333)
@@ -209,5 +209,5 @@
 static ACL* getFileDACL(JNIEnv* env, SECURITY_DESCRIPTOR* sd) {
     ACL *acl;
-    int defaulted, present;
+    BOOL defaulted, present;
 
     if (!(*GetSecurityDescriptorDacl_func)(sd, &present, &acl, &defaulted)) {
Index: /trunk/openjdk/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c	(revision 333)
@@ -31,4 +31,8 @@
 #include <time.h>
 #include <assert.h>
+
+#ifdef __WIN32OS2__
+#include <string.h>
+#endif
 
 #include "jni_util.h"
Index: /trunk/openjdk/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c	(revision 333)
@@ -25,4 +25,9 @@
 
 #include <windows.h>
+
+#ifdef __WIN32OS2__
+#include <string.h>
+#endif
+
 #include "jni.h"
 #include "jni_util.h"
Index: /trunk/openjdk/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c	(revision 333)
@@ -66,5 +66,5 @@
 {
     OSVERSIONINFO   version;
-    UCHAR libName[MAX_PATH];
+    char libName[MAX_PATH];
 
     ntlm_ctxHandleID = (*env)->GetFieldID(env, clazz, "ctxHandle", "J");
@@ -196,5 +196,5 @@
     CtxtHandle      *newContext;
     TimeStamp            ltime;
-    jbyteArray       result;
+    jbyteArray       result = 0;
 
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c	(revision 333)
@@ -195,5 +195,5 @@
 {
     char bytes[WAKEUP_SOCKET_BUF_SIZE];
-    long bytesToRead;
+    u_long bytesToRead;
 
     /* Drain socket */
Index: /trunk/openjdk/jdk/src/windows/native/sun/security/mscapi/security.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/security/mscapi/security.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/security/mscapi/security.cpp	(revision 333)
@@ -641,5 +641,5 @@
     HCRYPTKEY hKeyPair;
     DWORD dwFlags = (keySize << 16) | CRYPT_EXPORTABLE;
-    jobject keypair;
+    jobject keypair = NULL;
     const char* pszKeyContainerName = NULL; // UUID
 
@@ -738,5 +738,5 @@
         } else {
             char buffer[64];
-            if (sprintf(buffer, "%lu", dwAlgId)) {
+            if (sprintf(buffer, "%u", dwAlgId)) {
                 return env->NewStringUTF(buffer);
             }
@@ -1401,5 +1401,5 @@
     jbyteArray blob = NULL;
     DWORD dwBlobLen;
-    BYTE* pbKeyBlob;
+    BYTE* pbKeyBlob = NULL;
 
     __try
Index: /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h	(revision 333)
@@ -26,9 +26,15 @@
 #include <windows.h>
 
+#ifdef __EMX__
+#define DECLSPEC_DLLIMPORT
+#else
+#define DECLSPEC_DLLIMPORT __declspec(dllimport)
+#endif
+
 // in nss.h:
 // extern PRBool NSS_VersionCheck(const char *importedVersion);
 // extern SECStatus NSS_Init(const char *configdir);
-typedef int __declspec(dllimport) (*FPTR_VersionCheck)(const char *importedVersion);
-typedef int __declspec(dllimport) (*FPTR_Init)(const char *configdir);
+typedef int DECLSPEC_DLLIMPORT (*FPTR_VersionCheck)(const char *importedVersion);
+typedef int DECLSPEC_DLLIMPORT (*FPTR_Init)(const char *configdir);
 
 // in secmod.h
@@ -38,5 +44,5 @@
 //extern SECMODModuleList *SECMOD_GetDBModuleList(void);
 
-typedef void __declspec(dllimport) *(*FPTR_LoadModule)(char *moduleSpec, void *parent, int recurse);
-typedef char __declspec(dllimport) **(*FPTR_GetModuleSpecList)(void *module);
-typedef void __declspec(dllimport) *(*FPTR_GetDBModuleList)(void);
+typedef void DECLSPEC_DLLIMPORT *(*FPTR_LoadModule)(char *moduleSpec, void *parent, int recurse);
+typedef char DECLSPEC_DLLIMPORT **(*FPTR_GetModuleSpecList)(void *module);
+typedef void DECLSPEC_DLLIMPORT *(*FPTR_GetDBModuleList)(void);
Index: /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h	(revision 333)
@@ -59,4 +59,10 @@
 #include <windows.h>
 
+#ifdef __EMX__
+#define DECLSPEC_DLLIMPORT
+#else
+#define DECLSPEC_DLLIMPORT __declspec(dllimport)
+#endif
+
 /* statement according to PKCS11 docu */
 #pragma pack(push, cryptoki, 1)
@@ -64,7 +70,7 @@
 /* definitions according to PKCS#11 docu for Win32 environment */
 #define CK_PTR *
-#define CK_DEFINE_FUNCTION(returnType, name) returnType __declspec(dllexport) name
-#define CK_DECLARE_FUNCTION(returnType, name) returnType __declspec(dllimport) name
-#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType __declspec(dllimport) (* name)
+#define CK_DEFINE_FUNCTION(returnType, name) returnType DECLSPEC_DLLIMPORT name
+#define CK_DECLARE_FUNCTION(returnType, name) returnType DECLSPEC_DLLIMPORT name
+#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType DECLSPEC_DLLIMPORT (* name)
 #define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
 #ifndef NULL_PTR
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/GDIHashtable.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/GDIHashtable.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/GDIHashtable.cpp	(revision 333)
@@ -135,8 +135,8 @@
                                                                UINT nSecondThreshold,
                                                                UINT nDestroyPeriod) :
+  m_nCounter(0),
   m_nFirstThreshold(nFirstThreshold),
   m_nSecondThreshold(nSecondThreshold),
   m_nDestroyPeriod(nDestroyPeriod),
-  m_nCounter(0),
   m_bBatchingEnabled(TRUE) {
     load_rsrc32_procs();
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	(revision 333)
@@ -231,5 +231,5 @@
     if (FAILED(hr)) {
         char c[64];
-        sprintf(c, "Could not initialize COM: HRESULT=0x%08X", hr);
+        sprintf(c, "Could not initialize COM: HRESULT=0x%08lX", hr);
         JNU_ThrowInternalError(env, c);
     }
@@ -625,5 +625,5 @@
     STRRET strret;
     OLECHAR olePath[MAX_PATH]; // wide-char version of path name
-    LPWSTR wstr;
+    LPWSTR wstr = NULL;
 
     IShellFolder* pParent = (IShellFolder*)parentIShellFolder;
@@ -959,5 +959,5 @@
             // Extract the color bitmap
             int nBits = iconSize * iconSize;
-            long colorBits[1024];
+            jint colorBits[1024];
             GetDIBits(dc, iconInfo.hbmColor, 0, iconSize, colorBits, &bmi, DIB_RGB_COLORS);
             // XP supports alpha in some icons, and depending on device.
@@ -1011,5 +1011,5 @@
     HBITMAP hBitmap = NULL;
     BITMAP bm;
-    HINSTANCE libComCtl32;
+    HINSTANCE libComCtl32 = NULL;
     HINSTANCE libShell32;
 
@@ -1052,5 +1052,5 @@
     int numPixels = bm.bmWidth * bm.bmHeight;
     //long colorBits[192 * 16];
-    long *colorBits = (long*)safe_Malloc(numPixels * sizeof(long));
+    jint *colorBits = (jint*)safe_Malloc(numPixels * sizeof(jint));
     if (GetDIBits(dc, hBitmap, 0, bm.bmHeight, colorBits, &bmi, DIB_RGB_COLORS) == 0) {
         return NULL;
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 333)
@@ -46,14 +46,17 @@
 HMODULE UnicowsLoader::hmodUnicows = NULL;
 
+extern "C"
+{
 // MSLU loader entry point, which is called when the module
 // is initialized.
-extern "C" HMODULE (__stdcall *_PfnLoadUnicows)(void) =
+HMODULE (__stdcall *_PfnLoadUnicows)(void) =
         &UnicowsLoader::LoadUnicows;
 
 // Overriede APIs that are not supported by MSLU.
-extern "C" FARPROC Unicows_GetPrinterW =
+FARPROC Unicows_GetPrinterW =
         (FARPROC)&UnicowsLoader::GetPrinterWImpl;
-extern "C" FARPROC Unicows_EnumPrintersW =
+FARPROC Unicows_EnumPrintersW =
         (FARPROC)&UnicowsLoader::EnumPrintersWImpl;
+}
 
 HMODULE __stdcall UnicowsLoader::LoadUnicows(void)
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	(revision 333)
@@ -5250,5 +5250,5 @@
     jint wheelAmt = 0;
     jint id = (env)->GetIntField(mouseEvent, AwtAWTEvent::idID);
-    UINT message;
+    UINT message = 0;
     switch (id) {
       case java_awt_event_MouseEvent_MOUSE_PRESSED: {
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp	(revision 333)
@@ -367,5 +367,5 @@
 
     BOOL fontSmoothing = FALSE, settingsChanged;
-    UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder;
+    UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder=0;
 
     if (firstTime) {
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp	(revision 333)
@@ -1178,5 +1178,5 @@
     m_parent = parent;
 
-    m_buffer = (signed char *)safe_Calloc(sizeof(signed char), m_blen = blen);
+    m_buffer = (jbyte *)safe_Calloc(sizeof(jbyte), m_blen = blen);
 
     env->GetByteArrayRegion(buffer, 0, blen, m_buffer);
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.h	(revision 333)
@@ -207,5 +207,5 @@
                 AwtDragSource*   m_parent;
 
-                signed   char*   m_buffer;
+                jbyte*           m_buffer;
                 unsigned int     m_off;
                 unsigned int     m_blen;
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Font.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Font.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Font.cpp	(revision 333)
@@ -891,5 +891,5 @@
 
             for (; len; len--) {
-                result += widths[*pStr++];
+                result += widths[(unsigned char)*pStr++];
             }
         } catch (...) {
@@ -1199,5 +1199,5 @@
 
 LONG AwtFontCache::IncRefCount(Item* item){
-    LONG    newVal;
+    LONG    newVal = 0;
 
     if(NULL != item){
@@ -1208,5 +1208,5 @@
 
 LONG AwtFontCache::DecRefCount(Item* item){
-    LONG    newVal;
+    LONG    newVal = 0;
 
     if(NULL != item){
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp	(revision 333)
@@ -147,5 +147,5 @@
     PDATA pData;
     HWND hwndParent = NULL;
-    AwtFrame* frame;
+    AwtFrame* frame = NULL;
     jclass cls = NULL;
     jclass inputMethodWindowCls = NULL;
@@ -872,5 +872,5 @@
 MsgRouting AwtFrame::WmActivate(UINT nState, BOOL fMinimized, HWND opposite)
 {
-    jint type;
+    jint type = 0;
     BOOL doActivateFrame = TRUE;
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Label.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Label.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Label.cpp	(revision 333)
@@ -125,5 +125,5 @@
         if (env->EnsureLocalCapacity(3) < 0)
             return;
-        long x,y;
+        long x = 0, y;
         SIZE size;
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Menu.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Menu.h	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Menu.h	(revision 333)
@@ -80,5 +80,5 @@
     /*for multifont menu */
     BOOL IsTopMenu();
-    virtual AwtMenuItem* GetItem(jobject target, long index);
+    virtual AwtMenuItem* GetItem(jobject target, jint index);
 
     virtual int CountItem(jobject target);
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp	(revision 333)
@@ -915,5 +915,5 @@
     HGLOBAL hDevNames = AwtPrintControl::getPrintHDName(env, self);
     if (hDevNames != NULL) {
-        DWORD dmFields;
+        DWORD dmFields = 0;
         DEVNAMES *devnames = (DEVNAMES *)::GlobalLock(hDevNames);
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.cpp	(revision 333)
@@ -114,5 +114,5 @@
         {
             /* Adjust style for scrollbar visibility and word wrap  */
-          DWORD scroll_style;
+          DWORD scroll_style = 0;
           jint scrollbarVisibility =
               env->GetIntField(target, AwtTextArea::scrollbarVisibilityID);
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp	(revision 333)
@@ -775,13 +775,13 @@
     JNI_CHECK_PEER_RETURN_NULL(self);
     AwtComponent* c = (AwtComponent*)pData;
-/*
-    int line = 0;
-    int lineIndex = 0;
-    while (lineIndex < i) {
-        lineIndex = c->SendMessage(EM_LINEINDEX, 1 + line++);
-    }
-    line--;     // line is now the line which contains our character at position 'i'
-    int offsetIndex = i - lineIndex;    // offsetIndex is now distance in on the line
-* /
+
+//    int line = 0;
+//    int lineIndex = 0;
+//    while (lineIndex < i) {
+//        lineIndex = c->SendMessage(EM_LINEINDEX, 1 + line++);
+//    }
+//    line--;     // line is now the line which contains our character at position 'i'
+//    int offsetIndex = i - lineIndex;    // offsetIndex is now distance in on the line
+
     POINT p;
 
@@ -793,15 +793,14 @@
     jint charHeight;
 
-/*
-    HFONT font = c->SendMessage(WM_GETFONT);
-    if (GetCharWidth32(c->hdc, i, i, &charWidth) != 0) {        // [[[FIXME]]] need to get hDC!
-
-        JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-        jobject rect = JNU_NewObjectByName(env, "java/awt/Rectangle", "(IIII)V",
-                                           (jint) p.x, (jint) p.y, charWidth, charHeight);
-
-        return rect;
-    }
-* /
+//    HFONT font = c->SendMessage(WM_GETFONT);
+//    if (GetCharWidth32(c->hdc, i, i, &charWidth) != 0) {        // [[[FIXME]]] need to get hDC!
+//
+//        JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+//        jobject rect = JNU_NewObjectByName(env, "java/awt/Rectangle", "(IIII)V",
+//                                           (jint) p.x, (jint) p.y, charWidth, charHeight);
+//
+//        return rect;
+//    }
+
     return (jobject) 0;
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	(revision 332)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	(revision 333)
@@ -412,5 +412,5 @@
 #endif
 
-        //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+        ///////////////////////////////////////////////////////////////////////////
         // Bugs 4032109, 4047966, and 4071991 to fix AWT
         //      crash in 16 color display mode.  16 color mode is supported.  Less
@@ -583,5 +583,5 @@
 
     jobject gcomponent = env->NewGlobalRef((jobject)component);
-    jobject gparent;
+    jobject gparent = 0;
     if (isParentALocalReference) gparent = env->NewGlobalRef((jobject)parent);
     ComponentCreatePacket ccp = { gcomponent,
