$NetBSD: patch-aa,v 1.1.1.1 2011/05/09 20:20:10 jihbed Exp $

--- genus2reduction.c.orig	2010-02-19 22:53:02.000000000 +0000
+++ genus2reduction.c	2010-02-19 23:38:55.000000000 +0000
@@ -5,9 +5,36 @@
    An algorithm ' la Tate' for curves of genus 2
 */
 
-/* Last modified october 5th 1998 */ 
 
-#include "genpari.h"
+/*
+ An algorithm ' la Tate' for curves of genus 2
+
+   Current maintainer: William Stein (wstein@ucsd.edu)
+   (as part of SAGE: Software for Algebra and Geometry Experimentation)
+*/
+/* 
+  William Stein: Modified 2006-03-05.
+*/
+
+#include <pari.h>
+#ifdef LONG_IS_64BIT
+#  define VERYBIGINT (9223372036854775807L) /* 2^63-1 */
+#  define EXP220 (1099511627776L)          /* 2^40   */
+#  define BIGINT (2147483647)              /* 2^31-1 */
+#else
+#  define VERYBIGINT (2147483647L) /* 2^31-1 */
+#  define EXP220 (1048576L)       /* 2^20   */
+#  define BIGINT (32767)          /* 2^15-1 */
+#endif
+
+GEN
+mppgcd(GEN a, GEN b)
+{
+  if (typ(a) != t_INT || typ(b) != t_INT) err(arither1);
+  return gcdii(a,b);
+}
+ 
+
 
 GEN
 caltheta(GEN pol, GEN p, long lambda);
@@ -1657,7 +1684,9 @@
 	    printf("erreur, racine multiple\n");fflush(stdout);exit(1);
 	  } 
       for(i=1;i<=nb;i++)
-	(GEN)list[i]=gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p)));
+	/* (GEN)list[i] = gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p))); */
+	list[i] = (long) gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p))); 
+
     }
   return list;
 }
