From 01b9a6263491a53d12ea40ecf1ca23ee957964f2 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Thu, 5 Jan 2023 21:32:22 -0500 Subject: [PATCH] fixed a bug with gettid for Linux systems where syscall returns an int; changed version to 6.0.7 --- Makefile | 2 +- README.rst | 4 ++-- changelog | 3 +++ include/vasq/definitions.h | 2 +- scripts/pre-commit.sh | 5 +++++ source/logger.c | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) create mode 100755 scripts/pre-commit.sh diff --git a/Makefile b/Makefile index add5d08..1b7cd8d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC ?= gcc debug ?= no -CFLAGS := -std=gnu99 -fdiagnostics-color -Wall -Wextra +CFLAGS := -std=gnu99 -fdiagnostics-color -Wall -Wextra -Werror ifeq ($(debug),yes) CFLAGS += -O0 -g -DDEBUG else diff --git a/README.rst b/README.rst index 3b5d891..207f106 100644 --- a/README.rst +++ b/README.rst @@ -3,8 +3,8 @@ Vanilla Squad ============= :Author: Daniel Walker -:Version: 6.0.6 -:Date: 2022-12-14 +:Version: 6.0.7 +:Date: 2023-01-05 Overview ======== diff --git a/changelog b/changelog index e5b43ec..9e648b1 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +6.0.7: + - Fixed a bug with gettid for Linux systems where syscall returns an int. + 6.0.6: - vasqLoggerCreate now sets *logger to NULL upon error. - vasqSetLoggerLevel no longer emits a logging message. diff --git a/include/vasq/definitions.h b/include/vasq/definitions.h index a68c3ae..32da423 100644 --- a/include/vasq/definitions.h +++ b/include/vasq/definitions.h @@ -9,7 +9,7 @@ /** * @brief Current version of the library. */ -#define VASQ_VERSION "6.0.6" +#define VASQ_VERSION "6.0.7" #ifndef NO_OP #define NO_OP ((void)0) diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh new file mode 100755 index 0000000..d568eca --- /dev/null +++ b/scripts/pre-commit.sh @@ -0,0 +1,5 @@ +#!/bin/sh -ex + +make tests + +find . -name '*.[hc]' -print0 | xargs -0 -n 1 clang-format --dry-run --Werror diff --git a/source/logger.c b/source/logger.c index c1cbf82..4b882bd 100644 --- a/source/logger.c +++ b/source/logger.c @@ -127,7 +127,7 @@ vlogToBuffer(const vasqLogger *logger, vasqLogLevel_t level, VASQ_CONTEXT_DECL, case 'p': vasqIncSnprintf(dst, remaining, "%li", (long)getpid()); break; #ifdef __linux__ - case 'T': vasqIncSnprintf(dst, remaining, "%li", syscall(__NR_gettid)); break; + case 'T': vasqIncSnprintf(dst, remaining, "%li", (long)syscall(__NR_gettid)); break; #endif case 'L': vasqIncSnprintf(dst, remaining, "%s", logLevelName(level)); break;