Skip to content

Commit 9874606

Browse files
jrngitster
authored andcommitted
Standardize do { ... } while (0) style
Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d1d6e5 commit 9874606

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

base85.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#define say1(a,b) fprintf(stderr, a, b)
88
#define say2(a,b,c) fprintf(stderr, a, b, c)
99
#else
10-
#define say(a) do {} while(0)
11-
#define say1(a,b) do {} while(0)
12-
#define say2(a,b,c) do {} while(0)
10+
#define say(a) do { /* nothing */ } while (0)
11+
#define say1(a,b) do { /* nothing */ } while (0)
12+
#define say2(a,b,c) do { /* nothing */ } while (0)
1313
#endif
1414

1515
static const char en85[] = {

cache.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ extern int init_db(const char *template_dir, unsigned int flags);
449449
alloc = alloc_nr(alloc); \
450450
x = xrealloc((x), alloc * sizeof(*(x))); \
451451
} \
452-
} while(0)
452+
} while (0)
453453

454454
/* Initialize and use the cache information */
455455
extern int read_index(struct index_state *);

diffcore.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct diff_queue_struct {
9898
(q)->queue = NULL; \
9999
(q)->nr = (q)->alloc = 0; \
100100
(q)->run = 0; \
101-
} while(0);
101+
} while (0)
102102

103103
extern struct diff_queue_struct diff_queued_diff;
104104
extern struct diff_filepair *diff_queue(struct diff_queue_struct *,
@@ -118,9 +118,9 @@ void diff_debug_filespec(struct diff_filespec *, int, const char *);
118118
void diff_debug_filepair(const struct diff_filepair *, int);
119119
void diff_debug_queue(const char *, struct diff_queue_struct *);
120120
#else
121-
#define diff_debug_filespec(a,b,c) do {} while(0)
122-
#define diff_debug_filepair(a,b) do {} while(0)
123-
#define diff_debug_queue(a,b) do {} while(0)
121+
#define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0)
122+
#define diff_debug_filepair(a,b) do { /* nothing */ } while (0)
123+
#define diff_debug_queue(a,b) do { /* nothing */ } while (0)
124124
#endif
125125

126126
extern int diffcore_count_changes(struct diff_filespec *src,

http.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#endif
2424

2525
#if LIBCURL_VERSION_NUM < 0x070704
26-
#define curl_global_cleanup() do { /* nothing */ } while(0)
26+
#define curl_global_cleanup() do { /* nothing */ } while (0)
2727
#endif
2828
#if LIBCURL_VERSION_NUM < 0x070800
29-
#define curl_global_init(a) do { /* nothing */ } while(0)
29+
#define curl_global_init(a) do { /* nothing */ } while (0)
3030
#endif
3131

3232
#if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)

0 commit comments

Comments
 (0)