[libdvdnav-devel] [PATCH] nav_print: Remove printing bogus value for vobu_uop_ctl

Diego Biurrun diego at biurrun.de
Thu Jan 2 22:31:27 CET 2014


navPrint_PCI_GI() prints the values of a pci_gi_t struct, but for the embedded
user_ops_t substruct it just prints the first 32 bytes by pointer type punning.
Given that the latter is a large struct with members of system-dependent sizes
the result of this is often enough just a random value, so drop printing the
value altogether.

src/nav_print.c:39:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
---
 src/nav_print.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/nav_print.c b/src/nav_print.c
index e224222..2d9e6b2 100644
--- a/src/nav_print.c
+++ b/src/nav_print.c
@@ -36,7 +36,6 @@ static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
   printf("pci_gi:\n");
   printf("nv_pck_lbn    0x%08x\n", pci_gi->nv_pck_lbn);
   printf("vobu_cat      0x%04x\n", pci_gi->vobu_cat);
-  printf("vobu_uop_ctl  0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl);
   printf("vobu_s_ptm    0x%08x\n", pci_gi->vobu_s_ptm);
   printf("vobu_e_ptm    0x%08x\n", pci_gi->vobu_e_ptm);
   printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm);
-- 
1.8.3.2



More information about the libdvdnav-devel mailing list