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