Removed compiler warning - pointer of type 'void *' used in arithmetic 24/32824/1
authorAnkur <ankur29.garg@samsung.com>
Wed, 24 Dec 2014 12:04:20 +0000 (17:34 +0530)
committerAnkur <ankur29.garg@samsung.com>
Wed, 24 Dec 2014 12:04:35 +0000 (17:34 +0530)
-The void * pointer was being directly used in the calculation without type cast.
-Tested after change. Seems to work fine.

Change-Id: I483f946d870b3b5b1415139dbd0f442796b18059

src/shared/csocket.cpp

index 63eaa47..5a04ce3 100755 (executable)
@@ -215,7 +215,7 @@ ssize_t csocket::send_for_stream(void const* buffer, size_t size) const
        ssize_t total_sent_size = 0;
 
        do {
-               len = ::send(m_sock_fd, buffer + total_sent_size, size - total_sent_size, m_send_flags);
+               len = ::send(m_sock_fd, (void const*)((uint8_t *)buffer + total_sent_size), size - total_sent_size, m_send_flags);
 
                if (len >= 0) {
                        total_sent_size += len;
@@ -242,7 +242,7 @@ ssize_t csocket::recv_for_stream(void* buffer, size_t size) const
        ssize_t total_recv_size = 0;
 
        do {
-               len = ::recv(m_sock_fd, buffer + total_recv_size, size - total_recv_size, m_recv_flags);
+               len = ::recv(m_sock_fd, (void *)((uint8_t *)buffer + total_recv_size), size - total_recv_size, m_recv_flags);
 
                if (len > 0) {
                        total_recv_size += len;