Skip to content

Commit

Permalink
Standardize do { ... } while (0) style
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Aug 12, 2010
1 parent 0d1d6e5 commit 9874606
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions base85.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#define say1(a,b) fprintf(stderr, a, b)
#define say2(a,b,c) fprintf(stderr, a, b, c)
#else
#define say(a) do {} while(0)
#define say1(a,b) do {} while(0)
#define say2(a,b,c) do {} while(0)
#define say(a) do { /* nothing */ } while (0)
#define say1(a,b) do { /* nothing */ } while (0)
#define say2(a,b,c) do { /* nothing */ } while (0)
#endif

static const char en85[] = {
Expand Down
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ extern int init_db(const char *template_dir, unsigned int flags);
alloc = alloc_nr(alloc); \
x = xrealloc((x), alloc * sizeof(*(x))); \
} \
} while(0)
} while (0)

/* Initialize and use the cache information */
extern int read_index(struct index_state *);
Expand Down
8 changes: 4 additions & 4 deletions diffcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct diff_queue_struct {
(q)->queue = NULL; \
(q)->nr = (q)->alloc = 0; \
(q)->run = 0; \
} while(0);
} while (0)

extern struct diff_queue_struct diff_queued_diff;
extern struct diff_filepair *diff_queue(struct diff_queue_struct *,
Expand All @@ -118,9 +118,9 @@ void diff_debug_filespec(struct diff_filespec *, int, const char *);
void diff_debug_filepair(const struct diff_filepair *, int);
void diff_debug_queue(const char *, struct diff_queue_struct *);
#else
#define diff_debug_filespec(a,b,c) do {} while(0)
#define diff_debug_filepair(a,b) do {} while(0)
#define diff_debug_queue(a,b) do {} while(0)
#define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0)
#define diff_debug_filepair(a,b) do { /* nothing */ } while (0)
#define diff_debug_queue(a,b) do { /* nothing */ } while (0)
#endif

extern int diffcore_count_changes(struct diff_filespec *src,
Expand Down
4 changes: 2 additions & 2 deletions http.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#endif

#if LIBCURL_VERSION_NUM < 0x070704
#define curl_global_cleanup() do { /* nothing */ } while(0)
#define curl_global_cleanup() do { /* nothing */ } while (0)
#endif
#if LIBCURL_VERSION_NUM < 0x070800
#define curl_global_init(a) do { /* nothing */ } while(0)
#define curl_global_init(a) do { /* nothing */ } while (0)
#endif

#if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)
Expand Down

0 comments on commit 9874606

Please sign in to comment.