Skip to content

Commit 1e14a04

Browse files
committed
8338570: sun/font/HBShaper - mismatch in return type of FFM upcall function description and native invocation
Reviewed-by: serb, aivanov
1 parent cd8382e commit 1e14a04

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/java.desktop/share/classes/sun/font/HBShaper.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private static VarHandle getVarHandle(StructLayout struct, String name) {
187187
dispose_face_handle = tmp3;
188188

189189
FunctionDescriptor shapeDesc = FunctionDescriptor.ofVoid(
190-
//JAVA_INT, // return type
191190
JAVA_FLOAT, // ptSize
192191
ADDRESS, // matrix
193192
ADDRESS, // face
@@ -470,7 +469,7 @@ static void shape(
470469
MemorySegment matrix = arena.allocateFrom(JAVA_FLOAT, mat);
471470
MemorySegment chars = arena.allocateFrom(JAVA_CHAR, text);
472471

473-
/*int ret =*/ jdk_hb_shape_handle.invokeExact(
472+
jdk_hb_shape_handle.invokeExact(
474473
ptSize, matrix, hbface, chars, text.length,
475474
script, offset, limit,
476475
baseIndex, startX, startY, flags, slot,

src/java.desktop/share/native/libfontmanager/HBShaper_Panama.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static float euclidianDistance(float a, float b)
6363
#define TYPO_LIGA 0x00000002
6464
#define TYPO_RTL 0x80000000
6565

66-
JDKEXPORT int jdk_hb_shape(
66+
JDKEXPORT void jdk_hb_shape(
6767
float ptSize,
6868
float *matrix,
6969
void* pFace,
@@ -92,7 +92,6 @@ JDKEXPORT int jdk_hb_shape(
9292
int featureCount = 0;
9393
char* kern = (flags & TYPO_KERN) ? "kern" : "-kern";
9494
char* liga = (flags & TYPO_LIGA) ? "liga" : "-liga";
95-
int ret;
9695
unsigned int buflen;
9796

9897
float devScale = 1.0f;
@@ -132,7 +131,7 @@ JDKEXPORT int jdk_hb_shape(
132131
glyphInfo = hb_buffer_get_glyph_infos(buffer, 0);
133132
glyphPos = hb_buffer_get_glyph_positions(buffer, &buflen);
134133

135-
ret = (*store_layout_results_fn)
134+
(*store_layout_results_fn)
136135
(slot, baseIndex, offset, startX, startY, devScale,
137136
charCount, glyphCount, glyphInfo, glyphPos);
138137

@@ -141,5 +140,5 @@ JDKEXPORT int jdk_hb_shape(
141140
if (features != NULL) {
142141
free(features);
143142
}
144-
return ret;
143+
return;
145144
}

src/java.desktop/share/native/libfontmanager/hb-jdk-p.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ hb_font_t* jdk_font_create_hbp(
5656
hb_font_funcs_t* font_funcs);
5757

5858

59-
typedef int (*store_layoutdata_func_t)
59+
typedef void (*store_layoutdata_func_t)
6060
(int slot, int baseIndex, int offset,
6161
float startX, float startY, float devScale,
6262
int charCount, int glyphCount,
6363
hb_glyph_info_t *glyphInfo, hb_glyph_position_t *glyphPos);
6464

65-
JDKEXPORT int jdk_hb_shape(
65+
JDKEXPORT void jdk_hb_shape(
6666

6767
float ptSize,
6868
float *matrix,

0 commit comments

Comments
 (0)