diff options
author | jstebbins <[email protected]> | 2008-09-07 17:06:39 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-09-07 17:06:39 +0000 |
commit | b97863af3eb0b376403de71d89b070d65b6bbe9b (patch) | |
tree | 50d537dbb11c6f1ebd3febf095dc3932401563a6 /gtk/src/values.c | |
parent | 5917f628bf5aa7d6c19aa4bb67588ef064dc709c (diff) |
LinGui: Fix several strict-aliasing warnings and a null pointer dereference
that can happen if preferences don't yet exist and your running the app over
an ssh session.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1673 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/values.c')
-rw-r--r-- | gtk/src/values.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/src/values.c b/gtk/src/values.c index 8ef3bf365..b6be28af4 100644 --- a/gtk/src/values.c +++ b/gtk/src/values.c @@ -528,7 +528,10 @@ dict_copy(gpointer boxed) dict_delete_key, dict_delete_value); g_hash_table_iter_init(&iter, dict); - while (g_hash_table_iter_next(&iter, (gpointer*)&key, (gpointer*)&gval)) + // middle (void*) cast prevents gcc warning "defreferencing type-punned + // pointer will break strict-aliasing rules" + while (g_hash_table_iter_next( + &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval)) { g_hash_table_insert(copy, g_strdup(key), ghb_value_dup(gval)); } |