blob: d21e97950c0a67150874e7b507d5380940ede21f [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 9500f12f5d827840634311d6ca972d9551211e4d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 21 Nov 2016 01:00:51 -0800
4Subject: [PATCH] filedescriptorclient: Typecast min() arguments correctly
5
6Fixes
7
8| /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp
9p/client/connectors/filedescriptorclient.cpp:47:92: note: deduced conflicting types for parameter 'co
10nst _Tp' ('unsigned int' and 'long unsigned int')
11| ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE));
12
13Signed-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
18diff --git a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp
19index 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--
322.10.2
33