From: Harlan Stenn Date: Sat, 28 Feb 2015 09:47:20 +0000 (+0000) Subject: [Bug 2757] Quiet compiler warnings. X-Git-Tag: NTP_4_3_3~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8593588caa1ffe5243c7d7f3f0e8b24512d3d169;p=thirdparty%2Fntp.git [Bug 2757] Quiet compiler warnings. bk: 54f18ea89e7kOyhRJf8qC19La7gxgA --- diff --git a/lib/isc/inet_ntop.c b/lib/isc/inet_ntop.c index 26d5dcad1..773018031 100644 --- a/lib/isc/inet_ntop.c +++ b/lib/isc/inet_ntop.c @@ -135,6 +135,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; + best.len = cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) diff --git a/lib/isc/log.c b/lib/isc/log.c index ce98303fe..38f0c4ff5 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -1143,7 +1143,7 @@ sync_channellist(isc_logconfig_t *lcfg) { static isc_result_t greatest_version(isc_logchannel_t *channel, int *greatestp) { /* XXXDCL HIGHLY NT */ - char *basename, *digit_end; + char *basenam, *digit_end; const char *dirname; int version, greatest = -1; unsigned int basenamelen; @@ -1160,23 +1160,23 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { * It is safe to DE_CONST the file.name because it was copied * with isc_mem_strdup in isc_log_createchannel. */ - basename = strrchr(FILE_NAME(channel), sep); + basenam = strrchr(FILE_NAME(channel), sep); #ifdef _WIN32 basename2 = strrchr(FILE_NAME(channel), '\\'); - if ((basename != NULL && basename2 != NULL && basename2 > basename) || - (basename == NULL && basename2 != NULL)) { - basename = basename2; + if ((basenam != NULL && basename2 != NULL && basename2 > basenam) || + (basenam == NULL && basename2 != NULL)) { + basenam = basename2; sep = '\\'; } #endif - if (basename != NULL) { - *basename++ = '\0'; + if (basenam != NULL) { + *basenam++ = '\0'; dirname = FILE_NAME(channel); } else { - DE_CONST(FILE_NAME(channel), basename); + DE_CONST(FILE_NAME(channel), basenam); dirname = "."; } - basenamelen = strlen(basename); + basenamelen = strlen(basenam); isc_dir_init(&dir); result = isc_dir_open(&dir, dirname); @@ -1184,8 +1184,8 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { /* * Replace the file separator if it was taken out. */ - if (basename != FILE_NAME(channel)) - *(basename - 1) = sep; + if (basenam != FILE_NAME(channel)) + *(basenam - 1) = sep; /* * Return if the directory open failed. @@ -1195,7 +1195,7 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { while (isc_dir_read(&dir) == ISC_R_SUCCESS) { if (dir.entry.length > basenamelen && - strncmp(dir.entry.name, basename, basenamelen) == 0 && + strncmp(dir.entry.name, basenam, basenamelen) == 0 && dir.entry.name[basenamelen] == '.') { version = strtol(&dir.entry.name[basenamelen + 1], diff --git a/ntpd/ntp_leapsec.c b/ntpd/ntp_leapsec.c index ec42a9740..eeef89f3c 100644 --- a/ntpd/ntp_leapsec.c +++ b/ntpd/ntp_leapsec.c @@ -787,7 +787,7 @@ leapsec_add( const vint64 * now64 , int insert) { - vint64 ttime, stime; + vint64 ttime, starttime; struct calendar fts; leap_info_t li; @@ -815,12 +815,12 @@ leapsec_add( fts.hour = 0; fts.minute = 0; fts.second = 0; - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); fts.month++; ttime = ntpcal_date_to_ntp64(&fts); li.ttime = ttime; - li.stime = ttime.D_s.lo - stime.D_s.lo; + li.stime = ttime.D_s.lo - starttime.D_s.lo; li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai) + (insert ? 1 : -1); li.dynls = 1; @@ -839,7 +839,7 @@ leapsec_raw( int taiof, int dynls) { - vint64 stime; + vint64 starttime; struct calendar fts; leap_info_t li; @@ -856,9 +856,9 @@ leapsec_raw( return FALSE; } fts.month--; /* was in range 1..12, no overflow here! */ - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); li.ttime = *ttime; - li.stime = ttime->D_s.lo - stime.D_s.lo; + li.stime = ttime->D_s.lo - starttime.D_s.lo; li.taiof = (int16_t)taiof; li.dynls = (dynls != 0); return add_range(pt, &li); diff --git a/parseutil/dcfd.c b/parseutil/dcfd.c index 0db94c0be..9bf384de1 100644 --- a/parseutil/dcfd.c +++ b/parseutil/dcfd.c @@ -219,9 +219,16 @@ typedef struct clocktime clocktime_t; /* * (usually) quick constant multiplications */ +#ifndef TIMES10 #define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1)) /* *8 + *2 */ +#endif +#ifndef TIMES24 #define TIMES24(_X_) (((_X_) << 4) + ((_X_) << 3)) /* *16 + *8 */ +#endif +#ifndef TIMES60 #define TIMES60(_X_) ((((_X_) << 4) - (_X_)) << 2) /* *(16 - 1) *4 */ +#endif + /* * generic l_abs() function */ diff --git a/sntp/libevent/include/event2/event.h b/sntp/libevent/include/event2/event.h index 6e0a4f04c..570031f26 100644 --- a/sntp/libevent/include/event2/event.h +++ b/sntp/libevent/include/event2/event.h @@ -777,6 +777,10 @@ void event_set_fatal_callback(event_fatal_cb cb); EVENT2_EXPORT_SYMBOL void event_enable_debug_logging(ev_uint32_t which); +EVENT2_EXPORT_SYMBOL +void +event_disable_debug_mode(void); + /** Associate a different event base with an event.