From f13ba03959f6227a75ff8c2e129058215dea380f Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 12 Apr 2008 17:18:31 +0000 Subject: [PATCH] * Removed SyscallRestartWrapper comparison operators. They are not needed, since we've got a cast operator. * Reverted r24927-r24929. There's no potential ambiguity anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24949 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/syscall_restart.h | 7 ------- src/system/kernel/fs/fd.cpp | 4 ++-- src/system/kernel/fs/socket.cpp | 18 +++++++++--------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/headers/private/kernel/syscall_restart.h b/headers/private/kernel/syscall_restart.h index 936912b20d..fb41f6354d 100644 --- a/headers/private/kernel/syscall_restart.h +++ b/headers/private/kernel/syscall_restart.h @@ -144,13 +144,6 @@ struct SyscallRestartWrapper { return *this; } - bool operator==(const Type& other) const { return fResult == other; } - bool operator!=(const Type& other) const { return fResult != other; } - bool operator<=(const Type& other) const { return fResult <= other; } - bool operator>=(const Type& other) const { return fResult >= other; } - bool operator<(const Type& other) const { return fResult < other; } - bool operator>(const Type& other) const { return fResult > other; } - operator Type() const { return fResult; } private: diff --git a/src/system/kernel/fs/fd.cpp b/src/system/kernel/fs/fd.cpp index 52fd0a9218..ce960e184b 100644 --- a/src/system/kernel/fs/fd.cpp +++ b/src/system/kernel/fs/fd.cpp @@ -660,7 +660,7 @@ common_user_io(int fd, off_t pos, void *buffer, size_t length, bool write) else status = descriptor->ops->fd_read(descriptor, pos, buffer, &length); - if (status < (status_t)B_OK) + if (status < B_OK) return status; if (movePosition) @@ -726,7 +726,7 @@ common_user_vector_io(int fd, off_t pos, const iovec *userVecs, size_t count, &length); } - if (status < (status_t)B_OK) { + if (status < B_OK) { if (bytesTransferred == 0) return status; status = B_OK; diff --git a/src/system/kernel/fs/socket.cpp b/src/system/kernel/fs/socket.cpp index 620178cb3c..ad788f1ddf 100644 --- a/src/system/kernel/fs/socket.cpp +++ b/src/system/kernel/fs/socket.cpp @@ -894,7 +894,7 @@ _user_recvfrom(int socket, void *data, size_t length, int flags, socklen_t userAddressBufferSize = addressLength; result = common_recvfrom(socket, data, length, flags, userAddress != NULL ? (sockaddr*)address : NULL, &addressLength, false); - if (result < (ssize_t)0) + if (result < 0) return result; // copy address size and address back to userland @@ -945,7 +945,7 @@ _user_recvmsg(int socket, struct msghdr *userMessage, int flags) SyscallRestartWrapper result; result = common_recvmsg(socket, &message, flags, false); - if (result < (ssize_t)0) + if (result < 0) return result; // copy the address, the ancillary data, and the message header back to @@ -1072,7 +1072,7 @@ _user_getsockopt(int socket, int level, int option, void *userValue, SyscallRestartWrapper error; error = common_getsockopt(socket, level, option, value, &length, false); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // copy value back to userland @@ -1114,7 +1114,7 @@ _user_getpeername(int socket, struct sockaddr *userAddress, SyscallRestartWrapper error; error = prepare_userland_address_result(userAddress, _addressLength, addressLength, true); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // getpeername() @@ -1122,7 +1122,7 @@ _user_getpeername(int socket, struct sockaddr *userAddress, socklen_t userAddressBufferSize = addressLength; error = common_getpeername(socket, (sockaddr*)address, &addressLength, false); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // copy address size and address back to userland @@ -1144,7 +1144,7 @@ _user_getsockname(int socket, struct sockaddr *userAddress, SyscallRestartWrapper error; error = prepare_userland_address_result(userAddress, _addressLength, addressLength, true); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // getsockname() @@ -1152,7 +1152,7 @@ _user_getsockname(int socket, struct sockaddr *userAddress, socklen_t userAddressBufferSize = addressLength; error = common_getsockname(socket, (sockaddr*)address, &addressLength, false); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // copy address size and address back to userland @@ -1186,7 +1186,7 @@ _user_socketpair(int family, int type, int protocol, int *userSocketVector) int socketVector[2]; SyscallRestartWrapper error; error = common_socketpair(family, type, protocol, socketVector, false); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // copy FDs back to userland @@ -1217,7 +1217,7 @@ _user_get_next_socket_stat(int family, uint32 *_cookie, struct net_stat *_stat) net_stat stat; SyscallRestartWrapper error; error = common_get_next_socket_stat(family, &cookie, &stat); - if (error != (status_t)B_OK) + if (error != B_OK) return error; // copy cookie and data back to userland