{"thread":{"id":"4689","subject":"[PATCH] quote.c: silence compiler warnings from EMIT macro","startedAt":"2006-06-28T05:59:23Z","lastAt":"2006-06-28T10:01:13Z","messageCount":2,"participants":["Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22706","messageId":"20060628055923.GA6071@coredump.intra.peff.net","threadId":"4689","inReplyTo":null,"subject":"[PATCH] quote.c: silence compiler warnings from EMIT macro","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-06-28T05:59:23Z","receivedAt":"2006-06-28T05:59:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Signed-off-by: Jeff King <peff@peff.net>\n---\nThis allows compiling with gcc -Wall -Werror, which makes finding useful\nwarnings easier. I also think the 'if' is easier to read than the\nshort-circuit.\n\n quote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/quote.c b/quote.c\nindex dcc2326..1910d00 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -13,7 +13,7 @@ #include \"quote.h\"\n  *  a!b      ==> a'\\!'b    ==> 'a'\\!'b'\n  */\n #undef EMIT\n-#define EMIT(x) ( (++len < n) && (*bp++ = (x)) )\n+#define EMIT(x) do { if (++len < n) *bp++ = (x); } while(0)\n \n static inline int need_bs_quote(char c)\n {\n-- \n1.4.1.rc1.g29f4a-dirty\n"},{"id":"22728","messageId":"7vd5ct38gm.fsf@assigned-by-dhcp.cox.net","threadId":"4689","inReplyTo":"20060628055923.GA6071@coredump.intra.peff.net","subject":"Re: [PATCH] quote.c: silence compiler warnings from EMIT macro","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-28T10:01:13Z","receivedAt":"2006-06-28T10:01:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}