From: Jon Griffiths Date: Tue, 22 Mar 2016 06:57:29 +0000 (+1300) Subject: crypto: Remove C++ comments X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=98d16c40f7cb21268751da58c0cb0d14efd38c5a crypto: Remove C++ comments Prevents warnings from gcc at higher warning levels. Signed-off-by: Jon Griffiths --- diff --git a/ccan/crypto/ripemd160/ripemd160.c b/ccan/crypto/ripemd160/ripemd160.c index 46a6c950..9fc7d140 100644 --- a/ccan/crypto/ripemd160/ripemd160.c +++ b/ccan/crypto/ripemd160/ripemd160.c @@ -282,7 +282,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len) size_t bufsize = ctx->bytes % 64; if (bufsize + len >= 64) { - // Fill the buffer, and process it. + /* Fill the buffer, and process it. */ memcpy(ctx->buf.u8 + bufsize, data, 64 - bufsize); ctx->bytes += 64 - bufsize; data += 64 - bufsize; @@ -292,7 +292,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len) } while (len >= 64) { - // Process full chunks directly from the source. + /* Process full chunks directly from the source. */ if (alignment_ok(data, sizeof(uint32_t))) Transform(ctx->s, (const uint32_t *)data); else { @@ -305,7 +305,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len) } if (len) { - // Fill the buffer with what remains. + /* Fill the buffer with what remains. */ memcpy(ctx->buf.u8 + bufsize, data, len); ctx->bytes += len; } diff --git a/ccan/crypto/ripemd160/ripemd160.h b/ccan/crypto/ripemd160/ripemd160.h index e29e42bb..fc3bf0ea 100644 --- a/ccan/crypto/ripemd160/ripemd160.h +++ b/ccan/crypto/ripemd160/ripemd160.h @@ -6,7 +6,7 @@ #include /* Uncomment this to use openssl's RIPEMD160 routines (and link with -lcrypto) */ -//#define CCAN_CRYPTO_RIPEMD160_USE_OPENSSL 1 +/*#define CCAN_CRYPTO_RIPEMD160_USE_OPENSSL 1*/ #ifdef CCAN_CRYPTO_RIPEMD160_USE_OPENSSL #include diff --git a/ccan/crypto/sha256/benchmarks/double-sha-bench.c b/ccan/crypto/sha256/benchmarks/double-sha-bench.c index b66531b8..09a9900e 100644 --- a/ccan/crypto/sha256/benchmarks/double-sha-bench.c +++ b/ccan/crypto/sha256/benchmarks/double-sha-bench.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) memset(&block, 0, sizeof(block)); sha256(&block.h, &n, sizeof(n)); block.u8[sizeof(block.h)] = 0x80; - // Size is 256 bits + /* Size is 256 bits */ block.u8[sizeof(block)-2] = 1; start = time_now(); diff --git a/ccan/crypto/sha256/sha256.c b/ccan/crypto/sha256/sha256.c index 40da0b4b..95c70069 100644 --- a/ccan/crypto/sha256/sha256.c +++ b/ccan/crypto/sha256/sha256.c @@ -181,7 +181,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) size_t bufsize = ctx->bytes % 64; if (bufsize + len >= 64) { - // Fill the buffer, and process it. + /* Fill the buffer, and process it. */ memcpy(ctx->buf.u8 + bufsize, data, 64 - bufsize); ctx->bytes += 64 - bufsize; data += 64 - bufsize; @@ -191,7 +191,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) } while (len >= 64) { - // Process full chunks directly from the source. + /* Process full chunks directly from the source. */ if (alignment_ok(data, sizeof(uint32_t))) Transform(ctx->s, (const uint32_t *)data); else { @@ -204,7 +204,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) } if (len) { - // Fill the buffer with what remains. + /* Fill the buffer with what remains. */ memcpy(ctx->buf.u8 + bufsize, data, len); ctx->bytes += len; } diff --git a/ccan/crypto/sha256/sha256.h b/ccan/crypto/sha256/sha256.h index eedaa94e..be4b3b7a 100644 --- a/ccan/crypto/sha256/sha256.h +++ b/ccan/crypto/sha256/sha256.h @@ -6,7 +6,7 @@ #include /* Uncomment this to use openssl's SHA256 routines (and link with -lcrypto) */ -//#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1 +/*#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1*/ #ifdef CCAN_CRYPTO_SHA256_USE_OPENSSL #include