Closed tobiolo closed 2 months ago
Something being never negative is a bad reason for using unsigned
in C++. You make code more brittle since there are lots of subtle code patterns where substracting can now wrap (which usually has worse results than being negative). Also mixing signed and unsigned can produce subtle issues. Best is to simply use signed everywhere.
Thanks for your explanation! I came to the same conclusion then, but not with the perspective of the wrap in substraction cases. Thanks for having pointed out! Best to learn the basic Computer Science stuff the hard way, a good motivation for the theoretical stuff. Thank you 🙏 for the feedback! Have a nice day over in America!
Use uint8_t.
wxDataOutputStream::Write8(wxUint8)
andwxDataInputStream::Read8
also uses only unsigned integers.