Skip to content

Commit 42262e1

Browse files
committed
Remove unnecessary cast to long, which breaks builds for Win x64
1 parent 9634718 commit 42262e1

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

imgui-binding/src/main/java/imgui/ImFont.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void destroy() {
4444

4545
private native long nCreate(); /*
4646
ImFont* imFont = new ImFont();
47-
return (long)(intptr_t)imFont;
47+
return (intptr_t)imFont;
4848
*/
4949

5050
private native void nDestroy(long ptr); /*
@@ -87,7 +87,7 @@ public ImFontGlyph getFallbackGlyph() {
8787
}
8888

8989
private native long nGetFallbackGlyphPtr(); /*
90-
return (long)(intptr_t)IM_FONT->FallbackGlyph;
90+
return (intptr_t)IM_FONT->FallbackGlyph;
9191
*/
9292

9393
/**

imgui-binding/src/main/java/imgui/ImFontAtlas.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void destroy() {
5959

6060
private native long nCreate(); /*
6161
ImFontAtlas* imFontAtlas = new ImFontAtlas();
62-
return (long)(intptr_t)imFontAtlas;
62+
return (intptr_t)imFontAtlas;
6363
*/
6464

6565
private native void nDestroy(long ptr); /*
@@ -71,55 +71,55 @@ public ImFont addFont(final ImFontConfig imFontConfig) {
7171
}
7272

7373
private native long nAddFont(long imFontConfigPtr); /*
74-
return (long)(intptr_t)IM_FONT_ATLAS->AddFont((ImFontConfig*)imFontConfigPtr);
74+
return (intptr_t)IM_FONT_ATLAS->AddFont((ImFontConfig*)imFontConfigPtr);
7575
*/
7676

7777
public ImFont addFontDefault() {
7878
return new ImFont(nAddFontDefault());
7979
}
8080

8181
private native long nAddFontDefault(); /*
82-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontDefault();
82+
return (intptr_t)IM_FONT_ATLAS->AddFontDefault();
8383
*/
8484

8585
public ImFont addFontDefault(final ImFontConfig imFontConfig) {
8686
return new ImFont(nAddFontDefault(imFontConfig.ptr));
8787
}
8888

8989
private native long nAddFontDefault(long imFontConfigPtr); /*
90-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontDefault((ImFontConfig*)imFontConfigPtr);
90+
return (intptr_t)IM_FONT_ATLAS->AddFontDefault((ImFontConfig*)imFontConfigPtr);
9191
*/
9292

9393
public ImFont addFontFromFileTTF(final String filename, final float sizePixels) {
9494
return new ImFont(nAddFontFromFileTTF(filename, sizePixels));
9595
}
9696

9797
private native long nAddFontFromFileTTF(String filename, float sizePixels); /*
98-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels);
98+
return (intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels);
9999
*/
100100

101101
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig imFontConfig) {
102102
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, imFontConfig.ptr));
103103
}
104104

105105
private native long nAddFontFromFileTTF(String filename, float sizePixels, long imFontConfigPtr); /*
106-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr);
106+
return (intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr);
107107
*/
108108

109109
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final short[] glyphRanges) {
110110
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, glyphRanges));
111111
}
112112

113113
private native long nAddFontFromFileTTF(String filename, float sizePixels, short[] glyphRanges); /*
114-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
114+
return (intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
115115
*/
116116

117117
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig imFontConfig, final short[] glyphRanges) {
118118
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, imFontConfig.ptr, glyphRanges));
119119
}
120120

121121
private native long nAddFontFromFileTTF(String filename, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /*
122-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
122+
return (intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
123123
*/
124124

125125
/**
@@ -131,7 +131,7 @@ public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels
131131
}
132132

133133
private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels); /*
134-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels);
134+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels);
135135
*/
136136

137137

@@ -144,7 +144,7 @@ public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels
144144
}
145145

146146
private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, long imFontConfigPtr); /*
147-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr);
147+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr);
148148
*/
149149

150150
/**
@@ -156,7 +156,7 @@ public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels
156156
}
157157

158158
private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, short[] glyphRanges); /*
159-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
159+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
160160
*/
161161

