summaryrefslogtreecommitdiffstats
path: root/src/sratom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sratom.c')
-rw-r--r--src/sratom.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/sratom.c b/src/sratom.c
index f1d80a6..3bbe21d 100644
--- a/src/sratom.c
+++ b/src/sratom.c
@@ -229,13 +229,15 @@ number_type(const Sratom* sratom, const uint8_t* type)
(!strcmp((const char*)type, (const char*)NS_XSD "int") ||
!strcmp((const char*)type, (const char*)NS_XSD "long"))) {
return serd_node_from_string(SERD_URI, NS_XSD "integer");
- } else if (sratom->pretty_numbers &&
- (!strcmp((const char*)type, (const char*)NS_XSD "float") ||
- !strcmp((const char*)type, (const char*)NS_XSD "double"))) {
+ }
+
+ if (sratom->pretty_numbers &&
+ (!strcmp((const char*)type, (const char*)NS_XSD "float") ||
+ !strcmp((const char*)type, (const char*)NS_XSD "double"))) {
return serd_node_from_string(SERD_URI, NS_XSD "decimal");
- } else {
- return serd_node_from_string(SERD_URI, type);
}
+
+ return serd_node_from_string(SERD_URI, type);
}
int
@@ -556,15 +558,24 @@ atom_size(Sratom* sratom, uint32_t type_urid)
{
if (type_urid == sratom->forge.Int || type_urid == sratom->forge.Bool) {
return sizeof(int32_t);
- } else if (type_urid == sratom->forge.Long) {
+ }
+
+ if (type_urid == sratom->forge.Long) {
return sizeof(int64_t);
- } else if (type_urid == sratom->forge.Float) {
+ }
+
+ if (type_urid == sratom->forge.Float) {
return sizeof(float);
- } else if (type_urid == sratom->forge.Double) {
+ }
+
+ if (type_urid == sratom->forge.Double) {
return sizeof(double);
- } else if (type_urid == sratom->forge.URID) {
+ }
+
+ if (type_urid == sratom->forge.URID) {
return sizeof(uint32_t);
}
+
return 0;
}