Date: Thursday, December 1, 2005 @ 19:31:15
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/JavaSocket.hpp (1.11 -> 1.12) src/JavaSocket.cpp (1.16
-> 1.17)
Changed wstring arguments "by copy passing" to "by reference passing"
Removed useless const on copied parameters
------------------------+
include/JavaSocket.hpp | 12 +++++++-----
src/JavaSocket.cpp | 10 +++++-----
2 files changed, 12 insertions(+), 10 deletions(-)
Index: carob/include/JavaSocket.hpp
diff -u carob/include/JavaSocket.hpp:1.11 carob/include/JavaSocket.hpp:1.12
--- carob/include/JavaSocket.hpp:1.11 Thu Dec 1 19:10:15 2005
+++ carob/include/JavaSocket.hpp Thu Dec 1 19:31:15 2005
@@ -73,7 +73,7 @@
* @return true upon successfull connection, false otherwise
* @throws ConnectionException
*/
- bool connectTo(std::wstring host, in_addr_t port)
+ bool connectTo(const std::wstring& host, in_addr_t port)
throw (ConnectionException, UnexpectedException);
/**
* Closes connection.
@@ -161,8 +161,9 @@
* @return true if the data could be send successfully
* @throws SocketIOException
*/
- bool sendToSocket(const std::wstring fctName, const std::wstring
objName,
- const void* buf, const int len, const int flags)
+ bool sendToSocket(const std::wstring& fctName,
+ const std::wstring& objName, const void* buf, int len,
+ int flags)
const throw (SocketIOException, UnexpectedException);
/**
* Wrapper around recv(...) function to handle errors and throw exceptions
@@ -174,8 +175,9 @@
* @return true if the data could be send successfully
* @throws SocketIOException
*/
- bool receiveFromSocket(std::wstring fctName, std::wstring objName,
- void *buf, const int len, const int flags)
+ bool receiveFromSocket(const std::wstring& fctName,
+ const std::wstring& objName,
+ void *buf, int len, int flags)
const throw (SocketIOException, UnexpectedException);
private:
Index: carob/src/JavaSocket.cpp
diff -u carob/src/JavaSocket.cpp:1.16 carob/src/JavaSocket.cpp:1.17
--- carob/src/JavaSocket.cpp:1.16 Thu Dec 1 19:10:15 2005
+++ carob/src/JavaSocket.cpp Thu Dec 1 19:31:15 2005
@@ -76,7 +76,7 @@
return true;
}
-bool JavaSocket::connectTo(std::wstring host, in_addr_t port)
+bool JavaSocket::connectTo(const std::wstring& host, in_addr_t port)
throw (ConnectionException, UnexpectedException)
{
wstring fctName(L"JavaSocket::Connect");
@@ -359,8 +359,8 @@
return len;
}
-bool JavaSocket::sendToSocket(const wstring fctName, const wstring objName,
- const void* buf, const int len, const int flags) const
+bool JavaSocket::sendToSocket(const wstring& fctName, const wstring& objName,
+ const void* buf, int len, int flags) const
throw (SocketIOException, UnexpectedException)
{
if (isVerboseEnabled())
@@ -375,8 +375,8 @@
return true;
}
-bool JavaSocket::receiveFromSocket(wstring fctName, wstring objName, void *buf,
- const int len, const int flags) const
+bool JavaSocket::receiveFromSocket(const wstring& fctName,
+ const wstring& objName, void *buf, int len, int flags) const
throw (SocketIOException, UnexpectedException)
{
if (isVerboseEnabled())
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits