Index: /trunk/openjdk/jdk/make/common/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 329)
+++ /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 330)
@@ -125,5 +125,5 @@
 # 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
+GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-missing-field-initializers
 GCC_WARNINGS_CXX += -Wno-write-strings
 
Index: /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c	(revision 330)
@@ -178,5 +178,5 @@
 {
     jboolean rv = JNI_FALSE;
-    int mode;
+    int mode = 0;
     switch (a) {
     case java_io_FileSystem_ACCESS_READ:
@@ -346,5 +346,5 @@
                                   jobject file)
 {
-    DIR *dir;
+    DIR *dir = NULL;
     struct dirent *ptr;
     int len, maxlen;
Index: /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	(revision 330)
@@ -240,5 +240,5 @@
 {
     jboolean rv = JNI_FALSE;
-    int mode;
+    int mode = 0;
     WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
     if (pathbuf == NULL)
Index: /trunk/openjdk/jdk/src/windows/native/java/io/dirent_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/dirent_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/dirent_md.c	(revision 330)
@@ -32,4 +32,8 @@
 #include <errno.h>
 #include <assert.h>
+
+#ifdef __WIN32OS2__
+#include <string.h>
+#endif
 
 #include "dirent_md.h"
Index: /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c	(revision 330)
@@ -46,5 +46,5 @@
 #endif
 
-extern jboolean onNT = JNI_FALSE;
+jboolean onNT = JNI_FALSE;
 
 static int MAX_INPUT_EVENTS = 2000;
@@ -339,5 +339,5 @@
     }
 
-    if (! PeekNamedPipe(han, NULL, 0, NULL, pbytes, NULL)) {
+    if (! PeekNamedPipe(han, NULL, 0, NULL, (LPDWORD)pbytes, NULL)) {
         /* PeekNamedPipe fails when at EOF.  In that case we
          * simply make *pbytes = 0 which is consistent with the
@@ -535,5 +535,5 @@
     HANDLE h = (HANDLE)fd;
 
-    if (fd == INVALID_HANDLE_VALUE) {
+    if (h == INVALID_HANDLE_VALUE) {
         return 0;
     }
Index: /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessEnvironment_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessEnvironment_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessEnvironment_md.c	(revision 330)
@@ -52,5 +52,5 @@
     if ((bytes = (*env)->NewByteArray(env, i)) == NULL) return NULL;
     (*env)->SetByteArrayRegion(env, bytes, 0, i, blockA);
-    FreeEnvironmentStringsA(blockA);
+    FreeEnvironmentStringsA((LPSTR)blockA);
     return (*env)->NewObject(env, JNU_ClassString(env),
                              String_init_ID, bytes);
@@ -74,5 +74,5 @@
 
     envblock = (*env)->NewString(env, blockW, i);
-    FreeEnvironmentStringsW(blockW);
+    FreeEnvironmentStringsW((LPWSTR)blockW);
     return envblock;
 }
Index: /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessImpl_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessImpl_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/lang/ProcessImpl_md.c	(revision 330)
@@ -34,4 +34,8 @@
 #include <io.h>
 
+#ifdef __WIN32OS2__
+#include <string.h>
+#endif
+
 #define PIPE_SIZE 4096
 
Index: /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c	(revision 330)
@@ -41,5 +41,5 @@
 #include "java_props.h"
 
-#ifdef __EMX__
+#ifdef __GNUC__
 #define boolean int
 #endif
Index: /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c	(revision 330)
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include "TimeZone_md.h"
-
-#ifdef __EMX__
+#include "jvm.h"
+
+#ifdef __GNUC__
 #include <wchar.h>
 #include <string.h>
@@ -110,5 +111,5 @@
     valSize = sizeof(val);
     ret = RegQueryValueExA(hKey, (char *) keyNames[keyIndex + 1], NULL,
-                           typePtr, val, &valSize);
+                           typePtr, (LPBYTE) val, &valSize);
     if (ret != ERROR_SUCCESS) {
         return ret;
@@ -142,5 +143,5 @@
     }
     if (gmtOffset != 0) {
-        sprintf(buffer, "GMT%c%02d:%02d",
+        sprintf(buffer, "GMT%c%02ld:%02ld",
                 ((sign >= 0) ? '+' : '-'),
                 gmtOffset / 60,
@@ -293,5 +294,5 @@
         size = sizeof(szValue);
         ret = getValueInRegistry(hSubKey, STD_NAME, &valueType,
-                                 szValue, &size);
+                                 (LPBYTE) szValue, &size);
         if (ret != ERROR_SUCCESS) {
             /*
@@ -352,5 +353,5 @@
      */
     valueSize = MAX_MAPID_LENGTH;
-    ret = RegQueryValueExA(hSubKey, "MapID", NULL, &valueType, winMapID, &valueSize);
+    ret = RegQueryValueExA(hSubKey, "MapID", NULL, &valueType, (LPBYTE)winMapID, &valueSize);
     (void) RegCloseKey(hSubKey);
     (void) RegCloseKey(hKey);
Index: /trunk/openjdk/jdk/src/windows/native/java/util/WindowsPreferences.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/util/WindowsPreferences.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/java/util/WindowsPreferences.c	(revision 330)
@@ -105,5 +105,5 @@
         buffer = (char*)malloc(valueSize);
 
-        if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, buffer,
+        if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, (LPBYTE)buffer,
             &valueSize) != ERROR_SUCCESS) {
             free(buffer);
@@ -138,5 +138,5 @@
         valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
         error_code = RegSetValueEx((HKEY)hKey, valueNameStr, 0,
-                                                        REG_SZ, dataStr, size);
+                                                        REG_SZ, (LPBYTE)dataStr, size);
         (*env)->ReleaseByteArrayElements(env, data, dataStr, 0);
         (*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
@@ -165,6 +165,6 @@
         int errorCode = -1;
         errorCode = RegQueryInfoKey((HKEY)hKey, NULL, NULL, NULL,
-                 &subKeysNumber, &maxSubKeyLength, NULL,
-                 &valuesNumber, &maxValueNameLength,
+                 (LPDWORD)&subKeysNumber, (LPDWORD)&maxSubKeyLength, NULL,
+                 (LPDWORD)&valuesNumber, (LPDWORD)&maxValueNameLength,
                  NULL, NULL, NULL);
         tmp[0]= subKeysNumber;
@@ -184,5 +184,5 @@
         char* buffer = NULL;
         buffer = (char*)malloc(maxKeyLength);
-        if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, &size, NULL, NULL,
+        if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, (LPDWORD)&size, NULL, NULL,
                                                  NULL, NULL) != ERROR_SUCCESS){
         free(buffer);
@@ -203,5 +203,5 @@
           buffer = (char*)malloc(maxValueNameLength);
           error_code = RegEnumValue((HKEY) hKey, valueIndex, buffer,
-                                             &size, NULL, NULL, NULL, NULL);
+                                             (LPDWORD)&size, NULL, NULL, NULL, NULL);
           if (error_code!= ERROR_SUCCESS){
             free(buffer);
Index: /trunk/openjdk/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c	(revision 329)
+++ /trunk/openjdk/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c	(revision 330)
@@ -85,5 +85,5 @@
     numBytes = (*env)->GetArrayLength(env, randArray);
     randBytes = (*env)->GetByteArrayElements(env, randArray, NULL);
-    if (genRandom(hCryptProv, numBytes, randBytes)) {
+    if (genRandom(hCryptProv, numBytes, (BYTE*)randBytes)) {
         result = JNI_TRUE;
     }
