[python-arrayfire] 64/250: BUGFIX: Using c_void_p instead of c_ulonglong for void *

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.

commit a5b17219ddab04b66ff2ce3a28307ea3839f975a
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Thu Aug 27 17:41:37 2015 -0400

    BUGFIX: Using c_void_p instead of c_ulonglong for void *
    
    - Also removed c_dims assigned to ctypes module
---
 arrayfire/array.py    | 14 +++++++-------
 arrayfire/base.py     |  2 +-
 arrayfire/features.py |  2 +-
 arrayfire/index.py    |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arrayfire/array.py b/arrayfire/array.py
index 39addab..aacafb3 100644
--- a/arrayfire/array.py
+++ b/arrayfire/array.py
@@ -15,10 +15,10 @@ from .base import *
 from .index import *
 
 def create_array(buf, numdims, idims, dtype):
-    out_arr = ct.c_longlong(0)
-    ct.c_dims = dim4(idims[0], idims[1], idims[2], idims[3])
-    safe_call(clib.af_create_array(ct.pointer(out_arr), ct.c_longlong(buf),\
-                                   numdims, ct.pointer(ct.c_dims), dtype))
+    out_arr = ct.c_void_p(0)
+    c_dims = dim4(idims[0], idims[1], idims[2], idims[3])
+    safe_call(clib.af_create_array(ct.pointer(out_arr), ct.c_void_p(buf),
+                                   numdims, ct.pointer(c_dims), dtype))
     return out_arr
 
 def constant_array(val, d0, d1=None, d2=None, d3=None, dtype=f32):
@@ -29,7 +29,7 @@ def constant_array(val, d0, d1=None, d2=None, d3=None, dtype=f32):
         else:
             raise TypeError("Invalid dtype")
 
-    out = ct.c_longlong(0)
+    out = ct.c_void_p(0)
     dims = dim4(d0, d1, d2, d3)
 
     if isinstance(val, complex):
@@ -187,7 +187,7 @@ class array(base_array):
             clib.af_release_array(self.arr)
 
     def device_ptr(self):
-        ptr = ctypes.c_void_p(0)
+        ptr = ct.c_void_p(0)
         clib.af_get_device_ptr(ct.pointer(ptr), self.arr)
         return ptr.value
 
@@ -445,7 +445,7 @@ class array(base_array):
             else:
                 other_arr = val.arr
 
-            out_arr = ct.c_longlong(0)
+            out_arr = ct.c_void_p(0)
             inds  = get_indices(key, n_dims)
 
             safe_call(clib.af_assign_gen(ct.pointer(out_arr),\
diff --git a/arrayfire/base.py b/arrayfire/base.py
index ce8e23a..26d5ade 100644
--- a/arrayfire/base.py
+++ b/arrayfire/base.py
@@ -11,4 +11,4 @@ from .util import *
 
 class base_array(object):
     def __init__(self):
-        self.arr = ct.c_longlong(0)
+        self.arr = ct.c_void_p(0)
diff --git a/arrayfire/features.py b/arrayfire/features.py
index 8c8c694..2a1854d 100644
--- a/arrayfire/features.py
+++ b/arrayfire/features.py
@@ -13,7 +13,7 @@ import numbers
 class features(object):
 
     def __init__(self, num=None):
-        self.feat = ct.c_longlong(0)
+        self.feat = ct.c_void_p(0)
         if num is not None:
             assert(isinstance(num, numbers.Number))
             safe_call(clib.af_create_features(ct.pointer(self.feat), ct.c_longlong(num)))
diff --git a/arrayfire/index.py b/arrayfire/index.py
index d37949e..102be8e 100644
--- a/arrayfire/index.py
+++ b/arrayfire/index.py
@@ -80,7 +80,7 @@ def slice_to_length(key, dim):
     return int(((tkey[1] - tkey[0] - 1) / tkey[2]) + 1)
 
 class uidx(ct.Union):
-    _fields_ = [("arr", ct.c_longlong),
+    _fields_ = [("arr", ct.c_void_p),
                 ("seq", seq)]
 
 class index(ct.Structure):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git



More information about the debian-science-commits mailing list