[Bf-committers] Proposed changes re: procedural textures
Mathias Panzenböck
grosser.meister.morti at gmx.net
Thu Nov 30 20:08:04 CET 2006
Emil Brink wrote:
> [hash]
>> The only ugly thing at the moment:
>> The hash_get_sorted_keys() function uses it's own quick-sort
>> implementation (the one from
>> Wikipedia). Somehow stdlibs qsort didn't work. I don't know what I did
>> wrong. I left the qsort call
>> as comment in the source, maybe someone knows what's wrong.
>
> Hm ... I replied to this a couple of hours ago, but haven't seen my reply
> turn up on the list yet, I suspect there's some issue with my mail. So this
> is a second attempt, using webmail instead. Apologies if two replies turn
> up.
>
> Anyway, attached is a patch that I believe fixes the issue with qsort().
> The problem I think was due to that since you are sorting an array of
> pointers (each "element" in qsort's opinion) is a pointer, you get pointers
> to pointers in the comparison function. So, you cannot hand qsort() strcmp()
> directly, since that requires pointers to the strings. You need a small
> glue function between them, that does the dereferencing.
>
Oh. I see. Thanks!
I applyed the changes and removed q_sort.
Download here:
http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=213233
panzi
More information about the Bf-committers
mailing list