Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From 9500f12f5d827840634311d6ca972d9551211e4d Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 21 Nov 2016 01:00:51 -0800 |
| 4 | Subject: [PATCH] filedescriptorclient: Typecast min() arguments correctly |
| 5 | |
| 6 | Fixes |
| 7 | |
| 8 | | /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp |
| 9 | p/client/connectors/filedescriptorclient.cpp:47:92: note: deduced conflicting types for parameter 'co |
| 10 | nst _Tp' ('unsigned int' and 'long unsigned int') |
| 11 | | ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE)); |
| 12 | |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | src/jsonrpccpp/client/connectors/filedescriptorclient.cpp | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp |
| 19 | index 77aac7e..6325b5c 100644 |
| 20 | --- a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp |
| 21 | +++ b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp |
| 22 | @@ -43,7 +43,7 @@ void FileDescriptorClient::SendRPCMessage(const std::string& message, |
| 23 | string toSend = message; |
| 24 | do |
| 25 | { |
| 26 | - ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE)); |
| 27 | + ssize_t byteWritten = write(outputfd, toSend.c_str(), min((long unsigned int)toSend.size(), MAX_WRITE_SIZE)); |
| 28 | if (byteWritten < 1) |
| 29 | throw JsonRpcException(Errors::ERROR_CLIENT_CONNECTOR, |
| 30 | "Unknown error occured while writing to the output file descriptor"); |
| 31 | -- |
| 32 | 2.10.2 |
| 33 | |