Code

janitor: use NULL and not 0 for pointers.
authorPierre Habouzit <madcoder@debian.org>
Wed, 22 Jul 2009 21:34:33 +0000 (23:34 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jul 2009 04:57:41 +0000 (21:57 -0700)
Brought to you thanks to coccinelle:

    ---8<----
    @@
    expression *E;
    @@
    (
      E ==
    - 0
    + NULL
    |
      E !=
    - 0
    + NULL
    |
      E =
    - 0
    + NULL
    )

    @@
    identifier f;
    type T;
    @@
    T *f(...) {
    <...
    - return 0;
    + return NULL;
    ...>
    }
    --->8----

There are a lot more hits in compat/nedmallox and compat/regex but these
are borrowed code we rather do not want to maintain our own forks for,
and this patch refrains from touching them.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c

diff --git a/graph.c b/graph.c
index f8d7a5c0f6d17538a72b75e8de9dd092829a0262..e466770208d73d8e1f5bc7f6b12728b6f2b7c6bb 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -893,7 +893,7 @@ static struct column *find_new_column_by_commit(struct git_graph *graph,
                if (graph->new_columns[i].commit == commit)
                        return &graph->new_columns[i];
        }
-       return 0;
+       return NULL;
 }
 
 static void graph_output_post_merge_line(struct git_graph *graph, struct strbuf *sb)