Closed TiltMeSenpai closed 2 years ago
Please use uint64_t rather than unsigned long long (even if they're the same underlying type) to make "this is explicitly 64 bits" more obvious in the code.
Otherwise, good catch. I actually got some static analysis warnings about this recently and fixed some (but clearly not all) instances of similar behavior.
Are there "parse as unsigned 64 bit int" functions similar to stoull? I could have worded this clearer, but this is just a stol -> stoull swap.
Ah, OK. Not to my knowledge, this is probably good. Let me have a look.
Actually it's probably worth refactoring out the auto's and making uint64_t returns for stoull explicit, lemme do that
For some godforsaken reason, Windows insists that longs should be 32 bits wide, and Linux (I think) thinks they should be 64 bits wide. I'm currently running the picoscope SCPI bridge in a WSL instance, and glscopeclient on the Windows side. This is introducing crashes, as the picoscope bridge is happy to serialize a long > 32 bits max, but glscopeclient freaks out and crashes since this is above it's perceived max long value. Changing the SCPI parsing functions to use stoull should fix this, since all systems look like they agree that unsigned long long's are 64 bits wide.