From 5164c5f30f9a2bf6f0d77bec6602563ebd117d17 Mon Sep 17 00:00:00 2001
From: florian <f.spreckelsen@inidscale.com>
Date: Tue, 7 Sep 2021 16:02:30 +0200
Subject: [PATCH] FIX: Return to int64

---
 src/Entity.jl    | 36 ++++++++++++++++++------------------
 test/runtests.jl |  4 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/Entity.jl b/src/Entity.jl
index c256580..9c23a8e 100644
--- a/src/Entity.jl
+++ b/src/Entity.jl
@@ -771,11 +771,11 @@ function get_value(entity::Ref{_Entity})
     if ent_datatype[1] in _caosdb_dtypes
         if !is_list
             if ent_datatype[1] == "INTEGER"
-                out = Ref{Cint}(0)
+                out = Ref{Clong}(0)
                 err_code = ccall(
                     (:caosdb_entity_entity_get_int_value, CaosDB.library_name),
                     Cint,
-                    (Ref{_Entity}, Ref{Cint}),
+                    (Ref{_Entity}, Ref{Clong}),
                     entity,
                     out,
                 )
@@ -815,7 +815,7 @@ function get_value(entity::Ref{_Entity})
         else
             list_length = get_property_list_length(entity)
             if ent_datatype[1] == "INTEGER"
-                out = Vector{Cint}()
+                out = Vector{Clong}()
                 for i::Cint = 1:list_length
                     temp = get_int_list_value_at(entity, i)
                     append!(out, temp)
@@ -880,11 +880,11 @@ function get_value(property::Ref{_Property})
     if prop_datatype[1] in _caosdb_dtypes
         if !is_list
             if prop_datatype[1] == "INTEGER"
-                out = Ref{Cint}(0)
+                out = Ref{Clong}(0)
                 err_code = ccall(
                     (:caosdb_entity_property_get_int_value, CaosDB.library_name),
                     Cint,
-                    (Ref{_Property}, Ref{Cint}),
+                    (Ref{_Property}, Ref{Clong}),
                     property,
                     out,
                 )
@@ -924,7 +924,7 @@ function get_value(property::Ref{_Property})
         else
             list_length = get_property_list_length(property)
             if prop_datatype[1] == "INTEGER"
-                out = Vector{Cint}()
+                out = Vector{Clong}()
                 for i::Cint = 1:list_length
                     temp = get_int_list_value_at(property, i)
                     append!(out, temp)
@@ -1024,11 +1024,11 @@ end
 Return the value of the INTEGER list of the given `property` at the position `index`.
 """
 function get_int_list_value_at(property::Ref{_Property}, index::Cint)
-    out = Ref{Cint}(0)
+    out = Ref{Clong}(0)
     err_code = ccall(
         (:caosdb_entity_property_get_int_list_value_at, CaosDB.library_name),
         Cint,
-        (Ref{_Property}, Ref{Cint}, Cint),
+        (Ref{_Property}, Ref{Clong}, Cint),
         property,
         out,
         index - Cint(1),
@@ -1044,11 +1044,11 @@ end
 Return the value of the INTEGER list of the given `entity` at the position `index`.
 """
 function get_int_list_value_at(entity::Ref{_Entity}, index::Cint)
-    out = Ref{Cint}(0)
+    out = Ref{Clong}(0)
     err_code = ccall(
         (:caosdb_entity_entity_get_int_list_value_at, CaosDB.library_name),
         Cint,
-        (Ref{_Entity}, Ref{Cint}, Cint),
+        (Ref{_Entity}, Ref{Clong}, Cint),
         entity,
         out,
         index - Cint(1),
@@ -1985,9 +1985,9 @@ function set_value(
         err_code = ccall(
             (:caosdb_entity_entity_set_int_value, CaosDB.library_name),
             Cint,
-            (Ref{_Entity}, Cint),
+            (Ref{_Entity}, Clong),
             entity,
-            Cint(value),
+            Clong(value),
         )
     elseif in_type <: Number
         err_code = ccall(
@@ -2022,9 +2022,9 @@ function set_value(
             err_code = ccall(
                 (:caosdb_entity_entity_set_int_list_value, CaosDB.library_name),
                 Cint,
-                (Ref{_Entity}, Ptr{Cint}, Cint),
+                (Ref{_Entity}, Ptr{Clong}, Cint),
                 entity,
-                Vector{Cint}(value),
+                Vector{Clong}(value),
                 vec_length,
             )
         elseif in_type <: Vector{T} where {T<:Number}
@@ -2074,9 +2074,9 @@ function set_value(
         err_code = ccall(
             (:caosdb_entity_property_set_int_value, CaosDB.library_name),
             Cint,
-            (Ref{_Property}, Cint),
+            (Ref{_Property}, Clong),
             property,
-            Cint(value),
+            Clong(value),
         )
     elseif in_type <: Number
         err_code = ccall(
@@ -2111,9 +2111,9 @@ function set_value(
             err_code = ccall(
                 (:caosdb_entity_property_set_int_list_value, CaosDB.library_name),
                 Cint,
-                (Ref{_Property}, Ptr{Cint}, Cint),
+                (Ref{_Property}, Ptr{Clong}, Cint),
                 property,
-                Vector{Cint}(value),
+                Vector{Clong}(value),
                 vec_length,
             )
         elseif in_type <: Vector{T} where {T<:Number}
diff --git a/test/runtests.jl b/test/runtests.jl
index 436d283..a296add 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -260,7 +260,7 @@ using CaosDB
             @test CaosDB.Entity.get_value(bool_list_prop) === [true, false]
             @test CaosDB.Entity.get_value(string_list_prop) == ["Hello", "World"]
             @test CaosDB.Entity.get_value(ref_list_prop) == ["some_id", "another_id"]
-            @test isa(CaosDB.Entity.get_value(int_list_prop), Vector{Cint})
+            @test isa(CaosDB.Entity.get_value(int_list_prop), Vector{Clong})
             @test isa(CaosDB.Entity.get_value(double_list_prop), Vector{Cdouble})
             @test isa(CaosDB.Entity.get_value(bool_list_prop), Vector{Bool})
             @test isa(CaosDB.Entity.get_value(string_list_prop), Vector{String})
@@ -342,7 +342,7 @@ using CaosDB
             @test CaosDB.Entity.get_value(bool_list_prop) === [true, false]
             @test CaosDB.Entity.get_value(string_list_prop) == ["Hello", "World"]
             @test CaosDB.Entity.get_value(ref_list_prop) == ["some_id", "another_id"]
-            @test isa(CaosDB.Entity.get_value(int_list_prop), Vector{Cint})
+            @test isa(CaosDB.Entity.get_value(int_list_prop), Vector{Clong})
             @test isa(CaosDB.Entity.get_value(double_list_prop), Vector{Cdouble})
             @test isa(CaosDB.Entity.get_value(bool_list_prop), Vector{Bool})
             @test isa(CaosDB.Entity.get_value(string_list_prop), Vector{String})
-- 
GitLab