diff options
author | Eion Robb <eion@robbmob.com> | 2018-11-10 22:12:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-10 22:12:22 +0300 |
commit | b405173ea4bafce50546f6a56755cd9566bf7b70 (patch) | |
tree | f166da68c76253c0a334e8f3125ea904e764f6c4 | |
parent | 90007bf698c0ea6571825f3a95f5bfa64c3fb817 (diff) | |
parent | 0603c20bddfad34d654e021b882d21b5f74507ca (diff) |
Merge pull request #621 from basicmaster/fix_printf_warnings
Fix printf warnings
-rw-r--r-- | skypeweb/libskypeweb.h | 12 | ||||
-rw-r--r-- | skypeweb/skypeweb_contacts.c | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/skypeweb/libskypeweb.h b/skypeweb/libskypeweb.h index e38739d..190a8c5 100644 --- a/skypeweb/libskypeweb.h +++ b/skypeweb/libskypeweb.h @@ -28,6 +28,7 @@ #include <glib.h> +#include <inttypes.h> #include <errno.h> #include <string.h> #include <glib/gi18n.h> @@ -45,6 +46,17 @@ # endif /* __GNUC__ >= 4 */ #endif /* G_GNUC_NULL_TERMINATED */ +// workaround for MinGW32 which doesn't support "%zu"; see also https://stackoverflow.com/a/44383330 +#ifdef _WIN32 +# ifdef _WIN64 +# define PRI_SIZET PRIu64 +# else +# define PRI_SIZET PRIu32 +# endif +#else +# define PRI_SIZET "zu" +#endif + #include "purplecompat.h" #ifdef _WIN32 diff --git a/skypeweb/skypeweb_contacts.c b/skypeweb/skypeweb_contacts.c index 202e598..363f75f 100644 --- a/skypeweb/skypeweb_contacts.c +++ b/skypeweb/skypeweb_contacts.c @@ -629,10 +629,10 @@ skypeweb_xfer_send_contents_reader(PurpleHttpConnection *con, gchar *buf, size_t PurpleXfer *xfer = swft->xfer; gsize read;
- purple_debug_info("skypeweb", "Asked %d bytes from offset %d\n", len, offset); + purple_debug_info("skypeweb", "Asked %" PRI_SIZET " bytes from offset %" PRI_SIZET "\n", len, offset); purple_xfer_set_bytes_sent(xfer, offset); read = purple_xfer_read_file(xfer, (guchar *)buf, len); - purple_debug_info("skypeweb", "Read %d bytes\n", read);
+ purple_debug_info("skypeweb", "Read %" G_GSIZE_FORMAT " bytes\n", read);
cb(con, TRUE, read != len, read); } |