Remix.run Logo
▲ mrlonglong 2 days ago

Why redefine the stdints?

▲flohofwoe 3 hours ago | parent | next [-]

It's ok as long as the types don't leak into the public API when the code is distributed as a library. But yeah, it looks like a leftover bad habit from pre-C99 times (I suspect the author is on Windows where MSVC was very late to the C99 party), and Microsoft also recommened for a while to build C code via the C++ compiler, which is where the "cast result of malloc" habit might come from.

▲veltas 4 hours ago | parent | prev | next [-]

They wanted shorter aliases for them to make their code clearer, I suppose.

▲rfgplk 3 hours ago | parent [-]

The one thing Rust got right was inheriting the i64/u64/i32/u32/i8/u8 naming convention for types. Far more concise and unambiguously clear. No more typing unsigned long long int or uint64_t

▲Lvl999Noob 2 hours ago | parent [-]

I would have liked it more if it was U64 instead of u64, etc. It feels weird when all the other types are in PascalCase but then the primitive types are like this. Also str -> Str.

▲jtari3333 3 hours ago | parent | prev | next [-]

Typedefing uint32t to u32 etc is extremely common

▲indy 3 hours ago | parent | prev [-]

To make them easier to type and more aesthetically pleasing