[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[datasets 10/18] gui: Prefer NULL to 0 for initializing pointers.
From: |
Ben Pfaff |
Subject: |
[datasets 10/18] gui: Prefer NULL to 0 for initializing pointers. |
Date: |
Sat, 30 Apr 2011 22:36:38 -0700 |
Using NULL instead of 0 is better modern C style.
---
src/ui/gui/helper.c | 2 +-
src/ui/gui/val-labs-dialog.c | 8 ++++----
src/ui/gui/var-display.c | 2 +-
src/ui/gui/variable-info-dialog.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c
index 36165c7..75954fb 100644
--- a/src/ui/gui/helper.c
+++ b/src/ui/gui/helper.c
@@ -52,7 +52,7 @@
gchar *
value_to_text (union value v, const PsppireDict *dict, struct fmt_spec format)
{
- gchar *s = 0;
+ gchar *s = NULL;
s = data_out (&v, dict_get_encoding (dict->dict), &format);
g_strchug (s);
diff --git a/src/ui/gui/val-labs-dialog.c b/src/ui/gui/val-labs-dialog.c
index 605be36..950a59e 100644
--- a/src/ui/gui/val-labs-dialog.c
+++ b/src/ui/gui/val-labs-dialog.c
@@ -1,5 +1,5 @@
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2009, 2011 Free Software Foundation
+ Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -192,7 +192,7 @@ val_labs_ok (GtkWidget *w, gpointer data)
val_labs_destroy (dialog->labs);
- dialog->labs = 0;
+ dialog->labs = NULL;
gtk_widget_hide (dialog->window);
@@ -206,7 +206,7 @@ val_labs_cancel (struct val_labs_dialog *dialog)
{
val_labs_destroy (dialog->labs);
- dialog->labs = 0;
+ dialog->labs = NULL;
gtk_widget_hide (dialog->window);
}
@@ -461,7 +461,7 @@ val_labs_dialog_create (GtkWindow *toplevel,
PsppireVarStore *var_store)
g_signal_connect (dialog->add_button, "clicked",
G_CALLBACK (on_add), dialog);
- dialog->labs = 0;
+ dialog->labs = NULL;
g_object_unref (xml);
diff --git a/src/ui/gui/var-display.c b/src/ui/gui/var-display.c
index 26de981..5f85af2 100644
--- a/src/ui/gui/var-display.c
+++ b/src/ui/gui/var-display.c
@@ -69,7 +69,7 @@ missing_values_to_string (const PsppireDict *dict, const
struct variable *pv, GE
if ( mv_has_value (miss))
{
- gchar *ss = 0;
+ gchar *ss = NULL;
ss = value_to_text (*mv_get_value (miss, 0), dict, *fmt);
diff --git a/src/ui/gui/variable-info-dialog.c
b/src/ui/gui/variable-info-dialog.c
index 37f501a..3692a0d 100644
--- a/src/ui/gui/variable-info-dialog.c
+++ b/src/ui/gui/variable-info-dialog.c
@@ -55,7 +55,7 @@ label_to_string (const struct variable *var)
static void
populate_text (PsppireDictView *treeview, gpointer data)
{
- gchar *text = 0;
+ gchar *text = NULL;
GString *gstring;
PsppireDict *dict;
--
1.7.2.5
- Re: [datasets 17/18] gui: Add ellipsis to menu items that require further input., (continued)
[datasets 07/18] psppire-window: Use g_string_append_unichar() instead of global var., Ben Pfaff, 2011/05/01
[datasets 08/18] gui: Include only <gtk/gtk.h> to use GTK+., Ben Pfaff, 2011/05/01
[datasets 01/18] gui: Always convert file names to UTF-8 for use in syntax., Ben Pfaff, 2011/05/01
[datasets 14/18] gui: Fix g_object_get() memory leaks for PsppireWindow's filename., Ben Pfaff, 2011/05/01
[datasets 03/18] gui: Fix const-ness warning for measure_to_string() return type., Ben Pfaff, 2011/05/01
[datasets 16/18] Implement DATASET commands., Ben Pfaff, 2011/05/01
[datasets 10/18] gui: Prefer NULL to 0 for initializing pointers.,
Ben Pfaff <=
[datasets 18/18] gui: Change View|Data and View|Variables to radio button menu items., Ben Pfaff, 2011/05/01
[datasets 15/18] gui: New "entry-dialog" module for prompting for a text string., Ben Pfaff, 2011/05/01
[datasets 12/18] gui: Eliminate dataset-related global variables., Ben Pfaff, 2011/05/01
[datasets 11/18] gui: Make syntax execution functions take a PsppireDataWindow argument., Ben Pfaff, 2011/05/01