162162
/**
@@ -168,7 +168,7 @@ public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels
168168
}
169169

170170
private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /*
171-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
171+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
172172
*/
173173

174174
/**
@@ -179,7 +179,7 @@ public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, fi
179179
}
180180

181181
private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels); /*
182-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels);
182+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels);
183183
*/
184184

185185
/**
@@ -190,7 +190,7 @@ public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, fi
190190
}
191191

192192
private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, long imFontConfigPtr); /*
193-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr);
193+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr);
194194
*/
195195

196196
/**
@@ -201,7 +201,7 @@ public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, fi
201201
}
202202

203203
private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, short[] glyphRanges); /*
204-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
204+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
205205
*/
206206

207207
/**
@@ -212,7 +212,7 @@ public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, fi
212212
}
213213

214214
private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /*
215-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
215+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
216216
*/
217217

218218
/**
@@ -223,7 +223,7 @@ public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDa
223223
}
224224

225225
private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels); /*
226-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels);
226+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels);
227227
*/
228228

229229
/**
@@ -234,7 +234,7 @@ public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDa
234234
}
235235

236236
private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, long imFontConfigPtr); /*
237-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr);
237+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr);
238238
*/
239239

240240
/**
@@ -245,7 +245,7 @@ public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDa
245245
}
246246

247247
private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, short[] glyphRanges); /*
248-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
248+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
249249
*/
250250

251251
/**
@@ -256,7 +256,7 @@ public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDa
256256
}
257257

258258
private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /*
259-
return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
259+
return (intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]);
260260
*/
261261

262262
/**
@@ -512,7 +512,7 @@ public int addCustomRectFontGlyph(final ImFont imFont, final short id, final int
512512
* It is passed back to you during rendering via the ImDrawCmd structure.
513513
*/
514514
public native int getTexID(); /*
515-
return (int)(long)(intptr_t)(void*)IM_FONT_ATLAS->TexID;
515+
return (int)(intptr_t)(void*)IM_FONT_ATLAS->TexID;
516516
*/
517517

518518
/**

imgui-binding/src/main/java/imgui/ImFontConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void destroy() {
4242

4343
private native long nCreate(); /*
4444
ImFontConfig* imFontConfig = new ImFontConfig();
45-
return (long)(intptr_t)imFontConfig;
45+
return (intptr_t)imFontConfig;
4646
*/
4747

4848
private native void nDestroy(long ptr); /*

imgui-binding/src/main/java/imgui/ImFontGlyph.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void destroy() {
3838

3939
private native long nCreate(); /*
4040
ImFontConfig* imFontConfig = new ImFontConfig();
41-
return (long)(intptr_t)imFontConfig;
41+
return (intptr_t)imFontConfig;
4242
*/
4343

4444
private native void nDestroy(long ptr); /*

imgui-binding/src/main/java/imgui/ImGui.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static ImGuiStyle getStyle() {
157157
}
158158

159159
private static native long nGetStyle(); /*
160-
return (long)(intptr_t)&ImGui::GetStyle();
160+
return (intptr_t)&ImGui::GetStyle();
161161
*/
162162

163163
/**
@@ -895,7 +895,7 @@ public static ImFont getFont() {
895895
}
896896

897897
private static native long nGetFont(); /*
898-
return (long)(intptr_t)ImGui::GetFont();
898+
return (intptr_t)ImGui::GetFont();
899899
*/
900900

901901
/**

imgui-binding/src/main/java/imgui/ImGuiIO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public ImFontAtlas getFonts() {
208208
}
209209

210210
private native long nGetFontsPtr(); /*
211-
return (long)(intptr_t)ImGui::GetIO().Fonts;
211+
return (intptr_t)ImGui::GetIO().Fonts;
212212
*/
213213

214214
/**

imgui-binding/src/main/java/imgui/ImGuiStyle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void destroy() {
4343

4444
private native long nCreate(); /*
4545
ImGuiStyle* imGuiStyle = new ImGuiStyle();
46-
return (long)(intptr_t)imGuiStyle;
46+
return (intptr_t)imGuiStyle;
4747
*/
4848

4949
private native void nDestroy(long ptr); /*

0 commit comments

Comments
 (0)