[evolution] Prefer G_VALUE_INIT over memset().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Prefer G_VALUE_INIT over memset().
- Date: Thu, 29 Sep 2011 16:09:09 +0000 (UTC)
commit 31a6477e702eb480c2cc18ebf1772f67b2b984d3
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Sep 5 08:27:28 2011 -0400
Prefer G_VALUE_INIT over memset().
G_VALUE_INIT is new in GLib 2.30. More convenient than zero-filling a
statically declared GValue with memset().
composer/e-composer-header-table.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 7fe1399..2dd94eb 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -21,7 +21,6 @@
#include "e-composer-header-table.h"
-#include <string.h>
#include <glib/gi18n-lib.h>
#include <libedataserverui/e-name-selector.h>
@@ -81,10 +80,9 @@ g_value_set_destinations (GValue *value,
EDestination **destinations)
{
GValueArray *value_array;
- GValue element;
+ GValue element = G_VALUE_INIT;
gint ii;
- memset (&element, 0, sizeof (GValue));
g_value_init (&element, E_TYPE_DESTINATION);
/* Preallocate some reasonable number. */
@@ -122,9 +120,8 @@ g_value_set_string_list (GValue *value,
GList *list)
{
GValueArray *value_array;
- GValue element;
+ GValue element = G_VALUE_INIT;
- memset (&element, 0, sizeof (GValue));
g_value_init (&element, G_TYPE_STRING);
value_array = g_value_array_new (g_list_length (list));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]