[71158] trunk/dports/games/alienarena

ryandesign at macports.org ryandesign at macports.org
Fri Sep 3 04:21:31 PDT 2010


Revision: 71158
          http://trac.macports.org/changeset/71158
Author:   ryandesign at macports.org
Date:     2010-09-03 04:21:26 -0700 (Fri, 03 Sep 2010)
Log Message:
-----------
alienarena: more optimized round_page implementation

Modified Paths:
--------------
    trunk/dports/games/alienarena/Portfile
    trunk/dports/games/alienarena/files/patch-unix-q_shunix.c.diff

Added Paths:
-----------
    trunk/dports/games/alienarena/files/patch-client-cl_main.c.diff
    trunk/dports/games/alienarena/files/patch-qcommon-common.c.diff
    trunk/dports/games/alienarena/files/patch-ref_gl-r_model.h.diff

Modified: trunk/dports/games/alienarena/Portfile
===================================================================
--- trunk/dports/games/alienarena/Portfile	2010-09-02 21:09:29 UTC (rev 71157)
+++ trunk/dports/games/alienarena/Portfile	2010-09-03 11:21:26 UTC (rev 71158)
@@ -6,7 +6,7 @@
 name                    alienarena
 # Keep version in sync between alienarena and alienarena-data.
 version                 7.45-20100726
-revision                1
+revision                2
 set version_number      [lindex [split ${version} -] 0]
 set version_date        [lindex [split ${version} -] 1]
 categories              games
@@ -47,8 +47,11 @@
 
 post-extract {
     # DOS to UNIX line endings so we can patch properly.
-    reinplace "s|\r||g" ${patch.dir}/game/q_shared.h \
-                        ${patch.dir}/ref_gl/r_main.c
+    reinplace "s|\r||g" ${patch.dir}/client/cl_main.c \
+                        ${patch.dir}/game/q_shared.h \
+                        ${patch.dir}/qcommon/common.c \
+                        ${patch.dir}/ref_gl/r_main.c \
+                        ${patch.dir}/ref_gl/r_model.h
 }
 
 patchfiles              patch-game-q_shared.h.diff \
@@ -58,9 +61,12 @@
 
 platform darwin {
     patchfiles-append   patch-Makefile.diff \
+                        patch-client-cl_main.c.diff \
                         patch-client-qal.h.diff \
                         patch-client-snd_openal.c.diff \
+                        patch-qcommon-common.c.diff \
                         patch-ref_gl-r_main.c.diff \
+                        patch-ref_gl-r_model.h.diff \
                         patch-unix-qal_unix.c.diff \
                         patch-unix-sys_unix.c.diff
     post-patch {

Added: trunk/dports/games/alienarena/files/patch-client-cl_main.c.diff
===================================================================
--- trunk/dports/games/alienarena/files/patch-client-cl_main.c.diff	                        (rev 0)
+++ trunk/dports/games/alienarena/files/patch-client-cl_main.c.diff	2010-09-03 11:21:26 UTC (rev 71158)
@@ -0,0 +1,11 @@
+--- client/cl_main.c	(revision 1999)
++++ client/cl_main.c	(working copy)
+@@ -2132,6 +2132,8 @@
+ 
+ 	// all archived variables will now be loaded
+ 
++	round_page_init ();
++
+ 	Con_Init ();
+ #if defined __unix__ || defined __sgi
+ 	S_Init ();

Added: trunk/dports/games/alienarena/files/patch-qcommon-common.c.diff
===================================================================
--- trunk/dports/games/alienarena/files/patch-qcommon-common.c.diff	                        (rev 0)
+++ trunk/dports/games/alienarena/files/patch-qcommon-common.c.diff	2010-09-03 11:21:26 UTC (rev 71158)
@@ -0,0 +1,11 @@
+--- qcommon/common.c	(revision 1999)
++++ qcommon/common.c	(working copy)
+@@ -1494,6 +1494,8 @@
+ 	if (setjmp (abortframe) )
+ 		Sys_Error ("Error during initialization");
+ 
++	round_page_init ();
++
+ 	z_chain.next = z_chain.prev = &z_chain;
+ 
+ 	// prepare enough of the subsystems to handle

Added: trunk/dports/games/alienarena/files/patch-ref_gl-r_model.h.diff
===================================================================
--- trunk/dports/games/alienarena/files/patch-ref_gl-r_model.h.diff	                        (rev 0)
+++ trunk/dports/games/alienarena/files/patch-ref_gl-r_model.h.diff	2010-09-03 11:21:26 UTC (rev 71158)
@@ -0,0 +1,11 @@
+--- ref_gl/r_model.h	(revision 1999)
++++ ref_gl/r_model.h	(working copy)
+@@ -389,3 +389,8 @@
+ 
+ void	Mod_FreeAll (void);
+ void	Mod_Free (model_t *mod);
++
++//============================================================================
++
++void	round_page_init ();
++size_t	round_page (size_t size);

Modified: trunk/dports/games/alienarena/files/patch-unix-q_shunix.c.diff
===================================================================
--- trunk/dports/games/alienarena/files/patch-unix-q_shunix.c.diff	2010-09-02 21:09:29 UTC (rev 71157)
+++ trunk/dports/games/alienarena/files/patch-unix-q_shunix.c.diff	2010-09-03 11:21:26 UTC (rev 71158)
@@ -1,18 +1,27 @@
 --- unix/q_shunix.c	(revision 1999)
 +++ unix/q_shunix.c	(working copy)
-@@ -35,7 +35,15 @@
- #ifndef __linux__
- /* For round_page() macro. */
- #include <machine/param.h>
-+#ifndef round_page
-+size_t round_page (size_t size)
-+{
-+    int pagesize = sysconf(_SC_PAGESIZE);
-+    // This is wrong (too large) when size == 0, oh well
-+    return (1 + (size - 1) / pagesize) * pagesize;
-+}
- #endif
-+#endif
+@@ -39,6 +39,24 @@
  
  //===============================================================================
  
++size_t pagesize, pagesize_mask;
++
++void round_page_init () {
++	pagesize = sysconf (_SC_PAGESIZE);
++	pagesize_mask = -pagesize;
++}
++
++size_t round_page (size_t size) {
++	if (size) {
++		size--;
++		size &= pagesize_mask;
++		size += pagesize;
++	}
++	return size;
++}
++
++//===============================================================================
++
+ byte *membase;
+ int maxhunksize;
+ int curhunksize;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100903/ecd16303/attachment-0001.html>


More information about the macports-changes mailing list