diff --git a/include/libnfs-private.h b/include/libnfs-private.h index 9ed9ea9..c2dbfdb 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -217,12 +217,16 @@ void nfs_set_error(struct nfs_context *nfs, char *error_string, ...) #endif ; +#if defined(PS2_EE) +#define RPC_LOG(rpc, level, format, ...) ; +#else #define RPC_LOG(rpc, level, format, ...) \ do { \ if (level <= rpc->debug) { \ fprintf(stderr, "libnfs:%d " format "\n", level, ## __VA_ARGS__); \ } \ } while (0) +#endif const char *nfs_get_server(struct nfs_context *nfs); const char *nfs_get_export(struct nfs_context *nfs); diff --git a/lib/nfs_v4.c b/lib/nfs_v4.c index 10fe1fd..ee740eb 100644 --- a/lib/nfs_v4.c +++ b/lib/nfs_v4.c @@ -410,7 +410,8 @@ nfs_pntoh64(const uint32_t *buf) { uint64_t val; - val = ntohl(*(uint32_t *)(void *)buf++); + val = ntohl(*(uint32_t *)(void *)buf); + buf++; val <<= 32; val |= ntohl(*(uint32_t *)(void *)buf); diff --git a/lib/pdu.c b/lib/pdu.c index 5388a3f..6fa7552 100644 --- a/lib/pdu.c +++ b/lib/pdu.c @@ -239,7 +239,8 @@ void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid) int rpc_queue_pdu(struct rpc_context *rpc, struct rpc_pdu *pdu) { - int size, recordmarker; + int size; + int32_t recordmarker; assert(rpc->magic == RPC_CONTEXT_MAGIC); @@ -472,7 +473,8 @@ static int rpc_process_call(struct rpc_context *rpc, ZDR *zdr) if (endpoint == NULL) { rpc_set_error(rpc, "No endpoint found for CALL " "program:0x%08x version:%d\n", - call.body.cbody.prog, call.body.cbody.vers); + (int)call.body.cbody.prog, + (int)call.body.cbody.vers); if (!found_program) { return rpc_send_error_reply(rpc, &call, PROG_UNAVAIL, 0, 0); @@ -502,7 +504,8 @@ int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size) struct rpc_pdu *pdu, *prev_pdu; struct rpc_queue *q; ZDR zdr; - int pos, recordmarker = 0; + int pos; + int32_t recordmarker = 0; unsigned int hash; uint32_t xid; char *reasbuf = NULL; @@ -572,7 +575,7 @@ int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size) } pos = zdr_getpos(&zdr); - if (zdr_int(&zdr, (int *)&xid) == 0) { + if (zdr_u_int(&zdr, &xid) == 0) { rpc_set_error(rpc, "zdr_int reading xid failed"); zdr_destroy(&zdr); if (reasbuf != NULL) { diff --git a/lib/socket.c b/lib/socket.c index 07185d5..df54417 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -351,7 +351,7 @@ rpc_read_from_socket(struct rpc_context *rpc) "buffer of %d bytes for " "pdu, errno:%d. Closing " "socket.", - pdu_size, errno); + (int)pdu_size, errno); return -1; } memcpy(rpc->inbuf, &rpc->rm_buf, 4); diff --git a/ps2_ee/ps2_compat.h b/ps2_ee/ps2_compat.h index eaa4923..8662d86 100644 --- a/ps2_ee/ps2_compat.h +++ b/ps2_ee/ps2_compat.h @@ -30,7 +30,6 @@ #include typedef unsigned long int fsfilcnt_t; -typedef unsigned long int fsblkcnt_t; #define getservbyport(a,b) NULL #define major(a) 0 @@ -64,8 +63,6 @@ struct statvfs { #define close(a) lwip_close(a) #define getlogin_r(a,b) ENXIO -#define srandom srand -#define random rand #define POLLIN 0x0001 /* There is data to read */ #define POLLPRI 0x0002 /* There is urgent data to read */