Re: g_ptr_array_sort bug?



On Wednesday 17 March 2004 20:35, bhochstetler houston rr com wrote:

Has anyone used the g_ptr_array_sort method? The pointers I put into the
g_ptr_array are never given to the compare_func. I've attached some code
that demonstrates this problem.

-    MyType *adata = (MyType*)a;
-    MyType *bdata = (MyType*)b;

+    MyType *adata = *((MyType**)a);
+    MyType *bdata = *((MyType**)b);

should fix this. 

Cheers
-Tim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]