[Debburn-changes] r699 - in cdrkit/trunk: icedax libparanoia librols libusal wodim

Peter Samuelson peters-guest at alioth.debian.org
Mon Jan 29 00:52:12 CET 2007


Author: peters-guest
Date: 2007-01-29 00:52:11 +0100 (Mon, 29 Jan 2007)
New Revision: 699

Modified:
   cdrkit/trunk/icedax/interface.c
   cdrkit/trunk/libparanoia/paranoia.c
   cdrkit/trunk/librols/getpagesize.c
   cdrkit/trunk/libusal/scsi-aix.c
   cdrkit/trunk/wodim/fifo.c
Log:
Minor cleanup: remove several #ifdefs around getpagesize() calls: the
getpagesize() function call itself already does exactly the same thing.

Note, this will change behavior on linux systems still using glibc 2.0
or older, where getpagesize() does not use sysconf(), but I really
doubt anyone is still using those.  Arguably we should rename our
getpagesize to rols_getpagesize, but it doesn't seem worth it.


Modified: cdrkit/trunk/icedax/interface.c
===================================================================
--- cdrkit/trunk/icedax/interface.c	2007-01-28 09:40:05 UTC (rev 698)
+++ cdrkit/trunk/icedax/interface.c	2007-01-28 23:52:11 UTC (rev 699)
@@ -937,11 +937,7 @@
     global.cooked_fd = OpenCdRom ( global.dev_name );
 #endif
 
-#ifdef  _SC_PAGESIZE
-    global.pagesize = sysconf(_SC_PAGESIZE);
-#else
     global.pagesize = getpagesize();
-#endif
 
     /* request one sector for table of contents */
     bufferTOC = malloc( CD_FRAMESIZE_RAW + 96 );      /* assumes sufficient aligned addresses */

Modified: cdrkit/trunk/libparanoia/paranoia.c
===================================================================
--- cdrkit/trunk/libparanoia/paranoia.c	2007-01-28 09:40:05 UTC (rev 698)
+++ cdrkit/trunk/libparanoia/paranoia.c	2007-01-28 23:52:11 UTC (rev 699)
@@ -1464,11 +1464,7 @@
 	 * that cannot be passed to free().
 	 */
 	if (pagesize < 0) {
-#ifdef	_SC_PAGESIZE
-		pagesize = sysconf(_SC_PAGESIZE);
-#else
 		pagesize = getpagesize();
-#endif
 		if (pagesize < 0)
 			pagesize = 4096;	/* Just a guess */
 	}

Modified: cdrkit/trunk/librols/getpagesize.c
===================================================================
--- cdrkit/trunk/librols/getpagesize.c	2007-01-28 09:40:05 UTC (rev 698)
+++ cdrkit/trunk/librols/getpagesize.c	2007-01-28 23:52:11 UTC (rev 699)
@@ -32,6 +32,7 @@
 #include <mconfig.h>
 
 #ifndef	HAVE_GETPAGESIZE
+
 #include <unixstd.h>
 #include <standard.h>
 #ifdef	HAVE_SYS_PARAM_H
@@ -43,34 +44,22 @@
 #include <OS.h>		/* BeOS for B_PAGE_SIZE */
 #endif
 
-EXPORT	int	getpagesize	__PR((void));
-
-EXPORT int
-getpagesize()
+int getpagesize(void)
 {
-	register int	pagesize;
+#ifdef _SC_PAGESIZE
+	return sysconf(_SC_PAGESIZE);
+#else
+# ifdef PAGESIZE		/* Traditional UNIX page size from param.h */
+	return PAGESIZE;
+# else
 
-#ifdef	_SC_PAGESIZE
-	pagesize = sysconf(_SC_PAGESIZE);
-#else	/* ! _SC_PAGESIZE */
-
-
-#ifdef	PAGESIZE		/* Traditional UNIX page size from param.h */
-	pagesize = PAGESIZE;
-
-#else	/* ! PAGESIZE */
-
-#ifdef	B_PAGE_SIZE		/* BeOS page size from OS.h */
-	pagesize = B_PAGE_SIZE;
-
-#else	/* ! B_PAGE_SIZE */
-
-	pagesize = 512;
-#endif	/* ! B_PAGE_SIZE */
-#endif	/* ! PAGESIZE */
-#endif	/* ! _SC_PAGESIZE */
-
-	return (pagesize);
+#  ifdef B_PAGE_SIZE		/* BeOS page size from OS.h */
+	return B_PAGE_SIZE;
+#  else
+	return 512;
+#  endif
+# endif
+#endif
 }
 
 #endif	/* HAVE_GETPAGESIZE */

Modified: cdrkit/trunk/libusal/scsi-aix.c
===================================================================
--- cdrkit/trunk/libusal/scsi-aix.c	2007-01-28 09:40:05 UTC (rev 698)
+++ cdrkit/trunk/libusal/scsi-aix.c	2007-01-28 23:52:11 UTC (rev 699)
@@ -217,14 +217,8 @@
     return (usalp->bufbase);
 #else
 	void	*ret;
-	int	pagesize;
+	int	pagesize = getpagesize();
 
-#ifdef	_SC_PAGESIZE
-	pagesize = sysconf(_SC_PAGESIZE);
-#else
-	pagesize = getpagesize();
-#endif
-
 	if (usalp->debug > 0) {
 		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);

Modified: cdrkit/trunk/wodim/fifo.c
===================================================================
--- cdrkit/trunk/wodim/fifo.c	2007-01-28 09:40:05 UTC (rev 698)
+++ cdrkit/trunk/wodim/fifo.c	2007-01-28 23:52:11 UTC (rev 699)
@@ -219,11 +219,7 @@
 	if (fs == 0L)
 		return;
 
-#ifdef	_SC_PAGESIZE
-	pagesize = sysconf(_SC_PAGESIZE);
-#else
 	pagesize = getpagesize();
-#endif
 	buflen = roundup(fs, pagesize) + pagesize;
 	EDEBUG(("fs: %ld buflen: %ld\n", fs, buflen));
 
@@ -439,12 +435,7 @@
 	if (buflen == 0L)
 		return (FALSE);
 
-#ifdef	_SC_PAGESIZE
-	pagesize = sysconf(_SC_PAGESIZE);
-#else
 	pagesize = getpagesize();
-#endif
-
 	faio_buf_size = bufsize;
 	f = (faio_t *)buf;
 




More information about the Debburn-changes mailing list