From 93bcfeade143014d01fee913a5a4a37e613a5355 Mon Sep 17 00:00:00 2001 From: Yijun Zhao Date: Thu, 3 Aug 2023 17:11:44 +0800 Subject: [PATCH] support for higher version compilers --- Makefile | 2 +- util/pma.h | 2 +- util/snappy.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 09cb39e2..2821be5f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MAJOR=3 MINOR=1 PLATFORM_LDFLAGS=-pthread PLATFORM_SHARED_CFLAGS=-fPIC -PLATFORM_SHARED_LDFLAGS=-c -W -Wall -Werror -std=c99 +PLATFORM_SHARED_LDFLAGS=-c -W -Wall -Werror -std=gnu2x ifdef ENABLE_ASAN WITH_SAN = -fsanitize=address -fno-omit-frame-pointer diff --git a/util/pma.h b/util/pma.h index 4971c102..e8664588 100644 --- a/util/pma.h +++ b/util/pma.h @@ -33,7 +33,7 @@ struct pma { ness_rwlock_t slots_rwlock; }; -struct pma *pma_new(); +struct pma *pma_new(int); void pma_free(struct pma *); void pma_insert(struct pma *, void *, compare_func f, void *); diff --git a/util/snappy.c b/util/snappy.c index 3e8b3b03..61946814 100644 --- a/util/snappy.c +++ b/util/snappy.c @@ -1428,13 +1428,13 @@ static inline int compress(struct snappy_env *env, struct source *reader, struct sink *writer) { int err; - size_t written = 0; +// size_t written = 0; int N = available(reader); char ulength[kmax32]; char *p = varint_encode32(ulength, N); append(writer, ulength, p - ulength); - written += (p - ulength); +// written += (p - ulength); while (N > 0) { /* Get next block to compress (without copying if possible) */ @@ -1490,7 +1490,7 @@ static inline int compress(struct snappy_env *env, struct source *reader, char *end = compress_fragment(fragment, fragment_size, dest, table, table_size); append(writer, dest, end - dest); - written += (end - dest); +// written += (end - dest); N -= num_to_read; skip(reader, pending_advance);