diff --git a/Makefile b/Makefile index e6ad796b..51602975 100644 --- a/Makefile +++ b/Makefile @@ -45,8 +45,8 @@ mg_prefix: mongoose.c mongoose.h $(CLANG) mongoose.c $(CFLAGS) -c -o /tmp/x.o && nm /tmp/x.o | grep ' T' | grep -v 'mg_' ; test $$? = 1 # C++ build -test++: CLANG = g++ -Wno-deprecated -test++: WARN += -Wno-shadow +test++: CLANG = g++ +test++: WARN += -Wno-shadow -Wno-missing-field-initializers -Wno-deprecated test++: unamalgamated # Make sure we can build from an unamalgamated sources diff --git a/mongoose.c b/mongoose.c index 89f47a64..5eb2970c 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3846,7 +3846,7 @@ unsigned short mg_url_port(const char *url) { if (memcmp(url, "wss:", 4) == 0 || memcmp(url, "https:", 6) == 0) port = 443; if (memcmp(url, "mqtt:", 5) == 0) port = 1883; if (memcmp(url, "mqtts:", 6) == 0) port = 8883; - if (u.port) port = (uint16_t) atoi(url + u.port); + if (u.port) port = (unsigned short) atoi(url + u.port); return port; } diff --git a/src/url.c b/src/url.c index f54ecb80..b962a58e 100644 --- a/src/url.c +++ b/src/url.c @@ -64,7 +64,7 @@ unsigned short mg_url_port(const char *url) { if (memcmp(url, "wss:", 4) == 0 || memcmp(url, "https:", 6) == 0) port = 443; if (memcmp(url, "mqtt:", 5) == 0) port = 1883; if (memcmp(url, "mqtts:", 6) == 0) port = 8883; - if (u.port) port = (uint16_t) atoi(url + u.port); + if (u.port) port = (unsigned short) atoi(url + u.port); return port; }