[fix] Remove some warnings for ignored const qualifiers
[fix] TTYget must return a signed int to be able to return EOF
[fix] prevent signed vs unsigned comparison