DD1984 / sockperf

Automatically exported from code.google.com/p/sockperf
Other
1 stars 0 forks source link

When compiling Sockperf in Windows 64 bit there is a compilation warning #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When compiling Sockperf in Windows 64 bit the following compilation warning 
is printed:

    src\SockPerf.cpp(2430): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

The following patch will fix this issue:

Author: Dotan Barak <dotanb@dev.mellanox.co.il>
Date:   Wed Nov 6 14:36:59 2013 +0200

    Fixed compilation warning in Windows 64 bit

    Fixed the following compilation warning in Windows:
    src\SockPerf.cpp(2430): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

    Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>

diff --git a/src/SockPerf.cpp b/src/SockPerf.cpp
index f677546..a79282c 100644
--- a/src/SockPerf.cpp
+++ b/src/SockPerf.cpp
@@ -2425,7 +2425,7 @@ int sock_set_tos(int fd)
 {
        int rc = SOCKPERF_ERR_NONE;
        if (s_user_params.tos) {
-               size_t len = sizeof(s_user_params.tos);
+               socklen_t len = sizeof(s_user_params.tos);
                if (setsockopt(fd, IPPROTO_IP, IP_TOS, (char*)&s_user_params.tos, len) < 0) {
                        log_err("setsockopt(TOS), set  failed.  It could be that this option is not supported in your system");
                        rc = SOCKPERF_ERR_SOCKET;

Original issue reported on code.google.com by dot...@dev.mellanox.co.il on 6 Nov 2013 at 1:20

GoogleCodeExporter commented 9 years ago

Original comment by avne...@gmail.com on 6 Nov 2013 at 1:27

GoogleCodeExporter commented 9 years ago
fixed in r236

Original comment by orkmella...@gmail.com on 6 Nov 2013 at 2:01