summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84bf534)
raw | patch | inline | side by side (parent: 84bf534)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 9 Nov 2014 14:39:22 +0000 (15:39 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 9 Nov 2014 14:39:22 +0000 (15:39 +0100) |
src/core/data.c | patch | blob | history | |
src/core/store.c | patch | blob | history | |
src/core/store_lookup.c | patch | blob | history |
diff --git a/src/core/data.c b/src/core/data.c
index a954b3d5eec13b1a084917730f9e154170527fc5..53cc88835883db4d895a66953af33948969d3f60 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
return 0;
}
switch (op) {
- case SDB_DATA_CONCAT:
- return data_concat(d1, d2, res);
- case SDB_DATA_ADD:
- return data_lin(d1, 1, d2, res);
- case SDB_DATA_SUB:
- return data_lin(d1, -1, d2, res);
- case SDB_DATA_MUL:
- return data_mul(d1, d2, res);
- case SDB_DATA_DIV:
- return data_div(d1, d2, res, NULL);
- case SDB_DATA_MOD:
- return data_div(d1, d2, NULL, res);
+ case SDB_DATA_CONCAT: return data_concat(d1, d2, res);
+ case SDB_DATA_ADD: return data_lin(d1, 1, d2, res);
+ case SDB_DATA_SUB: return data_lin(d1, -1, d2, res);
+ case SDB_DATA_MUL: return data_mul(d1, d2, res);
+ case SDB_DATA_DIV: return data_div(d1, d2, res, NULL);
+ case SDB_DATA_MOD: return data_div(d1, d2, NULL, res);
}
return -1;
} /* sdb_data_expr_eval */
diff --git a/src/core/store.c b/src/core/store.c
index d6ad01fedd354da89efaa9bac27c6b44921cd180..455e5a328ae14c29d012906bd1057959d8ad15ae 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
tmp.data.array.length = obj->backends_num;
tmp.data.array.values = obj->backends;
return sdb_data_copy(res, &tmp);
- break;
}
default:
return -1;
index b80a18fdd1cdad47372afb9e7fd0cc4efbfb3bce..e1e03961fc5e3e7760865c0d6e1e7805a7215c4f 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
@@ -107,18 +107,14 @@ match_cmp_value(int op, sdb_data_t *v1, sdb_data_t *v2, _Bool strcmp_fallback)
if (status == INT_MAX)
return 0;
- else if (op == MATCHER_LT)
- return status < 0;
- else if (op == MATCHER_LE)
- return status <= 0;
- else if (op == MATCHER_EQ)
- return status == 0;
- else if (op == MATCHER_NE)
- return status != 0;
- else if (op == MATCHER_GE)
- return status >= 0;
- else if (op == MATCHER_GT)
- return status > 0;
+ switch (op) {
+ case MATCHER_LT: return status < 0;
+ case MATCHER_LE: return status <= 0;
+ case MATCHER_EQ: return status == 0;
+ case MATCHER_NE: return status != 0;
+ case MATCHER_GE: return status >= 0;
+ case MATCHER_GT: return status > 0;
+ }
return 0;
} /* match_cmp_value */