now with attachment

On 11/ 4/13 06:46 PM, Nils Goroll wrote:
can we come back to this one ?

Only casting to (void *) gives a

warning: cast to pointer from integer of different size

and I like -Wall

Thanks, Nils
>From dd833610ddbf01c007163c9444f8c24e1a1f22fe Mon Sep 17 00:00:00 2001
From: Nils Goroll <[email protected]>
Date: Mon, 4 Nov 2013 18:41:11 +0100
Subject: [PATCH] portable cast from thread_id to (void *)

Fixes #932
---
 bin/varnishreplay/varnishreplay.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/varnishreplay/varnishreplay.c 
b/bin/varnishreplay/varnishreplay.c
index f7355cb..b7648ae 100644
--- a/bin/varnishreplay/varnishreplay.c
+++ b/bin/varnishreplay/varnishreplay.c
@@ -175,7 +175,7 @@ thread_log(int lvl, int errcode, const char *fmt, ...)
        if (lvl > debug)
                return;
        pthread_mutex_lock(&log_mutex);
-       fprintf(stderr, "%p ", (void *)pthread_self());
+       fprintf(stderr, "%p ", (void *)(uintptr_t)pthread_self());
        va_start(ap, fmt);
        vfprintf(stderr, fmt, ap);
        va_end(ap);
@@ -269,7 +269,7 @@ thread_get(int fd, void *(*thread_main)(void *))
                } else {
                        threads[fd]->fd = fd;
                        thread_log(0, 0, "thread %p:%d started",
-                           (void *)threads[fd]->thread_id, fd);
+                           (void *)(uintptr_t)threads[fd]->thread_id, fd);
                }
        }
        if (threads[fd] == THREAD_FAIL)
@@ -294,7 +294,7 @@ thread_close(int fd)
        mailbox_close(&threads[fd]->mbox);
        pthread_join(threads[fd]->thread_id, NULL);
        thread_log(0, 0, "thread %p stopped",
-           (void *)threads[fd]->thread_id);
+           (void *)(uintptr_t)threads[fd]->thread_id);
        thread_clear(threads[fd]);
        mailbox_destroy(&threads[fd]->mbox);
        freez(threads[fd]);
-- 
1.5.6.5

_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to