From de742131028a5b26202c8ed647522b3d2ff6979e Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Thu, 18 Aug 2011 14:02:17 +0200 Subject: [PATCH] [lib] Rename OWL_TIMESTAMP_STR_LEN OWL_TIMESTAMP_STRLEN --- libowlps/libowlps.c | 4 ++-- libowlps/owlps.h | 2 +- owlps-aggregator/owlps-aggregatord.c | 10 +++++----- owlps-client/owlps-client.c | 2 +- owlps-listener/owlps-listenerd.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libowlps/libowlps.c b/libowlps/libowlps.c index aaa0881..9b0e1b8 100644 --- a/libowlps/libowlps.c +++ b/libowlps/libowlps.c @@ -200,12 +200,12 @@ uint64_t owl_timestamp_to_ms(const owl_timestamp d) /* * Converts a owl_timestamp date value into a printable string. - * 'dst' must be an allocated array of at least owl_timestamp_STR_LEN + * 'dst' must be an allocated array of at least OWL_TIMESTAMP_STRLEN * characters. */ void owl_timestamp_to_string(char *const dst, const owl_timestamp src) { - snprintf(dst, OWL_TIMESTAMP_STR_LEN, "%"PRIu32".%"PRIu32, + snprintf(dst, OWL_TIMESTAMP_STRLEN, "%"PRIu32".%"PRIu32, src.tv_sec, src.tv_nsec) ; } diff --git a/libowlps/owlps.h b/libowlps/owlps.h index 40bd0ba..7759248 100644 --- a/libowlps/owlps.h +++ b/libowlps/owlps.h @@ -53,7 +53,7 @@ typedef struct _owl_timestamp uint32_t tv_nsec ; } owl_timestamp ; // Length of a owl_timestamp when converted to string: -#define OWL_TIMESTAMP_STR_LEN 22 // 22 = 10 digits, '.', 10 digits, '\0' +#define OWL_TIMESTAMP_STRLEN 22 // 22 = 10 digits, '.', 10 digits, '\0' /* Message sent by the listener to the aggregator */ diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 7047e3f..efa9be5 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -422,8 +422,8 @@ int read_loop(int sockfd) char // Return values of mobile_ip_str[INET_ADDRSTRLEN], // inet_ntop() // and owl_timestamp_to_string(): - request_time_str[OWL_TIMESTAMP_STR_LEN], - start_time_str[OWL_TIMESTAMP_STR_LEN] ; + request_time_str[OWL_TIMESTAMP_STRLEN], + start_time_str[OWL_TIMESTAMP_STRLEN] ; while (owl_run) { @@ -506,7 +506,7 @@ void* monitor_requests(void *NULL_value) FILE *fd = NULL ; char mac_str[OWL_ETHER_ADDR_STRLEN] ; uint_fast32_t sub ; // owl_time_elapsed_ms() result - char request_time_str[OWL_TIMESTAMP_STR_LEN] ; + char request_time_str[OWL_TIMESTAMP_STRLEN] ; uint_fast32_t aggregate_timeout = cfg_getint(cfg, "aggregate_timeout") ; @@ -1191,8 +1191,8 @@ void print_request_list() request_info_list *info_ptr = NULL ; char mobile_mac_str[OWL_ETHER_ADDR_STRLEN] ; char - request_time_str[OWL_TIMESTAMP_STR_LEN], - start_time_str[OWL_TIMESTAMP_STR_LEN] ; + request_time_str[OWL_TIMESTAMP_STRLEN], + start_time_str[OWL_TIMESTAMP_STRLEN] ; sem_wait(&lock_requests) ; diff --git a/owlps-client/owlps-client.c b/owlps-client/owlps-client.c index 2fc95d0..95ca65d 100644 --- a/owlps-client/owlps-client.c +++ b/owlps-client/owlps-client.c @@ -373,7 +373,7 @@ void make_packet() { uint_fast16_t offset ; // Index used to create the packet owl_timestamp request_time ; - char request_time_str[OWL_TIMESTAMP_STR_LEN] ; + char request_time_str[OWL_TIMESTAMP_STRLEN] ; // Get the current time and copy it as a string before to switch it to // network endianess: diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 56e0033..4e0e8d9 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -977,8 +977,8 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header, if (GET_DISPLAY_CAPTURED()) { char - request_time_str[OWL_TIMESTAMP_STR_LEN], - start_time_str[OWL_TIMESTAMP_STR_LEN] ; + request_time_str[OWL_TIMESTAMP_STRLEN], + start_time_str[OWL_TIMESTAMP_STRLEN] ; owl_timestamp_to_string(request_time_str, owl_ntoh_timestamp(request.request_time)) ; owl_timestamp_to_string(start_time_str, @@ -1332,7 +1332,7 @@ uint_fast16_t make_packet(uint8_t **packet) if (VERBOSE_CHATTERBOX) { - char request_time_str[OWL_TIMESTAMP_STR_LEN] ; + char request_time_str[OWL_TIMESTAMP_STRLEN] ; owl_timestamp_to_string(request_time_str, request_time) ; printf("Autocalibration time: %s\n", request_time_str) ; }