The arguments to isxxxx() and family must give well-defined results.
In other words, it must either be EOF or a value representable by an unsigned char. Here we simply cast all the arguments to these functions to "unsigned char".
Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?
Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?
Possibly. However, EOF cannot be represented in an unsigned char, so if you need to test for EOF that needs to be done before the returned data is passed on. I've not looked at whether that would make the diff smaller or the code simpler.