fix undefined shift operations on signed integers
This commit is contained in:
parent
e5a593f013
commit
69642dd440
3 changed files with 4 additions and 4 deletions
|
@ -62,7 +62,7 @@ split_ip6(IPAddr *ip, uint32_t *dst)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
dst[i] = ip->addr.in6[i * 4 + 0] << 24 |
|
||||
dst[i] = (uint32_t)ip->addr.in6[i * 4 + 0] << 24 |
|
||||
ip->addr.in6[i * 4 + 1] << 16 |
|
||||
ip->addr.in6[i * 4 + 2] << 8 |
|
||||
ip->addr.in6[i * 4 + 3];
|
||||
|
|
4
conf.c
4
conf.c
|
@ -700,11 +700,11 @@ parse_refclock(char *line)
|
|||
if (!strcasecmp(cmd, "refid")) {
|
||||
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
|
||||
break;
|
||||
ref_id = ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
ref_id = (uint32_t)ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
} else if (!strcasecmp(cmd, "lock")) {
|
||||
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
|
||||
break;
|
||||
lock_ref_id = ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
lock_ref_id = (uint32_t)ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
} else if (!strcasecmp(cmd, "poll")) {
|
||||
if (sscanf(line, "%d%n", &poll, &n) != 1) {
|
||||
break;
|
||||
|
|
|
@ -233,7 +233,7 @@ RCL_AddRefclock(RefclockParameters *params)
|
|||
if (index >= 10)
|
||||
ref[2] = (index / 10) % 10 + '0';
|
||||
|
||||
inst->ref_id = ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
inst->ref_id = (uint32_t)ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
|
||||
}
|
||||
|
||||
if (inst->driver->poll) {
|
||||
|
|
Loading…
Reference in a new issue