Fri Mar 9 15:35:28 2012 UTC ()
Cast constants to the appropriate type.


(christos)
diff -r1.4 -r1.5 src/sys/sys/ptree.h

cvs diff -r1.4 -r1.5 src/sys/sys/ptree.h (expand / switch to unified diff)

--- src/sys/sys/ptree.h 2011/07/30 16:37:05 1.4
+++ src/sys/sys/ptree.h 2012/03/09 15:35:28 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ptree.h,v 1.4 2011/07/30 16:37:05 christos Exp $ */ 1/* $NetBSD: ptree.h,v 1.5 2012/03/09 15:35:28 christos Exp $ */
2/*- 2/*-
3 * Copyright (c) 2008 The NetBSD Foundation, Inc. 3 * Copyright (c) 2008 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas <matt@3am-software.com> 7 * by Matt Thomas <matt@3am-software.com>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -42,29 +42,29 @@ typedef enum { @@ -42,29 +42,29 @@ typedef enum {
42 42
43typedef unsigned int pt_slot_t; 43typedef unsigned int pt_slot_t;
44typedef unsigned int pt_bitoff_t; 44typedef unsigned int pt_bitoff_t;
45typedef unsigned int pt_bitlen_t; 45typedef unsigned int pt_bitlen_t;
46 46
47typedef struct pt_node { 47typedef struct pt_node {
48 uintptr_t ptn_slots[2]; /* must be first */ 48 uintptr_t ptn_slots[2]; /* must be first */
49#define PT_SLOT_LEFT 0u 49#define PT_SLOT_LEFT 0u
50#define PT_SLOT_RIGHT 1u 50#define PT_SLOT_RIGHT 1u
51#ifdef _PT_PRIVATE 51#ifdef _PT_PRIVATE
52#define PT_SLOT_ROOT 0u 52#define PT_SLOT_ROOT 0u
53#define PT_SLOT_OTHER 1u 53#define PT_SLOT_OTHER 1u
54#define PT_SLOT_ODDMAN 1u 54#define PT_SLOT_ODDMAN 1u
55#define PT_TYPE_LEAF 0x00000000u 55#define PT_TYPE_LEAF ((uintptr_t)0x00000000u)
56#define PT_TYPE_BRANCH 0x00000001u 56#define PT_TYPE_BRANCH ((uintptr_t)0x00000001u)
57#define PT_TYPE_MASK 0x00000001u 57#define PT_TYPE_MASK ((uintptr_t)0x00000001u)
58#endif /* _PT_PRIVATE */ 58#endif /* _PT_PRIVATE */
59 59
60 uint32_t ptn_nodedata; 60 uint32_t ptn_nodedata;
61#ifdef _PT_PRIVATE 61#ifdef _PT_PRIVATE
62#define PTN_LEAF_POSITION_BITS 8u 62#define PTN_LEAF_POSITION_BITS 8u
63#define PTN_LEAF_POSITION_SHIFT 0u 63#define PTN_LEAF_POSITION_SHIFT 0u
64#define PTN_BRANCH_POSITION_BITS 8u 64#define PTN_BRANCH_POSITION_BITS 8u
65#define PTN_BRANCH_POSITION_SHIFT 8u 65#define PTN_BRANCH_POSITION_SHIFT 8u
66#ifndef PTNOMASK 66#ifndef PTNOMASK
67#define PTN_MASK_BITLEN_BITS 15u 67#define PTN_MASK_BITLEN_BITS 15u
68#define PTN_MASK_BITLEN_SHIFT 16u 68#define PTN_MASK_BITLEN_SHIFT 16u
69#define PTN_MASK_FLAG 0x80000000u 69#define PTN_MASK_FLAG 0x80000000u
70#endif 70#endif