nfs4: Fix gcc4 warnings
This commit is contained in:
@@ -26,8 +26,8 @@ struct dns_resolver_module {
|
|||||||
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
getaddrinfo(const char* node, const char* service, const struct addrinfo* hints,
|
kgetaddrinfo(const char* node, const char* service,
|
||||||
struct addrinfo** res)
|
const struct addrinfo* hints, struct addrinfo** res)
|
||||||
{
|
{
|
||||||
dns_resolver_module* dns;
|
dns_resolver_module* dns;
|
||||||
status_t result = get_module(DNS_RESOLVER_MODULE_NAME,
|
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
|
static inline void
|
||||||
freeaddrinfo(struct addrinfo* res)
|
kfreeaddrinfo(struct addrinfo* res)
|
||||||
{
|
{
|
||||||
free(res);
|
free(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define getaddrinfo kgetaddrinfo
|
||||||
|
#define freeaddrinfo kfreeaddrinfo
|
||||||
|
|
||||||
|
|
||||||
#endif // DNS_RESOLVER_H
|
#endif // DNS_RESOLVER_H
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ LockInfo::operator==(const struct flock& lock) const
|
|||||||
uint64 start = static_cast<uint64>(lock.l_start);
|
uint64 start = static_cast<uint64>(lock.l_start);
|
||||||
uint64 len = static_cast<uint64>(lock.l_len);
|
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);
|
result = reply.Access(NULL, &allowed);
|
||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
else if (allowed & (ACCESS4_READ | ACCESS4_LOOKUP)
|
else if ((allowed & (ACCESS4_READ | ACCESS4_LOOKUP))
|
||||||
!= (ACCESS4_READ | ACCESS4_LOOKUP))
|
!= (ACCESS4_READ | ACCESS4_LOOKUP))
|
||||||
return B_PERMISSION_DENIED;
|
return B_PERMISSION_DENIED;
|
||||||
|
|
||||||
AttrValue* values;
|
AttrValue* values;
|
||||||
|
|||||||
@@ -938,7 +938,8 @@ NFS4Inode::ReadDirOnce(DirEntry** dirents, uint32* count, OpenDirCookie* cookie,
|
|||||||
return result;
|
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)
|
||||||
*change = after[0].fData.fValue64;
|
*change = after[0].fData.fValue64;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ uint64
|
|||||||
NFS4Server::ClientId(uint64 prevId, bool forceNew)
|
NFS4Server::ClientId(uint64 prevId, bool forceNew)
|
||||||
{
|
{
|
||||||
MutexLocker _(fClientIdLock);
|
MutexLocker _(fClientIdLock);
|
||||||
if (fUseCount == 0 && fClientIdLastUse + (time_t)LeaseTime() < time(NULL)
|
if ((fUseCount == 0 && fClientIdLastUse + (time_t)LeaseTime() < time(NULL))
|
||||||
|| forceNew && fClientId == prevId) {
|
|| (forceNew && fClientId == prevId)) {
|
||||||
|
|
||||||
Request request(fServer);
|
Request request(fServer);
|
||||||
request.Builder().SetClientID(fServer);
|
request.Builder().SetClientID(fServer);
|
||||||
|
|||||||
@@ -161,11 +161,11 @@ ReplyInterpreter::Create(uint64* before, uint64* after, bool& atomic)
|
|||||||
|
|
||||||
// Bit Twiddling Hacks
|
// Bit Twiddling Hacks
|
||||||
// http://graphics.stanford.edu/~seander/bithacks.html
|
// 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 - ((v >> 1) & 0x55555555);
|
||||||
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
|
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;
|
uint32 attr_count = 0;
|
||||||
for (uint32 i = 0; i < bcount; i++) {
|
for (uint32 i = 0; i < bcount; i++) {
|
||||||
bitmap[i] = str.GetUInt();
|
bitmap[i] = str.GetUInt();
|
||||||
attr_count += sCountBits(bitmap[i]);
|
attr_count += CountBits(bitmap[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr_count == 0) {
|
if (attr_count == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user