Fix warinings for the curses UI

This PR aims to solve the warninigs for the curses part.
Note that this PR does not intend to fix 64-bit related warnings. These will be followed up with another PR.