Sigh. The "data" element of a GArray is, alas, a "gchar *", not a "void
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Apr 2011 18:04:43 +0000 (18:04 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Apr 2011 18:04:43 +0000 (18:04 +0000)
*", and some compilers complain when you cast that pointer to something
requiring stricter alignment.  Maybe the intent is to nudge you into
thinking about whether the pointer really is properly aligned, but....

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36739 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/file_access.c

index 8d1feff515b77c545cb40fa21fa876b7233620da..810a6ca5cc6bae30113da3abc9d11a38ff81ac50 100644 (file)
@@ -179,7 +179,7 @@ static void init_open_routines(void) {
 
        g_array_append_vals(open_routines_arr,open_routines_base,N_FILE_TYPES);
 
-       open_routines = (wtap_open_routine_t*)open_routines_arr->data;
+       open_routines = (wtap_open_routine_t*)(void *)open_routines_arr->data;
 }
 
 void wtap_register_open_routine(wtap_open_routine_t open_routine, gboolean has_magic) {
@@ -190,7 +190,7 @@ void wtap_register_open_routine(wtap_open_routine_t open_routine, gboolean has_m
        else
                g_array_append_val(open_routines_arr,open_routine);
 
-       open_routines = (wtap_open_routine_t*)open_routines_arr->data;
+       open_routines = (wtap_open_routine_t*)(void *)open_routines_arr->data;
 }
 
 /*
@@ -662,7 +662,7 @@ static void init_file_types(void) {
 
        g_array_append_vals(dump_open_table_arr,dump_open_table_base,wtap_num_file_types);
 
-       dump_open_table = (const struct file_type_info*)dump_open_table_arr->data;
+       dump_open_table = (const struct file_type_info*)(void *)dump_open_table_arr->data;
 }
 
 int wtap_register_file_type(const struct file_type_info* fi) {
@@ -670,7 +670,7 @@ int wtap_register_file_type(const struct file_type_info* fi) {
 
        g_array_append_val(dump_open_table_arr,*fi);
 
-       dump_open_table = (const struct file_type_info*)dump_open_table_arr->data;
+       dump_open_table = (const struct file_type_info*)(void *)dump_open_table_arr->data;
 
        return wtap_num_file_types++;
 }