From 0614b52219d9519a34d9b47f308e7a079e44b1fd Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 15 May 2013 15:46:13 -0400 Subject: [PATCH] [lib] Stop defining owl_bool (use stdbool.h) We don't define our own boolean type in owlps.h any more: bool (from stdbool.h) is used instead. --- TODO.t2t | 2 - .../owlps-resultreader-udp.c | 2 +- libowlps/libowlps.c | 20 ++--- libowlps/owlps.h | 24 +++--- owlps-aggregator/owlps-aggregatord.c | 26 +++--- owlps-client/owlps-client.c | 14 +-- owlps-listener/owlps-listener.h | 14 +-- owlps-listener/owlps-listenerd.c | 86 +++++++++---------- owlps-positioner/src/owlps-positionerd.cc | 2 +- owlps-positioner/src/userinterface.cc | 4 +- owlps-udp-to-http/owlps-udp-to-http.c | 8 +- 11 files changed, 100 insertions(+), 102 deletions(-) diff --git a/TODO.t2t b/TODO.t2t index e9f37a9..ec2ccfd 100644 --- a/TODO.t2t +++ b/TODO.t2t @@ -91,8 +91,6 @@ Work to do in OwlPS = libowlps = -- Use stdbool.h instead of #define owl_bool. - - Currently unused functions: - owl_timestamp_is_null() diff --git a/libowlps-resultreader/owlps-resultreader-udp.c b/libowlps-resultreader/owlps-resultreader-udp.c index 17348b6..915c29b 100644 --- a/libowlps-resultreader/owlps-resultreader-udp.c +++ b/libowlps-resultreader/owlps-resultreader-udp.c @@ -71,7 +71,7 @@ int main(void) return 1 ; /* Read loop */ - owl_run = owl_true ; + owl_run = true ; while (owl_run) { if (! (result = owl_receive_position(sockfd))) diff --git a/libowlps/libowlps.c b/libowlps/libowlps.c index a393a8e..8e4da46 100644 --- a/libowlps/libowlps.c +++ b/libowlps/libowlps.c @@ -58,7 +58,7 @@ -owl_bool owl_run = owl_true ; +bool owl_run = true ; @@ -96,16 +96,16 @@ void owl_mac_bytes_to_string_r(const uint8_t *const mac_binary, /* * Compares two MAC addresses. - * Returns owl_true if they are identical, owl_false otherwise. + * Returns true if they are identical, false otherwise. */ -owl_bool owl_mac_equals(const uint8_t *const mac1, - const uint8_t *const mac2) +bool owl_mac_equals(const uint8_t *const mac1, + const uint8_t *const mac2) { int i ; for (i = ETHER_ADDR_LEN - 1 ; i >= 0 ; --i) if(mac1[i] != mac2[i]) - return owl_false ; - return owl_true ; + return false ; + return true ; } @@ -263,8 +263,8 @@ void owl_timeval_to_timestamp(const struct timeval *const src, } -owl_bool owl_timestamp_equals(const owl_timestamp *const d1, - const owl_timestamp *const d2) +bool owl_timestamp_equals(const owl_timestamp *const d1, + const owl_timestamp *const d2) { assert(d1) ; assert(d2) ; @@ -272,7 +272,7 @@ owl_bool owl_timestamp_equals(const owl_timestamp *const d1, } -owl_bool owl_timestamp_is_null(const owl_timestamp *const d) +bool owl_timestamp_is_null(const owl_timestamp *const d) { assert(d) ; return d->tv_sec == 0 && d->tv_nsec == 0 ; @@ -524,7 +524,7 @@ void owl_sigint_handler(const int num) exit(OWL_ERR_BAD_SIGNAL) ; } - owl_run = owl_false ; + owl_run = false ; #ifndef NDEBUG fprintf(stderr, "\nSignal received: end.\n"); diff --git a/libowlps/owlps.h b/libowlps/owlps.h index a9f5e34..c3d88d1 100644 --- a/libowlps/owlps.h +++ b/libowlps/owlps.h @@ -51,7 +51,7 @@ extern "C" { #include // We'll use with C++ 0x - +#include #include #include #include @@ -75,11 +75,6 @@ extern "C" { #define OWL_DEFAULT_RESULT_PORT 9910 -/* Boolean type */ -typedef enum {owl_false, owl_true} owl_bool ; -#define OWL_BOOL_TO_STRING(B) ((B) ? "true" : "false") - - /* Direction type */ enum {owl_north = 1, owl_east, owl_south, owl_west} ; #define OWL_DIRECTION_MIN 1 @@ -217,7 +212,7 @@ typedef struct _owl_autocalibration_order /* Global variables */ // Used to handle end of loops: -extern owl_bool owl_run ; +extern bool owl_run ; /* Error codes */ @@ -247,13 +242,18 @@ extern owl_bool owl_run ; #define OWL_ERR_IFACE_MODE_SET 132 +/* Macros */ +// Converts a bool to the corresponding string +#define OWL_BOOL_TO_STRING(B) ((B) ? "true" : "false") + + /* Function headers */ // Misc const char* owl_mac_bytes_to_string(const uint8_t *const mac_binary) ; void owl_mac_bytes_to_string_r(const uint8_t *const mac_binary, char mac_str[OWL_ETHER_ADDR_STRLEN]) ; -owl_bool owl_mac_equals(const uint8_t *const mac1, - const uint8_t *const mac2) ; +bool owl_mac_equals(const uint8_t *const mac1, + const uint8_t *const mac2) ; uint_fast8_t owl_frequency_to_channel(const uint_fast16_t channel) ; // Time @@ -263,9 +263,9 @@ void owl_timespec_to_timestamp(const struct timespec *const src, owl_timestamp *const dst) ; void owl_timeval_to_timestamp(const struct timeval *const src, owl_timestamp *const dst) ; -owl_bool owl_timestamp_equals(const owl_timestamp *const d1, - const owl_timestamp *const d2) ; -owl_bool owl_timestamp_is_null(const owl_timestamp *const d) ; +bool owl_timestamp_equals(const owl_timestamp *const d1, + const owl_timestamp *const d2) ; +bool owl_timestamp_is_null(const owl_timestamp *const d) ; uint64_t owl_timestamp_to_ms(const owl_timestamp *const d) ; void owl_timestamp_to_string(const owl_timestamp *const src, char *const dst) ; diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 66d7ffa..d7778e8 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -84,7 +84,7 @@ int main(int argc, char **argv) uint_fast16_t listening_port ; int sockfd = -1 ; // UDP listening socket - owl_run = owl_true ; + owl_run = true ; program_name = argv[0] ; ret = initialise_configuration(argc, argv) ; @@ -298,18 +298,18 @@ int parse_config_file(int argc, char **argv) if (! config_file) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return errno ; } strcpy(config_file, optarg) ; break ; case 'h' : print_usage() ; - owl_run = owl_false ; + owl_run = false ; return EXIT_SUCCESS ; case 'V' : print_version() ; - owl_run = owl_false ; + owl_run = false ; return EXIT_SUCCESS ; } } @@ -322,7 +322,7 @@ int parse_config_file(int argc, char **argv) if (! config_file) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return errno ; } strcpy(config_file, DEFAULT_CONFIG_FILE) ; @@ -342,7 +342,7 @@ int parse_config_file(int argc, char **argv) "Error! Parsing of configuration file \"%s\" failed!\n", config_file) ; free(config_file) ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_CONFIG_FILE ; } free(config_file) ; @@ -415,7 +415,7 @@ int parse_command_line(int argc, char **argv) break ; default : print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } } @@ -431,7 +431,7 @@ int check_configuration() { fprintf(stderr, "Error! You must specify an output file.\n") ; print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } @@ -461,7 +461,7 @@ int check_configuration() fprintf(stderr, "Error! You must specify the IP address of the" " localisation server.\n") ; print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } @@ -836,7 +836,7 @@ void got_request(owl_captured_request request) if (! tmp_info) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return ; } @@ -860,7 +860,7 @@ void got_request(owl_captured_request request) if (! tmp_request) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; goto end ; } tmp_request->type = request.type ; @@ -929,7 +929,7 @@ void got_request(owl_captured_request request) if (! tmp_request) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; goto end ; } tmp_request->type = request.type ; @@ -1127,7 +1127,7 @@ ap_list* add_ap_front(uint8_t mac_addr_bytes[ETHER_ADDR_LEN]) if (! ap) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return NULL ; } memcpy(ap->mac_addr_bytes, mac_addr_bytes, ETHER_ADDR_LEN) ; diff --git a/owlps-client/owlps-client.c b/owlps-client/owlps-client.c index 092105c..1c736df 100644 --- a/owlps-client/owlps-client.c +++ b/owlps-client/owlps-client.c @@ -100,7 +100,7 @@ void print_version(void) ; /* Options */ struct { - owl_bool daemon ; + bool daemon ; char dest_ip[INET_ADDRSTRLEN] ; // Destination IP of the packets uint_fast16_t dest_port ; char iface[IFNAMSIZ + 1] ; // Source network interface @@ -116,7 +116,7 @@ struct { float y ; float z ; } options = { - owl_false, // daemon + false, // daemon "", // dest_ip OWL_DEFAULT_REQUEST_PORT, // dest_port "", // iface @@ -131,9 +131,9 @@ struct { char *program_name = NULL ; -// owl_true if the packet is a calibration request, owl_false if it is +// true if the packet is a calibration request, false if it is // a simple positioning request: -owl_bool is_calibration_request = owl_false ; +bool is_calibration_request = false ; int sockfd ; // Sending socket descriptor struct sockaddr_in server ; // Server info @@ -218,7 +218,7 @@ void parse_main_options(int argc, char **argv) switch (opt) { case 'D' : - options.daemon = owl_true ; + options.daemon = true ; break ; case 'F' : /* Facultative getopt options do not handle separated values @@ -327,7 +327,7 @@ void parse_calibration_data(int argc, char **argv) { if (argc - optind == 4) { - is_calibration_request = owl_true ; + is_calibration_request = true ; options.direction = strtoul(argv[optind++], NULL, 0) ; options.x = strtod(argv[optind++], NULL) ; options.y = strtod(argv[optind++], NULL) ; @@ -449,7 +449,7 @@ void check_configuration() " the foreground if the flood mode is not activated" " Option -D ignored.\n") ; #endif // DEBUG - options.daemon = owl_false ; + options.daemon = false ; } } } diff --git a/owlps-listener/owlps-listener.h b/owlps-listener/owlps-listener.h index 96c2c72..8b8c1af 100644 --- a/owlps-listener/owlps-listener.h +++ b/owlps-listener/owlps-listener.h @@ -234,7 +234,7 @@ void extract_packet_numbers(const u_char *pkt_data, owl_captured_request *request) ; void extract_radiotap_data(const u_char *pkt_data, owl_captured_request *request, - owl_bool rtap_fields[15]) ; + bool rtap_fields[15]) ; uint_fast16_t nat_align(uint_fast16_t offset, uint_fast8_t field_len) ; void get_mac_addr(char *eth, uint8_t mac_bytes[ETHER_ADDR_LEN]) ; void get_ip_addr(char *eth, char *ip_bytes) ; @@ -365,9 +365,9 @@ void print_version(void) ; /* Home-made structure macros */ #else // USE_CONFIG_FILE #define SET_DAEMON() \ - (options.daemon = owl_true) + (options.daemon = true) #define UNSET_DAEMON() \ - (options.daemon = owl_false) + (options.daemon = false) #define GET_DAEMON() \ (options.daemon) #define SET_MODE(MODE) \ @@ -380,9 +380,9 @@ void print_version(void) ; (options.aggregation_ip) #ifdef ENABLE_KEEP_MONITOR #define SET_KEEP_MONITOR() \ - (options.keep_monitor = owl_true) + (options.keep_monitor = true) #define UNSET_KEEP_MONITOR() \ - (options.keep_monitor = owl_false) + (options.keep_monitor = false) #define GET_KEEP_MONITOR() \ (options.keep_monitor) #endif // ENABLE_KEEP_MONITOR @@ -416,9 +416,9 @@ void print_version(void) ; #ifdef USE_PTHREAD #define SET_AUTOCALIBRATION() \ - (options.autocalibration = owl_true) + (options.autocalibration = true) #define UNSET_AUTOCALIBRATION() \ - (options.autocalibration = owl_false) + (options.autocalibration = false) #define GET_AUTOCALIBRATION() \ (options.autocalibration) #define SET_AUTOCALIBRATION_IP(IP) \ diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index a541087..d899265 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -88,8 +88,8 @@ struct sockaddr_in aggregation_server ; #ifdef USE_PTHREAD int autocalibration_send_sockfd ; struct sockaddr_in autocalibration_send_server ; -// owl_true if the coordinates of the listener were provided by the user: -owl_bool coordinates_provided = owl_false ; +// true if the coordinates of the listener were provided by the user: +bool coordinates_provided = false ; #endif // USE_PTHREAD #ifdef USE_CONFIG_FILE @@ -100,19 +100,19 @@ cfg_t *cfg = NULL ; // Configuration structure * options. */ struct { - owl_bool daemon ; + bool daemon ; char mode ; char aggregation_ip[INET_ADDRSTRLEN] ; uint_fast16_t aggregation_port ; uint_fast16_t listening_port ; #ifdef ENABLE_KEEP_MONITOR - owl_bool keep_monitor ; + bool keep_monitor ; #endif // ENABLE_KEEP_MONITOR char rtap_iface[IFNAMSIZ + 1] ; char *pcap_file ; char wifi_iface[IFNAMSIZ + 1] ; #ifdef USE_PTHREAD - owl_bool autocalibration ; + bool autocalibration ; char autocalibration_ip[INET_ADDRSTRLEN] ; uint_fast16_t autocalibration_request_port ; uint_fast16_t autocalibration_order_port ; @@ -127,19 +127,19 @@ struct { #endif // USE_PTHREAD uint_fast8_t verbose ; } options = { // Initalise default options: - owl_false, // daemon + false, // daemon MODE_ACTIVE, // mode "127.0.0.1", // aggregation_ip OWL_DEFAULT_LISTENER_PORT, // aggregation_port OWL_DEFAULT_REQUEST_PORT, // listening_port #ifdef ENABLE_KEEP_MONITOR - owl_false, // keep_monitor + false, // keep_monitor #endif // ENABLE_KEEP_MONITOR "", // rtap_iface NULL, // pcap_file "", // wifi_iface #ifdef USE_PTHREAD - owl_false, // autocalibration + false, // autocalibration "", // autocalibration_ip 0, // autocalibration_request_port OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT, // autocalibration_order_port @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) pthread_t keep_monitor_thread ; #endif // ENABLE_KEEP_MONITOR - owl_run = owl_true ; + owl_run = true ; program_name = argv[0] ; ret = initialise_configuration(argc, argv) ; @@ -425,7 +425,7 @@ int parse_config_file(int argc, char **argv) if (! config_file) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return errno ; } strcpy(config_file, optarg) ; @@ -438,11 +438,11 @@ int parse_config_file(int argc, char **argv) break ; case 'h' : print_usage() ; - owl_run = owl_false ; + owl_run = false ; return EXIT_SUCCESS ; case 'V' : print_version() ; - owl_run = owl_false ; + owl_run = false ; return EXIT_SUCCESS ; } } @@ -456,7 +456,7 @@ int parse_config_file(int argc, char **argv) if (! config_file) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return errno ; } strcpy(config_file, DEFAULT_CONFIG_FILE) ; @@ -476,7 +476,7 @@ int parse_config_file(int argc, char **argv) "Error! Parsing of configuration file \"%s\" failed!\n", config_file) ; free(config_file) ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_CONFIG_FILE ; } free(config_file) ; @@ -605,7 +605,7 @@ int parse_main_options(int argc, char **argv) break ; default : print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } } @@ -623,7 +623,7 @@ int parse_calibration_data(int argc, char **argv) { if (argc - optind == 4) { - coordinates_provided = owl_true ; + coordinates_provided = true ; SET_MY_DIRECTION(strtoul(argv[optind++], NULL, 0)) ; SET_MY_POSITION_X(strtod(argv[optind++], NULL)) ; SET_MY_POSITION_Y(strtod(argv[optind++], NULL)) ; @@ -632,7 +632,7 @@ int parse_calibration_data(int argc, char **argv) else // Bad number of arguments { print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } } @@ -655,7 +655,7 @@ int check_configuration() default : fprintf(stderr, "Error! Unknown mode \"%c\".\n", (char) GET_MODE()) ; print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } @@ -704,7 +704,7 @@ int check_configuration() fprintf(stderr, "Error! You must specify either a radiotap" " interface or a pcap file to read packets from.\n") ; print_usage() ; - owl_run = owl_false ; + owl_run = false ; return OWL_ERR_BAD_USAGE ; } @@ -953,7 +953,7 @@ int capture() case 0: // timeout reached break ; case -2: // no more packet to read from input file - owl_run = owl_false ; + owl_run = false ; break ; case -1: // an error occured pcap_perror(capture_handler, "Error during capture") ; @@ -977,7 +977,7 @@ void read_packet(const struct pcap_pkthdr *pkt_header, owl_captured_request request ; // Message to send to the aggregator uint16_t rtap_bytes ; // Radiotap header size uint_fast16_t offset ; // Offset to read the packet - owl_bool rtap_fields[15] ; // Present flags + bool rtap_fields[15] ; // Present flags uint8_t raw_packet_fc1 ; // First byte of the received frame's FC uint8_t raw_packet_fc2 ; // Second byte of the received frame's FC // Size of the IEEE 802.11 header: @@ -989,9 +989,9 @@ void read_packet(const struct pcap_pkthdr *pkt_header, struct udphdr *packet_udp_header = NULL ; // Localisation request type (request, calibration, autocalibration): // Is the packet an explicit request? - owl_bool is_explicit_packet = owl_true ; + bool is_explicit_packet = true ; // Is the packet an autocalibration positioning request? - owl_bool uses_autocalibration_request_port = owl_false ; + bool uses_autocalibration_request_port = false ; ssize_t nsent ; // sendto return value // Blank the request: @@ -1064,7 +1064,7 @@ void read_packet(const struct pcap_pkthdr *pkt_header, #ifdef USE_PTHREAD if (GET_AUTOCALIBRATION() && dest_port == (uint_fast16_t) GET_AUTOCALIBRATION_REQUEST_PORT()) - uses_autocalibration_request_port = owl_true ; + uses_autocalibration_request_port = true ; else #endif // USE_PTHREAD if (dest_port != (uint_fast16_t) GET_LISTENING_PORT()) @@ -1076,7 +1076,7 @@ void read_packet(const struct pcap_pkthdr *pkt_header, not_explicit_packet : if (GET_MODE() == MODE_ACTIVE) return ; - is_explicit_packet = owl_false ; + is_explicit_packet = false ; process_packet : @@ -1281,11 +1281,11 @@ void extract_packet_numbers(const u_char *pkt_data, /* * Fills 'request' with the required data extracted from the Radiotap * header of 'pkt_data'. The elements of 'rtap_fields' are set to - * owl_true when the corresponding Radiotap flag is found in the packet. + * true when the corresponding Radiotap flag is found in the packet. */ void extract_radiotap_data(const u_char *pkt_data, owl_captured_request *request, - owl_bool rtap_fields[15]) + bool rtap_fields[15]) { uint32_t rtap_presentflags ; uint_fast16_t rtap_position ; @@ -1298,7 +1298,7 @@ void extract_radiotap_data(const u_char *pkt_data, rtap_presentflags = le32toh(rtap_presentflags) ; for (i = 0 ; i < 15 ; ++i) // Initialise present flags structure - rtap_fields[i] = owl_false ; + rtap_fields[i] = false ; rtap_position = 8 ; // Begining of the present flags determined fields // Test the first 15 bits of the flag field in order to check their @@ -1310,19 +1310,19 @@ void extract_radiotap_data(const u_char *pkt_data, switch(i) { case RTAP_MACTS: - rtap_fields[RTAP_MACTS] = owl_true ; + rtap_fields[RTAP_MACTS] = true ; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_MACTS) ; break ; case RTAP_FLAGS: - rtap_fields[RTAP_FLAGS] = owl_true; + rtap_fields[RTAP_FLAGS] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_FLAGS) ; break ; case RTAP_RATE: - rtap_fields[RTAP_RATE] = owl_true; + rtap_fields[RTAP_RATE] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_RATE) ; break ; case RTAP_CHANNEL: - rtap_fields[RTAP_CHANNEL] = owl_true ; + rtap_fields[RTAP_CHANNEL] = true ; // The channel field is actually two fields that must be // aligned independently rtap_position += SKIP_FIELD(rtap_position, RTAP_L_CHANNEL) ; @@ -1330,11 +1330,11 @@ void extract_radiotap_data(const u_char *pkt_data, RTAP_L_CHANNELTYPE) ; break ; case RTAP_FHSS: - rtap_fields[RTAP_FHSS] = owl_true; + rtap_fields[RTAP_FHSS] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_FHSS) ; break ; case RTAP_ANTENNASIGNALDBM: - rtap_fields[RTAP_ANTENNASIGNALDBM] = owl_true ; + rtap_fields[RTAP_ANTENNASIGNALDBM] = true ; rtap_position += nat_align(rtap_position, RTAP_L_ANTENNASIGNALDBM) ; memcpy(&request->ss_dbm, @@ -1344,46 +1344,46 @@ void extract_radiotap_data(const u_char *pkt_data, rtap_position += RTAP_L_ANTENNASIGNALDBM ; break ; case RTAP_ANTENNANOISEDBM: - rtap_fields[RTAP_ANTENNANOISEDBM] = owl_true; + rtap_fields[RTAP_ANTENNANOISEDBM] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_ANTENNANOISEDBM) ; break ; case RTAP_LOCKQUALITY: - rtap_fields[RTAP_LOCKQUALITY] = owl_true; + rtap_fields[RTAP_LOCKQUALITY] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_LOCKQUALITY) ; break ; case RTAP_TXATTENUATION: - rtap_fields[RTAP_TXATTENUATION] = owl_true; + rtap_fields[RTAP_TXATTENUATION] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_TXATTENUATION) ; break ; case RTAP_TXATTENUATIONDB: - rtap_fields[RTAP_TXATTENUATIONDB] = owl_true; + rtap_fields[RTAP_TXATTENUATIONDB] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_TXATTENUATIONDB) ; break ; case RTAP_TXATTENUATIONDBM: - rtap_fields[RTAP_TXATTENUATIONDBM] = owl_true; + rtap_fields[RTAP_TXATTENUATIONDBM] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_TXATTENUATIONDBM) ; break ; case RTAP_ANTENNA: - rtap_fields[RTAP_ANTENNA] = owl_true; + rtap_fields[RTAP_ANTENNA] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_ANTENNA) ; break ; case RTAP_ANTENNASIGNALDB: - rtap_fields[RTAP_ANTENNASIGNALDB] = owl_true; + rtap_fields[RTAP_ANTENNASIGNALDB] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_ANTENNASIGNALDB) ; break ; case RTAP_ANTENNANOISEDB: - rtap_fields[RTAP_ANTENNANOISEDB] = owl_true; + rtap_fields[RTAP_ANTENNANOISEDB] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_ANTENNANOISEDB) ; break ; case RTAP_FCS: - rtap_fields[RTAP_FCS] = owl_true; + rtap_fields[RTAP_FCS] = true; rtap_position += SKIP_FIELD(rtap_position, RTAP_L_FCS) ; break ; default: diff --git a/owlps-positioner/src/owlps-positionerd.cc b/owlps-positioner/src/owlps-positionerd.cc index e43d725..37651ef 100644 --- a/owlps-positioner/src/owlps-positionerd.cc +++ b/owlps-positioner/src/owlps-positionerd.cc @@ -58,7 +58,7 @@ using namespace std ; int main(int argc, char **argv) { - owl_run = owl_true ; + owl_run = true ; /* Read options & configuration */ delete new UserInterface(argc, argv) ; diff --git a/owlps-positioner/src/userinterface.cc b/owlps-positioner/src/userinterface.cc index d847182..3e85af9 100644 --- a/owlps-positioner/src/userinterface.cc +++ b/owlps-positioner/src/userinterface.cc @@ -435,14 +435,14 @@ void UserInterface::print_information() const "unknown version" #endif // OWLPS_VERSION << ".\n" ; - owl_run = owl_false ; // Tell main() to exit + owl_run = false ; // Tell main() to exit } // Print usage if requested if (Configuration::is_configured("help")) { cout << *cli_options ; - owl_run = owl_false ; // Tell main() to exit + owl_run = false ; // Tell main() to exit } } diff --git a/owlps-udp-to-http/owlps-udp-to-http.c b/owlps-udp-to-http/owlps-udp-to-http.c index da20be7..ea942bf 100644 --- a/owlps-udp-to-http/owlps-udp-to-http.c +++ b/owlps-udp-to-http/owlps-udp-to-http.c @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) pthread_t tcp_server_thread ; program_name = argv[0] ; - owl_run = owl_true ; + owl_run = true ; if (argc > 1) fprintf(stderr, @@ -228,7 +228,7 @@ void store_result(owl_result *new_result) if (! results) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; goto end ; } ++nb_results ; @@ -256,7 +256,7 @@ void store_result(owl_result *new_result) if (! res) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; goto end ; } ++nb_results ; @@ -329,7 +329,7 @@ void* tcp_server(void *NULL_value) if (! answer_buflen) { perror("Cannot allocate memory") ; - owl_run = owl_false ; + owl_run = false ; return NULL ; } strncpy(answer, ANSWER_HDR, ANSWER_HDR_STRLEN) ;