[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [datasets 10/18] gui: Prefer NULL to 0 for initializing pointers.
From: |
John Darrington |
Subject: |
Re: [datasets 10/18] gui: Prefer NULL to 0 for initializing pointers. |
Date: |
Sun, 1 May 2011 11:15:21 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
If we were using C++ I'd have to disagree.
C doesn't have the same typecasting semantics so
doesn't matter so much. However, sometimes I've
had problems porting programs which use NULL, becauase
different Oses define it in different headers.
On Sat, Apr 30, 2011 at 10:36:38PM -0700, Ben Pfaff wrote:
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
_______________________________________________
pspp-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/pspp-dev
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- 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, 2011/05/01
- Re: [datasets 10/18] gui: Prefer NULL to 0 for initializing pointers.,
John Darrington <=
- [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
- [datasets 04/18] gui: Fix const-ness warning in create_lines_tree_view()., Ben Pfaff, 2011/05/01