From 811f4c8d940e266b32668565017ff7fca2040c36 Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 14 Nov 2016 00:33:03 +0000 Subject: [PATCH] Fix mips 32-bit buildworld. Reported by: adrian MFC after: 6 weeks X-MFC with: r308493 --- contrib/amd/amd/readdir.c | 13 +++++++------ contrib/amd/amq/amq.c | 2 +- contrib/amd/include/amq_defs.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/amd/amd/readdir.c b/contrib/amd/amd/readdir.c index 3d3c7add01a7..69be7a71d653 100644 --- a/contrib/amd/amd/readdir.c +++ b/contrib/amd/amd/readdir.c @@ -38,6 +38,7 @@ */ +#include #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ @@ -201,7 +202,7 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable static int amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count, int fully_browsable) { - u_int gen = *(u_int *) cookie; + u_int gen = *(u_int *) (uintptr_t) cookie; int chain_length, i; static nfsentry *te, *te_next; static int j; @@ -364,7 +365,7 @@ amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry * static int amfs_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count) { - u_int gen = *(u_int *) cookie; + u_int gen = *(u_int *) (uintptr_t) cookie; am_node *xp; dp->dl_eof = FALSE; /* assume readdir not done */ @@ -639,7 +640,7 @@ amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie, am_dirlist3 *dp, am_entry3 *ep, u_int count, int fully_browsable) { - uint64 gen = *(uint64 *) cookie; + uint64 gen = *(uint64 *) (uintptr_t) cookie; int chain_length, i; static am_entry3 *te, *te_next; static int j; @@ -796,7 +797,7 @@ static int amfs_readdir3(am_node *mp, am_cookie3 cookie, am_dirlist3 *dp, am_entry3 *ep, u_int count) { - uint64 gen = *(uint64 *) cookie; + uint64 gen = *(uint64 *) (uintptr_t) cookie; am_node *xp; if (amuDebug(D_READDIR)) @@ -944,8 +945,8 @@ amfs_generic_readdir(am_node *mp, voidp cookie, voidp dp, voidp ep, u_int count) return amfs_readdir(mp, cookie, dp, ep, count); } else { if (browsable) - return amfs_readdir3_browsable(mp, (am_cookie3) cookie, dp, ep, count, full); + return amfs_readdir3_browsable(mp, (am_cookie3) (uintptr_t) cookie, dp, ep, count, full); else - return amfs_readdir3(mp, (am_cookie3) cookie, dp, ep, count); + return amfs_readdir3(mp, (am_cookie3) (uintptr_t) cookie, dp, ep, count); } } diff --git a/contrib/amd/amq/amq.c b/contrib/amd/amq/amq.c index e99732fded5b..7140784c8631 100644 --- a/contrib/amd/amq/amq.c +++ b/contrib/amd/amq/amq.c @@ -79,7 +79,7 @@ enum show_opt { static void time_print(time_type tt) { - time_t t = (time_t)tt; + time_t t = (time_t)*tt; struct tm *tp = localtime(&t); printf("%02d/%02d/%04d %02d:%02d:%02d", tp->tm_mon + 1, tp->tm_mday, diff --git a/contrib/amd/include/amq_defs.h b/contrib/amd/include/amq_defs.h index 89f61805fc60..4db5133cba42 100644 --- a/contrib/amd/include/amq_defs.h +++ b/contrib/amd/include/amq_defs.h @@ -66,7 +66,7 @@ /* * TYPEDEFS */ -typedef long *time_type; +typedef time_t *time_type; typedef struct amq_mount_info amq_mount_info; typedef struct amq_map_info amq_map_info; typedef struct amq_mount_stats amq_mount_stats;