comparison mercurial/parsers.c @ 22540:9a860ac8c216

parsers: fix uninitialize variable warning The heads pointer is not initialized correctly if filter is false, causing both clang and gcc to issue a warning. Correctly initialize heads to NULL.
author David Soria Parra <davidsp@fb.com>
date Wed, 24 Sep 2014 13:16:20 -0700
parents 2b5940f64750
children 5e0d1478db8e
comparison
equal deleted inserted replaced
22539:6f434ef54222 22540:9a860ac8c216
852 852
853 static PyObject *index_headrevs(indexObject *self, PyObject *args) 853 static PyObject *index_headrevs(indexObject *self, PyObject *args)
854 { 854 {
855 Py_ssize_t i, len, addlen; 855 Py_ssize_t i, len, addlen;
856 char *nothead = NULL; 856 char *nothead = NULL;
857 PyObject *heads; 857 PyObject *heads = NULL;
858 PyObject *filter = NULL; 858 PyObject *filter = NULL;
859 PyObject *filteredrevs = Py_None; 859 PyObject *filteredrevs = Py_None;
860 860
861 if (!PyArg_ParseTuple(args, "|O", &filteredrevs)) { 861 if (!PyArg_ParseTuple(args, "|O", &filteredrevs)) {
862 return NULL; 862 return NULL;