- Replace %d with %ld specifiers for long unsigned int variables.
- g_variant_get expects Gvariant* instead of const Gvariant*.

Signed-off-by: Prathu Baronia <[email protected]>
---
 surf.c        | 6 +++---
 webext-surf.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/surf.c b/surf.c
index 03d8242..069d8ec 100644
--- a/surf.c
+++ b/surf.c
@@ -1237,7 +1237,7 @@ readsock(GIOChannel *s, GIOCondition ioc, gpointer unused)
                return TRUE;
        }
        if (msgsz < 2) {
-               fprintf(stderr, "surf: message too short: %d\n", msgsz);
+               fprintf(stderr, "surf: message too short: %ld\n", msgsz);
                return TRUE;
        }
 
@@ -1863,14 +1863,14 @@ msgext(Client *c, char type, const Arg *a)
        if (spair[0] < 0)
                return;
 
-       if ((ret = snprintf(msg, sizeof(msg), "%c%c%c", c->pageid, type, a->i))
+       if ((ret = snprintf(msg, sizeof(msg), "%ld%c%c", c->pageid, type, a->i))
            >= sizeof(msg)) {
                fprintf(stderr, "surf: message too long: %d\n", ret);
                return;
        }
 
        if (send(spair[0], msg, ret, 0) != ret)
-               fprintf(stderr, "surf: error sending: %u%c%d (%d)\n",
+               fprintf(stderr, "surf: error sending: %ld%c%d (%d)\n",
                        c->pageid, type, a->i, ret);
 }
 
diff --git a/webext-surf.c b/webext-surf.c
index d087219..f852c3e 100644
--- a/webext-surf.c
+++ b/webext-surf.c
@@ -25,7 +25,7 @@ msgsurf(guint64 pageid, const char *s)
        size_t sln = strlen(s);
        int ret;
 
-       if ((ret = snprintf(msg, sizeof(msg), "%c%s", pageid, s))
+       if ((ret = snprintf(msg, sizeof(msg), "%ld%s", pageid, s))
            >= sizeof(msg)) {
                fprintf(stderr, "webext: msg: message too long: %d\n", ret);
                return;
@@ -55,7 +55,7 @@ readsock(GIOChannel *s, GIOCondition c, gpointer unused)
        }
 
        if (msgsz < 2) {
-               fprintf(stderr, "webext: readsock: message too short: %d\n",
+               fprintf(stderr, "webext: readsock: message too short: %ld\n",
                        msgsz);
                return TRUE;
        }
@@ -95,7 +95,7 @@ 
webkit_web_extension_initialize_with_user_data(WebKitWebExtension *e,
 
        webext = e;
 
-       g_variant_get(gv, "i", &sock);
+       g_variant_get((GVariant *)gv, "i", &sock);
 
        gchansock = g_io_channel_unix_new(sock);
        g_io_channel_set_encoding(gchansock, NULL, NULL);
-- 
2.17.1


Reply via email to