1
0
Fork 0
forked from Miroirs/x49gp

formatting

This commit is contained in:
Gwenhael Le Moine 2024-10-23 12:41:43 +02:00
parent 6fe6c501b0
commit b5f7f5dfde
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -259,7 +259,7 @@ static void config_init( char* progname, int argc, char* argv[] )
struct option long_options[] = { struct option long_options[] = {
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"config", required_argument, NULL, 'c'}, {"config", required_argument, NULL, 'c'},
{"enable-debug", required_argument, NULL, 'D'}, {"enable-debug", required_argument, NULL, 'D'},
{"debug", no_argument, NULL, 'd'}, {"debug", no_argument, NULL, 'd'},
@ -277,35 +277,24 @@ static void config_init( char* progname, int argc, char* argv[] )
case 'h': case 'h':
fprintf( stderr, fprintf( stderr,
"%s %i.%i.%i Emulator for HP 49G+ / 50G calculators\n" "%s %i.%i.%i Emulator for HP 49G+ / 50G calculators\n"
"Usage: %s [<options>] [<config-file>]\n" "Usage: %s [<options>]\n"
"Valid options:\n" "Valid options:\n"
" -c, --config[=<filename>] alternate config file\n" " -c --config[=<filename>] alternate config file\n"
" -D, --enable-debug[=<port>] enable the debugger interface\n" " -D --enable-debug[=<port>] enable the debugger interface\n"
" (default port: %u)\n" " (default port: %u)\n"
" -d, --debug use along -D to also start the" " -d --debug use along -D to also start the debugger immediately\n"
" debugger immediately\n" " -f --reflash[=firmware] rebuild the flash using the supplied firmware\n"
" -f, --reflash[=firmware] rebuild the flash using the" " (default: select one interactively)\n"
" supplied firmware\n" " (implies -r for safety reasons)\n"
" (default: select one" " -F --reflash-full use along -f to drop the flash contents\n"
" interactively)\n" " in the area beyond the firmware\n"
" (implies -r for safety" " -r --reboot reboot on startup instead of continuing from the\n"
" reasons)\n" " saved state in the config file\n"
" -F, --reflash-full use along -f to drop the" " -h --help print this message and exit\n"
" flash contents\n" "The config file is formatted as INI file and contains the settings for which\n"
" in the area beyond the" " persistence makes sense, like calculator model, CPU registers, etc.\n"
" firmware\n"
" -r, --reboot reboot on startup instead of"
" continuing from the\n"
" saved state in the config"
" file\n"
" -h, --help print this message and exit\n"
"The config file is formatted as INI file and contains the"
" settings for which\n"
"persistence makes sense, like calculator model, CPU"
" registers, etc.\n"
"If the config file is omitted, ~/.config/%s/config is used.\n" "If the config file is omitted, ~/.config/%s/config is used.\n"
"Please consult the manual for more details on config file" "Please consult the manual for more details on config file settings.\n",
" settings.\n",
progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, progname, DEFAULT_GDBSTUB_PORT, progname ); progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, progname, DEFAULT_GDBSTUB_PORT, progname );
exit( EXIT_SUCCESS ); exit( EXIT_SUCCESS );
break; break;
@ -333,8 +322,7 @@ static void config_init( char* progname, int argc, char* argv[] )
if ( opt.debug_port != 0 && opt.debug_port != DEFAULT_GDBSTUB_PORT ) if ( opt.debug_port != 0 && opt.debug_port != DEFAULT_GDBSTUB_PORT )
fprintf( stderr, fprintf( stderr,
"Additional debug port \"%s\" specified," "Additional debug port \"%s\" specified, overriding\n",
" overriding\n",
optarg ); optarg );
opt.debug_port = port; opt.debug_port = port;
} }
@ -393,7 +381,7 @@ int main( int argc, char** argv )
x49gp = malloc( sizeof( x49gp_t ) ); x49gp = malloc( sizeof( x49gp_t ) );
if ( NULL == x49gp ) { if ( NULL == x49gp ) {
fprintf( stderr, "%s: %s:%u: Out of memory\n", progname, __FUNCTION__, __LINE__ ); fprintf( stderr, "%s: %s:%u: Out of memory\n", progname, __FUNCTION__, __LINE__ );
exit( 1 ); exit( EXIT_FAILURE );
} }
memset( x49gp, 0, sizeof( x49gp_t ) ); memset( x49gp, 0, sizeof( x49gp_t ) );