]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2757] Quiet compiler warnings.
authorHarlan Stenn <stenn@ntp.org>
Sat, 28 Feb 2015 09:47:20 +0000 (09:47 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 28 Feb 2015 09:47:20 +0000 (09:47 +0000)
bk: 54f18ea89e7kOyhRJf8qC19La7gxgA

lib/isc/inet_ntop.c
lib/isc/log.c
ntpd/ntp_leapsec.c
parseutil/dcfd.c
sntp/libevent/include/event2/event.h

index 26d5dcad1f0a69f1a5d6d261dbcf79bea7cec483..773018031b9d3ec796b25b70344de13ae41cf42c 100644 (file)
@@ -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)
index ce98303fecafdb3bec5c53d72c0f25020534ad01..38f0c4ff51e6819f42ab9f99f54cecc2230359eb 100644 (file)
@@ -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],
index ec42a9740a076d266d7b09010e67bd271e49245f..eeef89f3c6481bac7e0d359df1f1be6be24af190 100644 (file)
@@ -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);
index 0db94c0be973f3e0c8d6963d803cc855d73514cb..9bf384de17c30b07ebd5289ee64c198c63bd8276 100644 (file)
@@ -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
  */
index 6e0a4f04c739649fd205406ffc6bf0589b243600..570031f264b0bfc66589701ee2b66ff21f1afb4c 100644 (file)
@@ -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.