mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8074844: Resolve disabled warnings for libfontmanager
Reviewed-by: serb, ihse, erikj
This commit is contained in:
parent
acb329cd0e
commit
3d7b524593
@ -566,9 +566,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare unused-function int-to-pointer-cast, \
|
||||
DISABLED_WARNINGS_clang := sign-compare, \
|
||||
DISABLED_WARNINGS_microsoft := 4018 4146 4244 4996, \
|
||||
LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
|
||||
$(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@ -105,7 +105,7 @@ GlyphBlitVector* setupBlitVector(JNIEnv *env, jobject glyphlist) {
|
||||
jfloat px = x + positions[++n];
|
||||
jfloat py = y + positions[++n];
|
||||
|
||||
ginfo = (GlyphInfo*)imagePtrs[g];
|
||||
ginfo = (GlyphInfo*)((uintptr_t)imagePtrs[g]);
|
||||
gbv->glyphs[g].glyphInfo = ginfo;
|
||||
gbv->glyphs[g].pixels = ginfo->image;
|
||||
gbv->glyphs[g].width = ginfo->width;
|
||||
@ -118,7 +118,7 @@ GlyphBlitVector* setupBlitVector(JNIEnv *env, jobject glyphlist) {
|
||||
positions, JNI_ABORT);
|
||||
} else {
|
||||
for (g=0; g<len; g++) {
|
||||
ginfo = (GlyphInfo*)imagePtrs[g];
|
||||
ginfo = (GlyphInfo*)((uintptr_t)imagePtrs[g]);
|
||||
gbv->glyphs[g].glyphInfo = ginfo;
|
||||
gbv->glyphs[g].pixels = ginfo->image;
|
||||
gbv->glyphs[g].width = ginfo->width;
|
||||
@ -531,7 +531,7 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
|
||||
* heterogenous
|
||||
*/
|
||||
if (subPixPos && len > 0) {
|
||||
ginfo = (GlyphInfo*)imagePtrs[0];
|
||||
ginfo = (GlyphInfo*)((uintptr_t)imagePtrs[0]);
|
||||
if (ginfo == NULL) {
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, glyphImages,
|
||||
imagePtrs, JNI_ABORT);
|
||||
@ -566,7 +566,7 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
|
||||
for (g=0; g<len; g++) {
|
||||
jfloat px, py;
|
||||
|
||||
ginfo = (GlyphInfo*)imagePtrs[g];
|
||||
ginfo = (GlyphInfo*)((uintptr_t)imagePtrs[g]);
|
||||
if (ginfo == NULL) {
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, glyphImages,
|
||||
imagePtrs, JNI_ABORT);
|
||||
@ -647,7 +647,7 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
|
||||
positions, JNI_ABORT);
|
||||
} else {
|
||||
for (g=0; g<len; g++) {
|
||||
ginfo = (GlyphInfo*)imagePtrs[g];
|
||||
ginfo = (GlyphInfo*)((uintptr_t)imagePtrs[g]);
|
||||
if (ginfo == NULL) {
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, glyphImages,
|
||||
imagePtrs, JNI_ABORT);
|
||||
|
||||
@ -210,7 +210,7 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream,
|
||||
if (byteArray == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
jsize len = (*env)->GetArrayLength(env, byteArray);
|
||||
unsigned long len = (*env)->GetArrayLength(env, byteArray);
|
||||
if (len < numBytes) {
|
||||
numBytes = len; // don't get more bytes than there are ..
|
||||
}
|
||||
@ -241,7 +241,7 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream,
|
||||
scalerInfo->fontDataLength);
|
||||
if (bread <= 0) {
|
||||
return 0;
|
||||
} else if (bread < numBytes) {
|
||||
} else if ((unsigned long)bread < numBytes) {
|
||||
numBytes = bread;
|
||||
}
|
||||
memcpy(destBuffer, scalerInfo->fontData, numBytes);
|
||||
@ -1213,7 +1213,7 @@ static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
|
||||
|
||||
FT_Outline_Translate(&ftglyph->outline,
|
||||
FloatToF26Dot6(xpos),
|
||||
-FloatToF26Dot6(ypos));
|
||||
FloatToF26Dot6(-ypos));
|
||||
|
||||
return &ftglyph->outline;
|
||||
}
|
||||
@ -1519,7 +1519,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative(
|
||||
(FTScalerInfo*) jlong_to_ptr(pScaler);
|
||||
|
||||
glyphs = NULL;
|
||||
if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= numGlyphs) {
|
||||
if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= (unsigned int)numGlyphs) {
|
||||
glyphs = (jint*) malloc(numGlyphs*sizeof(jint));
|
||||
}
|
||||
if (glyphs == NULL) {
|
||||
|
||||
@ -304,9 +304,6 @@ _hb_jdk_get_font_funcs (void)
|
||||
static void _do_nothing(void) {
|
||||
}
|
||||
|
||||
static void _free_nothing(void*) {
|
||||
}
|
||||
|
||||
struct Font2DPtr {
|
||||
JavaVM* vmPtr;
|
||||
jweak font2DRef;
|
||||
|
||||
@ -38,7 +38,7 @@ typedef struct JDKFontInfo_Struct {
|
||||
JNIEnv* env;
|
||||
jobject font2D;
|
||||
jobject fontStrike;
|
||||
long nativeFont;
|
||||
jlong nativeFont;
|
||||
float matrix[4];
|
||||
float ptSize;
|
||||
float xPtSize;
|
||||
|
||||
@ -50,7 +50,7 @@ JNIEXPORT void JNICALL
|
||||
Java_sun_font_NativeStrikeDisposer_freeNativeScalerContext
|
||||
(JNIEnv *env, jobject disposer, jlong pScalerContext) {
|
||||
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
|
||||
if (context != NULL) {
|
||||
if (context->xFont != NULL) {
|
||||
@ -210,8 +210,8 @@ Java_sun_font_NativeFont_countGlyphs
|
||||
(JNIEnv *env, jobject font, jbyteArray xlfdBytes, jint ptSize) {
|
||||
|
||||
NativeScalerContext *context = (NativeScalerContext*)
|
||||
Java_sun_font_NativeStrike_createScalerContext
|
||||
(env, NULL, xlfdBytes, ptSize, 1);
|
||||
(uintptr_t)(Java_sun_font_NativeStrike_createScalerContext
|
||||
(env, NULL, xlfdBytes, ptSize, 1));
|
||||
|
||||
if (context == NULL) {
|
||||
return 0;
|
||||
@ -227,7 +227,7 @@ JNIEXPORT jint JNICALL
|
||||
Java_sun_font_NativeStrike_getMaxGlyph
|
||||
(JNIEnv *env, jobject strike, jlong pScalerContext) {
|
||||
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
if (context == NULL) {
|
||||
return (jint)0;
|
||||
} else {
|
||||
@ -242,7 +242,7 @@ Java_sun_font_NativeFont_getGlyphAdvance
|
||||
AWTChar xcs = NULL;
|
||||
jfloat advance = 0.0f;
|
||||
AWTFont xFont;
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
if (context == NULL) {
|
||||
return advance;
|
||||
} else {
|
||||
@ -285,7 +285,7 @@ Java_sun_font_NativeFont_getGlyphImageNoDefault
|
||||
|
||||
AWTChar2b xChar;
|
||||
AWTFont xFont;
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
if (context == NULL) {
|
||||
return (jlong)0;
|
||||
} else {
|
||||
@ -311,7 +311,7 @@ Java_sun_font_NativeFont_getGlyphImage
|
||||
|
||||
AWTChar2b xChar;
|
||||
AWTFont xFont;
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
if (context == NULL) {
|
||||
return (jlong)0;
|
||||
} else {
|
||||
@ -338,7 +338,7 @@ JNIEXPORT jobject JNICALL
|
||||
jfloat j0=0, j1=1, ay=j0, dy=j0, mx=j0;
|
||||
jobject metrics;
|
||||
AWTFont xFont;
|
||||
NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
|
||||
NativeScalerContext *context = (NativeScalerContext*)(uintptr_t)(pScalerContext);
|
||||
if (context == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
|
||||
@ -125,15 +125,6 @@ static unsigned char* getIGTable(int gamma) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_font_FileFontStrike_initNative(JNIEnv *env, jclass unused) {
|
||||
|
||||
DWORD osVersion = GetVersion();
|
||||
DWORD majorVersion = (DWORD)(LOBYTE(LOWORD(osVersion)));
|
||||
DWORD minorVersion = (DWORD)(HIBYTE(LOWORD(osVersion)));
|
||||
|
||||
/* Need at least XP which is 5.1 */
|
||||
if (majorVersion < 5 || (majorVersion == 5 && minorVersion < 1)) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
memset(igLUTable, 0, LCDLUTCOUNT);
|
||||
|
||||
return JNI_TRUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user