Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress error: cast from pointer to integer of different size #448

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
petervdonovan marked this conversation as resolved.
Show resolved Hide resolved

/**
* @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));
petervdonovan marked this conversation as resolved.
Show resolved Hide resolved
}

pqueue_tag_t* pqueue_tag_init(size_t initial_size) {
Expand Down
Loading