diff options
| author | 2024-11-28 16:22:09 +0100 | |
|---|---|---|
| committer | 2024-11-28 16:22:09 +0100 | |
| commit | 1813edad70efd32feba4f5778536de264241132e (patch) | |
| tree | bcfb81fe083df54bce92ea0d78f6d61067914e8a /src | |
| parent | b611aa62b8373f6d47bf3528782550a2667cc0f0 (diff) | |
| download | libplist-1813edad70efd32feba4f5778536de264241132e.tar.gz libplist-1813edad70efd32feba4f5778536de264241132e.tar.bz2 | |
Fix warnings on MSVC
Diffstat (limited to 'src')
| -rw-r--r-- | src/jplist.c | 4 | ||||
| -rw-r--r-- | src/oplist.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c index 4f30cd0..1c7a932 100644 --- a/src/jplist.c +++ b/src/jplist.c | |||
| @@ -72,8 +72,10 @@ void plist_json_set_debug(int debug) | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | #ifndef HAVE_STRNDUP | 74 | #ifndef HAVE_STRNDUP |
| 75 | #ifndef _MSC_VER | ||
| 75 | #pragma GCC diagnostic push | 76 | #pragma GCC diagnostic push |
| 76 | #pragma GCC diagnostic ignored "-Wshadow" | 77 | #pragma GCC diagnostic ignored "-Wshadow" |
| 78 | #endif | ||
| 77 | static char* strndup(const char* str, size_t len) | 79 | static char* strndup(const char* str, size_t len) |
| 78 | { | 80 | { |
| 79 | char *newstr = (char *)malloc(len+1); | 81 | char *newstr = (char *)malloc(len+1); |
| @@ -83,8 +85,10 @@ static char* strndup(const char* str, size_t len) | |||
| 83 | } | 85 | } |
| 84 | return newstr; | 86 | return newstr; |
| 85 | } | 87 | } |
| 88 | #ifndef _MSC_VER | ||
| 86 | #pragma GCC diagnostic pop | 89 | #pragma GCC diagnostic pop |
| 87 | #endif | 90 | #endif |
| 91 | #endif | ||
| 88 | 92 | ||
| 89 | static size_t dtostr(char *buf, size_t bufsize, double realval) | 93 | static size_t dtostr(char *buf, size_t bufsize, double realval) |
| 90 | { | 94 | { |
diff --git a/src/oplist.c b/src/oplist.c index 6ab6603..33896f9 100644 --- a/src/oplist.c +++ b/src/oplist.c | |||
| @@ -71,8 +71,10 @@ void plist_ostep_set_debug(int debug) | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | #ifndef HAVE_STRNDUP | 73 | #ifndef HAVE_STRNDUP |
| 74 | #ifndef _MSC_VER | ||
| 74 | #pragma GCC diagnostic push | 75 | #pragma GCC diagnostic push |
| 75 | #pragma GCC diagnostic ignored "-Wshadow" | 76 | #pragma GCC diagnostic ignored "-Wshadow" |
| 77 | #endif | ||
| 76 | static char* strndup(const char* str, size_t len) | 78 | static char* strndup(const char* str, size_t len) |
| 77 | { | 79 | { |
| 78 | char *newstr = (char *)malloc(len+1); | 80 | char *newstr = (char *)malloc(len+1); |
| @@ -82,8 +84,10 @@ static char* strndup(const char* str, size_t len) | |||
| 82 | } | 84 | } |
| 83 | return newstr; | 85 | return newstr; |
| 84 | } | 86 | } |
| 87 | #ifndef _MSC_VER | ||
| 85 | #pragma GCC diagnostic pop | 88 | #pragma GCC diagnostic pop |
| 86 | #endif | 89 | #endif |
| 90 | #endif | ||
| 87 | 91 | ||
| 88 | static size_t dtostr(char *buf, size_t bufsize, double realval) | 92 | static size_t dtostr(char *buf, size_t bufsize, double realval) |
| 89 | { | 93 | { |
