# HG changeset patch # User mroi # Date 1114013780 0 # Node ID 8c86b61eb06f7ebaf757ea45822feda6b157757a # Parent d999338cab17e48cb22d1d6f245a48e3801c7c01 fix compiler warnings related to aliasing violations diff -r d999338cab17 -r 8c86b61eb06f dvdnav.c --- a/dvdnav.c Wed Apr 20 16:05:43 2005 +0000 +++ b/dvdnav.c Wed Apr 20 16:16:20 2005 +0000 @@ -1092,23 +1092,28 @@ * the union of two of those bitfields so to make this quicker * than performing 32 ORs, we will access them as 32bits words. */ - uint32_t ops=0; + union { + user_ops_t ops_struct; + uint32_t ops_int; + } ops; + + ops.ops_int = 0; if(!this) { printerr("Passed a NULL pointer."); - return *(user_ops_t*)&ops; + return ops.ops_struct; } if(!this->started) { printerr("Virtual DVD machine not started."); - return *(user_ops_t*)&ops; + return ops.ops_struct; } pthread_mutex_lock(&this->vm_lock); - ops|=*(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl; + ops.ops_int |= *(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl; if(this->vm && this->vm->state.pgc) - ops|=*(uint32_t*)&this->vm->state.pgc->prohibited_ops; + ops.ops_int |= *(uint32_t*)&this->vm->state.pgc->prohibited_ops; pthread_mutex_unlock(&this->vm_lock); - return *(user_ops_t*)&ops; + return ops.ops_struct; } diff -r d999338cab17 -r 8c86b61eb06f dvdnav.h --- a/dvdnav.h Wed Apr 20 16:05:43 2005 +0000 +++ b/dvdnav.h Wed Apr 20 16:16:20 2005 +0000 @@ -580,6 +580,7 @@ */ user_ops_t dvdnav_get_restrictions(dvdnav_t *self); + /********************************************************************* * multiple angles * *********************************************************************/