[pacman-dev] [PATCH] Changed implicit NULL check to explicit one, to comply with style guide.
Signed-off-by: Terry Bolt <bolt.terry@gmail.com> --- lib/libalpm/diskspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 5bb2173..7ee1289 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -62,7 +62,7 @@ static void mount_point_list_free(alpm_list_t *mount_points) { alpm_list_t *i; - for(i = mount_points; i; i = i->next) { + for(i = mount_points; i != NULL; i = i->next) { alpm_mountpoint_t *data = i->data; FREE(data->mount_dir); } -- 2.6.4
On 23/12/15 10:27, Terry Bolt wrote:
Signed-off-by: Terry Bolt <bolt.terry@gmail.com> --- lib/libalpm/diskspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
That does not really comply with the coding style given every other loop is like the original. A
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 5bb2173..7ee1289 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -62,7 +62,7 @@ static void mount_point_list_free(alpm_list_t *mount_points) { alpm_list_t *i;
- for(i = mount_points; i; i = i->next) { + for(i = mount_points; i != NULL; i = i->next) { alpm_mountpoint_t *data = i->data; FREE(data->mount_dir); }
What about lib/libalpm/diskspace.c:183: for(ptr = mount_points; ptr != NULL; ptr = ptr->next) { On 23 December 2015 at 01:31, Allan McRae <allan@archlinux.org> wrote:
On 23/12/15 10:27, Terry Bolt wrote:
Signed-off-by: Terry Bolt <bolt.terry@gmail.com> --- lib/libalpm/diskspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
That does not really comply with the coding style given every other loop is like the original.
A
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 5bb2173..7ee1289 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -62,7 +62,7 @@ static void mount_point_list_free(alpm_list_t *mount_points) { alpm_list_t *i;
- for(i = mount_points; i; i = i->next) { + for(i = mount_points; i != NULL; i = i->next) { alpm_mountpoint_t *data = i->data; FREE(data->mount_dir); }
On 23/12/15 11:38, Terry Bolt wrote:
What about lib/libalpm/diskspace.c:183:
for(ptr = mount_points; ptr != NULL; ptr = ptr->next) {
Ok... 241 cases have no == NULL or != NULL, 3 cases do. A
Oh interesting, thanks. Never mind then. Terry On 23 Dec 2015 1:41 am, "Allan McRae" <allan@archlinux.org> wrote:
On 23/12/15 11:38, Terry Bolt wrote:
What about lib/libalpm/diskspace.c:183:
for(ptr = mount_points; ptr != NULL; ptr = ptr->next) {
Ok... 241 cases have no == NULL or != NULL, 3 cases do.
A
participants (2)
-
Allan McRae
-
Terry Bolt