From 768ceb4ead2c1a78b2af047e8f54f2472b34e849 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 3 Oct 2021 12:02:58 +0900 Subject: [PATCH] Cast to void pointer for `%p` in commented out code [ci skip] --- addr2line.c | 2 +- compile.c | 8 ++++---- ractor.c | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/addr2line.c b/addr2line.c index d99102407d..f660be9129 100644 --- a/addr2line.c +++ b/addr2line.c @@ -2138,7 +2138,7 @@ found_mach_header: char *strtab = file + cmd->stroff, *sname = 0; uint32_t j; uintptr_t saddr = 0; - /* kprintf("[%2d]: %x/symtab %p\n", i, cmd->cmd, p); */ + /* kprintf("[%2d]: %x/symtab %p\n", i, cmd->cmd, (void *)p); */ for (j = 0; j < cmd->nsyms; j++) { uintptr_t symsize, d; struct LP(nlist) *e = &nl[j]; diff --git a/compile.c b/compile.c index e9295a47b4..1e88dc242d 100644 --- a/compile.c +++ b/compile.c @@ -1181,11 +1181,11 @@ debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *cur) { LINK_ELEMENT *list = FIRST_ELEMENT(anchor); printf("----\n"); - printf("anch: %p, frst: %p, last: %p\n", &anchor->anchor, - anchor->anchor.next, anchor->last); + printf("anch: %p, frst: %p, last: %p\n", (void *)&anchor->anchor, + (void *)anchor->anchor.next, (void *)anchor->last); while (list) { - printf("curr: %p, next: %p, prev: %p, type: %d\n", list, list->next, - list->prev, (int)list->type); + printf("curr: %p, next: %p, prev: %p, type: %d\n", (void *)list, (void *)list->next, + (void *)list->prev, (int)list->type); list = list->next; } printf("----\n"); diff --git a/ractor.c b/ractor.c index 9253327165..0a9033c5b6 100644 --- a/ractor.c +++ b/ractor.c @@ -413,7 +413,7 @@ ractor_queue_enq(rb_ractor_t *r, struct rb_ractor_queue *rq, struct rb_ractor_ba rq->size *= 2; } rq->baskets[(rq->start + rq->cnt++) % rq->size] = *basket; - // fprintf(stderr, "%s %p->cnt:%d\n", __func__, rq, rq->cnt); + // fprintf(stderr, "%s %p->cnt:%d\n", __func__, (void *)rq, rq->cnt); } static void @@ -502,7 +502,7 @@ ractor_wakeup(rb_ractor_t *r, enum ractor_wait_status wait_status, enum ractor_w { ASSERT_ractor_locking(r); - // fprintf(stderr, "%s r:%p status:%s/%s wakeup_status:%s/%s\n", __func__, r, + // fprintf(stderr, "%s r:%p status:%s/%s wakeup_status:%s/%s\n", __func__, (void *)r, // wait_status_str(r->sync.wait.status), wait_status_str(wait_status), // wakeup_status_str(r->sync.wait.wakeup_status), wakeup_status_str(wakeup_status)); @@ -582,7 +582,7 @@ ractor_sleep(rb_execution_context_t *ec, rb_ractor_t *cr) { VM_ASSERT(GET_RACTOR() == cr); VM_ASSERT(cr->sync.wait.status != wait_none); - // fprintf(stderr, "%s r:%p status:%s, wakeup_status:%s\n", __func__, cr, + // fprintf(stderr, "%s r:%p status:%s, wakeup_status:%s\n", __func__, (void *)cr, // wait_status_str(cr->sync.wait.status), wakeup_status_str(cr->sync.wait.wakeup_status)); RACTOR_UNLOCK(cr); @@ -754,7 +754,8 @@ rq_dump(struct rb_ractor_queue *rq) bool bug = false; for (int i=0; icnt; i++) { struct rb_ractor_basket *b = ractor_queue_at(rq, i); - fprintf(stderr, "%d (start:%d) type:%s %p %s\n", i, rq->start, basket_type_name(b->type), b, RSTRING_PTR(RARRAY_AREF(b->v, 1))); + fprintf(stderr, "%d (start:%d) type:%s %p %s\n", i, rq->start, basket_type_name(b->type), + (void *)b, RSTRING_PTR(RARRAY_AREF(b->v, 1))); if (b->type == basket_type_reserved) bug = true; } if (bug) rb_bug("!!");