nfs4: Fix gcc4 warnings

This commit is contained in:
Pawel Dziepak
2012-08-16 03:41:29 +02:00
parent a15e8fcfbe
commit 870528b799
6 changed files with 18 additions and 12 deletions
+7 -3
View File
@@ -26,8 +26,8 @@ struct dns_resolver_module {
static inline int
getaddrinfo(const char* node, const char* service, const struct addrinfo* hints,
struct addrinfo** res)
kgetaddrinfo(const char* node, const char* service,
const struct addrinfo* hints, struct addrinfo** res)
{
dns_resolver_module* dns;
status_t result = get_module(DNS_RESOLVER_MODULE_NAME,
@@ -44,11 +44,15 @@ getaddrinfo(const char* node, const char* service, const struct addrinfo* hints,
static inline void
freeaddrinfo(struct addrinfo* res)
kfreeaddrinfo(struct addrinfo* res)
{
free(res);
}
#define getaddrinfo kgetaddrinfo
#define freeaddrinfo kfreeaddrinfo
#endif // DNS_RESOLVER_H
@@ -53,7 +53,8 @@ LockInfo::operator==(const struct flock& lock) const
uint64 start = static_cast<uint64>(lock.l_start);
uint64 len = static_cast<uint64>(lock.l_len);
return fStart == start && fLength == len || eof && fLength == UINT64_MAX;
return fStart == start && (fLength == len
|| (eof && fLength == UINT64_MAX));
}
@@ -110,8 +110,8 @@ FileSystem::Mount(FileSystem** pfs, RPC::Server* serv, const char* fsPath,
result = reply.Access(NULL, &allowed);
if (result != B_OK)
return result;
else if (allowed & (ACCESS4_READ | ACCESS4_LOOKUP)
!= (ACCESS4_READ | ACCESS4_LOOKUP))
else if ((allowed & (ACCESS4_READ | ACCESS4_LOOKUP))
!= (ACCESS4_READ | ACCESS4_LOOKUP))
return B_PERMISSION_DENIED;
AttrValue* values;
@@ -938,7 +938,8 @@ NFS4Inode::ReadDirOnce(DirEntry** dirents, uint32* count, OpenDirCookie* cookie,
return result;
}
if (*change == 0 && before[0].fData.fValue64 == after[0].fData.fValue64
if ((*change == 0
&& before[0].fData.fValue64 == after[0].fData.fValue64)
|| *change == after[0].fData.fValue64)
*change = after[0].fData.fValue64;
else
@@ -109,8 +109,8 @@ uint64
NFS4Server::ClientId(uint64 prevId, bool forceNew)
{
MutexLocker _(fClientIdLock);
if (fUseCount == 0 && fClientIdLastUse + (time_t)LeaseTime() < time(NULL)
|| forceNew && fClientId == prevId) {
if ((fUseCount == 0 && fClientIdLastUse + (time_t)LeaseTime() < time(NULL))
|| (forceNew && fClientId == prevId)) {
Request request(fServer);
request.Builder().SetClientID(fServer);
@@ -161,11 +161,11 @@ ReplyInterpreter::Create(uint64* before, uint64* after, bool& atomic)
// Bit Twiddling Hacks
// http://graphics.stanford.edu/~seander/bithacks.html
static inline uint32 sCountBits(uint32 v)
static inline uint32 CountBits(uint32 v)
{
v = v - ((v >> 1) & 0x55555555);
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}
@@ -562,7 +562,7 @@ ReplyInterpreter::_DecodeAttrs(XDR::ReadStream& str, AttrValue** attrs,
uint32 attr_count = 0;
for (uint32 i = 0; i < bcount; i++) {
bitmap[i] = str.GetUInt();
attr_count += sCountBits(bitmap[i]);
attr_count += CountBits(bitmap[i]);
}
if (attr_count == 0) {