Further adjust "snprintf" integer types, etc.

Made additional changes to integer types in calls to "snprintf" and
reverted "get_upgrade_cost" back to its previous return type (int32_t).