r5870 broke compiling on linux/gcc as itoa is not present, this patch changes calls to itoa to sprintf which should achieve the same result:
Index: gui/climates.cc
===================================================================
--- gui/climates.cc (revision 5872)
+++ gui/climates.cc (working copy)
@@ -87,7 +87,7 @@
add_komponente( numberinput_lbl+labelnr );
labelnr++;
- itoa( sets->get_climate_borders()[arctic_climate], snowline_txt, 10 );
+ sprintf( snowline_txt ,"%d", sets->get_climate_borders()[arctic_climate] );
summer_snowline.init( NULL, koord( TEXT_RIGHT, y ), COL_WHITE, gui_label_t::right );
summer_snowline.set_text_pointer( snowline_txt );
add_komponente( &summer_snowline );
@@ -234,7 +234,7 @@
}
snowline_winter.set_limits( 0, arctic );
}
- itoa( sets->get_climate_borders()[arctic_climate], snowline_txt, 10 );
+ sprintf( snowline_txt ,"%d", sets->get_climate_borders()[arctic_climate] );
return true;
}
thank you!
itoa? What the heck, someone here has been poking around with AutoLISP besides me. :D
That function has been available on my first system, using K&R style C in 1991. Thus I assumed it was a standard function.
It is rather odd that C hasn't managed to get something as basic as conversion between numbers and text right. There are two (three if sscanf is counted) apparently standardized ways of going from text to number, but neither of them has a standardized inverse (only sprintf, which is the inverse of sscanf).