As DWORD is a typedef for unsigned long, we can use the %lu format
specifier. The %p format specifier requires (void *) pointers.

Signed-off-by: Antonin Décimo <anto...@tarides.com>
---
 mingw-w64-libraries/winpthreads/src/cond.c   |  6 +++---
 mingw-w64-libraries/winpthreads/src/rwlock.c |  6 +++---
 mingw-w64-libraries/winpthreads/src/thread.c | 16 ++++++++--------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/cond.c 
b/mingw-w64-libraries/winpthreads/src/cond.c
index d50f85b40..7a3b73a5a 100644
--- a/mingw-w64-libraries/winpthreads/src/cond.c
+++ b/mingw-w64-libraries/winpthreads/src/cond.c
@@ -67,11 +67,11 @@ void cond_print(volatile pthread_cond_t *c, char *txt)
     if (!print_state) return;
     cond_t *c_ = (cond_t *)*c;
     if (c_ == NULL) {
-        fprintf(fo,"C%p %d %s\n",(void *)*c,(int)GetCurrentThreadId(),txt);
+        fprintf(fo,"C%p %lu %s\n",(void *)*c,GetCurrentThreadId(),txt);
     } else {
-        fprintf(fo,"C%p %d V=%0X w=%ld %s\n",
+        fprintf(fo,"C%p %lu V=%0X w=%ld %s\n",
             (void *)*c,
-            (int)GetCurrentThreadId(), 
+            GetCurrentThreadId(),
             (int)c_->valid, 
             c_->waiters_count_,
             txt
diff --git a/mingw-w64-libraries/winpthreads/src/rwlock.c 
b/mingw-w64-libraries/winpthreads/src/rwlock.c
index f2496f3db..76669dff1 100644
--- a/mingw-w64-libraries/winpthreads/src/rwlock.c
+++ b/mingw-w64-libraries/winpthreads/src/rwlock.c
@@ -140,11 +140,11 @@ void rwl_print(volatile pthread_rwlock_t *rwl, char *txt)
     if (!print_state) return;
     rwlock_t *r = (rwlock_t *)*rwl;
     if (r == NULL) {
-        printf("RWL%p %d %s\n",(void *)*rwl,(int)GetCurrentThreadId(),txt);
+        printf("RWL%p %lu %s\n",(void *)*rwl,GetCurrentThreadId(),txt);
     } else {
-        printf("RWL%p %d V=%0X B=%d r=%ld w=%ld L=%p %s\n",
+        printf("RWL%p %lu V=%0X B=%d r=%ld w=%ld L=%p %s\n",
             (void *)*rwl,
-            (int)GetCurrentThreadId(), 
+            GetCurrentThreadId(),
             (int)r->valid, 
             (int)r->busy,
             0L,0L,NULL,txt);
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 4049ec5c9..45136dd37 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -548,13 +548,13 @@ thread_print (volatile pthread_t t, char *txt)
     if (!print_state)
       return;
     if (!t)
-      printf("T%p %d %s\n",NULL,(int)GetCurrentThreadId(),txt);
+      printf("T%p %lu %s\n",NULL,GetCurrentThreadId(),txt);
     else
       {
-       printf("T%p %d V=%0X H=%p %s\n",
-           __pth_gpointer_locked (t), 
-           (int)GetCurrentThreadId(), 
-           (int) (__pth_gpointer_locked (t))->valid, 
+       printf("T%p %lu V=%0X H=%p %s\n",
+           (void *) __pth_gpointer_locked (t),
+           GetCurrentThreadId(),
+           (__pth_gpointer_locked (t))->valid,
            (__pth_gpointer_locked (t))->h,
            txt
            );
@@ -626,7 +626,7 @@ leaveOnceObject (collect_once_t *c)
        }
     }
   else
-    fprintf(stderr, "%p not found?!?!\n", c);
+    fprintf(stderr, "%p not found?!?!\n", (void *) c);
   pthread_spin_unlock (&once_global);
 }
 
@@ -657,7 +657,7 @@ _pthread_once_raw (pthread_once_t *o, void (*func)(void))
       *o = 1;
     }
   else if (*o != 1)
-    fprintf (stderr," once %p is %d\n", o, (int) *o);
+    fprintf (stderr," once %p is %ld\n", (void *) o, (long) *o);
   pthread_mutex_unlock(&co->m);
   leaveOnceObject(co);
 
@@ -782,7 +782,7 @@ pthread_once (pthread_once_t *o, void (*func)(void))
       *o = 1;
     }
   else if (*o != 1)
-    fprintf (stderr," once %p is %d\n", o, (int) *o);
+    fprintf (stderr," once %p is %ld\n", (void *) o, (long) *o);
   pthread_mutex_unlock(&co->m);
   leaveOnceObject(co);
 
-- 
2.43.0



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to