But if you add a cast the warning goes away?
Code:
m_ptr->confused += 10 + (unsigned char)randint0(p_ptr->lev) / 5;
I notice you used (byte) in your alt version, which should work too I guess.
That's certainly very common; there are tons of standard functions that want a "const char*" and you can use a cast to eliminate those warnings if your parameter is really just a "char*".
But as for checking the value with your ternary operation, that will not matter to the compiler* one way or the other. It may be a good idea anyway, of course. But if you know the execution is such that data loss (or wrap-around) will actually be impossible, then it's totally unnecessary; technically plain old arithmetic could be used to wrap around int values too, but generally you don't need to check for that possibility.
* if you think about it you should be able to intuit why it CANNOT matter to the compiler, which is to say it can't issue a warning because you did or did not add an error checking routine. Although the warning may prompt you to write one, that will not change the warning...