Changeset 3325
- Timestamp:
- 05/05/08 01:05:16 (5 months ago)
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/opensync/helper/opensync_hashtable.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3307 r3325 1 2008-05-04 Graham Cobb <g+770@cobb.uk.net> 2 3 * opensync/helper/opensync_hashtable.c (osync_hashtable_get_deleted): 4 Reimplement change below to avoid local function declaration, which does not 5 work on suncc. Use user_data parameter on callback_check_deleted instead. 6 1 7 2008-05-03 Graham Cobb <g+770@cobb.uk.net> 2 8 trunk/opensync/helper/opensync_hashtable.c
r3313 r3325 495 495 * 496 496 */ 497 struct callback_data { 498 OSyncList *deleted_entries; 499 OSyncHashTable *table; 500 }; 501 static void callback_check_deleted(gpointer key, gpointer value, gpointer user_data) 502 { 503 struct callback_data *cbdata = user_data; 504 if (!g_hash_table_lookup(cbdata->table->reported_entries, key)) 505 cbdata->deleted_entries = osync_list_prepend(cbdata->deleted_entries, key); 506 } 497 507 OSyncList *osync_hashtable_get_deleted(OSyncHashTable *table) 498 508 { … … 502 512 osync_trace(TRACE_ENTRY, "%s(%p)", __func__, table); 503 513 504 OSyncList *deleted_entries = NULL; 505 506 void callback_check_deleted(gpointer key, gpointer value, gpointer user_data) 507 { 508 if (!g_hash_table_lookup(table->reported_entries, key)) 509 deleted_entries = osync_list_prepend(deleted_entries, key); 510 } 511 512 g_hash_table_foreach(table->db_entries, callback_check_deleted, NULL); 513 514 osync_trace(TRACE_EXIT, "%s: %p", __func__, deleted_entries); 515 return deleted_entries; 514 struct callback_data cbdata = {NULL, table}; 515 516 g_hash_table_foreach(table->db_entries, callback_check_deleted, &cbdata); 517 518 osync_trace(TRACE_EXIT, "%s: %p", __func__, cbdata.deleted_entries); 519 return cbdata.deleted_entries; 516 520 } 517 521
