Mostly fix a portability problem in $rtoi (run time)
Mostly fix a portability problem in $rtoi (run time)

themperek/iverilog,themperek/iverilog,CastMi/iverilog,themperek/iverilog,CastMi/iverilog,CastMi/iverilog