[arch-commits] Commit in symmetrica/trunk (PKGBUILD int32.patch macro.h.patch)

Antonio Rojas arojas at archlinux.org
Sat Jan 3 23:26:20 UTC 2015


    Date: Sunday, January 4, 2015 @ 00:26:20
  Author: arojas
Revision: 125258

Fix integer overflow on 64 bits systems

Added:
  symmetrica/trunk/int32.patch
Modified:
  symmetrica/trunk/PKGBUILD
Deleted:
  symmetrica/trunk/macro.h.patch

---------------+
 PKGBUILD      |   10 +++++-----
 int32.patch   |   37 +++++++++++++++++++++++++++++++++++++
 macro.h.patch |   33 ---------------------------------
 3 files changed, 42 insertions(+), 38 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-01-03 23:22:39 UTC (rev 125257)
+++ PKGBUILD	2015-01-03 23:26:20 UTC (rev 125258)
@@ -3,7 +3,7 @@
 
 pkgname=symmetrica
 pkgver=2.0
-pkgrel=3
+pkgrel=4
 pkgdesc="Algorithms for symmetric groups and classical groups"
 arch=('i686' 'x86_64')
 url="http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/"
@@ -10,15 +10,15 @@
 license=('custom')
 depends=()
 options=('staticlibs')
-source=('http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/SYM2_0_tar.gz'
-        'macro.h.patch' 'LICENSE')
+source=('http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/SYM2_0_tar.gz' 'int32.patch' 'LICENSE')
 md5sums=('c901a30ffb44715adc85ec43a9838069'
-         '2a018908686a23ee12b3e7b5d104c929'
+         'cc057ecdfc5f0d629d13f6b2999ba23c'
          'c385bb47c0759cb6464e55702875b7a0')
 
 prepare() {
   sed -i -e 's/-O2/$(CFLAGS)/' makefile
-  patch -p0 -i macro.h.patch
+# fix integer overflow on 64 bits
+  patch -p1 -i int32.patch
 
 # disable banner
   sed -i 's|no_banner = FALSE|no_banner = TRUE|' de.c

Added: int32.patch
===================================================================
--- int32.patch	                        (rev 0)
+++ int32.patch	2015-01-03 23:26:20 UTC (rev 125258)
@@ -0,0 +1,37 @@
+diff -ru src/def.h c/def.h
+--- src/def.h	2007-12-06 17:30:56.000000000 +0100
++++ c/def.h	2013-10-19 18:42:55.118745730 +0200
+@@ -2,14 +2,9 @@
+ /* INT should always be 4 byte */
+ #ifndef DEF_H
+ 
+-
+-#ifdef __alpha
+-typedef  int INT;
+-typedef unsigned  int  UINT;
+-#else /* __alpha */
+-typedef long INT;
+-typedef unsigned long UINT;
+-#endif /* __alpha */
++#include <stdint.h>
++typedef int32_t INT;
++typedef uint32_t UINT;
+ 
+ #include <stdio.h>
+ #include <memory.h>
+@@ -65,10 +60,13 @@
+ 
+ 
+ /* definitionen fuer object.c */
+-typedef INT OBJECTKIND;   /* 4 byte */
++/* NOTE: partition code assumes that there is no unused space in the
++ * object struct when an INT is stored. This requires both OBJECTKIND
++ * and OBJECTSELF to have a size equal to a machine word. */
++typedef intptr_t OBJECTKIND;
+ 
+ typedef union {
+-	INT ob_INT;
++	intptr_t ob_INT;
+ 	INT * ob_INTpointer;
+ 	char *ob_charpointer;
+ 	struct bruch *ob_bruch;

Deleted: macro.h.patch
===================================================================
--- macro.h.patch	2015-01-03 23:22:39 UTC (rev 125257)
+++ macro.h.patch	2015-01-03 23:26:20 UTC (rev 125258)
@@ -1,33 +0,0 @@
---- macro.h.orig	2009-05-15 04:31:26.000000000 -0700
-+++ macro.h	2007-12-07 00:40:20.000000000 -0800
-@@ -171,7 +170,7 @@
- 
- 
- 
--extern INT partition_speichersize,partition_speicherindex,mem_counter_part;
-+extern long partition_speichersize,partition_speicherindex,mem_counter_part;
- extern struct partition **partition_speicher; 
- 
- #define FREEPARTITION(d)\
-@@ -266,7 +265,7 @@
-       C_MO_K(c,b); \
- } while(0)
- 
--extern INT monom_speicherindex,mem_counter_monom,monom_speichersize;
-+extern long monom_speicherindex,mem_counter_monom,monom_speichersize;
- extern struct monom **monom_speicher;
- 
- #define FREEMONOM(v) \
-@@ -554,10 +553,10 @@
- 
- /* for longint */
- 
--extern INT loc_index, loc_size,loc_counter;
-+extern long loc_index, loc_size,loc_counter;
- extern struct loc **loc_speicher;
- 
--extern INT longint_speicherindex,mem_counter_loc,longint_speichersize;
-+extern long longint_speicherindex,mem_counter_loc,longint_speichersize;
- extern struct longint **longint_speicher;
- 
- 



More information about the arch-commits mailing list