Browse Source

Merge branch 'rs/avoid-null-statement-after-macro-call'

Fix macros that can silently inject unintended null-statements.

* rs/avoid-null-statement-after-macro-call:
  mem-pool: drop trailing semicolon from macro definition
  block-sha1: drop trailing semicolon from macro definition
maint
Junio C Hamano 4 years ago
parent
commit
a8a0ac3234
  1. 2
      block-sha1/sha1.c
  2. 2
      mem-pool.c

2
block-sha1/sha1.c

@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
* the input data, the next mix it from the 512-bit array.
*/
#define SHA_SRC(t) get_be32((unsigned char *) block + (t)*4)
#define SHA_MIX(t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1);
#define SHA_MIX(t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1)

#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
unsigned int TEMP = input(t); setW(t, TEMP); \

2
mem-pool.c

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
#include "cache.h"
#include "mem-pool.h"

#define BLOCK_GROWTH_SIZE 1024*1024 - sizeof(struct mp_block);
#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))

/*
* Allocate a new mp_block and insert it after the block specified in

Loading…
Cancel
Save