Skip to content

Commit d94a533

Browse files
committed
Properly cast the list_item_t
Technically, the object is a "struct pmix_list_item_t*" in the pmix_list_t definition because the actual list item object hasn't been defined yet when we defined the list structure. So when we access it, we should cast to the defined object. Signed-off-by: Ralph Castain <[email protected]>
1 parent 1318c07 commit d94a533

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/class/pmix_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static inline pmix_list_item_t *pmix_list_remove_first(pmix_list_t *list)
670670
list->pmix_list_length--;
671671

672672
/* get pointer to first element on the list */
673-
item = list->pmix_list_sentinel.pmix_list_next;
673+
item = (pmix_list_item_t*)list->pmix_list_sentinel.pmix_list_next;
674674

675675
/* reset previous pointer of next item on the list */
676676
item->pmix_list_next->pmix_list_prev = item->pmix_list_prev;
@@ -731,7 +731,7 @@ static inline pmix_list_item_t *pmix_list_remove_last(pmix_list_t *list)
731731
list->pmix_list_length--;
732732

733733
/* get item */
734-
item = list->pmix_list_sentinel.pmix_list_prev;
734+
item = (pmix_list_item_t*)list->pmix_list_sentinel.pmix_list_prev;
735735

736736
/* reset previous pointer on next to last pointer */
737737
item->pmix_list_prev->pmix_list_next = item->pmix_list_next;

0 commit comments

Comments
 (0)