diff -BburN modules/awt/src/main/native/lcmm/shared/NativeCMM.c modules.new/awt/src/main/native/lcmm/shared/NativeCMM.c --- modules/awt/src/main/native/lcmm/shared/NativeCMM.c 2008-07-22 00:29:17.000000000 +0800 +++ modules.new/awt/src/main/native/lcmm/shared/NativeCMM.c 2008-07-22 18:28:40.000000000 +0800 @@ -58,7 +58,7 @@ cmsInitialized = TRUE; } - hProfile = cmmOpenProfile(byteData, dataSize); + hProfile = cmmOpenProfile((LPBYTE)byteData, dataSize); (*env)->ReleaseByteArrayElements (env, data, byteData, 0); @@ -116,7 +116,7 @@ unsigned profileSize = (unsigned) (*env)->GetArrayLength (env, data); jbyte *byteData = (*env)->GetByteArrayElements(env, data, 0); - cmmGetProfile(hProfile, byteData, profileSize); + cmmGetProfile(hProfile, (LPBYTE)byteData, profileSize); (*env)->ReleaseByteArrayElements (env, data, byteData, 0); } @@ -137,13 +137,13 @@ if(ts == HEADER_TAG_ID) { - if(!cmmGetProfileHeader(hProfile, byteData, dataSize)) { + if(!cmmGetProfileHeader(hProfile, (LPBYTE)byteData, dataSize)) { newCMMException(env, errMsg); // Throw java exception if error occured free(errMsg); errMsg = NULL; } } else { - if(!cmmGetProfileElement(hProfile, ts, byteData, &dataSize)) { + if(!cmmGetProfileElement(hProfile, ts, (LPBYTE)byteData, &dataSize)) { newCMMException(env, errMsg); // Throw java exception if error occured free(errMsg); errMsg = NULL; @@ -195,7 +195,7 @@ if(dataSize != sizeof(icHeader)) newCMMException(env, "Invalid size of the data"); // Throw java exception - if(!cmmSetProfileHeader(hProfile, byteData)) + if(!cmmSetProfileHeader(hProfile, (LPBYTE)byteData)) newCMMException(env, "Invalid header data"); // Throw java exception if error occured } else { diff -BburN modules/awt/src/main/native/linuxfont/unix/LinuxNativeFont.c modules.new/awt/src/main/native/linuxfont/unix/LinuxNativeFont.c --- modules/awt/src/main/native/linuxfont/unix/LinuxNativeFont.c 2008-07-22 20:11:03.000000000 +0800 +++ modules.new/awt/src/main/native/linuxfont/unix/LinuxNativeFont.c 2008-07-22 20:13:49.000000000 +0800 @@ -126,10 +126,10 @@ printf (" %s", family); #endif /* DEBUG */ - len = (strlen(family)+1); + len = (strlen((char *)family)+1); famList[j] = (char*)malloc(sizeof(char) * len); - strncpy(famList[j], family, len); + strncpy(famList[j], (char *)family, len); } else { /* * TODO @@ -189,7 +189,7 @@ } char *path = (char *)(*env)->GetStringUTFChars(env, fName, 0); - fontAdded = FcConfigAppFontAddFile(config, path); + fontAdded = FcConfigAppFontAddFile(config, (unsigned char*)path); unsigned short *familyName = 0; @@ -248,13 +248,13 @@ if (fid == 0) { (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } dpy = (Display *)(long)(*env)->GetLongField(env, linuxFont, fid); if (dpy == NULL){ throwNPException(env, "Cannot connect to XServer"); - return (jlong)NULL; + return (jlong)(int)NULL; } if (jStyle & FONT_BOLD) { @@ -281,7 +281,7 @@ if (fid == 0) { (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } scr = (*env)->GetIntField(env, linuxFont, fid); @@ -299,7 +299,7 @@ (*env)->ReleaseStringUTFChars(env, jName, name); } if(faceStyle){ - (*env)->ReleaseStringUTFChars(env, jFaceStyle, faceStyle); + (*env)->ReleaseStringUTFChars(env, jFaceStyle, (char *)faceStyle); } XftPatternDestroy (pattern); throwNPException(env, "Error during adding family name to XFTPattern structure"); @@ -312,7 +312,7 @@ if (faceStyle && !XftPatternAddString (pattern, XFT_STYLE, faceStyle)){ if(faceStyle){ - (*env)->ReleaseStringUTFChars(env, jFaceStyle, faceStyle); + (*env)->ReleaseStringUTFChars(env, jFaceStyle, (char *)faceStyle); } XftPatternDestroy (pattern); throwNPException(env, "Error during adding style name to XFTPattern structure"); @@ -321,7 +321,7 @@ /* We do not need faceStyle any more */ if(faceStyle){ XftPatternDestroy (pattern); - (*env)->ReleaseStringUTFChars(env, jFaceStyle, faceStyle); + (*env)->ReleaseStringUTFChars(env, jFaceStyle, (char *)faceStyle); } if (!XftPatternAddInteger(pattern, XFT_SLANT, slant)){ @@ -414,7 +414,7 @@ if (font_type == FONT_TYPE_UNDEF){ XftFontClose (dpy, xftFnt); - return (jlong)NULL; + return (jlong)(int)NULL; } /* Set Font type in LinuxFont object (upcall) */ @@ -426,7 +426,7 @@ #endif // DEBUG (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } (*env)->CallVoidMethod(env, linuxFont, mid, font_type); @@ -437,7 +437,7 @@ #endif // DEBUG (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } return (long)xftFnt; @@ -484,13 +484,13 @@ if (fid == 0) { (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } dpy = (Display *)(long)(*env)->GetLongField(env, linuxFont, fid); if (dpy == NULL){ throwNPException(env, "Cannot connect to XServer"); - return (jlong)NULL; + return (jlong)(int)NULL; } xlfd = (*env)->GetStringUTFChars(env, jXLFD, &iscopy); @@ -505,7 +505,7 @@ if (fid == 0) { (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } scr = (*env)->GetIntField(env, linuxFont, fid); @@ -517,7 +517,7 @@ if (n == 0){ free(buffer); - return (jlong)NULL; + return (jlong)(int)NULL; } /* Xft part */ @@ -589,7 +589,7 @@ if (font_type == FONT_TYPE_UNDEF){ XftFontClose (dpy, xftFnt); - return (jlong)NULL; + return (jlong)(int)NULL; } /* Set Font type in LinuxFont object (upcall) */ @@ -601,7 +601,7 @@ #endif // DEBUG (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } (*env)->CallVoidMethod(env, linuxFont, mid, font_type); @@ -612,7 +612,7 @@ #endif // DEBUG (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - return (jlong)NULL; + return (jlong)(int)NULL; } return (long)xftFnt; @@ -937,14 +937,14 @@ fontStyle |= FONT_ITALIC; } - len = snprintf(font, BUF_SIZE, fstr, family, style, fontStyle); + len = snprintf((char *)font, BUF_SIZE, fstr, family, style, fontStyle); if (len < 0){ len = BUF_SIZE; } fontList[j] = (char*)malloc(sizeof(char) * (len+1)); - strncpy(fontList[j], font, len); + strncpy(fontList[j], (char *)font, len); fontList[j][len] = 0; } XftFontSetDestroy (fs); @@ -966,7 +966,7 @@ free(fontList); throwNPException(env, "Not enough memory to create families list"); - return (jlong)NULL; + return (jlong)(int)NULL; } for (i = 0;i < numFonts;i++){ @@ -1347,7 +1347,7 @@ FcStrSetDestroy (subdirs); FcStrListDone (list); - (*env)->ReleaseStringUTFChars(env, fName, dirName); + (*env)->ReleaseStringUTFChars(env, fName, (char *)dirName); return result; } @@ -1387,7 +1387,7 @@ XftUnlockFace(font); - return (jlong)NULL; + return (jlong)(int)NULL; } error = FT_Get_Glyph( face->glyph, &glyph ); @@ -1396,7 +1396,7 @@ // throwNPException(env, "NativeInitGlyphBitmap 1 : FreeType error"); XftUnlockFace(font); - return (jlong)NULL; + return (jlong)(int)NULL; } // convert to a bitmap (default render mode + destroy old) if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) { @@ -1406,7 +1406,7 @@ // glyph unchanged FT_Done_Glyph( glyph ); XftUnlockFace(font); - return (jlong)NULL; + return (jlong)(int)NULL; } } @@ -1633,7 +1633,7 @@ throwNPException(env, "getGlyphOutline : FreeType error"); XftUnlockFace(font); - return (jlong)NULL; + return (jlong)(int)NULL; } if ((face->glyph->format & ft_glyph_format_outline) != 0){ diff -BburN modules/instrument/src/main/native/instrument/shared/inst_agt.c modules.new/instrument/src/main/native/instrument/shared/inst_agt.c --- modules/instrument/src/main/native/instrument/shared/inst_agt.c 2008-07-22 00:29:16.000000000 +0800 +++ modules.new/instrument/src/main/native/instrument/shared/inst_agt.c 2008-07-22 19:27:38.000000000 +0800 @@ -57,8 +57,8 @@ jbyteArray jname_bytes = (*jni_env)->NewByteArray(jni_env, name_len); //construct java byteArray for old class data and class name - (*jni_env)->SetByteArrayRegion(jni_env, jold_bytes, 0, class_data_len, (unsigned char *)class_data); - (*jni_env)->SetByteArrayRegion(jni_env, jname_bytes, 0, name_len, (char *)name); + (*jni_env)->SetByteArrayRegion(jni_env, jold_bytes, 0, class_data_len, (jbyte *)class_data); + (*jni_env)->SetByteArrayRegion(jni_env, jname_bytes, 0, name_len, (jbyte *)name); //invoke transform method jnew_bytes = (jbyteArray)(*jni_env)->CallObjectMethod(jni_env, *(gdata->inst), transform_method, loader, jname_bytes, class_being_redefined, protection_domain, jold_bytes); @@ -133,13 +133,13 @@ jbyteArray joptions=NULL, jclass_name; if(class_name){ jclass_name = (*env)->NewByteArray(env, strlen(class_name)); - (*env)->SetByteArrayRegion(env, jclass_name, 0, strlen(class_name), class_name); + (*env)->SetByteArrayRegion(env, jclass_name, 0, strlen(class_name), (jbyte*)class_name); }else{ goto DEALLOCATE; } if(agent_options){ joptions = (*env)->NewByteArray(env, strlen(agent_options)); - (*env)->SetByteArrayRegion(env, joptions, 0, strlen(agent_options), agent_options); + (*env)->SetByteArrayRegion(env, joptions, 0, strlen(agent_options), (jbyte*)agent_options); } (*env)->CallObjectMethod(env, *(gdata->inst), *(gdata->premain_method), jclass_name, joptions); @@ -208,7 +208,7 @@ size = zipEntry.uncompressedSize; result = (char *)hymem_allocate_memory(size*sizeof(char)); #ifndef HY_ZIP_API - retval = zip_getZipEntryData(privatePortLibrary, &zipFile, &zipEntry, result, size); + retval = zip_getZipEntryData(privatePortLibrary, &zipFile, &zipEntry, (unsigned char*)result, size); #else /* HY_ZIP_API */ retval = zipFuncs->zip_getZipEntryData(VMI, &zipFile, &zipEntry, result, size); #endif /* HY_ZIP_API */ diff -BburN modules/instrument/src/main/native/instrument/shared/instrument.c modules.new/instrument/src/main/native/instrument/shared/instrument.c --- modules/instrument/src/main/native/instrument/shared/instrument.c 2008-07-22 00:29:16.000000000 +0800 +++ modules.new/instrument/src/main/native/instrument/shared/instrument.c 2008-07-22 19:16:22.000000000 +0800 @@ -252,7 +252,7 @@ //construct a jvmtiClassDefinition element class_definitions[index].klass=klass; - class_definitions[index].class_bytes=class_bytes; + class_definitions[index].class_bytes=(unsigned char*)class_bytes; class_definitions[index].class_byte_count=class_byte_count; } diff -BburN modules/luni/src/main/native/launcher/shared/libhlp.c modules.new/luni/src/main/native/launcher/shared/libhlp.c --- modules/luni/src/main/native/launcher/shared/libhlp.c 2008-07-22 00:29:24.000000000 +0800 +++ modules.new/luni/src/main/native/launcher/shared/libhlp.c 2008-07-22 18:21:38.000000000 +0800 @@ -28,7 +28,7 @@ { /* append a separator, first */ - if (*classPath && (*classPath)->data[strlen ((*classPath)->data)] != sep) + if (*classPath && (*classPath)->data[strlen ((char *)((*classPath)->data))] != sep) { char separator[2]; separator[0] = (char) sep; @@ -65,8 +65,8 @@ if (*classPath == NULL) return -1; hysysinfo_get_env (envvar, - (*classPath)->data + strlen ((*classPath)->data), - rc); + (char *)((*classPath)->data) + strlen ((char *)((*classPath)->data)), + (U_32)rc); (*classPath)->remaining -= rc; break; } @@ -266,7 +266,7 @@ if (((*env)->ExceptionCheck (env))) return 1; - (*env)->SetByteArrayRegion (env, bytearray, (UDATA) 0, strLength, chars); + (*env)->SetByteArrayRegion (env, bytearray, (UDATA) 0, strLength, (jbyte*)chars); string = (*env)->NewObject (env, stringClass, stringMid, bytearray, (UDATA) 0, diff -BburN modules/luni/src/main/native/launcher/shared/main.c modules.new/luni/src/main/native/launcher/shared/main.c --- modules/luni/src/main/native/launcher/shared/main.c 2008-07-22 00:29:24.000000000 +0800 +++ modules.new/luni/src/main/native/launcher/shared/main.c 2008-07-22 17:47:58.000000000 +0800 @@ -941,7 +941,7 @@ } /* FIXME: buffer leak ignored */ - options[j].optionString = lineBuf->data; + options[j].optionString = (char *)(lineBuf->data); options[j].extraInfo = NULL; ++j; } @@ -989,7 +989,7 @@ /* Check that the minimum required -D options have been included. If not, calculate and add the defaults */ initDefaultDefines (portLibrary, (void **)&options, argc, argv, isStandaloneJar ? classArg : 0, &classPath2, &javaHome, - &javaLibraryPath, vmdllsubdir, &j); + &javaLibraryPath, vmdllsubdir, (int *) &j); // Slam in the pointer to the HyPortLibrary portLibOptionStr = hymem_allocate_memory (strlen(PORT_LIB_OPTION) + 1); diff -BburN modules/luni/src/main/native/launcher/shared/strbuf.c modules.new/luni/src/main/native/launcher/shared/strbuf.c --- modules/luni/src/main/native/launcher/shared/strbuf.c 2008-07-22 00:29:24.000000000 +0800 +++ modules.new/luni/src/main/native/launcher/shared/strbuf.c 2008-07-22 18:14:10.000000000 +0800 @@ -30,7 +30,7 @@ buffer = strBufferEnsure (portLibrary, buffer, len); if (buffer) { - strcat (buffer->data, string); + strcat ((char *)(buffer->data), string); buffer->remaining -= len; } @@ -60,12 +60,12 @@ PORT_ACCESS_FROM_PORT (portLibrary); UDATA newSize = len > MIN_GROWTH ? len : MIN_GROWTH; HyStringBuffer *new = - hymem_allocate_memory (strlen (buffer->data) + newSize + + hymem_allocate_memory (strlen ((char *)(buffer->data)) + newSize + sizeof (UDATA) + 1); if (new) { new->remaining = newSize; - strcpy (new->data, buffer->data); + strcpy ((char *)(new->data), (char *)(buffer->data)); } hymem_free_memory (buffer); return new; @@ -83,8 +83,8 @@ buffer = strBufferEnsure (portLibrary, buffer, len); if (buffer) { - memmove (buffer->data + len, buffer->data, strlen (buffer->data) + 1); - strncpy (buffer->data, string, len); + memmove (buffer->data + len, buffer->data, strlen ((char *)(buffer->data)) + 1); + strncpy ((char *)(buffer->data), string, len); buffer->remaining -= len; } @@ -94,5 +94,5 @@ char * strBufferData (HyStringBuffer * buffer) { - return buffer ? buffer->data : NULL; + return buffer ? (char *)(buffer->data) : NULL; } diff -BburN modules/portlib/src/main/native/port/shared/hynls.c modules.new/portlib/src/main/native/port/shared/hynls.c --- modules/portlib/src/main/native/port/shared/hynls.c 2008-07-22 00:29:21.000000000 +0800 +++ modules.new/portlib/src/main/native/port/shared/hynls.c 2008-07-22 00:46:05.000000000 +0800 @@ -781,7 +781,7 @@ { charPointer = dataBuf; endPointer = - charPointer + strlen (charPointer); + charPointer + strlen ((char *)charPointer); } } if (charPointer >= endPointer) @@ -869,7 +869,7 @@ BUF_SIZE) != NULL) { charPointer = dataBuf; - endPointer = charPointer + strlen (charPointer); + endPointer = charPointer + strlen ((char *)charPointer); } } if (charPointer >= endPointer) diff -BburN modules/portlib/src/main/native/port/shared/hystr.c modules.new/portlib/src/main/native/port/shared/hystr.c --- modules/portlib/src/main/native/port/shared/hystr.c 2008-07-22 00:29:21.000000000 +0800 +++ modules.new/portlib/src/main/native/port/shared/hystr.c 2008-07-22 01:15:18.000000000 +0800 @@ -1071,7 +1071,7 @@ currentU16 = value; while (numberOfUnicodeChar-- > 0) { - buf += encodeUTF8Char ((UDATA) * currentU16++, buf); + buf += encodeUTF8Char ((UDATA) * currentU16++, (U_8 *)buf); } } bufLen -= numberOfUTF8Char; diff -BburN modules/portlib/src/main/native/port/unix/hyfiletext.c modules.new/portlib/src/main/native/port/unix/hyfiletext.c --- modules/portlib/src/main/native/port/unix/hyfiletext.c 2008-07-22 00:29:24.000000000 +0800 +++ modules.new/portlib/src/main/native/port/unix/hyfiletext.c 2008-07-22 00:40:16.000000000 +0800 @@ -292,7 +292,7 @@ int wcresult; numberU8Consumed = decodeUTF8Char (cursor, &unicode); cursor += numberU8Consumed; - wcresult = wctomb (out, (wchar_t) unicode); + wcresult = wctomb ((char *) out, (wchar_t) unicode); if (wcresult == -1) { *out++ = '?'; @@ -331,7 +331,7 @@ } if (newBuf) { - translateUTF8String (buf, newBuf, nbytes); + translateUTF8String ((const U_8*)buf, (U_8 *)newBuf, nbytes); buf = newBuf; nbytes = newLength; } @@ -361,7 +361,7 @@ outBuf = portLibrary->mem_allocate_memory (portLibrary, newLength + 1); if (outBuf) { - translateUTF8String (buf, outBuf, nbytes); + translateUTF8String ((const U_8 *)buf, (U_8 *) outBuf, nbytes); nbytes = newLength; outBuf[nbytes] = '\0'; } else diff -BburN modules/portlib/src/main/native/port/unix/hysock.c modules.new/portlib/src/main/native/port/unix/hysock.c --- modules/portlib/src/main/native/port/unix/hysock.c 2008-07-22 00:29:24.000000000 +0800 +++ modules.new/portlib/src/main/native/port/unix/hysock.c 2008-07-22 01:06:02.000000000 +0800 @@ -5206,7 +5206,7 @@ { /* ok we have more work to do to figure it out */ if (getsockopt (SOCKET_CAST(sock), SOL_SOCKET, SO_ERROR, - (char *) &errorVal, &errorValLen) >= 0) { + (char *) &errorVal, (unsigned int *)&errorValLen) >= 0) { return errorVal ? findError(errorVal):0; } else { rc = errno; @@ -5220,7 +5220,7 @@ /* if the descriptor is in the exception set then the connect failed */ if (my_pollfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { if (getsockopt(SOCKET_CAST(sock), SOL_SOCKET, SO_ERROR, - (char *) &errorVal, &errorValLen) >= 0) { + (char *) &errorVal, (unsigned int *)&errorValLen) >= 0) { return errorVal ? findError(errorVal):0; } rc = errno;