Commits

Jörg Rädler committed b271c44

version 2.0.5,
fix some data types to work with numpy and prevent warnings,
fix warning in gpfInfo()

Comments (0)

Files changed (4)

+03.07.12
+- version 2.0.5
+- changed some data types to prevent warnings
+- fixed numpy interface
+- numpy support is switched on by default now
+- close file correctly in gpfInfo()
+
 30.03.11
 - version 2.0.4
 - fixed a bug in writeSVG()
                 holes += int(f.readline())
         [ f.readline() for p in range(pp-x) ]
         points += pp
-
+    f.close()
     return contours, holes, points, withHoles
 #  * faster adding of contours from NumPy arrays
 #  * data style STYLE_NUMPY to get contours and TriStrips
 #    as NumPy arrays
-withNumPy=False
+withNumPy=True
 
 # if withNumPy is True, set the include path for numpy/arrayobject.h
 # the example is for python on Windows:
 
 args = { 
     'name'            : "Polygon",
-    'version'         : "2.0.4",
+    'version'         : "2.0.5",
     'description'     : "Polygon is a python package that handles polygonal shapes in 2D",
     'long_description': longdesc,
     'license'         : "LGPL for Polygon, other for gpc",
 #define INDEF INT_MAX
 
 #ifndef POLY_VERSION
-#define POLY_VERSION "2.0.4"
+#define POLY_VERSION "2.0.5"
 #endif
 
 #ifndef PyMODINIT_FUNC
 }
 
 
-static int Polygon_len(PyObject *self) {
+static Py_ssize_t Polygon_len(PyObject *self) {
     return ((Polygon *)self)->gpc_p->num_contours;
 }
 
 
-static PyObject *Polygon_getitem(PyObject *self, int item) {
+static PyObject *Polygon_getitem(PyObject *self, Py_ssize_t item) {
     PyObject *R;
     gpc_vertex_list * vl = NULL;
     gpc_vertex *v;
         } break;
 #ifdef WITH_NUMPY
         case STYLE_NUMPY: {
-            int dims[2] = {0, 2};
+            npy_intp dims[2] = {0, 2};
             PyArrayObject *a;
             dims[0] = imax; 
             R = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
         } break;
 #ifdef WITH_NUMPY
         case STYLE_NUMPY: {
-            int dims[2] = {0, 2};
+            npy_intp dims[2] = {0, 2};
             R = PyTuple_New(t->num_strips);
             for (i=0; i < t->num_strips; i++) {
                 vl = t->strip + i;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.