[gnumeric] internals: add some preconditions.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] internals: add some preconditions.
- Date: Thu, 3 Mar 2011 18:52:15 +0000 (UTC)
commit a5296350025289c007a9d2423c073f4b4214f05d
Author: Morten Welinder <terra gnome org>
Date: Thu Mar 3 13:51:07 2011 -0500
internals: add some preconditions.
ChangeLog | 6 ++++++
src/expr.c | 2 ++
src/value.c | 6 +++++-
3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8d79b1a..cb6540a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,12 @@
* schemas/org.gnome.gnumeric.gschema.xml.in.in: ditto.
* schemas/org.gnome.gnumeric.plugin.gschema.xml.in.in: ditto.
+2011-03-03 Morten Welinder <terra gnome org>
+
+ * src/value.c (value_new_string_str): Add precondition.
+
+ * src/expr.c (gnm_expr_new_constant): Add precondition.
+
2011-03-01 Morten Welinder <terra gnome org>
* src/gnumeric-gconf.c (get_node): Handle absolute keys, assuming
diff --git a/src/expr.c b/src/expr.c
index 93b8a1f..2fb2f15 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -77,6 +77,8 @@ gnm_expr_new_constant (GnmValue *v)
{
GnmExprConstant *ans;
+ g_return_val_if_fail (v != NULL, NULL);
+
ans = CHUNK_ALLOC (GnmExprConstant, expression_pool_small);
if (!ans)
return NULL;
diff --git a/src/value.c b/src/value.c
index 26fd500..4821e7b 100644
--- a/src/value.c
+++ b/src/value.c
@@ -228,7 +228,11 @@ value_error_classify (GnmValue const *v)
GnmValue *
value_new_string_str (GOString *str)
{
- GnmValueStr *v = CHUNK_ALLOC (GnmValueStr, value_string_pool);
+ GnmValueStr *v;
+
+ g_return_val_if_fail (str != NULL, NULL);
+
+ v = CHUNK_ALLOC (GnmValueStr, value_string_pool);
*((GnmValueType *)&(v->type)) = VALUE_STRING;
v->fmt = NULL;
v->val = str;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]