Repository: SINTEF/dlite (language: python)

Issue:
Added "integer" as a valid type name
# Description:
Adding "integer" as an alias for "int64". Motivated by Otello writing "integer" in his entities, which shows that it is a natural alias to use for newcomers to dlite.

**Question**: what should be the precision of unspecified types like "integer", "int" or "float"? 
- If we are C-oriented, the natural answer would be `sizeof(int)` for "int" and `sizeof(float)` for "float". Both of these will correspond to 32 bits on both X86 and x64_86 platforms. 
- If we are Python-oriented, the natural answer would be 64 bits for all of them.

The current implementation is C-oriented for the precision of "int" and "float" types. Is that the best choice? 

This PR is defines "integer" to 64 bit. Does that make sense?

## Type of change:
<!-- Put an `x` in the box that applies. -->
- [ ] Bug fix.
- [x] New feature.
- [ ] Documentation update.

## Checklist for the reviewer:
<!-- Put an `x` in the boxes that apply. These can be filled by reviewer after the PR is created. -->

This checklist should be used as a help for the reviewer.

- [x] Is the change limited to one issue?
- [x] Does this PR close the issue?
- [x] Is the code easy to read and understand?
- [ ] Do all new feature have an accompanying new test?
- [ ] Has the documentation been updated as necessary?



Discussion / hints:
The size of int in C is technically system dependent, and is defined in stdint.h, but I guess for most systems this is 32bit. Given that the size of int(eger) might not be know by the end user, the safe bet would be to go 64 bit. So I agree with your conclusion
Is there some documentation to update?

Fix patch:
diff --git a/src/dlite-type.c b/src/dlite-type.c
index e96935572..f5dbcd852 100644
--- a/src/dlite-type.c
+++ b/src/dlite-type.c
@@ -62,18 +62,18 @@ static struct _TypeDescr {
   size_t alignment;
 } type_table[] = {
   {"bool",     dliteBool,      sizeof(bool),          alignof(bool)},
-  {"int",      dliteInt,       sizeof(int),           alignof(int)},
+  {"int",      dliteInt,       8,                     alignof(int64_t)},
+  {"integer",  dliteInt,       8,                     alignof(int64_t)},
   {"int8",     dliteInt,       1,                     alignof(int8_t)},
   {"int16",    dliteInt,       2,                     alignof(int16_t)},
   {"int32",    dliteInt,       4,                     alignof(int32_t)},
   {"int64",    dliteInt,       8,                     alignof(int64_t)},
-  {"integer",  dliteInt,       8,                     alignof(int64_t)},
-  {"uint",     dliteUInt,      sizeof(unsigned int),  alignof(unsigned int)},
+  {"uint",     dliteUInt,      8,                     alignof(uint64_t)},
   {"uint8",    dliteUInt,      1,                     alignof(uint8_t)},
   {"uint16",   dliteUInt,      2,                     alignof(uint16_t)},
   {"uint32",   dliteUInt,      4,                     alignof(uint32_t)},
   {"uint64",   dliteUInt,      8,                     alignof(uint64_t)},
-  {"float",    dliteFloat,     sizeof(float),         alignof(float)},
+  {"float",    dliteFloat,     sizeof(double),        alignof(double)},
   {"single",   dliteFloat,     sizeof(float),         alignof(float)},
   {"double",   dliteFloat,     sizeof(double),        alignof(double)},
   {"longdouble",dliteFloat,    sizeof(long double),   alignof(long double)},


Test patch:
diff --git a/src/tests/python/test_python_mapping.c b/src/tests/python/test_python_mapping.c
index eb232a36b..735800dff 100644
--- a/src/tests/python/test_python_mapping.c
+++ b/src/tests/python/test_python_mapping.c
@@ -51,7 +51,7 @@ MU_TEST(test_map)
   inst3 = dlite_mapping("http://onto-ns.com/meta/0.1/ent3", instances, 1);
   mu_check(inst3);
   mu_check((p = dlite_instance_get_property(inst3, "c")));
-  mu_assert_double_eq(54.0, *(float *)p);
+  mu_assert_double_eq(54.0, *(double *)p);
 
   dlite_instance_save_url("json://inst3.json", inst3);