do_store(isc_task_t *task, isc_event_t *ev) {
counter_t *state = (counter_t *)ev->ev_arg;
int i;
- isc_uint8_t r;
+ isc_uint32_t r;
isc_uint32_t val;
r = random() % 256;
isc_task_t *tasks[TASKS];
isc_event_t *event;
int i;
- isc_uint8_t r;
+ isc_uint32_t r;
isc_uint32_t val;
t_assert("test_atomic_store", 1, T_REQUIRED, "%s",
dns_hash(dns_qid_t *qid, isc_sockaddr_t *dest, dns_messageid_t id,
in_port_t port)
{
- unsigned int ret;
+ isc_uint32_t ret;
ret = isc_sockaddr_hash(dest, ISC_TRUE);
- ret ^= (id << 16) | port;
+ ret ^= ((isc_uint32_t)id << 16) | port;
ret %= qid->qid_nbuckets;
INSIST(ret < qid->qid_nbuckets);
#define RBTDB_RDATATYPE_BASE(type) ((dns_rdatatype_t)((type) & 0xFFFF))
#define RBTDB_RDATATYPE_EXT(type) ((dns_rdatatype_t)((type) >> 16))
-#define RBTDB_RDATATYPE_VALUE(b, e) ((rbtdb_rdatatype_t)((e) << 16) | (b))
+#define RBTDB_RDATATYPE_VALUE(base, ext) ((rbtdb_rdatatype_t)(((isc_uint32_t)ext) << 16) | ((isc_uint32_t)base) & 0xffff)
#define RBTDB_RDATATYPE_SIGNSEC \
RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, dns_rdatatype_nsec)
isc_uint32_t value;
REQUIRE(region->length >= 4);
- value = region->base[0] << 24;
- value |= region->base[1] << 16;
- value |= region->base[2] << 8;
- value |= region->base[3];
+ value = (isc_uint32_t)region->base[0] << 24;
+ value |= (isc_uint32_t)region->base[1] << 16;
+ value |= (isc_uint32_t)region->base[2] << 8;
+ value |= (isc_uint32_t)region->base[3];
return(value);
}
static inline isc_boolean_t
portset_isset(isc_portset_t *portset, in_port_t port) {
- return (ISC_TF((portset->buf[port >> 5] & (1 << (port & 31))) != 0));
+ return (ISC_TF((portset->buf[port >> 5] & ((isc_uint32_t)1 << (port & 31))) != 0));
}
static inline void
portset_add(isc_portset_t *portset, in_port_t port) {
if (!portset_isset(portset, port)) {
portset->nports++;
- portset->buf[port >> 5] |= (1 << (port & 31));
+ portset->buf[port >> 5] |= ((isc_uint32_t)1 << (port & 31));
}
}
portset_remove(isc_portset_t *portset, in_port_t port) {
if (portset_isset(portset, port)) {
portset->nports--;
- portset->buf[port >> 5] &= ~(1 << (port & 31));
+ portset->buf[port >> 5] &= ~((isc_uint32_t)1 << (port & 31));
}
}