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:
Robert Osfield
2010-04-20 13:34:57 +00:00
parent 2c64536a09
commit 3bef6f9eae

View File

@@ -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);
}