Ancestors

Written by lawless polymorph on 2025-01-25 at 22:08

the code:

int32_t v93 = -2147483648;

the error message:

"unary minus operator applied to unsigned type, result still unsigned"

=> More informations about this toot | More toots from typeswitch@gamedev.lgbt

Toot

Written by lawless polymorph on 2025-01-25 at 22:13

what do I do? what is the blessed way of writing an integer literal with the value of INT32_MIN? (without creating a special case for INT32_MIN)

=> More informations about this toot | More toots from typeswitch@gamedev.lgbt

Descendants

Written by gaytabase on 2025-01-25 at 22:14

@typeswitch suffix it?

=> More informations about this toot | More toots from dysfun@treehouse.systems

Written by lawless polymorph on 2025-01-25 at 22:15

@dysfun is there a macro for picking out the correct suffix for fixed-size integer types? 🤔

=> More informations about this toot | More toots from typeswitch@gamedev.lgbt

Written by gaytabase on 2025-01-25 at 22:16

@typeswitch shrug i doubt it. but you can use a long and let it truncate?

=> More informations about this toot | More toots from dysfun@treehouse.systems

Written by lawless polymorph on 2025-01-25 at 22:16

@dysfun looks like INT32_C(...) should work, hope it exists in VC

=> More informations about this toot | More toots from typeswitch@gamedev.lgbt

Written by lawless polymorph on 2025-01-25 at 22:28

@dysfun nope, that doesn't work. I think i'll just special case INT32_MIN and INT64_MIN. 🙃

For INT32_MIN the LL suffix would work but I think INT64_MIN is going to have the same problem and there's no suffix that'll work there.

=> More informations about this toot | More toots from typeswitch@gamedev.lgbt

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113891293555249953
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
314.786195 milliseconds
Gemini-to-HTML Time
1.724912 milliseconds

This content has been proxied by September (3851b).