[gnumeric] Func: typos, cleanups, and core dump prevention.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Func: typos, cleanups, and core dump prevention.
- Date: Fri, 11 Jan 2013 01:59:08 +0000 (UTC)
commit aaedc013bd7857c595a7f9ee15ad130058c498a8
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 10 20:58:42 2013 -0500
Func: typos, cleanups, and core dump prevention.
ChangeLog | 1 +
src/func.c | 14 ++++++--------
2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cd194b6..edea68a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
(gnm_func_add_placeholder): Ditto.
(invent_name): Downcase the preferred name.
(gnm_func_add_placeholder_full): Eliminate GNM_FUNC_FREE_NAME.
+ (gnm_func_add): Initialize arg_names_p.
* src/gnm-plugin.c (plugin_service_function_group_activate):
Upgrade existing placeholder functions as needed.
diff --git a/src/func.c b/src/func.c
index 80e1f35..e623c62 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1086,7 +1086,7 @@ gnm_func_lookup_localized (char const *name, Workbook *scope)
GHashTableIter hiter;
gpointer value;
- /* Must localize all function name. */
+ /* Must localize all function names. */
g_hash_table_iter_init (&hiter, functions_by_name);
while (g_hash_table_iter_next (&hiter, NULL, &value)) {
GnmFunc *fd = value;
@@ -1159,6 +1159,7 @@ gnm_func_add (GnmFuncGroup *fn_group,
func->impl_status = desc->impl_status;
func->test_status = desc->test_status;
func->localized_name = NULL;
+ func->arg_names_p = NULL;
func->user_data = NULL;
func->usage_count = 0;
@@ -1202,8 +1203,8 @@ gnm_func_add (GnmFuncGroup *fn_group,
/* Handle unknown functions on import without losing their names */
static GnmValue *
unknownFunctionHandler (GnmFuncEvalInfo *ei,
- int argc,
- GnmExprConstPtr const *argv)
+ G_GNUC_UNUSED int argc,
+ G_GNUC_UNUSED GnmExprConstPtr const *argv)
{
return value_new_error_NAME (ei->pos);
}
@@ -1255,14 +1256,11 @@ invent_name (const char *pref, GHashTable *h, const char *template)
static int count = 0;
char *name = g_utf8_strdown (pref, -1);
- if (g_hash_table_lookup (h, name) == NULL)
- return name;
-
- do {
+ while (g_hash_table_lookup (h, name)) {
count++;
g_free (name);
name = g_strdup_printf (template, count);
- } while (g_hash_table_lookup (h, name));
+ }
return name;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]