Skip to content

Commit

Permalink
Suppress error: cast from pointer to integer of different size [-Werr…
Browse files Browse the repository at this point in the history
…or=pointer-to-int-cast]
  • Loading branch information
petervdonovan committed Jun 20, 2024
1 parent 587a8f9 commit 6c51f7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/utils/pqueue_tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include <stdlib.h>
#include <stdint.h>

#include "pqueue_tag.h"
#include "util.h" // For lf_print
Expand All @@ -23,7 +24,7 @@
* element is also the priority. This function is of type pqueue_get_pri_f.
* @param element A pointer to a pqueue_tag_element_t, cast to void*.
*/
static pqueue_pri_t pqueue_tag_get_priority(void* element) { return (pqueue_pri_t)element; }
static pqueue_pri_t pqueue_tag_get_priority(void* element) { return (pqueue_pri_t)(uintptr_t)element; }

/**
* @brief Callback function to determine whether two elements are equivalent.
Expand Down Expand Up @@ -65,7 +66,7 @@ static void pqueue_tag_print_element(void* element) {
// Functions defined in pqueue_tag.h.

int pqueue_tag_compare(pqueue_pri_t priority1, pqueue_pri_t priority2) {
return (lf_tag_compare(((pqueue_tag_element_t*)priority1)->tag, ((pqueue_tag_element_t*)priority2)->tag));
return (lf_tag_compare(((pqueue_tag_element_t*)(uintptr_t)priority1)->tag, ((pqueue_tag_element_t*)(uintptr_t)priority2)->tag));
}

pqueue_tag_t* pqueue_tag_init(size_t initial_size) {
Expand Down

0 comments on commit 6c51f7d

Please sign in to comment.