From 90779f7dceea3e84e01c8908383a97ac1a7f8b45 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 8 Jan 2012 13:30:51 +0100 Subject: [PATCH] while (1) -> while (true) --- lockfile.c | 4 ++-- stats.c | 4 ++-- test/framework.c | 4 ++-- util.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lockfile.c b/lockfile.c index 039d5ac50..b6d98a732 100644 --- a/lockfile.c +++ b/lockfile.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Joel Rosdahl + * Copyright (C) 2010-2012 Joel Rosdahl * * 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 the Free @@ -43,7 +43,7 @@ lockfile_acquire(const char *path, unsigned staleness_limit) #endif unsigned to_sleep = 1000, slept = 0; /* Microseconds. */ - while (1) { + while (true) { free(my_content); my_content = format("%s:%d:%d", hostname, (int)getpid(), (int)time(NULL)); diff --git a/stats.c b/stats.c index d023ae4c8..2b573428e 100644 --- a/stats.c +++ b/stats.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2002-2004 Andrew Tridgell - * Copyright (C) 2009-2011 Joel Rosdahl + * Copyright (C) 2009-2012 Joel Rosdahl * * 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 the Free @@ -105,7 +105,7 @@ parse_stats(struct counters *counters, const char *buf) long val; p = buf; - while (1) { + while (true) { val = strtol(p, &p2, 10); if (p2 == p) { break; diff --git a/test/framework.c b/test/framework.c index 53a8d60d2..9abbb0585 100644 --- a/test/framework.c +++ b/test/framework.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Joel Rosdahl + * Copyright (C) 2010, 2012 Joel Rosdahl * * 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 the Free @@ -68,7 +68,7 @@ cct_run(suite_fn *suites, int verbose_output) for (suite = suites; *suite; suite++) { unsigned test_index = 0; - while (1) { + while (true) { test_index = (*suite)(test_index + 1); if (test_index == 0) { /* We have reached the end of the suite. */ diff --git a/util.c b/util.c index cea46fb72..e1f09bc5f 100644 --- a/util.c +++ b/util.c @@ -900,7 +900,7 @@ gnu_getcwd(void) { unsigned size = 128; - while (1) { + while (true) { char *buffer = (char *)x_malloc(size); if (getcwd(buffer, size) == buffer) { return buffer; -- 2.47.3