[xiph-commits] r16100 - experimental/giles/rogg

giles at svn.xiph.org giles at svn.xiph.org
Wed Jun 10 16:11:53 PDT 2009


Author: giles
Date: 2009-06-10 16:11:53 -0700 (Wed, 10 Jun 2009)
New Revision: 16100

Modified:
   experimental/giles/rogg/rogg_aspect.c
   experimental/giles/rogg/rogg_crcfix.c
   experimental/giles/rogg/rogg_eosfix.c
   experimental/giles/rogg/rogg_pagedump.c
   experimental/giles/rogg/rogg_serial.c
   experimental/giles/rogg/rogg_stats.c
Log:
mmap returns MAP_FAILED, not NULL, on error.

Also removes some trailing whitespace.


Modified: experimental/giles/rogg/rogg_aspect.c
===================================================================
--- experimental/giles/rogg/rogg_aspect.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_aspect.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -184,7 +184,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;

Modified: experimental/giles/rogg/rogg_crcfix.c
===================================================================
--- experimental/giles/rogg/rogg_crcfix.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_crcfix.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -76,7 +76,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;
@@ -89,7 +89,7 @@
     } else {
       if (q > p) {
 	fprintf(stdout, "Skipped %d garbage bytes at the start\n", (int)(q-p));
-      } 
+      }
       while (q < e) {
 	o = rogg_scan(q, e-q);
 	if (o > q) {

Modified: experimental/giles/rogg/rogg_eosfix.c
===================================================================
--- experimental/giles/rogg/rogg_eosfix.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_eosfix.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -72,7 +72,7 @@
     ref->last = NULL;
     ref->next = head;
   }
-  
+
   return (ref != NULL) ? ref : head;
 }
 
@@ -155,7 +155,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;
@@ -188,7 +188,7 @@
 	  /* unset any eos flags */
 	  q[ROGG_OFFSET_FLAGS] &= ~0x04;
 	  rogg_page_update_crc(q);
-	  fprintf(stderr, "Removed eos flag on stream %08x\n", 
+	  fprintf(stderr, "Removed eos flag on stream %08x\n",
 		header.serialno);
         }
 #endif

Modified: experimental/giles/rogg/rogg_pagedump.c
===================================================================
--- experimental/giles/rogg/rogg_pagedump.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_pagedump.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -75,7 +75,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;

Modified: experimental/giles/rogg/rogg_serial.c
===================================================================
--- experimental/giles/rogg/rogg_serial.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_serial.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -53,7 +53,7 @@
   fprintf(stderr, "Script for editing ogg headers\n");
   fprintf(stderr, "%s [-s old:new] <file1.ogg> [<file2.ogg>...]\n",
 	name);
-  fprintf(stderr, 
+  fprintf(stderr,
 		  "    -s old:new  change the serial numer of a logical stream from old to new\n"
 		  "                (use hex values, e.g. 0x89ab4567:0x0123cdef)\n"
 		  "\n");
@@ -120,7 +120,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;
@@ -133,7 +133,7 @@
     } else {
       if (q > p) {
 	fprintf(stdout, "Skipped %d garbage bytes at the start\n", (int)(q-p));
-      } 
+      }
       while (q < e) {
 	o = rogg_scan(q, e-q); /* find the next Ogg page */
 	if (o > q) {

Modified: experimental/giles/rogg/rogg_stats.c
===================================================================
--- experimental/giles/rogg/rogg_stats.c	2009-06-10 18:50:57 UTC (rev 16099)
+++ experimental/giles/rogg/rogg_stats.c	2009-06-10 23:11:53 UTC (rev 16100)
@@ -76,7 +76,7 @@
       switch (argv[arg][1]) {
 	case 'v':
 	  verbose = 1;
-	  shift = 1; 
+	  shift = 1;
 	  break;
       }
     }
@@ -119,7 +119,7 @@
     }
     p = mmap(0, s.st_size, PROT_READ|PROT_WRITE,
 	MAP_SHARED, f, 0);
-    if (p == NULL) {
+    if (p == MAP_FAILED) {
 	fprintf(stderr, "couldn't mmap '%s'\n", argv[i]);
 	close(f);
 	continue;
@@ -132,7 +132,7 @@
     } else {
       if (q > p) {
 	fprintf(stdout, "Skipped %d garbage bytes at the start\n", (int)(q-p));
-      } 
+      }
       while (q < e) {
 	o = rogg_scan(q, e-q); /* find the next Ogg page */
 	if (o > q) {



More information about the commits mailing list