Changeset 330


Ignore:
Timestamp:
Feb 21, 2012, 9:24:37 PM (13 years ago)
Author:
dmik
Message:

jdk: Fix a bunch of warnings.

GCC is more strict than MSVC.

Location:
trunk/openjdk/jdk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/make/common/Defs-os2.gmk

    r310 r330  
    125125# We compile a lot of MSVC code which seems to silently tolerate this
    126126GCC_WARNINGS += -Wno-sign-compare
    127 GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
     127GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-missing-field-initializers
    128128GCC_WARNINGS_CXX += -Wno-write-strings
    129129
  • trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c

    r278 r330  
    178178{
    179179    jboolean rv = JNI_FALSE;
    180     int mode;
     180    int mode = 0;
    181181    switch (a) {
    182182    case java_io_FileSystem_ACCESS_READ:
     
    346346                                  jobject file)
    347347{
    348     DIR *dir;
     348    DIR *dir = NULL;
    349349    struct dirent *ptr;
    350350    int len, maxlen;
  • trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c

    r278 r330  
    240240{
    241241    jboolean rv = JNI_FALSE;
    242     int mode;
     242    int mode = 0;
    243243    WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
    244244    if (pathbuf == NULL)
  • trunk/openjdk/jdk/src/windows/native/java/io/dirent_md.c

    r278 r330  
    3232#include <errno.h>
    3333#include <assert.h>
     34
     35#ifdef __WIN32OS2__
     36#include <string.h>
     37#endif
    3438
    3539#include "dirent_md.h"
  • trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c

    r278 r330  
    4646#endif
    4747
    48 extern jboolean onNT = JNI_FALSE;
     48jboolean onNT = JNI_FALSE;
    4949
    5050static int MAX_INPUT_EVENTS = 2000;
     
    339339    }
    340340
    341     if (! PeekNamedPipe(han, NULL, 0, NULL, pbytes, NULL)) {
     341    if (! PeekNamedPipe(han, NULL, 0, NULL, (LPDWORD)pbytes, NULL)) {
    342342        /* PeekNamedPipe fails when at EOF.  In that case we
    343343         * simply make *pbytes = 0 which is consistent with the
     
    535535    HANDLE h = (HANDLE)fd;
    536536
    537     if (fd == INVALID_HANDLE_VALUE) {
     537    if (h == INVALID_HANDLE_VALUE) {
    538538        return 0;
    539539    }
  • trunk/openjdk/jdk/src/windows/native/java/lang/ProcessEnvironment_md.c

    r278 r330  
    5252    if ((bytes = (*env)->NewByteArray(env, i)) == NULL) return NULL;
    5353    (*env)->SetByteArrayRegion(env, bytes, 0, i, blockA);
    54     FreeEnvironmentStringsA(blockA);
     54    FreeEnvironmentStringsA((LPSTR)blockA);
    5555    return (*env)->NewObject(env, JNU_ClassString(env),
    5656                             String_init_ID, bytes);
     
    7474
    7575    envblock = (*env)->NewString(env, blockW, i);
    76     FreeEnvironmentStringsW(blockW);
     76    FreeEnvironmentStringsW((LPWSTR)blockW);
    7777    return envblock;
    7878}
  • trunk/openjdk/jdk/src/windows/native/java/lang/ProcessImpl_md.c

    r278 r330  
    3434#include <io.h>
    3535
     36#ifdef __WIN32OS2__
     37#include <string.h>
     38#endif
     39
    3640#define PIPE_SIZE 4096
    3741
  • trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c

    r278 r330  
    4141#include "java_props.h"
    4242
    43 #ifdef __EMX__
     43#ifdef __GNUC__
    4444#define boolean int
    4545#endif
  • trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c

    r278 r330  
    2828#include <stdlib.h>
    2929#include "TimeZone_md.h"
    30 
    31 #ifdef __EMX__
     30#include "jvm.h"
     31
     32#ifdef __GNUC__
    3233#include <wchar.h>
    3334#include <string.h>
     
    110111    valSize = sizeof(val);
    111112    ret = RegQueryValueExA(hKey, (char *) keyNames[keyIndex + 1], NULL,
    112                            typePtr, val, &valSize);
     113                           typePtr, (LPBYTE) val, &valSize);
    113114    if (ret != ERROR_SUCCESS) {
    114115        return ret;
     
    142143    }
    143144    if (gmtOffset != 0) {
    144         sprintf(buffer, "GMT%c%02d:%02d",
     145        sprintf(buffer, "GMT%c%02ld:%02ld",
    145146                ((sign >= 0) ? '+' : '-'),
    146147                gmtOffset / 60,
     
    293294        size = sizeof(szValue);
    294295        ret = getValueInRegistry(hSubKey, STD_NAME, &valueType,
    295                                  szValue, &size);
     296                                 (LPBYTE) szValue, &size);
    296297        if (ret != ERROR_SUCCESS) {
    297298            /*
     
    352353     */
    353354    valueSize = MAX_MAPID_LENGTH;
    354     ret = RegQueryValueExA(hSubKey, "MapID", NULL, &valueType, winMapID, &valueSize);
     355    ret = RegQueryValueExA(hSubKey, "MapID", NULL, &valueType, (LPBYTE)winMapID, &valueSize);
    355356    (void) RegCloseKey(hSubKey);
    356357    (void) RegCloseKey(hKey);
  • trunk/openjdk/jdk/src/windows/native/java/util/WindowsPreferences.c

    r278 r330  
    105105        buffer = (char*)malloc(valueSize);
    106106
    107         if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, buffer,
     107        if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, (LPBYTE)buffer,
    108108            &valueSize) != ERROR_SUCCESS) {
    109109            free(buffer);
     
    138138        valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
    139139        error_code = RegSetValueEx((HKEY)hKey, valueNameStr, 0,
    140                                                         REG_SZ, dataStr, size);
     140                                                        REG_SZ, (LPBYTE)dataStr, size);
    141141        (*env)->ReleaseByteArrayElements(env, data, dataStr, 0);
    142142        (*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
     
    165165        int errorCode = -1;
    166166        errorCode = RegQueryInfoKey((HKEY)hKey, NULL, NULL, NULL,
    167                  &subKeysNumber, &maxSubKeyLength, NULL,
    168                  &valuesNumber, &maxValueNameLength,
     167                 (LPDWORD)&subKeysNumber, (LPDWORD)&maxSubKeyLength, NULL,
     168                 (LPDWORD)&valuesNumber, (LPDWORD)&maxValueNameLength,
    169169                 NULL, NULL, NULL);
    170170        tmp[0]= subKeysNumber;
     
    184184        char* buffer = NULL;
    185185        buffer = (char*)malloc(maxKeyLength);
    186         if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, &size, NULL, NULL,
     186        if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, (LPDWORD)&size, NULL, NULL,
    187187                                                 NULL, NULL) != ERROR_SUCCESS){
    188188        free(buffer);
     
    203203          buffer = (char*)malloc(maxValueNameLength);
    204204          error_code = RegEnumValue((HKEY) hKey, valueIndex, buffer,
    205                                              &size, NULL, NULL, NULL, NULL);
     205                                             (LPDWORD)&size, NULL, NULL, NULL, NULL);
    206206          if (error_code!= ERROR_SUCCESS){
    207207            free(buffer);
  • trunk/openjdk/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c

    r278 r330  
    8585    numBytes = (*env)->GetArrayLength(env, randArray);
    8686    randBytes = (*env)->GetByteArrayElements(env, randArray, NULL);
    87     if (genRandom(hCryptProv, numBytes, randBytes)) {
     87    if (genRandom(hCryptProv, numBytes, (BYTE*)randBytes)) {
    8888        result = JNI_TRUE;
    8989    }
Note: See TracChangeset for help on using the changeset viewer.