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

Fix cast between incompatible function type #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aganm
Copy link
Contributor

@aganm aganm commented Dec 16, 2021

These 4 functions should return cpBool. (see commit)

Fixes these warnings:

[23/32] Building C object CMakeFiles/lib/Chipmunk2D/src/cpSweep1D.c.o                                          
../../lib/Chipmunk2D/src/cpSweep1D.c:251:2: warning: cast between incompatible function types from ‘int (*)(cpSweep1D *, void *, cpHashValue)’ {aka ‘int (*)(cpSweep1D *, void *, long unsigned int)’} to ‘cpBool (*)(cpSpatialIndex *, void *
, cpHashValue)’ {aka ‘unsigned char (*)(cpSpatialIndex *, void *, long unsigned int)’} [-Wcast-function-type]                                                                                                                                   251 |  (cpSpatialIndexContainsImpl)cpSweep1DContains,                                                                
      |  ^                                                                                                             
[26/32] Building C object CMakeFiles/lib/Chipmunk2D/src/cpBBTree.c.o                                           
../../lib/Chipmunk2D/src/cpBBTree.c: In function ‘cpBBTreeInit’:                                                                                                                                                                              
../../lib/Chipmunk2D/src/cpBBTree.c:573:33: warning: cast between incompatible function types from ‘int (*)(void *, Node *)’ to ‘cpBool (*)(const void *, const void *)’ {aka ‘unsigned char (*)(const void *, const void *)’} [-Wcast-functio
n-type]                                                                                                                
  573 |  tree->leaves = cpHashSetNew(0, (cpHashSetEqlFunc)leafSetEql);                                                 
      |                                 ^                                                                                                                                                                                                     
[29/32] Building C object CMakeFiles/lib/Chipmunk2D/src/cpSpaceHash.c.o                                        
../../lib/Chipmunk2D/src/cpSpaceHash.c: In function ‘cpSpaceHashInit’:                                                 
../../lib/Chipmunk2D/src/cpSpaceHash.c:181:36: warning: cast between incompatible function types from ‘int (*)(void *, cpHandle *)’ to ‘cpBool (*)(const void *, const void *)’ {aka ‘unsigned char (*)(const void *, const void *)’} [-Wcast-
function-type]                                                                                                                                                                                                                                
  181 |  hash->handleSet = cpHashSetNew(0, (cpHashSetEqlFunc)handleSetEql);                                                                                                                                                                   
      |                                    ^                                                                           
../../lib/Chipmunk2D/src/cpSpaceHash.c: At top level:                                                                  
../../lib/Chipmunk2D/src/cpSpaceHash.c:578:2: warning: cast between incompatible function types from ‘int (*)(cpSpaceHash *, void *, cpHashValue)’ {aka ‘int (*)(cpSpaceHash *, void *, long unsigned int)’} to ‘cpBool (*)(cpSpatialIndex *, 
void *, cpHashValue)’ {aka ‘unsigned char (*)(cpSpatialIndex *, void *, long unsigned int)’} [-Wcast-function-type]                                                                                                                           
  578 |  (cpSpatialIndexContainsImpl)cpSpaceHashContains,                                                              
      |  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant