Date: Tuesday, November 15, 2005 @ 17:33:24
Author: marc
Path: /cvsroot/carob/carob/src
Modified: JavaSocket.cpp (1.11 -> 1.12)
Using implicit bool<->int casts.
----------------+
JavaSocket.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: carob/src/JavaSocket.cpp
diff -u carob/src/JavaSocket.cpp:1.11 carob/src/JavaSocket.cpp:1.12
--- carob/src/JavaSocket.cpp:1.11 Tue Nov 15 17:19:12 2005
+++ carob/src/JavaSocket.cpp Tue Nov 15 17:33:24 2005
@@ -307,7 +307,7 @@
UnexpectedException)
{
wstring fctName(L"JavaSocket::WriteBoolean");
- byte byteToSend = b ? 1 : 0 ;
+ byte byteToSend = b; // the implicit casts do it right
//No byte order problem here: the only value read is '0' for false
//all other values are true
sendToSocket(fctName, L"Boolean", &byteToSend, sizeof(byteToSend),
MSG_NOSIGNAL);
@@ -320,7 +320,7 @@
byte rec;
if (receiveFromSocket(fctName, L"Boolean", &rec, sizeof(rec), 0))
- b = (rec != 0 ? true : false);
+ b = rec; // the implicit cast does it right
}
int JavaSocket::recvFully(void *buf, const int len, const int flags)
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits