1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

Use intptr_t to fix various sizeof(int) != sizeof(void *) warnings.

This commit is contained in:
John Baldwin 2002-11-08 21:13:18 +00:00
parent e068a87835
commit 8214d60e20
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106665
4 changed files with 12 additions and 12 deletions

View File

@ -532,7 +532,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item)
NGI_GET_M(item, m);
/* Get link number */
linkNum = (int)NG_HOOK_PRIVATE(hook);
linkNum = (intptr_t)NG_HOOK_PRIVATE(hook);
KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS,
("%s: linkNum=%u", __func__, linkNum));
link = priv->links[linkNum];
@ -791,7 +791,7 @@ ng_bridge_disconnect(hook_p hook)
int linkNum;
/* Get link number */
linkNum = (int)NG_HOOK_PRIVATE(hook);
linkNum = (intptr_t)NG_HOOK_PRIVATE(hook);
KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS,
("%s: linkNum=%u", __func__, linkNum));

View File

@ -238,7 +238,7 @@ ng_one2many_newhook(node_p node, hook_p hook, const char *name)
return (EISCONN);
/* Setup private info for this link */
NG_HOOK_SET_PRIVATE(hook, (void *)linkNum);
NG_HOOK_SET_PRIVATE(hook, (void *)(intptr_t)linkNum);
link->hook = hook;
bzero(&link->stats, sizeof(link->stats));
if (linkNum != NG_ONE2MANY_ONE_LINKNUM) {
@ -388,7 +388,7 @@ ng_one2many_rcvdata(hook_p hook, item_p item)
m = NGI_M(item); /* just peaking, mbuf still owned by item */
/* Get link number */
linkNum = (int)NG_HOOK_PRIVATE(hook);
linkNum = (intptr_t)NG_HOOK_PRIVATE(hook);
KASSERT(linkNum == NG_ONE2MANY_ONE_LINKNUM
|| (linkNum >= 0 && linkNum < NG_ONE2MANY_MAX_LINKS),
("%s: linkNum=%d", __func__, linkNum));
@ -492,7 +492,7 @@ ng_one2many_disconnect(hook_p hook)
int linkNum;
/* Get link number */
linkNum = (int)NG_HOOK_PRIVATE(hook);
linkNum = (intptr_t)NG_HOOK_PRIVATE(hook);
KASSERT(linkNum == NG_ONE2MANY_ONE_LINKNUM
|| (linkNum >= 0 && linkNum < NG_ONE2MANY_MAX_LINKS),
("%s: linkNum=%d", __func__, linkNum));

View File

@ -362,7 +362,7 @@ ng_int8_unparse(const struct ng_parse_type *type,
int8_t val;
bcopy(data + *off, &val, sizeof(int8_t));
switch ((int)type->info) {
switch ((intptr_t)type->info) {
case INT_SIGNED:
fmt = "%d";
fval = val;
@ -459,7 +459,7 @@ ng_int16_unparse(const struct ng_parse_type *type,
int16_t val;
bcopy(data + *off, &val, sizeof(int16_t));
switch ((int)type->info) {
switch ((intptr_t)type->info) {
case INT_SIGNED:
fmt = "%d";
fval = val;
@ -556,7 +556,7 @@ ng_int32_unparse(const struct ng_parse_type *type,
int32_t val;
bcopy(data + *off, &val, sizeof(int32_t));
switch ((int)type->info) {
switch ((intptr_t)type->info) {
case INT_SIGNED:
fmt = "%ld";
fval = val;
@ -652,7 +652,7 @@ ng_int64_unparse(const struct ng_parse_type *type,
int64_t val;
bcopy(data + *off, &val, sizeof(int64_t));
switch ((int)type->info) {
switch ((intptr_t)type->info) {
case INT_SIGNED:
fmt = "%lld";
fval = val;

View File

@ -455,7 +455,7 @@ ng_ppp_newhook(node_p node, hook_p hook, const char *name)
/* OK */
*hookPtr = hook;
NG_HOOK_SET_PRIVATE(hook, (void *)hookIndex);
NG_HOOK_SET_PRIVATE(hook, (void *)(intptr_t)hookIndex);
ng_ppp_update(node, 0);
return (0);
}
@ -593,7 +593,7 @@ ng_ppp_rcvdata(hook_p hook, item_p item)
{
const node_p node = NG_HOOK_NODE(hook);
const priv_p priv = NG_NODE_PRIVATE(node);
const int index = (int)NG_HOOK_PRIVATE(hook);
const int index = (intptr_t)NG_HOOK_PRIVATE(hook);
u_int16_t linkNum = NG_PPP_BUNDLE_LINKNUM;
hook_p outHook = NULL;
int proto = 0, error;
@ -826,7 +826,7 @@ ng_ppp_disconnect(hook_p hook)
{
const node_p node = NG_HOOK_NODE(hook);
const priv_p priv = NG_NODE_PRIVATE(node);
const int index = (int)NG_HOOK_PRIVATE(hook);
const int index = (intptr_t)NG_HOOK_PRIVATE(hook);
/* Zero out hook pointer */
if (index < 0)