From 098b3ebdc46413f2091f987546ef309117780e59 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sun, 12 Jun 2022 18:43:06 +0100 Subject: [PATCH] Try to fix the cmake 2.23 bug --- builder | 8 ++++---- libserene/lib/reader/reader.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builder b/builder index 337cf2e..e85520f 100755 --- a/builder +++ b/builder @@ -65,9 +65,9 @@ ROOT_DIR=$(pwd) BUILD_DIR=$ROOT_DIR/build ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P) -CMAKEARGS_DEBUG=" -DCMAKE_BUILD_TYPE=Debug" +CMAKEARGS_DEBUG=("-DCMAKE_BUILD_TYPE=Debug") # Verbose -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -CMAKEARGS=" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSERENE_CCACHE_DIR=$HOME/.ccache" +CMAKEARGS=("-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" "-DSERENE_CCACHE_DIR=$HOME/.ccache") # ----------------------------------------------------------------------------- # Helper functions @@ -103,8 +103,8 @@ function popd_build() { function build-gen() { pushed_build info "Running: " - info "cmake -G Ninja $CMAKEARGS $CMAKEARGS_DEBUG \"$*\" \"$ROOT_DIR\"" - cmake -G Ninja "$CMAKEARGS" "$CMAKEARGS_DEBUG" "$*" "$ROOT_DIR" + info "cmake -G Ninja " "${CMAKEARGS[@]}" "${CMAKEARGS[@]}" "\"$*\" \"$ROOT_DIR\"" + cmake -G Ninja "${CMAKEARGS[@]}" "${CMAKEARGS_DEBUG[@]}" "$*" "$ROOT_DIR" popd_build } diff --git a/libserene/lib/reader/reader.cpp b/libserene/lib/reader/reader.cpp index 18f806f..8eab985 100644 --- a/libserene/lib/reader/reader.cpp +++ b/libserene/lib/reader/reader.cpp @@ -179,8 +179,8 @@ const char *Reader::nextChar(bool skipWhitespace, unsigned count) { return c; }; -bool Reader::isEndOfBuffer(const unsigned char *c) { - return *c == '\0' || currentPos > buf.size() || *c == EOF; +bool Reader::isEndOfBuffer(const char *c) { + return *c == '\0' || currentPos > buf.size() || ((const int)*c == EOF); }; Location Reader::getCurrentLocation() { return currentLocation.clone(); };