mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
Squash some warnings under mingw crosscompiler
This commit is contained in:
1 parent
4d123a15f9
commit
25bc13ef1e
4 files changed
+10
-6
No files matched your search
+2
-1
@@ -1968,7 +1968,8 @@ char *mg_straddr(struct mg_connection *c, char *buf, size_t len) {
|
|||||||
char *mg_ntoa(const struct mg_addr *addr, char *buf, size_t len) {
|
char *mg_ntoa(const struct mg_addr *addr, char *buf, size_t len) {
|
||||||
uint8_t p[4];
|
uint8_t p[4];
|
||||||
memcpy(p, &addr->ip, sizeof(p));
|
memcpy(p, &addr->ip, sizeof(p));
|
||||||
snprintf(buf, len, "%hhu.%hhu.%hhu.%hhu", p[0], p[1], p[2], p[3]);
|
snprintf(buf, len, "%d.%d.%d.%d", (int) p[0], (int) p[1], (int) p[2],
|
||||||
|
(int) p[3]);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -264,8 +264,10 @@ enum { false = 0, true = 1 };
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define PATH_MAX MAX_PATH
|
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX MAX_PATH
|
||||||
|
#endif
|
||||||
#ifndef EINPROGRESS
|
#ifndef EINPROGRESS
|
||||||
#define EINPROGRESS WSAEINPROGRESS
|
#define EINPROGRESS WSAEINPROGRESS
|
||||||
#endif
|
#endif
|
||||||
@@ -280,7 +282,6 @@ typedef int socklen_t;
|
|||||||
#define va_copy(x, y) (x) = (y)
|
#define va_copy(x, y) (x) = (y)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef S_ISDIR
|
#ifndef S_ISDIR
|
||||||
#define S_ISDIR(x) (((x) &_S_IFMT) == _S_IFDIR)
|
#define S_ISDIR(x) (((x) &_S_IFMT) == _S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+3
-2
@@ -28,8 +28,10 @@ enum { false = 0, true = 1 };
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define PATH_MAX MAX_PATH
|
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX MAX_PATH
|
||||||
|
#endif
|
||||||
#ifndef EINPROGRESS
|
#ifndef EINPROGRESS
|
||||||
#define EINPROGRESS WSAEINPROGRESS
|
#define EINPROGRESS WSAEINPROGRESS
|
||||||
#endif
|
#endif
|
||||||
@@ -44,7 +46,6 @@ typedef int socklen_t;
|
|||||||
#define va_copy(x, y) (x) = (y)
|
#define va_copy(x, y) (x) = (y)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef S_ISDIR
|
#ifndef S_ISDIR
|
||||||
#define S_ISDIR(x) (((x) &_S_IFMT) == _S_IFDIR)
|
#define S_ISDIR(x) (((x) &_S_IFMT) == _S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ char *mg_straddr(struct mg_connection *c, char *buf, size_t len) {
|
|||||||
char *mg_ntoa(const struct mg_addr *addr, char *buf, size_t len) {
|
char *mg_ntoa(const struct mg_addr *addr, char *buf, size_t len) {
|
||||||
uint8_t p[4];
|
uint8_t p[4];
|
||||||
memcpy(p, &addr->ip, sizeof(p));
|
memcpy(p, &addr->ip, sizeof(p));
|
||||||
snprintf(buf, len, "%hhu.%hhu.%hhu.%hhu", p[0], p[1], p[2], p[3]);
|
snprintf(buf, len, "%d.%d.%d.%d", (int) p[0], (int) p[1], (int) p[2],
|
||||||
|
(int) p[3]);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user