Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame^] | 1 | From b97f62fdf3b78eb5cfcb3a1b12c6fd62f735717b Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 15 Jul 2017 09:29:33 -0700 |
| 4 | Subject: [PATCH] event.c: Cast pthread_t to unsigned long instead of unsigned |
| 5 | int |
| 6 | |
| 7 | On 64bit machines it ends up in errors |
| 8 | |
| 9 | event.c:85:67: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] |
| 10 | a_event->tid_hex_str_len = sprintf(a_event->tid_hex_str, "0x%x", (unsigned int)a_event->tid); |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | src/event.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/src/event.c b/src/event.c |
| 18 | index 8f988b5..c632c33 100644 |
| 19 | --- a/src/event.c |
| 20 | +++ b/src/event.c |
| 21 | @@ -82,7 +82,7 @@ zlog_event_t *zlog_event_new(int time_cache_count) |
| 22 | a_event->tid = pthread_self(); |
| 23 | |
| 24 | a_event->tid_str_len = sprintf(a_event->tid_str, "%lu", (unsigned long)a_event->tid); |
| 25 | - a_event->tid_hex_str_len = sprintf(a_event->tid_hex_str, "0x%x", (unsigned int)a_event->tid); |
| 26 | + a_event->tid_hex_str_len = sprintf(a_event->tid_hex_str, "0x%lu", (unsigned long)a_event->tid); |
| 27 | |
| 28 | //zlog_event_profile(a_event, ZC_DEBUG); |
| 29 | return a_event; |
| 30 | -- |
| 31 | 2.13.3 |
| 32 | |