Skip to content

Commit f8629c8

Browse files
committed
Fix compilation warnings
1 parent 38995c3 commit f8629c8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ if(MSVC)
2525
endif()
2626

2727
if (UNIX)
28-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wfatal-errors -fvisibility=hidden -Wfatal-errors -pedantic -Wl,--no-undefined -fPIC -Wall -Wextra -Wconversion -Werror=int-conversion -Werror=return-type -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=discarded-qualifiers")
29-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s -O3")
30-
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0")
31-
3228
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wfatal-errors -fvisibility=hidden -Wfatal-errors -pedantic -Wl,--no-undefined -fPIC -Wall -Wextra -Wconversion -Werror=return-type")
3329
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s -O3")
3430
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0")
@@ -47,7 +43,7 @@ set_target_properties(libwebster PROPERTIES
4743
PREFIX "lib" )
4844

4945

50-
find_package(Threads REQUIRED)
46+
#find_package(Threads REQUIRED)
5147

5248
add_executable(example_echo "examples/echo.cc")
5349
target_link_libraries(example_echo libwebster)

webster.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ int SocketNetwork::receive( Channel *channel, uint8_t *buffer, int size, int *re
17911791
int result = webster::poll(chann->poll, timeout);
17921792
if (result != WBERR_OK) return result;
17931793

1794-
auto bytes = ::recv(chann->socket, (char *) buffer, (size_t) size, 0);
1794+
auto bytes = ::recv(chann->socket, (char *) buffer, size, 0);
17951795
if (bytes <= 0)
17961796
{
17971797
if (bytes == 0) return WBERR_NOT_CONNECTED;
@@ -1812,15 +1812,19 @@ int SocketNetwork::send( Channel *channel, const uint8_t *buffer, int size, int
18121812

18131813
#ifdef WB_WINDOWS
18141814
int flags = 0;
1815+
int sent = 0
1816+
int pending = size;
1817+
int bytes = 0;
18151818
#else
18161819
int flags = MSG_NOSIGNAL;
1817-
#endif
18181820
ssize_t sent = 0;
18191821
ssize_t pending = size;
1822+
ssize_t bytes = 0;
1823+
#endif
18201824

18211825
do
18221826
{
1823-
ssize_t bytes = ::send(chann->socket, (const char *) buffer, pending, flags);
1827+
bytes = ::send(chann->socket, (const char *) buffer, pending, flags);
18241828
if (bytes < 0)
18251829
{
18261830
int code = get_error();

webster.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ struct Target
189189
std::string query;
190190

191191
Target();
192-
Target( const Target &that ) = default;
193-
Target( Target &&that ) = default;
194-
Target &operator=( const Target &that ) = default;
192+
Target( const Target & ) = default;
193+
Target( Target && ) = default;
194+
Target &operator=( const Target & ) = default;
195195
static int parse( const char *url, Target &target ); // TODO: make this dynamic
196196
static int parse( const std::string &url, Target &target ); // TODO: make this dynamic
197197
static std::string encode( const std::string & value );

0 commit comments

Comments
 (0)