Skip to content

Commit

Permalink
Use uintptr_t for unsigned int that can hold a pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Jun 22, 2024
1 parent 587a8f9 commit 1955c21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/utils/pqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ void set_reaction_position(void* reaction, size_t pos) { ((reaction_t*)reaction)

void print_reaction(void* reaction) {
reaction_t* r = (reaction_t*)reaction;
LF_PRINT_DEBUG("%s: index: %llx, reaction: %p", r->name, r->index, reaction);
LF_PRINT_DEBUG("%s: index: %" PRIxPTR ", reaction: %p", r->name, r->index, reaction);
}
3 changes: 2 additions & 1 deletion include/core/utils/pqueue_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
#define PQUEUE_BASE_H

#include <stddef.h>
#include <stdint.h>

/** Priority data type. */
typedef unsigned long long pqueue_pri_t;
typedef uintptr_t pqueue_pri_t;

/** Callback to get the priority of an element. */
typedef pqueue_pri_t (*pqueue_get_pri_f)(void* a);
Expand Down

0 comments on commit 1955c21

Please sign in to comment.