Casting issue fixes.
bk: 3c9e6e80xvPZzo_xnYNpNgXh6DN-bw
# include <config.h>
#endif
-# include <windows.h>
-# include <ws2tcpip.h>
-# include <winsock2.h>
-
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# if !defined(HAVE_CONFIG_H) || !defined(__config)
error "NT requires config.h to be included"
# endif /* HAVE_CONFIG_H) */
+# include <windows.h>
+# include <ws2tcpip.h>
+# include <winsock2.h>
# define ifreq _INTERFACE_INFO
# define ifr_flags iiFlags
* Defining registers are not a good idea on Windows
* This gets rid of the usage
*/
+#ifndef register
# define register
+#endif
typedef char *caddr_t;
#endif /* SYS_WINNT */
long val
)
{
- *((*bufpp)++) = val & 0xFF;
- *((*bufpp)++) = (val >> 8) & 0xFF;
+ *((*bufpp)++) = (unsigned char) (val & 0xFF);
+ *((*bufpp)++) = (unsigned char) ((val >> 8) & 0xFF);
}
long
long val
)
{
- *((*bufpp)++) = val & 0xFF;
- *((*bufpp)++) = (val >> 8) & 0xFF;
- *((*bufpp)++) = (val >> 16) & 0xFF;
- *((*bufpp)++) = (val >> 24) & 0xFF;
+ *((*bufpp)++) = (unsigned char)(val & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF);
}
long
long val
)
{
- *((*bufpp)++) = (val >> 8) & 0xFF;
- *((*bufpp)++) = val & 0xFF;
+ *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF);
+ *((*bufpp)++) = (unsigned char)( val & 0xFF);
}
long
long val
)
{
- *((*bufpp)++) = (val >> 24) & 0xFF;
- *((*bufpp)++) = (val >> 16) & 0xFF;
- *((*bufpp)++) = (val >> 8 ) & 0xFF;
- *((*bufpp)++) = val & 0xFF;
+ *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 8 ) & 0xFF);
+ *((*bufpp)++) = (unsigned char)( val & 0xFF);
}
/*
break;
}
jt->month++;
- jt->monthday = monthday;
+ jt->monthday = (u_char) monthday;
}
}
do {
tmp = sv;
- sv = sv/ten;
+ sv = (u_short) (sv/ten);
*(--cp) = tmp - ((sv<<3) + (sv<<1));
} while (sv != 0);
}
do {
stmp = swork;
- swork /= sten;
+ swork = (u_short) (swork/sten);
stmp -= (swork<<3) + (swork<<1);
*--cp = (u_char)stmp;
} while (swork != 0);
struct interface *localaddr;
struct refclockstat clock_stat;
FILEGEN *filegen;
+ u_char asterisk = '*';
/*
* Initialize, initialize
minpoll = NTP_MINDPOLL;
maxpoll = NTP_MAXDPOLL;
peerkey = 0;
- peerkeystr = '*';
+ peerkeystr = &asterisk;
peerflags = 0;
ttl = 0;
for (i = 2; i < ntokens; i++)
for (i = 0; i < 8; i++)
for (j = 1; j < 100; ++j) {
- rankey[i] = RANDOM & 0xff;
+ rankey[i] = (char) (RANDOM & 0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;
if (dpend - dpt > bmax - 1)
dpend = dpt + bmax - 1;
for (dp = lineptr; dpt < dpend; dpt++) {
- c = *dpt & 0x7f;
+ c = (char) (*dpt & 0x7f);
if (c >= ' ')
*dp++ = c;
}
clock_stat.haveflags = CLK_HAVEVAL2;
break;
case FUDGE_FLAGS:
- clock_stat.flags = (u_char) ntohl(cf->fudgeval_flags) & 0xf;
+ clock_stat.flags = (u_char) (ntohl(cf->fudgeval_flags) & 0xf);
clock_stat.haveflags =
(CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4);
break;