Re: [gtk-list] Re: g_list_insert_sorted bug



Sorry Owen, you are incorrect.

If you call g_slist_length on an empty list, it returns a length of 1...

If you actually test the follwing code:

>>

int some_func(gpointer data, gpointer user_data) {
  printf ("*: %s, %s\n", data, user_data);
}

int main (){
GSList       *Llist;

Llist = g_slist_alloc();

g_list_foreach (Llist, some_func, NULL);
	
}

<<

It Prints:

*: (null), (null)


Add 1 item to the list and it prints:

*: (null), (null)
*: item1, (null)



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