Skip to content

Commit 35d989f

Browse files
committed
Fix for 64-bit CI assert, use int32_t for all sizes in test code
1 parent e765678 commit 35d989f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/browser/test_glut_resize.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
#include <stdio.h>
99
#include <assert.h>
10+
#include <stdint.h>
1011
#include <emscripten/emscripten.h>
1112
#include <GL/glut.h>
1213

1314
typedef struct {
14-
int width;
15-
int height;
15+
int32_t width;
16+
int32_t height;
1617
} rect_size_t;
1718

1819
static rect_size_t browser_window_size = { 0, 0 };
@@ -47,18 +48,18 @@ int equal_size(rect_size_t rect_1, rect_size_t rect_2) {
4748
/**
4849
* Obtain various dimensions
4950
*/
50-
EM_JS(void, get_browser_window_size, (int* width, int* height), {
51+
EM_JS(void, get_browser_window_size, (int32_t* width, int32_t* height), {
5152
setValue(width, window.innerWidth, 'i32');
5253
setValue(height, window.innerHeight, 'i32');
5354
});
5455

55-
EM_JS(void, get_canvas_client_size, (int* width, int* height), {
56+
EM_JS(void, get_canvas_client_size, (int32_t* width, int32_t* height), {
5657
const canvas = Module.canvas;
5758
setValue(width, canvas.clientWidth, 'i32');
5859
setValue(height, canvas.clientHeight, 'i32');
5960
});
6061

61-
EM_JS(void, get_canvas_size, (int* width, int* height), {
62+
EM_JS(void, get_canvas_size, (int32_t* width, int32_t* height), {
6263
const canvas = Module.canvas;
6364
setValue(width, canvas.width, 'i32');
6465
setValue(height, canvas.height, 'i32');
@@ -176,8 +177,8 @@ void start_tests() {
176177
* Reshape callback - record latest size, verify and run next test if async
177178
*/
178179
void reshape(int w, int h) {
179-
glut_reshape_size.width = w;
180-
glut_reshape_size.height = h;
180+
glut_reshape_size.width = (int32_t)w;
181+
glut_reshape_size.height = (int32_t)h;
181182

182183
if (run_async_verification) {
183184
run_async_verification = 0; /* Only one verification per test */

0 commit comments

Comments
 (0)