4 ms·
The ScaleWindowExtEx example certainly has no legitimate reason to accept signed ints. Personally, the bug I introduce most often with signed ints is a failure
by ridiculous_fish 11y ago
The ScaleWindowExtEx example certainly has no legitimate reason to accept signed ints.
Personally, the bug I introduce most often with signed ints is a failure to range-check for negative values, e.g.:
void *get(int idx) { assert(idx <= arr.size(); return arr[idx]; }
- SamReidHughes 11y agoThe "legitimate reason" is that it's scaling a signed value, that has meaning when negative. > void *get(int idx) { assert(idx <= arr.size(); return arr[idx]; } You got problems there even if idx and arr.size() are unsigned.
- deleted 11y ago[deleted]