[Client] Get rid of the last indent tabs

This commit is contained in:
Matteo Cypriani 2011-02-24 14:54:31 +01:00
parent bbe43536ad
commit 7139be3070
1 changed files with 60 additions and 60 deletions

View File

@ -113,49 +113,49 @@ void parse_main_options(int argc, char **argv)
while ((opt = getopt(argc, argv, OPTIONS)) != -1)
{
switch (opt)
{
case 'd' :
strncpy(options.dest_ip, optarg, 16) ;
break ;
{
case 'd' :
strncpy(options.dest_ip, optarg, 16) ;
break ;
case 'h' :
print_usage() ;
exit(0) ;
case 'i' :
strncpy(options.iface, optarg, IFNAMSIZ + 1) ;
break ;
case 'l' :
case 'i' :
strncpy(options.iface, optarg, IFNAMSIZ + 1) ;
break ;
case 'l' :
/* Facultative getopt options does not handle separated
* values (like -l <port>) */
if (optarg == 0)
{
if (optarg == 0)
{
/* If we are at the end of the string, or the next optind
* is an option, we have -l without a port number */
if (argv[optind] == NULL || argv[optind][0] == '-')
if (argv[optind] == NULL || argv[optind][0] == '-')
// Take the default value:
options.listening_port = MOBILE_DEFAULT_PORT ;
else
{
options.listening_port = MOBILE_DEFAULT_PORT ;
else
{
// Take the optind value:
options.listening_port = strtol(argv[optind], NULL, 0) ;
optind++ ;
}
}
else // We got an option like -l<port>, it's OK
options.listening_port = strtol(optarg, NULL, 0) ;
break ;
case 'n' :
options.nb_pkt = strtol(optarg, NULL, 0) ;
break ;
case 'p' :
options.dest_port = strtol(optarg, NULL, 0) ;
break ;
case 't' :
options.delay = strtol(optarg, NULL, 0) ;
break ;
default :
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
options.listening_port = strtol(argv[optind], NULL, 0) ;
optind++ ;
}
}
else // We got an option like -l<port>, it's OK
options.listening_port = strtol(optarg, NULL, 0) ;
break ;
case 'n' :
options.nb_pkt = strtol(optarg, NULL, 0) ;
break ;
case 'p' :
options.dest_port = strtol(optarg, NULL, 0) ;
break ;
case 't' :
options.delay = strtol(optarg, NULL, 0) ;
break ;
default :
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
}
}
@ -181,18 +181,18 @@ void parse_calibration_data(int argc, char **argv)
if (argc - optind != 0)
{
if (argc - optind == 4)
{
is_calibration_request = TRUE ;
options.direction = strtol(argv[optind++], NULL, 0) ;
options.x = strtod(argv[optind++], NULL) ;
options.y = strtod(argv[optind++], NULL) ;
options.z = strtod(argv[optind], NULL) ;
}
{
is_calibration_request = TRUE ;
options.direction = strtol(argv[optind++], NULL, 0) ;
options.x = strtod(argv[optind++], NULL) ;
options.y = strtod(argv[optind++], NULL) ;
options.z = strtod(argv[optind], NULL) ;
}
else // Bad number of arguments
{
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
{
print_usage() ;
exit(ERR_BAD_USAGE) ;
}
}
}
@ -208,9 +208,9 @@ void check_configuration()
"Warning! delay: failing back to default value.\n") ;
#endif // DEBUG
if (is_calibration_request)
options.delay = DEFAULT_DELAY_CALIB ;
options.delay = DEFAULT_DELAY_CALIB ;
else
options.delay = DEFAULT_DELAY_NORMAL ;
options.delay = DEFAULT_DELAY_NORMAL ;
}
// Number of packet not specified (or bad number)
@ -221,9 +221,9 @@ void check_configuration()
"Warning! nb_pkt: failing back to default value.\n") ;
#endif // DEBUG
if (is_calibration_request)
options.nb_pkt = DEFAULT_NBPKT_CALIB ;
options.nb_pkt = DEFAULT_NBPKT_CALIB ;
else
options.nb_pkt = DEFAULT_NBPKT_NORMAL ;
options.nb_pkt = DEFAULT_NBPKT_NORMAL ;
}
// We want to send a calibration request AND to be located, which is
@ -255,17 +255,17 @@ void print_configuration()
"\tY: %f\n"
"\tZ: %f\n"
,
options.dest_ip,
options.dest_port,
options.iface,
options.delay,
options.nb_pkt,
options.listening_port,
options.direction,
options.x,
options.y,
options.z
) ;
options.dest_ip,
options.dest_port,
options.iface,
options.delay,
options.nb_pkt,
options.listening_port,
options.direction,
options.x,
options.y,
options.z
) ;
}
#endif // DEBUG