refactor port.c. strict type casts.
refactor dict.c stritc type casts
change int to size_t