* [Bug 2425] move part of input handler code from ntpd.c to ntp_io.c
and fix select()-only platforms calling input_handler directly.
+* [Bug 2446] Quiet warnings from Oracle's Studio compiler.
* Upgrade to AutoGen-5.18.1pre3
* Upgrade to libopts-40.1.15.
(4.2.7p377) 2013/07/28 Released by Harlan Stenn <stenn@ntp.org>
#include "ntp_string.h"
#include "ntp_syslog.h"
+#ifdef __GNUC__
+#define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define NTP_PRINTF(fmt, args)
+#endif
-extern int mprintf(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-extern int mfprintf(FILE *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
-extern int mvfprintf(FILE *, const char *, va_list)
- __attribute__((__format__(__printf__, 2, 0)));
+extern int mprintf(const char *, ...) NTP_PRINTF(1, 2);
+extern int mfprintf(FILE *, const char *, ...) NTP_PRINTF(2, 3);
+extern int mvfprintf(FILE *, const char *, va_list) NTP_PRINTF(2, 0);
extern int mvsnprintf(char *, size_t, const char *, va_list)
- __attribute__((__format__(__printf__, 3, 0)));
+ NTP_PRINTF(3, 0);
extern int msnprintf(char *, size_t, const char *, ...)
- __attribute__((__format__(__printf__, 3, 4)));
-extern void msyslog(int, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
+ NTP_PRINTF(3, 4);
+extern void msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
extern void init_logging (const char *, u_int32, int);
extern int change_logfile (const char *, int);
extern void setup_logfile (const char *);
typedef void (*blocking_work_callback)(blocking_work_req, void *, size_t, void *);
typedef enum blocking_magic_sig_e {
- BLOCKING_REQ_MAGIC = 0xb10c7ecf,
- BLOCKING_RESP_MAGIC = 0xb10c7e54,
+ BLOCKING_REQ_MAGIC = 0x510c7ecf,
+ BLOCKING_RESP_MAGIC = 0x510c7e54,
} blocking_magic_sig;
/*
extern void process_control (struct recvbuf *, int);
extern void report_event (int, struct peer *, const char *);
extern int mprintf_event (int, struct peer *, const char *, ...)
- __attribute__((__format__(__printf__, 3, 4)));
+ NTP_PRINTF(3, 4);
/* ntp_control.c */
/*
extern void record_loop_stats (double, double, double, double, int);
extern void record_clock_stats (sockaddr_u *, const char *);
extern int mprintf_clock_stats(sockaddr_u *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
+ NTP_PRINTF(2, 3);
extern void record_raw_stats (sockaddr_u *srcadr, sockaddr_u *dstadr, l_fp *t1, l_fp *t2, l_fp *t3, l_fp *t4, int leap, int version, int mode, int stratum, int poll, int precision, double root_delay, double root_dispersion, u_int32 refid);
extern void check_leap_file (void);
extern u_long leap_month(u_long);
* MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
*/
-static long randtbl[DEG_3 + 1] = {
+static unsigned long randtbl[DEG_3 + 1] = {
TYPE_3,
#ifdef USE_WEAK_SEEDING
/* Historic implementation compatibility */
* in the initialization of randtbl) because the state table pointer is set
* to point to randtbl[1] (as explained below).
*/
-static long *fptr = &randtbl[SEP_3 + 1];
-static long *rptr = &randtbl[1];
+static long *fptr = (long *)&randtbl[SEP_3 + 1];
+static long *rptr = (long *)&randtbl[1];
/*
* The following things are the pointer to the state information table, the
* this is more efficient than indexing every time to find the address of
* the last element to see if the front and rear pointers have wrapped.
*/
-static long *state = &randtbl[1];
+static long *state = (long *)&randtbl[1];
static long rand_type = TYPE_3;
static long rand_deg = DEG_3;
static long rand_sep = SEP_3;
-static long *end_ptr = &randtbl[DEG_3 + 1];
+static long *end_ptr = (long *)&randtbl[DEG_3 + 1];
static inline long good_rand (long);
static void oncore_load_almanac (struct instance *);
static void oncore_log (struct instance *, int, const char *);
static int oncore_log_f (struct instance *, int, const char *, ...)
- __attribute__((__format__(__printf__, 3, 4)));
+ NTP_PRINTF(3, 4);
static void oncore_print_Cb (struct instance *, u_char *);
/* static void oncore_print_array (u_char *, int); */
static void oncore_print_posn (struct instance *);
min_heap_shift_up_unconditional_(s, e->ev_timeout_pos.min_heap_idx, e);
else
min_heap_shift_down_(s, e->ev_timeout_pos.min_heap_idx, e);
- return 0;
}
- return -1;
+ return 0;
}
int min_heap_reserve_(min_heap_t* s, unsigned n)