Implemented Colin MacDonald's recommended change of "unsigned short" to "unsigned" to solve big endian problem under Solaris.
Also added comment to highlight the oddity of the mixing of types in the associated lib3ds code.
This commit is contained in:
@@ -452,7 +452,8 @@ compare_node_id( const void *a, const void *b ) {
|
||||
|
||||
static int
|
||||
compare_node_id2( const void *a, const void *b ) {
|
||||
return (int)(*((unsigned short*)a)) - (int)((*((Lib3dsNode**)b))->node_id);
|
||||
// not a is a pointer in the calling bsearch routine the user_id is an unsigned, while the node_id is an unsigned short?!
|
||||
return (int)(*((unsigned*)a)) - (int)((*((Lib3dsNode**)b))->node_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user