From 7d0397cf0f1ce2d46dccf0ef3bb231433a7cbace Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 1 Jun 2011 00:12:55 +1000 Subject: [PATCH] get rid of some compiler warnings --- examples/nfsclient-async.c | 4 ++-- examples/nfsclient-raw.c | 14 ++++++-------- examples/nfsclient-sync.c | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/nfsclient-async.c b/examples/nfsclient-async.c index 4abb901..4c7624c 100644 --- a/examples/nfsclient-async.c +++ b/examples/nfsclient-async.c @@ -19,7 +19,7 @@ */ #define SERVER "10.1.1.27" -#define EXPORT "/VIRTUAL" +#define EXPORT "/shared" #define NFSFILE "/BOOKS/Classics/Dracula.djvu" #define NFSDIR "/BOOKS/Classics/" @@ -187,7 +187,7 @@ void nfs_mount_cb(int status, struct nfs_context *nfs, void *data, void *private -int main(int argc, char *argv[]) +int main(int argc _U_, char *argv[] _U_) { struct nfs_context *nfs; struct pollfd pfd; diff --git a/examples/nfsclient-raw.c b/examples/nfsclient-raw.c index 3ccc949..40d570a 100644 --- a/examples/nfsclient-raw.c +++ b/examples/nfsclient-raw.c @@ -38,7 +38,7 @@ struct client { struct nfs_fh3 rootfh; }; -void nfs_fsinfo_cb(struct rpc_context *rpc, int status, void *data, void *private_data) +void nfs_fsinfo_cb(struct rpc_context *rpc _U_, int status, void *data, void *private_data) { struct client *client = private_data; FSINFO3res *res = data; @@ -59,7 +59,7 @@ void nfs_fsinfo_cb(struct rpc_context *rpc, int status, void *data, void *privat } -void nfs_connect_cb(struct rpc_context *rpc, int status, void *data, void *private_data) +void nfs_connect_cb(struct rpc_context *rpc, int status, void *data _U_, void *private_data) { struct client *client = private_data; @@ -130,7 +130,7 @@ void mount_null_cb(struct rpc_context *rpc, int status, void *data, void *privat } } -void mount_connect_cb(struct rpc_context *rpc, int status, void *data, void *private_data) +void mount_connect_cb(struct rpc_context *rpc, int status, void *data _U_, void *private_data) { struct client *client = private_data; @@ -151,7 +151,6 @@ void mount_connect_cb(struct rpc_context *rpc, int status, void *data, void *pri void pmap_getport_cb(struct rpc_context *rpc, int status, void *data, void *private_data) { struct client *client = private_data; - uint32_t port; if (status == RPC_STATUS_ERROR) { printf("portmapper getport call failed with \"%s\"\n", (char *)data); @@ -165,7 +164,7 @@ void pmap_getport_cb(struct rpc_context *rpc, int status, void *data, void *priv client->mount_port = *(uint32_t *)data; printf("GETPORT returned Port:%d\n", client->mount_port); if (client->mount_port == 0) { - printf("RPC.MOUNTD is not available on server : %s\n", client->server, client->mount_port); + printf("RPC.MOUNTD is not available on server : %s:%d\n", client->server, client->mount_port); exit(10); } @@ -204,7 +203,7 @@ void pmap_null_cb(struct rpc_context *rpc, int status, void *data, void *private } } -void pmap_connect_cb(struct rpc_context *rpc, int status, void *data, void *private_data) +void pmap_connect_cb(struct rpc_context *rpc, int status, void *data _U_, void *private_data) { struct client *client = private_data; @@ -222,11 +221,10 @@ void pmap_connect_cb(struct rpc_context *rpc, int status, void *data, void *priv } -int main(int argc, char *argv[]) +int main(int argc _U_, char *argv[] _U_) { struct rpc_context *rpc; struct pollfd pfd; - int ret; struct client client; rpc = rpc_init_context(); diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index 2f38395..a6794ee 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -44,7 +44,7 @@ struct client { }; -int main(int argc, char *argv[]) +int main(int argc _U_, char *argv[] _U_) { struct nfs_context *nfs; int i, ret; @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) ret = nfs_close_sync(nfs, nfsfh); if (ret < 0) { - printf("Failed to close(%s)\n", NFSFILE, nfs_get_error(nfs)); + printf("Failed to close(%s): %s\n", NFSFILE, nfs_get_error(nfs)); exit(10); } @@ -169,14 +169,14 @@ int main(int argc, char *argv[]) } ret = nfs_close_sync(nfs, nfsfh); if (ret < 0) { - printf("Failed to close(%s)\n", NFSFILEW, nfs_get_error(nfs)); + printf("Failed to close(%s) %s\n", NFSFILEW, nfs_get_error(nfs)); exit(10); } ret = nfs_statvfs_sync(nfs, NFSDIR, &svfs); if (ret < 0) { - printf("Failed to statvfs(%s)\n", NFSDIR, nfs_get_error(nfs)); + printf("Failed to statvfs(%s) %s\n", NFSDIR, nfs_get_error(nfs)); exit(10); } printf("files %d/%d/%d\n", (int)svfs.f_files, (int)svfs.f_ffree, (int)svfs.f_favail); -- 2.34.1