Skip to content

Fix a few signature that were using long types. NFC#18998

Merged
sbc100 merged 1 commit into
mainfrom
remove_long_usage
Mar 20, 2023
Merged

Fix a few signature that were using long types. NFC#18998
sbc100 merged 1 commit into
mainfrom
remove_long_usage

Conversation

@sbc100

@sbc100 sbc100 commented Mar 17, 2023

Copy link
Copy Markdown
Collaborator

The emscripten_request_animation_frame sig was just wrong since that Web API returns WebIDL long defined as i32.

For emscripten_webgl_get_parameter_i64v use GLint64 rather than long long to me more explicit.

For emscripten_websocket_get_buffered_amount using size_t since we already include stdint.h in this header anyway.

I found all of these while working on #18985 which detectes the use of long, size_t or pointers and marks tham a p in their __sig attribute.

@sbc100 sbc100 requested a review from kripken March 17, 2023 22:28
@sbc100 sbc100 enabled auto-merge (squash) March 17, 2023 22:28

// Returns the WebSocket.bufferedAmount field into bufferedAmount. bufferedAmount must not be a null pointer.
EMSCRIPTEN_RESULT emscripten_websocket_get_buffered_amount(EMSCRIPTEN_WEBSOCKET_T socket, unsigned long long *bufferedAmount __attribute__((nonnull)));
EMSCRIPTEN_RESULT emscripten_websocket_get_buffered_amount(EMSCRIPTEN_WEBSOCKET_T socket, size_t *bufferedAmount __attribute__((nonnull)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the type from i64 to either i32 or i64 depending on wasm32/64? In that case don't we need to update the place that writes to it in src/*.js which atm has i64?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

The emscripten_request_animation_frame sig was just wrong since that
Web API returns WebIDL `long` defined as i32.

For emscripten_webgl_get_parameter_i64v use GLint64 rather than `long
long` to me more explicit.

For `emscripten_websocket_get_buffered_amount` using `size_t` since we
already include `stdint.h` in this header anyway.

I found all of these while working on #18985 which detectes the use of
`long`, `size_t` or pointers and marks tham a `p` in their `__sig`
attribute.
@sbc100 sbc100 force-pushed the remove_long_usage branch from 8cc151f to 9dbba05 Compare March 20, 2023 16:38
@sbc100 sbc100 merged commit 0f494e6 into main Mar 20, 2023
@sbc100 sbc100 deleted the remove_long_usage branch March 20, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants