Fixes for Cython 0.12.

diff -r 26930d062656 sage/graphs/graph_fast.pyx
--- a/sage/graphs/graph_fast.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/graphs/graph_fast.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -201,7 +201,7 @@
     cdef int cur_iter, cur_edge
     cdef int i, j, x
     
-    cdef double t = 1, dt = t/iterations, k = sqrt(1.0/n)
+    cdef double t = 1, dt = t/(1e-20 + iterations), k = sqrt(1.0/n)
     cdef double square_dist, force, scale
     cdef double* disp_i
     cdef double* disp_j
diff -r 26930d062656 sage/libs/singular/function.pxd
--- a/sage/libs/singular/function.pxd	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/libs/singular/function.pxd	Thu Oct 29 15:58:21 2009 -0700
@@ -16,9 +16,20 @@
 
 from sage.structure.sage_object cimport SageObject
 from sage.libs.singular.decl cimport leftv, idhdl
-from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular
+from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular, MPolynomial_libsingular
 
-cdef class Converter(SageObject)
+cdef class Converter(SageObject):
+    cdef leftv *args
+    cdef MPolynomialRing_libsingular _ring
+    cdef leftv* pop_front(self) except NULL
+    cdef void _append_leftv(self, leftv *v)
+    cdef void _append(self, void* data, int res_type)
+    cdef int append_polynomial(self, MPolynomial_libsingular p) except -1
+    cdef int append_ideal(self,  i) except -1
+    cdef int append_number(self, n) except -1
+    cdef int append_int(self, n) except -1
+    cdef int append_str(self, n) except -1
+    cdef to_python(self, leftv* to_convert)
 
 cdef class BaseCallHandler:
     cdef leftv* handle_call(self, Converter argument_list) except NULL
diff -r 26930d062656 sage/libs/singular/function.pyx
--- a/sage/libs/singular/function.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/libs/singular/function.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -100,8 +100,6 @@
     A :class:`Converter` interfaces between Sage objects and Singular
     interpreter objects.
     """
-    cdef leftv *args
-    cdef MPolynomialRing_libsingular _ring
 
     def __init__(self, args, ring):
         """
diff -r 26930d062656 sage/libs/singular/polynomial.pyx
--- a/sage/libs/singular/polynomial.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/libs/singular/polynomial.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -488,7 +488,7 @@
     - ``bound`` - an integer > 0
     """
     cdef int count = 0
-    while p and count < bound:
+    while p != NULL and count < bound:
         p = pNext(p)
         count += 1
     return count
diff -r 26930d062656 sage/matrix/matrix_window_modn_dense.pyx
--- a/sage/matrix/matrix_window_modn_dense.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/matrix/matrix_window_modn_dense.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -1,3 +1,5 @@
+# cython: cdivision=True
+
 """
 TESTS:
     sage: a = random_matrix(GF(11), 30, 40)
diff -r 26930d062656 sage/misc/parser.pyx
--- a/sage/misc/parser.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/misc/parser.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -296,7 +296,7 @@
             while is_alphanumeric(s[pos]):
                 pos += 1
             # matrices
-            if s[self.pos:pos] == 'matrix':
+            if s[self.pos:pos] == b'matrix':
                 self.pos = pos
                 return MATRIX
             self.pos = pos
diff -r 26930d062656 sage/rings/integer.pyx
--- a/sage/rings/integer.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/rings/integer.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -122,6 +122,7 @@
 Integers
 """
 
+import cython
 
 import operator
 
@@ -3185,6 +3186,7 @@
 
         return z
         
+    @cython.cdivision(True)
     def multifactorial(self, int k):
         r"""
         Computes the k-th factorial `n!^{(k)}` of self. For k=1
diff -r 26930d062656 sage/rings/integer_mod.pyx
--- a/sage/rings/integer_mod.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/rings/integer_mod.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -1,3 +1,5 @@
+# cython: cdivision=True
+
 r"""
 Elements of `\ZZ/n\ZZ`
 
diff -r 26930d062656 sage/rings/polynomial/polynomial_element.pyx
--- a/sage/rings/polynomial/polynomial_element.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/rings/polynomial/polynomial_element.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -5076,8 +5076,7 @@
     cdef void __normalize(self):
         x = self.__coeffs
         cdef Py_ssize_t n = len(x) - 1
-        while n >= 0 and x[n].is_zero():
-#        while n > 0 and x[n] == 0:
+        while n >= 0 and not x[n]:
             del x[n]
             n -= 1
 
diff -r 26930d062656 sage/symbolic/expression.pyx
--- a/sage/symbolic/expression.pyx	Sun Sep 27 00:39:00 2009 -0700
+++ b/sage/symbolic/expression.pyx	Thu Oct 29 15:58:21 2009 -0700
@@ -6404,9 +6404,9 @@
        return rop
     elif rop == equal:
        return lop
-    elif (lop in [less, less_or_equal] and rop in [less, less_or_equal]):
+    elif lop in [less, less_or_equal] and rop in [less, less_or_equal]:
        return less
-    elif (lop in [greater, greater_or_equal] and rop in [greater, greater_or_equal]):
+    elif lop in [greater, greater_or_equal] and rop in [greater, greater_or_equal]:
        return greater
     else:
         raise TypeError, "incompatible relations"
diff -r 26930d062656 setup.py
--- a/setup.py	Sun Sep 27 00:39:00 2009 -0700
+++ b/setup.py	Thu Oct 29 15:58:21 2009 -0700
@@ -667,7 +667,7 @@
             outfile += ".c"
 
         # call cython, abort if it failed
-        cmd = "python `which cython` --embed-positions --incref-local-binop -I%s -o %s %s"%(os.getcwd(), outfile, f)
+        cmd = "python `which cython` --embed-positions --directive cdivision=True -I%s -o %s %s"%(os.getcwd(), outfile, f)
         r = run_command(cmd)
         if r:
             return r
