You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2021/03/18 10:13:28 UTC
[nifi-minifi-cpp] branch main updated: MINIFICPP-1352 - Enable
-Wall and -Wextra and resolve related warnings
This is an automated email from the ASF dual-hosted git repository.
aboda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new ba94849 MINIFICPP-1352 - Enable -Wall and -Wextra and resolve related warnings
ba94849 is described below
commit ba948491156b07caa0d430b6aaaaf0c5f808fc5d
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Thu Mar 18 10:32:58 2021 +0100
MINIFICPP-1352 - Enable -Wall and -Wextra and resolve related warnings
Signed-off-by: Arpad Boda <ab...@apache.org>
This closes #1020
---
.github/workflows/ci.yml | 30 +++++++++--
CMakeLists.txt | 36 +++++++++----
README.md | 7 +--
aptitude.sh | 2 +-
arch.sh | 2 +-
bootstrap.sh | 15 ++++--
bstrp_functions.sh | 9 ++--
cmake/BuildTests.cmake | 8 +--
cmake/BundledJemalloc.cmake | 2 +-
cmake/BundledLibCoAP.cmake | 2 +-
cmake/BundledLibLZMA.cmake | 2 +-
cmake/BundledOSSPUUID.cmake | 2 +-
cmake/Date.cmake | 5 +-
controller/CMakeLists.txt | 2 -
controller/Controller.h | 6 +--
debian.sh | 4 +-
encrypt-config/tests/CMakeLists.txt | 2 +-
.../aws/controllerservices/AWSCredentialsService.h | 2 +-
extensions/aws/processors/ListS3.cpp | 2 +-
extensions/aws/processors/S3Processor.cpp | 2 +-
extensions/aws/s3/S3Wrapper.cpp | 4 +-
extensions/civetweb/tests/CMakeLists.txt | 2 +-
extensions/civetweb/tests/ListenHTTPTests.cpp | 4 +-
extensions/coap/controllerservice/CoapResponse.h | 2 +-
extensions/coap/nanofi/coap_connection.c | 5 --
extensions/coap/nanofi/coap_functions.c | 22 ++++++--
extensions/coap/nanofi/coap_functions.h | 4 --
extensions/coap/nanofi/coap_message.c | 2 +-
extensions/coap/nanofi/coap_message.h | 2 +-
extensions/coap/nanofi/coap_server.c | 4 +-
extensions/coap/nanofi/coap_server.h | 4 +-
extensions/coap/protocols/CoapC2Protocol.cpp | 1 -
extensions/coap/protocols/CoapC2Protocol.h | 1 +
extensions/coap/server/CoapServer.h | 2 +-
extensions/coap/tests/CoapC2VerifyHeartbeat.cpp | 6 +--
extensions/coap/tests/CoapIntegrationBase.h | 3 +-
extensions/expression-language/CMakeLists.txt | 20 ++++---
.../expression-language/tests/CMakeLists.txt | 4 +-
.../tests/ExpressionLanguageTests.cpp | 2 +
extensions/gps/GetGPS.cpp | 4 +-
extensions/http-curl/processors/InvokeHTTP.h | 2 +-
extensions/http-curl/tests/C2PauseResumeTest.cpp | 2 +-
extensions/http-curl/tests/C2RequestClassTest.cpp | 4 +-
extensions/http-curl/tests/HTTPHandlers.h | 5 +-
extensions/http-curl/tests/HTTPIntegrationBase.h | 1 -
.../http-curl/tests/HttpGetIntegrationTest.cpp | 3 +-
.../http-curl/tests/VerifyInvokeHTTPTest.cpp | 2 +-
extensions/jni/ExecuteJavaControllerService.h | 2 +-
extensions/jni/ExecuteJavaProcessor.h | 2 +-
extensions/libarchive/BinFiles.cpp | 12 ++---
extensions/libarchive/MergeContent.h | 6 ++-
extensions/libarchive/UnfocusArchiveEntry.cpp | 4 +-
extensions/librdkafka/ConsumeKafka.h | 1 -
extensions/librdkafka/PublishKafka.cpp | 4 +-
extensions/librdkafka/rdkafka_utils.cpp | 2 +-
extensions/librdkafka/rdkafka_utils.h | 2 +-
extensions/librdkafka/tests/ConsumeKafkaTests.cpp | 39 +++++++-------
extensions/mqtt/processors/ConsumeMQTT.cpp | 2 +-
extensions/mqtt/processors/PublishMQTT.h | 2 +-
extensions/opc/include/opc.h | 2 -
extensions/opc/src/fetchopc.cpp | 6 +--
extensions/opc/src/opc.cpp | 17 +++---
extensions/opc/src/opcbase.cpp | 2 +-
extensions/opc/src/putopc.cpp | 2 +-
extensions/opencv/CaptureRTSPFrame.cpp | 2 +-
extensions/opencv/CaptureRTSPFrame.h | 2 +-
extensions/opencv/FrameIO.h | 2 +-
extensions/opencv/MotionDetector.cpp | 2 +-
extensions/opencv/OpenCVLoader.h | 2 +-
.../SourceInitiatedSubscriptionListener.cpp | 9 ++--
.../SourceInitiatedSubscriptionListener.h | 14 ++---
extensions/pcap/CapturePacket.cpp | 4 +-
extensions/pcap/CapturePacket.h | 2 +-
extensions/rocksdb-repos/RocksDatabase.h | 2 +-
.../RocksDbPersistableKeyValueStoreService.cpp | 4 +-
extensions/script/CMakeLists.txt | 2 +-
extensions/script/ExecuteScript.h | 2 +-
extensions/script/ScriptEngine.h | 2 +
extensions/script/lua/LuaBaseStream.cpp | 12 +++--
extensions/script/python/ExecutePythonProcessor.h | 4 ++
extensions/script/python/PyProcCreator.h | 3 ++
extensions/script/python/PythonScriptEngine.cpp | 4 +-
extensions/script/python/PythonScriptEngine.h | 2 +-
extensions/sensors/CMakeLists.txt | 2 +-
extensions/sensors/GetEnvironmentalSensors.h | 2 +-
extensions/sensors/GetMovementSensors.h | 2 +-
extensions/sftp/client/SFTPClient.cpp | 6 +--
extensions/sftp/client/SFTPClient.h | 2 +-
extensions/sftp/processors/FetchSFTP.cpp | 2 +-
extensions/sftp/processors/FetchSFTP.h | 2 +-
extensions/sftp/processors/ListSFTP.cpp | 18 +++----
extensions/sftp/processors/ListSFTP.h | 2 +-
extensions/sftp/processors/PutSFTP.cpp | 5 +-
extensions/sftp/processors/PutSFTP.h | 3 +-
extensions/sql/CMakeLists.txt | 2 +-
extensions/sql/data/DatabaseConnectors.h | 2 +-
extensions/sql/data/JSONSQLWriter.cpp | 6 +--
extensions/sql/data/MaxCollector.h | 4 +-
extensions/sql/processors/PutSQL.cpp | 2 +-
extensions/sql/processors/QueryDatabaseTable.cpp | 4 +-
extensions/sql/processors/SQLProcessor.h | 4 +-
extensions/sqlite/ExecuteSQL.cpp | 2 +-
extensions/sqlite/ExecuteSQL.h | 2 +-
extensions/sqlite/PutSQL.cpp | 2 +-
extensions/sqlite/PutSQL.h | 6 +--
...UnorderedMapPersistableKeyValueStoreService.cpp | 8 +--
.../processors/GenerateFlowFile.cpp | 4 +-
.../standard-processors/processors/GetFile.cpp | 2 +
.../processors/ListenSyslog.cpp | 4 +-
.../standard-processors/processors/ListenSyslog.h | 2 +-
.../standard-processors/processors/LogAttribute.h | 2 +-
.../standard-processors/processors/TailFile.h | 2 +-
.../tests/integration/SecureSocketGetTCPTest.cpp | 4 +-
.../TLSServerSocketSupportedProtocolsTest.cpp | 6 ++-
.../tests/unit/GetFileTests.cpp | 2 +-
.../standard-processors/tests/unit/GetTCPTests.cpp | 2 -
.../tests/unit/ProcessorTests.cpp | 2 +-
.../tests/unit/TailFileTests.cpp | 5 --
.../tests/unit/YamlConfigurationTests.cpp | 4 +-
extensions/usb-camera/GetUSBCamera.cpp | 13 +++--
extensions/usb-camera/GetUSBCamera.h | 4 +-
libminifi/CMakeLists.txt | 2 +-
libminifi/include/c2/PayloadParser.h | 2 +-
libminifi/include/c2/triggers/FileUpdateTrigger.h | 2 +-
libminifi/include/core/ConfigurationFactory.h | 6 +--
libminifi/include/core/Core.h | 1 +
libminifi/include/core/Flow.h | 2 +-
libminifi/include/core/ProcessContext.h | 5 +-
libminifi/include/core/Resource.h | 4 +-
.../include/core/repository/AtomicRepoEntries.h | 2 +-
.../include/core/state/nodes/DeviceInformation.h | 2 +-
libminifi/include/core/yaml/YamlConfiguration.h | 4 +-
libminifi/include/io/AtomicEntryStream.h | 6 +--
libminifi/include/sitetosite/RawSocketProtocol.h | 2 +-
libminifi/include/sitetosite/SiteToSite.h | 6 +--
libminifi/include/utils/Monitors.h | 4 +-
libminifi/include/utils/ProcessorConfigUtils.h | 1 -
libminifi/include/utils/file/FileManager.h | 1 +
libminifi/src/c2/C2Payload.cpp | 4 +-
libminifi/src/core/FlowFile.cpp | 13 +++--
libminifi/src/core/ProcessGroup.cpp | 12 ++---
libminifi/src/core/ProcessSessionReadCallback.cpp | 6 +--
libminifi/src/core/ProcessorNode.cpp | 4 +-
libminifi/src/core/PropertyValidation.cpp | 2 +-
libminifi/src/core/logging/LoggerConfiguration.cpp | 4 +-
libminifi/src/core/yaml/YamlConfiguration.cpp | 10 ++--
libminifi/src/io/FileStream.cpp | 8 +--
libminifi/src/io/ZlibStream.cpp | 4 +-
libminifi/src/io/tls/TLSSocket.cpp | 7 ++-
libminifi/src/provenance/Provenance.cpp | 4 +-
libminifi/src/utils/StringUtils.cpp | 1 +
libminifi/test/TestBase.cpp | 5 +-
libminifi/test/aws-tests/DeleteS3ObjectTests.cpp | 2 +-
libminifi/test/aws-tests/FetchS3ObjectTests.cpp | 2 +-
libminifi/test/aws-tests/ListS3Tests.cpp | 8 +--
libminifi/test/aws-tests/MockS3RequestSender.h | 12 ++---
libminifi/test/aws-tests/PutS3ObjectTests.cpp | 2 +-
libminifi/test/bustache-tests/CMakeLists.txt | 2 +-
libminifi/test/flow-tests/CustomProcessors.h | 1 +
libminifi/test/jni-tests/CMakeLists.txt | 4 +-
libminifi/test/kafka-tests/CMakeLists.txt | 4 +-
libminifi/test/mqtt-tests/CMakeLists.txt | 4 +-
libminifi/test/pcap-tests/PcapTest.cpp | 6 +--
libminifi/test/persistence-tests/CMakeLists.txt | 2 +-
libminifi/test/rocksdb-tests/CMakeLists.txt | 4 +-
.../test/rocksdb-tests/ContentSessionTests.cpp | 4 +-
libminifi/test/script-tests/CMakeLists.txt | 8 +--
libminifi/test/sensors-tests/CMakeLists.txt | 2 +-
libminifi/test/sqlite-tests/CMakeLists.txt | 2 +-
libminifi/test/unit/DecryptorTests.cpp | 22 ++++----
libminifi/test/unit/GeneralUtilsTest.cpp | 5 +-
libminifi/test/unit/MockClasses.h | 4 +-
libminifi/test/unit/PayloadParserTests.cpp | 8 +--
libminifi/test/unit/ProcessSessionTests.cpp | 2 +-
libminifi/test/unit/PropertyValidationTests.cpp | 3 +-
libminifi/test/usb-camera-tests/CMakeLists.txt | 2 +-
main/AgentDocs.cpp | 2 +-
main/CMakeLists.txt | 4 +-
nanofi/examples/generate_flow.c | 2 +-
nanofi/examples/hash_file.c | 2 +-
nanofi/examples/monitor_directory.c | 10 +---
nanofi/examples/terminate_handler.c | 4 +-
nanofi/examples/transmit_flow.c | 2 -
nanofi/include/api/nanofi.h | 4 +-
nanofi/include/core/log.h | 2 +-
nanofi/include/sitetosite/CPeer.h | 14 +++--
nanofi/include/sitetosite/CRawSocketProtocol.h | 32 +++++------
nanofi/include/sitetosite/CSiteToSite.h | 62 ++++++----------------
nanofi/src/api/ecu.c | 12 +++--
nanofi/src/api/nanofi.cpp | 6 ++-
nanofi/src/core/file_utils.c | 2 +-
nanofi/src/cxx/Plan.cpp | 2 -
nanofi/src/sitetosite/CRawSocketProtocol.c | 38 ++++++++++++-
nanofi/tests/CAPITests.cpp | 4 +-
nanofi/tests/CSite2SiteTests.cpp | 4 +-
nanofi/tests/CTestsBase.h | 2 +-
nanofi/tests/CUUIDTests.cpp | 2 +-
python/library/CMakeLists.txt | 1 +
thirdparty/open62541/open62541.patch | 13 +++++
thirdparty/pybind11/include/pybind11/cast.h | 4 +-
200 files changed, 573 insertions(+), 498 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4fa7a79..40f2cda 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,7 +30,7 @@ jobs:
run: |
export PATH="/usr/local/opt/lua@5.3/lib:/usr/local/opt/lua@5.3/include:/usr/local/opt/lua@5.3/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/lua@5.3/lib/pkgconfig"
- ./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_AWS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j4 --output-on-failure" && make linter
+ ./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_AWS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j4 --output-on-failure" && make linter
macos_xcode_12_0:
name: "macos-xcode12.0"
runs-on: macos-10.15
@@ -60,7 +60,7 @@ jobs:
run: |
export PATH="/usr/local/opt/lua@5.3/lib:/usr/local/opt/lua@5.3/include:/usr/local/opt/lua@5.3/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/lua@5.3/lib/pkgconfig"
- ./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_AWS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j4 --output-on-failure" && make linter
+ ./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_AWS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j4 --output-on-failure" && make linter
windows_VS2017:
name: "windows-vs2017"
runs-on: windows-2016
@@ -159,7 +159,29 @@ jobs:
sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: build
- run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_BUSTACHE=ON -DENABLE_SQLITE=ON -DENABLE_PCAP=ON -DSTRICT_GSL_CHECKS=AUDIT .. && make -j4 VERBOSE=1 && make test ARGS="--timeout 300 -j2 --output-on-failure"
+ run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_BUSTACHE=ON -DENABLE_SQLITE=ON -DENABLE_PCAP=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && make -j4 VERBOSE=1 && make test ARGS="--timeout 300 -j2 --output-on-failure"
+ ubuntu_20_04_all_clang:
+ name: "ubuntu-20.04-all-clang"
+ runs-on: ubuntu-20.04
+ timeout-minutes: 90
+ steps:
+ - id: checkout
+ uses: actions/checkout@v2
+ - id: cache
+ uses: actions/cache@v2
+ with:
+ path: ~/.ccache
+ key: ubuntu-20.04-all-clang-ccache-${{github.ref}}-${{github.sha}}
+ restore-keys: |
+ ubuntu-20.04-all-clang-ccache-${{github.ref}}-
+ ubuntu-20.04-all-clang-ccache-refs/heads/main-
+ - id: install_deps
+ run: |
+ sudo apt update
+ sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev openjdk-8-jdk maven libusb-1.0-0-dev libpng-dev libgps-dev
+ echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
+ - id: build
+ run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j8 --o [...]
ubuntu_16_04_all:
name: "ubuntu-16.04-all"
runs-on: ubuntu-16.04
@@ -182,7 +204,7 @@ jobs:
sudo apt install -y ccache openjdk-8-jdk maven libusb-1.0-0-dev libpng12-dev libgps-dev
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: build
- run: sudo mount tmpfs -t tmpfs /tmp && ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j8 --output-on-failure"
+ run: sudo mount tmpfs -t tmpfs /tmp && ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j8 --output-on-failure"
debian:
name: "debian"
runs-on: ubuntu-18.04
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68e1fc8..4cb6ae7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,6 +60,7 @@ option(DISABLE_CURL "Disables libCurl Properties." OFF)
option(USE_GOLD_LINKER "Use Gold Linker" OFF)
option(INSTALLER_MERGE_MODULES "Creates installer with merge modules" OFF)
+option(FAIL_ON_WARNINGS "Treat warnings as errors" OFF)
# This is needed for ninja:
# By default, neither Clang or GCC will add ANSI-formatted colors to your output if they detect
# the output medium is not a terminal. This means no coloring when using a generator
@@ -129,8 +130,6 @@ if (WIN32)
add_definitions(-DSERVICE_NAME="Apache NiFi MINiFi")
endif()
-#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-
if (NOT PORTABLE)
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX2")
@@ -185,7 +184,6 @@ endfunction()
# Find patch executable
find_package(Patch REQUIRED)
-# Setup passthrough args
set(PASSTHROUGH_CMAKE_ARGS -DANDROID_ABI=${ANDROID_ABI}
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
-DANDROID_STL=${ANDROID_STL}
@@ -259,7 +257,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/zlib/dummy")
# uthash
add_library(ut INTERFACE)
-target_include_directories(ut INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ut")
+target_include_directories(ut SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ut")
# cURL
if(NOT DISABLE_CURL)
@@ -281,23 +279,23 @@ use_bundled_yamlcpp(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
# concurrentqueue
add_library(concurrentqueue INTERFACE)
-target_include_directories(concurrentqueue INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/concurrentqueue")
+target_include_directories(concurrentqueue SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/concurrentqueue")
# RapidJSON
add_library(RapidJSON INTERFACE)
-target_include_directories(RapidJSON INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/rapidjson-1.1.0/include")
+target_include_directories(RapidJSON SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/rapidjson-1.1.0/include")
# Cron
add_library(cron INTERFACE)
-target_include_directories(cron INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cron")
+target_include_directories(cron SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cron")
# cxxopts
add_library(cxxopts INTERFACE)
-target_include_directories(cxxopts INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cxxopts/include")
+target_include_directories(cxxopts SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cxxopts/include")
# gsl-lite
add_library(gsl-lite INTERFACE)
-target_include_directories(gsl-lite INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gsl-lite-0.37.0/include")
+target_include_directories(gsl-lite SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gsl-lite-0.37.0/include")
# Add necessary definitions based on the value of STRICT_GSL_CHECKS, see gsl-lite README for more details
list(APPEND GslDefinitions gsl_CONFIG_DEFAULTS_VERSION=1)
@@ -315,11 +313,27 @@ target_compile_definitions(gsl-lite INTERFACE ${GslDefinitions})
# optional-lite
add_library(optional-lite INTERFACE)
-target_include_directories(optional-lite INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/optional-lite-3.2.0/include")
+target_include_directories(optional-lite SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/optional-lite-3.2.0/include")
# date
include(Date)
+# Setup passthrough args used by third parties
+set(PASSTHROUGH_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+set(PASSTHROUGH_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+
+# Setup warning flags
+if(MSVC)
+ if(FAIL_ON_WARNINGS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+ endif()
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+ if(FAIL_ON_WARNINGS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ endif()
+endif()
+
#### Extensions ####
SET(TEST_DIR ${CMAKE_SOURCE_DIR}/libminifi/test)
include(Extensions)
@@ -452,7 +466,7 @@ option(DISABLE_SCRIPTING "Disables the scripting extensions." OFF)
if (NOT DISABLE_SCRIPTING)
# sol
add_library(sol INTERFACE)
- target_include_directories(sol INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/sol2-2.20.0")
+ target_include_directories(sol SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/sol2-2.20.0")
createExtension(SCRIPTING-EXTENSIONS "SCRIPTING EXTENSIONS" "This enables scripting" "extensions/script" "${TEST_DIR}/script-tests")
endif()
diff --git a/README.md b/README.md
index 31afe09..043fca5 100644
--- a/README.md
+++ b/README.md
@@ -341,12 +341,12 @@ $ # It is recommended that you install bison from source as HomeBrew now uses an
If you have already bootstrapped, bootstrapping again isn't necessary to run make [ Y/N ] Y
*****************************************
Select MiNiFi C++ Features to toggle.
- *****************************************
+ ****************************************
A. Persistent Repositories .....Enabled
B. Lib Curl Features ...........Enabled
C. Lib Archive Features ........Enabled
D. Execute Script support ......Enabled
- E. Expression Langauge support .Enabled
+ E. Expression Language support .Enabled
F. Kafka support ...............Disabled
G. PCAP support ................Disabled
H. USB Camera support ..........Disabled
@@ -372,13 +372,14 @@ $ # It is recommended that you install bison from source as HomeBrew now uses an
4. Use Shared Dependency Links .Enabled
5. Build Profile ...............RelWithDebInfo Debug MinSizeRel Release
6. Create ASAN build ...........Disabled
+ 7. Treat warnings as errors.....Disabled
P. Continue with these options
Q. Quit
* Extension cannot be installed due to
version of cmake or other software, or
incompatibility with other extensions
- Enter choice [ A - X or 1-6 ]
+ Enter choice [ A - X or 1-7 ]
```
- Boostrap now saves state between runs. State will automatically be saved. Provide -c or --clear to clear this state. The -i option provides a guided menu install with the ability to change
diff --git a/aptitude.sh b/aptitude.sh
index c474b29..b8693b1 100644
--- a/aptitude.sh
+++ b/aptitude.sh
@@ -22,7 +22,7 @@ verify_enable_platform(){
verify_gcc_enable $feature
}
add_os_flags() {
- CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND}"
}
bootstrap_cmake(){
## on Ubuntu install the latest CMake
diff --git a/arch.sh b/arch.sh
index 43a34dc..f422bfd 100644
--- a/arch.sh
+++ b/arch.sh
@@ -22,7 +22,7 @@ verify_enable_platform(){
verify_gcc_enable $feature
}
add_os_flags() {
- CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND}"
}
bootstrap_cmake(){
sudo pacman -S --noconfirm cmake
diff --git a/bootstrap.sh b/bootstrap.sh
index 125ee9d..77d069a 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -325,6 +325,7 @@ add_dependency OPC_ENABLED "mbedtls"
USE_SHARED_LIBS=${TRUE}
TESTS_DISABLED=${FALSE}
ASAN_ENABLED=${FALSE}
+FAIL_ON_WARNINGS=${FALSE}
## name, default, values
add_multi_option BUILD_PROFILE "RelWithDebInfo" "RelWithDebInfo" "Debug" "MinSizeRel" "Release"
@@ -407,7 +408,7 @@ CMAKE_REVISION=`echo $CMAKE_VERSION | cut -d. -f3`
CMAKE_BUILD_COMMAND="${CMAKE_COMMAND} "
-if [ "${USE_NINJA}" = "${TRUE}" ]; then
+if [ "${USE_NINJA}" = "${TRUE}" ]; then
echo "use ninja"
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFORCE_COLORED_OUTPUT=ON -GNinja "
fi
@@ -466,13 +467,13 @@ build_cmake_command(){
else
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DASAN_BUILD=OFF"
fi
-
+
if [ "${USE_SHARED_LIBS}" = "${TRUE}" ]; then
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DUSE_SHARED_LIBS=ON "
else
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DUSE_SHARED_LIBS= "
fi
-
+
if [ "${PORTABLE_BUILD}" = "${TRUE}" ]; then
@@ -487,8 +488,14 @@ build_cmake_command(){
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DBUILD_ROCKSDB= "
fi
+ if [ "${FAIL_ON_WARNINGS}" = "${TRUE}" ]; then
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS=ON "
+ else
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS=OFF"
+ fi
+
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DBUILD_IDENTIFIER=${BUILD_IDENTIFIER}"
-
+
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_BUILD_TYPE=${BUILD_PROFILE}"
add_os_flags
diff --git a/bstrp_functions.sh b/bstrp_functions.sh
index a75b9f3..1eb1629 100755
--- a/bstrp_functions.sh
+++ b/bstrp_functions.sh
@@ -78,7 +78,7 @@ print_multi_option_status(){
feature="$1"
feature_status=${!1}
declare -a VAR_OPTS=()
-
+
declare VAR_OPTS=$1_OPTIONS[@]
VAR_OPTS=$1_OPTIONS[@]
@@ -95,7 +95,7 @@ ToggleMultiOption(){
feature="$1"
feature_status=${!1}
declare -a VAR_OPTS=()
-
+
declare VAR_OPTS=$1_OPTIONS[@]
#echo -e "${RED}${feature_status}${NO_COLOR} (${VAR_OPTS_VAL})"
VAR_OPTS=$1_OPTIONS[@]
@@ -170,6 +170,7 @@ save_state(){
echo_state_variable BUILD_PROFILE
echo_state_variable USE_SHARED_LIBS
echo_state_variable ASAN_ENABLED
+ echo_state_variable FAIL_ON_WARNINGS
for option in "${OPTIONS[@]}" ; do
echo_state_variable $option
done
@@ -375,6 +376,7 @@ show_supported_features() {
echo "4. Use Shared Dependency Links .$(print_feature_status USE_SHARED_LIBS)"
echo "5. Build Profile ...............$(print_multi_option_status BUILD_PROFILE)"
echo "6. Create ASAN build ...........$(print_feature_status ASAN_ENABLED)"
+ echo "7. Treat warnings as errors.....$(print_feature_status FAIL_ON_WARNINGS)"
echo "P. Continue with these options"
if [ "$GUIDED_INSTALL" = "${TRUE}" ]; then
echo "R. Return to Main Menu"
@@ -387,7 +389,7 @@ show_supported_features() {
read_feature_options(){
local choice
- read -p "Enter choice [ A - X or 1-6 ] " choice
+ read -p "Enter choice [ A - X or 1-7 ] " choice
choice=$(echo ${choice} | tr '[:upper:]' '[:lower:]')
case $choice in
a) ToggleFeature ROCKSDB_ENABLED ;;
@@ -427,6 +429,7 @@ read_feature_options(){
;;
5) ToggleMultiOption BUILD_PROFILE;;
6) ToggleFeature ASAN_ENABLED;;
+ 7) ToggleFeature FAIL_ON_WARNINGS;;
p) FEATURES_SELECTED="true" ;;
r) if [ "$GUIDED_INSTALL" = "${TRUE}" ]; then
MENU="main"
diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake
index 40acb88..337f26e 100644
--- a/cmake/BuildTests.cmake
+++ b/cmake/BuildTests.cmake
@@ -39,7 +39,7 @@ if(NOT EXCLUDE_BOOST)
endif()
function(appendIncludes testName)
- target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+ target_include_directories(${testName} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/include")
target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/")
target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/c2/protocols")
@@ -68,7 +68,7 @@ function(createTests testName)
appendIncludes("${testName}")
if (ENABLE_BINARY_DIFF)
- target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/bsdiff/")
+ target_include_directories(${testName} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/bsdiff/")
endif(ENABLE_BINARY_DIFF)
if (Boost_FOUND)
@@ -91,7 +91,7 @@ enable_testing(test)
SET(TEST_BASE_LIB test_base)
add_library(${TEST_BASE_LIB} STATIC "${TEST_DIR}/TestBase.cpp" "${TEST_DIR}/RandomServerSocket.cpp" "${TEST_DIR}/KamikazeProcessor.cpp")
target_link_libraries(${TEST_BASE_LIB} core-minifi)
-target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+target_include_directories(${TEST_BASE_LIB} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/")
if(WIN32)
target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/opsys/win")
@@ -101,7 +101,7 @@ endif()
SET(CATCH_MAIN_LIB catch_main)
add_library(${CATCH_MAIN_LIB} STATIC "${TEST_DIR}/CatchMain.cpp")
-target_include_directories(${CATCH_MAIN_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+target_include_directories(${CATCH_MAIN_LIB} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
SET(TEST_RESOURCES ${TEST_DIR}/resources)
diff --git a/cmake/BundledJemalloc.cmake b/cmake/BundledJemalloc.cmake
index acaf8e8..55b982b 100644
--- a/cmake/BundledJemalloc.cmake
+++ b/cmake/BundledJemalloc.cmake
@@ -35,7 +35,7 @@ function(use_bundled_jemalloc SOURCE_DIR BINARY_DIR)
BUILD_BYPRODUCTS "${BINARY_DIR}/thirdparty/jemalloc-src/${BYPRODUCT}"
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Skipping install step."
CONFIGURE_COMMAND ""
- PATCH_COMMAND ./autogen.sh && ./configure "CFLAGS=${CMAKE_C_FLAGS}" "CXXFLAGS=${CMAKE_CXX_FLAGS}"
+ PATCH_COMMAND ./autogen.sh && ./configure "CFLAGS=${PASSTHROUGH_CMAKE_C_FLAGS}" "CXXFLAGS=${PASSTHROUGH_CMAKE_CXX_FLAGS}"
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
)
diff --git a/cmake/BundledLibCoAP.cmake b/cmake/BundledLibCoAP.cmake
index dceb6ee..62a5705 100644
--- a/cmake/BundledLibCoAP.cmake
+++ b/cmake/BundledLibCoAP.cmake
@@ -62,7 +62,7 @@ function(use_bundled_libcoap SOURCE_DIR BINARY_DIR)
INSTALL_COMMAND make install
BUILD_BYPRODUCTS "${BINARY_DIR}/thirdparty/libcoap-install/${BYPRODUCT}"
CONFIGURE_COMMAND ""
- PATCH_COMMAND ./autogen.sh && ./configure "CFLAGS=${CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${CMAKE_CXX_FLAGS} -fPIC" --disable-examples --disable-dtls --disable-tests --disable-documentation --prefix=${BINARY_DIR}/thirdparty/libcoap-install
+ PATCH_COMMAND ./autogen.sh && ./configure "CFLAGS=${PASSTHROUGH_CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${PASSTHROUGH_CMAKE_CXX_FLAGS} -fPIC" --disable-examples --disable-dtls --disable-tests --disable-documentation --prefix=${BINARY_DIR}/thirdparty/libcoap-install
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
)
diff --git a/cmake/BundledLibLZMA.cmake b/cmake/BundledLibLZMA.cmake
index 1002f5a..b3d4815 100644
--- a/cmake/BundledLibLZMA.cmake
+++ b/cmake/BundledLibLZMA.cmake
@@ -57,7 +57,7 @@ function(use_bundled_liblzma SOURCE_DIR BINARY_DIR)
EXCLUDE_FROM_ALL TRUE
)
else()
- set(CONFIGURE_COMMAND ./configure "CFLAGS=${CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${CMAKE_CXX_FLAGS} -fPIC" --disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts --disable-doc --enable-shared=no "--prefix=${LIBLZMA_BIN_DIR}")
+ set(CONFIGURE_COMMAND ./configure "CFLAGS=${PASSTHROUGH_CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${PASSTHROUGH_CMAKE_CXX_FLAGS} -fPIC" --disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts --disable-doc --enable-shared=no "--prefix=${LIBLZMA_BIN_DIR}")
if(PORTABLE)
list(APPEND CONFIGURE_COMMAND "--disable-assembler")
endif()
diff --git a/cmake/BundledOSSPUUID.cmake b/cmake/BundledOSSPUUID.cmake
index 1bf311e..b55acea 100644
--- a/cmake/BundledOSSPUUID.cmake
+++ b/cmake/BundledOSSPUUID.cmake
@@ -38,7 +38,7 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
ENDFOREACH(BYPRODUCT)
# Build project
- set(CONFIGURE_COMMAND ./configure "CFLAGS=${CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${CMAKE_CXX_FLAGS} -fPIC" --enable-shared=no --with-cxx --without-perl --without-php --without-pgsql "--prefix=${BINARY_DIR}/thirdparty/ossp-uuid-install")
+ set(CONFIGURE_COMMAND ./configure "CFLAGS=${PASSTHROUGH_CMAKE_C_FLAGS} -fPIC" "CXXFLAGS=${PASSTHROUGH_CMAKE_CXX_FLAGS} -fPIC" --enable-shared=no --with-cxx --without-perl --without-php --without-pgsql "--prefix=${BINARY_DIR}/thirdparty/ossp-uuid-install")
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type)
if(NOT build_type MATCHES debug)
list(APPEND CONFIGURE_COMMAND --enable-debug=yes)
diff --git a/cmake/Date.cmake b/cmake/Date.cmake
index 80d25d0..0ef5892 100644
--- a/cmake/Date.cmake
+++ b/cmake/Date.cmake
@@ -55,7 +55,7 @@ FetchContent_Declare(date_src
FetchContent_GetProperties(date_src)
if (NOT date_src_POPULATED)
FetchContent_Populate(date_src)
- set(DATE_INCLUDE_DIR
+ set(DATE_INCLUDE_DIR
$<BUILD_INTERFACE:${date_src_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
@@ -69,6 +69,9 @@ if (NOT date_src_POPULATED)
add_library(date::tz ALIAS date-tz)
target_include_directories(date-tz PUBLIC ${DATE_INCLUDE_DIR})
target_compile_features(date-tz PUBLIC cxx_std_11)
+ if (NOT WIN32)
+ target_compile_options(date-tz PRIVATE "-Wno-error")
+ endif()
target_compile_definitions(date-tz PRIVATE AUTO_DOWNLOAD=0 HAS_REMOTE_API=0)
if (WIN32)
target_compile_definitions(date-tz PRIVATE INSTALL=. PUBLIC USE_OS_TZDB=0)
diff --git a/controller/CMakeLists.txt b/controller/CMakeLists.txt
index 9e2332b..3e4db51 100644
--- a/controller/CMakeLists.txt
+++ b/controller/CMakeLists.txt
@@ -23,8 +23,6 @@ IF(POLICY CMP0048)
CMAKE_POLICY(SET CMP0048 OLD)
ENDIF(POLICY CMP0048)
-
-
include_directories(../main/ ../libminifi/include ../libminifi/include/c2 ../libminifi/include/c2/protocols/ ../libminifi/include/core/state ./libminifi/include/core/statemanagement/metrics ../libminifi/include/core/yaml ../libminifi/include/core)
diff --git a/controller/Controller.h b/controller/Controller.h
index a029109..6c1f77c 100644
--- a/controller/Controller.h
+++ b/controller/Controller.h
@@ -36,7 +36,7 @@ bool sendSingleCommand(std::unique_ptr<minifi::io::Socket> socket, uint8_t op, c
minifi::io::BufferStream stream;
stream.write(&op, 1);
stream.write(value);
- return socket->write(const_cast<uint8_t*>(stream.getBuffer()), gsl::narrow<int>(stream.size())) == stream.size();
+ return static_cast<size_t>(socket->write(const_cast<uint8_t*>(stream.getBuffer()), gsl::narrow<int>(stream.size()))) == stream.size();
}
/**
@@ -144,12 +144,12 @@ int getJstacks(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out) {
uint64_t size = 0;
socket->read(size);
- for (int i = 0; i < size; i++) {
+ for (uint64_t i = 0; i < size; i++) {
std::string name;
uint64_t lines;
socket->read(name);
socket->read(lines);
- for (int j = 0; j < lines; j++) {
+ for (uint64_t j = 0; j < lines; j++) {
std::string line;
socket->read(line);
out << name << " -- " << line << std::endl;
diff --git a/debian.sh b/debian.sh
index 9b67d7d..6c58921 100644
--- a/debian.sh
+++ b/debian.sh
@@ -22,7 +22,7 @@ verify_enable_platform(){
verify_gcc_enable $feature
}
add_os_flags() {
- CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND}"
}
bootstrap_cmake(){
sudo apt-get -y install cmake
@@ -85,7 +85,7 @@ build_deps(){
fi
done
-
+
INSTALLED+=("autoconf")
for option in "${INSTALLED[@]}" ; do
diff --git a/encrypt-config/tests/CMakeLists.txt b/encrypt-config/tests/CMakeLists.txt
index f5305d1..18efe4e 100644
--- a/encrypt-config/tests/CMakeLists.txt
+++ b/encrypt-config/tests/CMakeLists.txt
@@ -26,7 +26,7 @@ foreach(testfile ${ENCRYPT_CONFIG_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable(${testfilename} "${testfile}" ${ENCRYPT_CONFIG_SOURCES})
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/encrypt-config")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test")
diff --git a/extensions/aws/controllerservices/AWSCredentialsService.h b/extensions/aws/controllerservices/AWSCredentialsService.h
index 88d3a2b..028e743 100644
--- a/extensions/aws/controllerservices/AWSCredentialsService.h
+++ b/extensions/aws/controllerservices/AWSCredentialsService.h
@@ -47,7 +47,7 @@ class AWSCredentialsService : public core::controller::ControllerService {
: ControllerService(name, uuid) {
}
- explicit AWSCredentialsService(const std::string &name, const std::shared_ptr<Configure> &configuration)
+ explicit AWSCredentialsService(const std::string &name, const std::shared_ptr<Configure>& /*configuration*/)
: ControllerService(name) {
}
diff --git a/extensions/aws/processors/ListS3.cpp b/extensions/aws/processors/ListS3.cpp
index 5a0b28c..ecae373 100644
--- a/extensions/aws/processors/ListS3.cpp
+++ b/extensions/aws/processors/ListS3.cpp
@@ -192,7 +192,7 @@ uint64_t ListS3::getLatestListedKeyTimestamp(const std::unordered_map<std::strin
return stored_listed_key_timestamp;
}
-ListS3::ListingState ListS3::getCurrentState(const std::shared_ptr<core::ProcessContext> &context) {
+ListS3::ListingState ListS3::getCurrentState(const std::shared_ptr<core::ProcessContext>& /*context*/) {
ListS3::ListingState current_listing_state;
std::unordered_map<std::string, std::string> state;
if (!state_manager_->get(state)) {
diff --git a/extensions/aws/processors/S3Processor.cpp b/extensions/aws/processors/S3Processor.cpp
index 993e031..9c4fe7b 100644
--- a/extensions/aws/processors/S3Processor.cpp
+++ b/extensions/aws/processors/S3Processor.cpp
@@ -190,7 +190,7 @@ minifi::utils::optional<aws::s3::ProxyOptions> S3Processor::getProxy(const std::
return proxy;
}
-void S3Processor::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void S3Processor::onSchedule(const std::shared_ptr<core::ProcessContext>& context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
std::string value;
if (!context->getProperty(Bucket.getName(), value) || value.empty()) {
throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Bucket property missing or invalid");
diff --git a/extensions/aws/s3/S3Wrapper.cpp b/extensions/aws/s3/S3Wrapper.cpp
index efd6d38..107de57 100644
--- a/extensions/aws/s3/S3Wrapper.cpp
+++ b/extensions/aws/s3/S3Wrapper.cpp
@@ -175,7 +175,7 @@ minifi::utils::optional<GetObjectResult> S3Wrapper::getObject(const GetObjectReq
void S3Wrapper::addListResults(const Aws::Vector<Aws::S3::Model::ObjectVersion>& content, const uint64_t min_object_age, std::vector<ListedObjectAttributes>& listed_objects) {
for (const auto& version : content) {
- if (last_bucket_list_timestamp_ - min_object_age < version.GetLastModified().Millis()) {
+ if (last_bucket_list_timestamp_ - min_object_age < gsl::narrow<uint64_t>(version.GetLastModified().Millis())) {
logger_->log_debug("Object version '%s' of key '%s' skipped due to minimum object age filter", version.GetVersionId(), version.GetKey());
continue;
}
@@ -194,7 +194,7 @@ void S3Wrapper::addListResults(const Aws::Vector<Aws::S3::Model::ObjectVersion>&
void S3Wrapper::addListResults(const Aws::Vector<Aws::S3::Model::Object>& content, const uint64_t min_object_age, std::vector<ListedObjectAttributes>& listed_objects) {
for (const auto& object : content) {
- if (last_bucket_list_timestamp_ - min_object_age < object.GetLastModified().Millis()) {
+ if (last_bucket_list_timestamp_ - min_object_age < gsl::narrow<uint64_t>(object.GetLastModified().Millis())) {
logger_->log_debug("Object with key '%s' skipped due to minimum object age filter", object.GetKey());
continue;
}
diff --git a/extensions/civetweb/tests/CMakeLists.txt b/extensions/civetweb/tests/CMakeLists.txt
index f1bdfba..10e056d 100644
--- a/extensions/civetweb/tests/CMakeLists.txt
+++ b/extensions/civetweb/tests/CMakeLists.txt
@@ -27,7 +27,7 @@ if(NOT DISABLE_CURL)
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/civetweb")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.10/include")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.10/include")
target_wholearchive_library(${testfilename} minifi-civet-extensions)
target_wholearchive_library(${testfilename} minifi-http-curl)
diff --git a/extensions/civetweb/tests/ListenHTTPTests.cpp b/extensions/civetweb/tests/ListenHTTPTests.cpp
index 8a1ffa9..f180ef5 100644
--- a/extensions/civetweb/tests/ListenHTTPTests.cpp
+++ b/extensions/civetweb/tests/ListenHTTPTests.cpp
@@ -360,10 +360,10 @@ TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP Batch tests", "[batch]") {
std::size_t expected_processed_request_count = 0;
std::vector<HttpResponseExpectations> requests;
auto create_requests = [&](std::size_t successful, std::size_t failed) {
- for (auto i = 0; i < successful; ++i) {
+ for (std::size_t i = 0; i < successful; ++i) {
requests.push_back(HttpResponseExpectations{true,200});
}
- for (auto i = 0; i < failed; ++i) {
+ for (std::size_t i = 0; i < failed; ++i) {
requests.push_back(HttpResponseExpectations{true,503});
}
};
diff --git a/extensions/coap/controllerservice/CoapResponse.h b/extensions/coap/controllerservice/CoapResponse.h
index 9f0fd50..be1a013 100644
--- a/extensions/coap/controllerservice/CoapResponse.h
+++ b/extensions/coap/controllerservice/CoapResponse.h
@@ -73,7 +73,7 @@ class CoapResponse {
* Returns a const pointer to the constant data.
* @return data pointer.
*/
- const uint8_t * const getData() const {
+ const uint8_t* getData() const {
return data_.get();
}
diff --git a/extensions/coap/nanofi/coap_connection.c b/extensions/coap/nanofi/coap_connection.c
index 20137e0..f44a225 100644
--- a/extensions/coap/nanofi/coap_connection.c
+++ b/extensions/coap/nanofi/coap_connection.c
@@ -37,9 +37,7 @@ CoapPDU *create_connection(uint8_t type, const char * const server, const char *
uri.port = port;
uri.scheme = COAP_URI_SCHEME_COAP;
- fd_set readfds;
coap_pdu_t* request;
- unsigned char get_method = 1;
int res = resolve_address(&uri.host, &pdu->dst_addr.addr.sa);
if (res < 0) {
@@ -48,19 +46,16 @@ CoapPDU *create_connection(uint8_t type, const char * const server, const char *
pdu->dst_addr.size = res;
pdu->dst_addr.addr.sin.sin_port = htons(uri.port);
- void *addrptr = NULL;
char port_str[NI_MAXSERV] = "0";
switch (pdu->dst_addr.addr.sa.sa_family) {
case AF_INET:
- addrptr = &pdu->dst_addr.addr.sin.sin_addr;
if (!create_session(&pdu->ctx, &pdu->session, 0x00, port_str, &pdu->dst_addr)) {
break;
} else {
return NULL;
}
case AF_INET6:
- addrptr = &pdu->dst_addr.addr.sin6.sin6_addr;
if (!create_session(&pdu->ctx, &pdu->session, 0x00, port_str, &pdu->dst_addr)) {
break;
} else {
diff --git a/extensions/coap/nanofi/coap_functions.c b/extensions/coap/nanofi/coap_functions.c
index 7ec25c0..fd97e6b 100644
--- a/extensions/coap/nanofi/coap_functions.c
+++ b/extensions/coap/nanofi/coap_functions.c
@@ -21,6 +21,14 @@
extern "C" {
#endif
+#ifndef UNUSED
+#define UNUSED(x) (void)(x)
+#endif
+
+// defines the context specific data for the data receiver
+static void *receiver;
+static callback_pointers global_ptrs;
+
/**
* Initialize the API access. Not thread safe.
*/
@@ -47,7 +55,6 @@ int create_session(coap_context_t **ctx, coap_session_t **session, const char *n
perror("getaddrinfo");
return -1;
}
- int skip = 1, count = 0;
for (interface_itr = result; interface_itr != NULL; interface_itr = interface_itr->ai_next) {
coap_address_t addr;
@@ -78,7 +85,6 @@ int create_session(coap_context_t **ctx, coap_session_t **session, const char *n
int create_endpoint_context(coap_context_t **ctx, const char *node, const char *port) {
struct addrinfo hints;
- coap_proto_t proto = COAP_PROTO_UDP;
struct addrinfo *result, *interface_itr;
memset(&hints, 0, sizeof(struct addrinfo));
@@ -115,6 +121,7 @@ int create_endpoint_context(coap_context_t **ctx, const char *node, const char *
}
struct coap_pdu_t *create_request(struct coap_context_t *ctx, struct coap_session_t *session, coap_optlist_t **optlist, unsigned char code, coap_str_const_t *ptr) {
+ UNUSED(ctx);
coap_pdu_t *pdu;
if (!(pdu = coap_new_pdu(session)))
@@ -128,12 +135,12 @@ struct coap_pdu_t *create_request(struct coap_context_t *ctx, struct coap_sessio
coap_add_optlist_pdu(pdu, optlist);
}
- int flags = 0;
coap_add_data(pdu, ptr->length, ptr->s);
return pdu;
}
int coap_event(struct coap_context_t *ctx, coap_event_t event, struct coap_session_t *session) {
+ UNUSED(session);
if (event == COAP_EVENT_SESSION_FAILED && global_ptrs.received_error) {
global_ptrs.received_error(receiver, ctx, -1);
}
@@ -141,14 +148,19 @@ int coap_event(struct coap_context_t *ctx, coap_event_t event, struct coap_sessi
}
void no_acknowledgement(struct coap_context_t *ctx, coap_session_t *session, coap_pdu_t *sent, coap_nack_reason_t reason, const coap_tid_t id) {
+ UNUSED(session);
+ UNUSED(sent);
+ UNUSED(reason);
+ UNUSED(id);
if (global_ptrs.received_error) {
global_ptrs.received_error(receiver, ctx, -1);
}
}
void response_handler(struct coap_context_t *ctx, struct coap_session_t *session, coap_pdu_t *sent, coap_pdu_t *received, const coap_tid_t id) {
- unsigned char* data;
- size_t data_len;
+ UNUSED(session);
+ UNUSED(sent);
+ UNUSED(id);
coap_opt_iterator_t opt_iter;
coap_opt_t * block_opt = coap_check_option(received, COAP_OPTION_BLOCK1, &opt_iter);
if (block_opt) {
diff --git a/extensions/coap/nanofi/coap_functions.h b/extensions/coap/nanofi/coap_functions.h
index faa63d2..75a4785 100644
--- a/extensions/coap/nanofi/coap_functions.h
+++ b/extensions/coap/nanofi/coap_functions.h
@@ -48,10 +48,6 @@ typedef struct {
void (*received_error)(void *receiver_context, struct coap_context_t *ctx, unsigned int code);
} callback_pointers;
-// defines the context specific data for the data receiver
-static void *receiver;
-static callback_pointers global_ptrs;
-
/**
* Initialize the API access. Not thread safe.
*/
diff --git a/extensions/coap/nanofi/coap_message.c b/extensions/coap/nanofi/coap_message.c
index 403bf5f..72c3d5c 100644
--- a/extensions/coap/nanofi/coap_message.c
+++ b/extensions/coap/nanofi/coap_message.c
@@ -17,7 +17,7 @@
*/
#include "coap_message.h"
-CoapMessage * const create_coap_message(const coap_pdu_t * const pdu) {
+CoapMessage* create_coap_message(const coap_pdu_t * const pdu) {
CoapMessage *message = (CoapMessage*) malloc(sizeof(CoapMessage));
coap_get_data(pdu, &message->size_, &message->data_);
message->code_ = pdu->code;
diff --git a/extensions/coap/nanofi/coap_message.h b/extensions/coap/nanofi/coap_message.h
index f2c4486..4eb5eb9 100644
--- a/extensions/coap/nanofi/coap_message.h
+++ b/extensions/coap/nanofi/coap_message.h
@@ -42,7 +42,7 @@ typedef struct {
/**
* Create a new CoAMessage, taking ownership of the aforementioned buffers
*/
-CoapMessage * const create_coap_message(const coap_pdu_t * const pdu);
+CoapMessage* create_coap_message(const coap_pdu_t * const pdu);
/**
* FRee the CoAP messages that are provided.
*/
diff --git a/extensions/coap/nanofi/coap_server.c b/extensions/coap/nanofi/coap_server.c
index d8badbb..eb16c41 100644
--- a/extensions/coap/nanofi/coap_server.c
+++ b/extensions/coap/nanofi/coap_server.c
@@ -20,7 +20,7 @@
/**
* Create a new CoAPServer
*/
-CoapServerContext * const create_server(const char * const server_hostname, const char * const port) {
+CoapServerContext* create_server(const char * const server_hostname, const char * const port) {
CoapServerContext *server = (CoapServerContext*) malloc(sizeof(CoapServerContext));
memset(server, 0x00, sizeof(CoapServerContext));
if (create_endpoint_context(&server->ctx, server_hostname, port)) {
@@ -30,7 +30,7 @@ CoapServerContext * const create_server(const char * const server_hostname, cons
return server;
}
-CoapEndpoint * const create_endpoint(CoapServerContext * const server, const char * const resource_path, uint8_t method, coap_method_handler_t handler) {
+CoapEndpoint* create_endpoint(CoapServerContext * const server, const char * const resource_path, uint8_t method, coap_method_handler_t handler) {
CoapEndpoint *endpoint = (CoapEndpoint*) malloc(sizeof(CoapEndpoint));
memset(endpoint, 0x00, sizeof(CoapEndpoint));
endpoint->server = server;
diff --git a/extensions/coap/nanofi/coap_server.h b/extensions/coap/nanofi/coap_server.h
index f4292a7..8e1e7e4 100644
--- a/extensions/coap/nanofi/coap_server.h
+++ b/extensions/coap/nanofi/coap_server.h
@@ -51,12 +51,12 @@ typedef struct {
* @param title title of base resource
* @return CoAPServer structure.
*/
-CoapServerContext * const create_server(const char *const server_hostname, const char * const port);
+CoapServerContext* create_server(const char *const server_hostname, const char * const port);
/**
* Creates an endpoint for the provided service context
*/
-CoapEndpoint * const create_endpoint(CoapServerContext * const, const char * const resource_path, uint8_t method, coap_method_handler_t handler);
+CoapEndpoint* create_endpoint(CoapServerContext * const, const char * const resource_path, uint8_t method, coap_method_handler_t handler);
/**
* Adds an endpoint to the provided CoapEndpoint structure
diff --git a/extensions/coap/protocols/CoapC2Protocol.cpp b/extensions/coap/protocols/CoapC2Protocol.cpp
index aa2da16..9304fed 100644
--- a/extensions/coap/protocols/CoapC2Protocol.cpp
+++ b/extensions/coap/protocols/CoapC2Protocol.cpp
@@ -214,7 +214,6 @@ minifi::c2::C2Payload CoapProtocol::serialize(const minifi::c2::C2Payload &paylo
uint16_t version = 0;
uint8_t payload_type = 0;
- uint64_t payload_u64 = 0;
uint16_t size = 0;
io::BufferStream stream;
diff --git a/extensions/coap/protocols/CoapC2Protocol.h b/extensions/coap/protocols/CoapC2Protocol.h
index 434f39e..46aee45 100644
--- a/extensions/coap/protocols/CoapC2Protocol.h
+++ b/extensions/coap/protocols/CoapC2Protocol.h
@@ -97,6 +97,7 @@ class CoapProtocol : public minifi::c2::RESTSender {
return response.getCode() == COAP_RESPONSE_400 && !memcmp(response.getData(), REGISTRATION_MSG, response.getSize());
}
+ using minifi::c2::RESTProtocol::getOperation;
/**
* Returns the operation for the translated integer
* @param type input type
diff --git a/extensions/coap/server/CoapServer.h b/extensions/coap/server/CoapServer.h
index 8994896..4bf5a6c 100644
--- a/extensions/coap/server/CoapServer.h
+++ b/extensions/coap/server/CoapServer.h
@@ -79,7 +79,7 @@ class CoapResponse {
return size_;
}
- uint8_t * const getData() const {
+ uint8_t* getData() const {
return data_.get();
}
diff --git a/extensions/coap/tests/CoapC2VerifyHeartbeat.cpp b/extensions/coap/tests/CoapC2VerifyHeartbeat.cpp
index aabb508..7341838 100644
--- a/extensions/coap/tests/CoapC2VerifyHeartbeat.cpp
+++ b/extensions/coap/tests/CoapC2VerifyHeartbeat.cpp
@@ -63,7 +63,7 @@ class VerifyCoAPServer : public CoapIntegrationBase {
dir = testController.createTempDirectory(format);
}
- void testSetup() {
+ void testSetup() override {
LogTestController::getInstance().setDebug<utils::HTTPClient>();
LogTestController::getInstance().setOff<processors::InvokeHTTP>();
LogTestController::getInstance().setDebug<minifi::c2::RESTReceiver>();
@@ -83,7 +83,7 @@ class VerifyCoAPServer : public CoapIntegrationBase {
CoapIntegrationBase::cleanup();
}
- void runAssertions() {
+ void runAssertions() override {
using org::apache::nifi::minifi::utils::verifyLogLinePresenceInPollTime;
assert(verifyLogLinePresenceInPollTime(std::chrono::seconds(3),
"Received ack. version 3. number of operations 1",
@@ -92,7 +92,7 @@ class VerifyCoAPServer : public CoapIntegrationBase {
"Received op 1, with id id and operand operand"));
}
- void queryRootProcessGroup(std::shared_ptr<core::ProcessGroup> pg) {
+ void queryRootProcessGroup(std::shared_ptr<core::ProcessGroup> pg) override {
std::shared_ptr<core::Processor> proc = pg->findProcessorByName("invoke");
assert(proc != nullptr);
diff --git a/extensions/coap/tests/CoapIntegrationBase.h b/extensions/coap/tests/CoapIntegrationBase.h
index 6ccee57..87ab800 100644
--- a/extensions/coap/tests/CoapIntegrationBase.h
+++ b/extensions/coap/tests/CoapIntegrationBase.h
@@ -44,7 +44,7 @@ class CoapIntegrationBase : public IntegrationBase {
server.reset();
}
- void run(const utils::optional<std::string>& test_file_location = {}, const utils::optional<std::string>& bootstrap_file = {}) override {
+ void run(const utils::optional<std::string>& test_file_location = {}, const utils::optional<std::string>& = {}) override {
testSetup();
std::shared_ptr<core::Repository> test_repo = std::make_shared<TestRepository>();
@@ -100,7 +100,6 @@ void CoapIntegrationBase::setUrl(std::string url, CivetHandler *handler) {
if (scheme == "https" && !key_dir.empty()) {
std::string cert = "";
cert = key_dir + "nifi-cert.pem";
- memset(&callback, 0, sizeof(callback));
callback.init_ssl = ssl_enable;
port += "s";
callback.log_message = log_message;
diff --git a/extensions/expression-language/CMakeLists.txt b/extensions/expression-language/CMakeLists.txt
index 9343964..69fa438 100644
--- a/extensions/expression-language/CMakeLists.txt
+++ b/extensions/expression-language/CMakeLists.txt
@@ -24,7 +24,7 @@ if(WIN32)
FetchContent_Declare(
winflexbison
GIT_REPOSITORY "https://github.com/lexxmark/winflexbison.git"
- GIT_TAG "a72f3d6b5102b65f064a5054ba634d3d62e94f41"
+ GIT_TAG "a72f3d6b5102b65f064a5054ba634d3d62e94f41"
)
FetchContent_GetProperties("winflexbison")
@@ -34,24 +34,24 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} .
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
RESULT_VARIABLE result
- OUTPUT_VARIABLE bisonbuild
+ OUTPUT_VARIABLE bisonbuild
ERROR_VARIABLE bisonbuildE
)
execute_process(
- COMMAND ${CMAKE_COMMAND} --build . --config RelWithDebInfo
+ COMMAND ${CMAKE_COMMAND} --build . --config RelWithDebInfo
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
RESULT_VARIABLE result
- OUTPUT_VARIABLE bisonbuild
+ OUTPUT_VARIABLE bisonbuild
ERROR_VARIABLE bisonbuildE
)
file(COPY ${winflexbison_SOURCE_DIR}/bison/Data DESTINATION ${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/)
endif()
-
+
set(BISON_EXECUTABLE "${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/win_bison.exe" CACHE PATH "bison executable")
set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/flex/RelWithDebInfo/win_flex.exe" CACHE PATH "flex executable")
-
+
include_directories(${winflexbison_SOURCE_DIR}/flex/src/)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/winflexbison")
@@ -74,7 +74,8 @@ flex_target(
add_flex_bison_dependency(el-scanner el-parser)
-include_directories(./ ../../libminifi/include ../../libminifi/include/core ../../thirdparty/)
+include_directories(./ ../../libminifi/include ../../libminifi/include/core)
+include_directories(SYSTEM ../../thirdparty/)
include_directories(common)
include_directories(impl)
@@ -89,6 +90,11 @@ endif()
file(GLOB SOURCES "*.cpp")
+if (NOT WIN32)
+ set_source_files_properties(${BISON_el-parser_OUTPUTS} PROPERTIES COMPILE_FLAGS -Wno-error)
+ set_source_files_properties(${FLEX_el-scanner_OUTPUTS} PROPERTIES COMPILE_FLAGS -Wno-error)
+endif()
+
add_library(minifi-expression-language-extensions STATIC ${SOURCES} ${BISON_el-parser_OUTPUTS} ${FLEX_el-scanner_OUTPUTS})
set_property(TARGET minifi-expression-language-extensions PROPERTY POSITION_INDEPENDENT_CODE ON)
diff --git a/extensions/expression-language/tests/CMakeLists.txt b/extensions/expression-language/tests/CMakeLists.txt
index e9016c0..fdb9699 100644
--- a/extensions/expression-language/tests/CMakeLists.txt
+++ b/extensions/expression-language/tests/CMakeLists.txt
@@ -25,7 +25,7 @@ if(NOT WIN32)
FOREACH(testfile ${EXPRESSION_LANGUAGE_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable(${testfilename} "${testfile}")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
@@ -55,7 +55,7 @@ SET(INT_EXTENSIONS_TEST_COUNT 0)
FOREACH(testfile ${INT_EXPRESSION_LANGUAGE_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable(${testfilename} "${testfile}")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors/processors")
diff --git a/extensions/expression-language/tests/ExpressionLanguageTests.cpp b/extensions/expression-language/tests/ExpressionLanguageTests.cpp
index b4f86a9..75a2e75 100644
--- a/extensions/expression-language/tests/ExpressionLanguageTests.cpp
+++ b/extensions/expression-language/tests/ExpressionLanguageTests.cpp
@@ -21,10 +21,12 @@
#include <memory>
#include <string>
#ifndef DISABLE_CURL
+#ifdef WIN32
#pragma comment(lib, "libcurl.lib")
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "legacy_stdio_definitions.lib")
#pragma comment(lib, "crypt32.lib")
+#endif
#include <curl/curl.h>
#endif
#include "impl/expression/Expression.h"
diff --git a/extensions/gps/GetGPS.cpp b/extensions/gps/GetGPS.cpp
index 678cf2a..9c3dc98 100644
--- a/extensions/gps/GetGPS.cpp
+++ b/extensions/gps/GetGPS.cpp
@@ -71,7 +71,7 @@ void GetGPS::initialize() {
setSupportedRelationships(relationships);
}
-void GetGPS::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void GetGPS::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
std::string value;
if (context->getProperty(GPSDHost.getName(), value)) {
@@ -86,7 +86,7 @@ void GetGPS::onSchedule(const std::shared_ptr<core::ProcessContext> &context, co
logger_->log_trace("GPSD client scheduled");
}
-void GetGPS::onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+void GetGPS::onTrigger(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSession> &session) {
try {
gpsmm gps_rec(gpsdHost_.c_str(), gpsdPort_.c_str());
diff --git a/extensions/http-curl/processors/InvokeHTTP.h b/extensions/http-curl/processors/InvokeHTTP.h
index 8a0a180..cdf11e4 100644
--- a/extensions/http-curl/processors/InvokeHTTP.h
+++ b/extensions/http-curl/processors/InvokeHTTP.h
@@ -165,7 +165,7 @@ class InvokeHTTP : public core::Processor {
REGISTER_RESOURCE(InvokeHTTP,"An HTTP client processor which can interact with a configurable HTTP Endpoint. "
"The destination URL and HTTP Method are configurable. FlowFile attributes are converted to HTTP headers and the "
- "FlowFile contents are included as the body of the request (if the HTTP Method is PUT, POST or PATCH).")
+ "FlowFile contents are included as the body of the request (if the HTTP Method is PUT, POST or PATCH).");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/http-curl/tests/C2PauseResumeTest.cpp b/extensions/http-curl/tests/C2PauseResumeTest.cpp
index c462965..035a0aa 100644
--- a/extensions/http-curl/tests/C2PauseResumeTest.cpp
+++ b/extensions/http-curl/tests/C2PauseResumeTest.cpp
@@ -53,7 +53,7 @@ class PauseResumeHandler: public HeartbeatHandler {
static const uint32_t INITIAL_GET_INVOKE_COUNT = 2;
explicit PauseResumeHandler(std::atomic_bool& flow_resumed_successfully) : HeartbeatHandler(), flow_resumed_successfully_(flow_resumed_successfully) {}
- bool handleGet(CivetServer *server, struct mg_connection *conn) override {
+ bool handleGet(CivetServer* /*server*/, struct mg_connection* conn) override {
assert(flow_state_ != FlowState::PAUSED);
++get_invoke_count_;
if (flow_state_ == FlowState::RESUMED) {
diff --git a/extensions/http-curl/tests/C2RequestClassTest.cpp b/extensions/http-curl/tests/C2RequestClassTest.cpp
index 7521eb0..9fd8ba7 100644
--- a/extensions/http-curl/tests/C2RequestClassTest.cpp
+++ b/extensions/http-curl/tests/C2RequestClassTest.cpp
@@ -29,7 +29,7 @@
class C2AcknowledgeHandler : public ServerAwareHandler {
public:
- bool handlePost(CivetServer *server, struct mg_connection *conn) override {
+ bool handlePost(CivetServer* /*server*/, struct mg_connection* conn) override {
std::string req = readPayload(conn);
rapidjson::Document root;
root.Parse(req.data(), req.size());
@@ -56,7 +56,7 @@ class C2HeartbeatHandler : public ServerAwareHandler {
public:
explicit C2HeartbeatHandler(std::string response) : response_(std::move(response)) {}
- bool handlePost(CivetServer *server, struct mg_connection *conn) override {
+ bool handlePost(CivetServer* /*server*/, struct mg_connection* conn) override {
std::string req = readPayload(conn);
rapidjson::Document root;
root.Parse(req.data(), req.size());
diff --git a/extensions/http-curl/tests/HTTPHandlers.h b/extensions/http-curl/tests/HTTPHandlers.h
index 6867c77..af9b0a8 100644
--- a/extensions/http-curl/tests/HTTPHandlers.h
+++ b/extensions/http-curl/tests/HTTPHandlers.h
@@ -79,12 +79,13 @@ class PeerResponder : public ServerAwareHandler {
public:
explicit PeerResponder(std::string base_url) {
+ (void)base_url; // unused in release builds
std::string scheme;
assert(parse_http_components(base_url, port, scheme, path));
}
bool handleGet(CivetServer* /*server*/, struct mg_connection *conn) override {
-
+
#ifdef WIN32
std::string hostname = org::apache::nifi::minifi::io::Socket::getMyHostName();
#else
@@ -242,7 +243,7 @@ class FlowFileResponder : public ServerAwareHandler {
read = stream.read(flow->data.data(), gsl::narrow<int>(length));
if(!isServerRunning())return false;
- assert(read == length);
+ assert(read == gsl::narrow<int>(length));
if (!invalid_checksum) {
site2site_rest_resp = std::to_string(stream.getCRC());
diff --git a/extensions/http-curl/tests/HTTPIntegrationBase.h b/extensions/http-curl/tests/HTTPIntegrationBase.h
index 066258a..7a1392c 100644
--- a/extensions/http-curl/tests/HTTPIntegrationBase.h
+++ b/extensions/http-curl/tests/HTTPIntegrationBase.h
@@ -88,7 +88,6 @@ void HTTPIntegrationBase::setUrl(const std::string &url, ServerAwareHandler *han
CivetCallbacks callback{};
if (scheme == "https" && !key_dir.empty()) {
std::string cert = key_dir + "nifi-cert.pem";
- memset(&callback, 0, sizeof(callback));
callback.init_ssl = ssl_enable;
port += "s";
callback.log_message = log_message;
diff --git a/extensions/http-curl/tests/HttpGetIntegrationTest.cpp b/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
index 74de6a6..d34ed72 100644
--- a/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
+++ b/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
@@ -113,7 +113,6 @@ int main(int argc, char **argv) {
if (scheme == "https") {
std::string cert;
cert = args.key_dir + "nifi-cert.pem";
- memset(&callback, 0, sizeof(callback));
callback.init_ssl = ssl_enable;
std::string https_port = port + "s";
callback.log_message = log_message;
@@ -123,7 +122,7 @@ int main(int argc, char **argv) {
}
controller->load();
controller->start();
-
+
assert(verifyLogLinePresenceInPollTime(
std::chrono::seconds(10),
"key:invokehttp.request.url value:" + url,
diff --git a/extensions/http-curl/tests/VerifyInvokeHTTPTest.cpp b/extensions/http-curl/tests/VerifyInvokeHTTPTest.cpp
index 9cce3ab..db0830f 100644
--- a/extensions/http-curl/tests/VerifyInvokeHTTPTest.cpp
+++ b/extensions/http-curl/tests/VerifyInvokeHTTPTest.cpp
@@ -85,7 +85,7 @@ class VerifyInvokeHTTP : public HTTPIntegrationBase {
setProperties(processorController->getProcessor());
}
- void run(const utils::optional<std::string>& flow_yml_path = {}, const utils::optional<std::string>& bootstrap_file = {}) override {
+ void run(const utils::optional<std::string>& flow_yml_path = {}, const utils::optional<std::string>& = {}) override {
setupFlow(flow_yml_path);
startFlowController();
diff --git a/extensions/jni/ExecuteJavaControllerService.h b/extensions/jni/ExecuteJavaControllerService.h
index 38db498..5ddc50c 100644
--- a/extensions/jni/ExecuteJavaControllerService.h
+++ b/extensions/jni/ExecuteJavaControllerService.h
@@ -155,7 +155,7 @@ class ExecuteJavaControllerService : public ConfigurationContext, public std::en
std::shared_ptr<logging::Logger> logger_;
};
-REGISTER_RESOURCE(ExecuteJavaControllerService, "ExecuteJavaClass runs NiFi Controller services given a provided system path ")
+REGISTER_RESOURCE(ExecuteJavaControllerService, "ExecuteJavaClass runs NiFi Controller services given a provided system path ");
} /* namespace controllers */
} /* namespace jni */
diff --git a/extensions/jni/ExecuteJavaProcessor.h b/extensions/jni/ExecuteJavaProcessor.h
index 9929251..56f865b 100644
--- a/extensions/jni/ExecuteJavaProcessor.h
+++ b/extensions/jni/ExecuteJavaProcessor.h
@@ -295,7 +295,7 @@ class ExecuteJavaProcessor : public core::Processor {
};
-REGISTER_RESOURCE(ExecuteJavaProcessor, "ExecuteJavaClass runs NiFi processors given a provided system path ")
+REGISTER_RESOURCE(ExecuteJavaProcessor, "ExecuteJavaClass runs NiFi processors given a provided system path ");
} /* namespace processors */
} /* namespace jni */
diff --git a/extensions/libarchive/BinFiles.cpp b/extensions/libarchive/BinFiles.cpp
index 79381a9..c3c92e2 100644
--- a/extensions/libarchive/BinFiles.cpp
+++ b/extensions/libarchive/BinFiles.cpp
@@ -100,19 +100,19 @@ void BinFiles::onSchedule(core::ProcessContext *context, core::ProcessSessionFac
uint32_t val32;
uint64_t val64;
if (context->getProperty(MinSize.getName(), val64)) {
- this->binManager_.setMinSize({val64});
+ this->binManager_.setMinSize(val64);
logger_->log_debug("BinFiles: MinSize [%" PRId64 "]", val64);
}
if (context->getProperty(MaxSize.getName(), val64)) {
- this->binManager_.setMaxSize({val64});
+ this->binManager_.setMaxSize(val64);
logger_->log_debug("BinFiles: MaxSize [%" PRId64 "]", val64);
}
if (context->getProperty(MinEntries.getName(), val32)) {
- this->binManager_.setMinEntries({val32});
+ this->binManager_.setMinEntries(val32);
logger_->log_debug("BinFiles: MinEntries [%" PRIu32 "]", val32);
}
if (context->getProperty(MaxEntries.getName(), val32)) {
- this->binManager_.setMaxEntries({val32});
+ this->binManager_.setMaxEntries(val32);
logger_->log_debug("BinFiles: MaxEntries [%" PRIu32 "]", val32);
}
if (context->getProperty(MaxBinCount.getName(), maxBinCount_)) {
@@ -122,7 +122,7 @@ void BinFiles::onSchedule(core::ProcessContext *context, core::ProcessSessionFac
if (context->getProperty(MaxBinAge.getName(), maxBinAgeStr)) {
core::TimeUnit unit;
if (core::Property::StringToTime(maxBinAgeStr, val64, unit) && core::Property::ConvertTimeUnitToMS(val64, unit, val64)) {
- this->binManager_.setBinAge({val64});
+ this->binManager_.setBinAge(val64);
logger_->log_debug("BinFiles: MaxBinAge [%" PRIu64 "]", val64);
}
}
@@ -301,7 +301,7 @@ void BinFiles::onTrigger(const std::shared_ptr<core::ProcessContext> &context, c
// migrate bin to ready bin
this->binManager_.gatherReadyBins();
- if (this->binManager_.getBinCount() > maxBinCount_) {
+ if (gsl::narrow<uint32_t>(this->binManager_.getBinCount()) > maxBinCount_) {
// bin count reach max allowed
context->yield();
logger_->log_debug("BinFiles reach max bin count %d", this->binManager_.getBinCount());
diff --git a/extensions/libarchive/MergeContent.h b/extensions/libarchive/MergeContent.h
index 092b37f..b847f04 100644
--- a/extensions/libarchive/MergeContent.h
+++ b/extensions/libarchive/MergeContent.h
@@ -154,8 +154,10 @@ class ArchiveMerge {
class WriteCallback: public OutputStreamCallback {
public:
WriteCallback(std::string merge_type, std::deque<std::shared_ptr<core::FlowFile>> &flows, FlowFileSerializer& serializer)
- : merge_type_(merge_type), flows_(flows), serializer_(serializer),
- logger_(logging::LoggerFactory<ArchiveMerge>::getLogger()) {
+ : merge_type_(merge_type),
+ flows_(flows),
+ logger_(logging::LoggerFactory<ArchiveMerge>::getLogger()),
+ serializer_(serializer) {
size_ = 0;
stream_ = nullptr;
}
diff --git a/extensions/libarchive/UnfocusArchiveEntry.cpp b/extensions/libarchive/UnfocusArchiveEntry.cpp
index af1b428..78a025b 100644
--- a/extensions/libarchive/UnfocusArchiveEntry.cpp
+++ b/extensions/libarchive/UnfocusArchiveEntry.cpp
@@ -67,7 +67,7 @@ void UnfocusArchiveEntry::onTrigger(core::ProcessContext *context, core::Process
ArchiveStack archiveStack;
{
std::string existingLensStack;
-
+
if (flowFile->getAttribute("lens.archive.stack", existingLensStack)) {
logger_->log_info("FocusArchiveEntry loading existing lens context");
@@ -173,7 +173,7 @@ int64_t UnfocusArchiveEntry::WriteCallback::process(const std::shared_ptr<io::Ba
// Iterate entries & write from tmp file to archive
char buf[8192];
struct stat st;
- struct archive_entry* entry;
+ struct archive_entry* entry = nullptr;
for (const auto &entryMetadata : _archiveMetadata->entryMetadata) {
entry = archive_entry_new();
diff --git a/extensions/librdkafka/ConsumeKafka.h b/extensions/librdkafka/ConsumeKafka.h
index 868f81d..e6e727a 100644
--- a/extensions/librdkafka/ConsumeKafka.h
+++ b/extensions/librdkafka/ConsumeKafka.h
@@ -165,7 +165,6 @@ class ConsumeKafka : public core::Processor {
std::vector<std::string> headers_to_add_as_attributes_;
std::size_t max_poll_records_;
std::chrono::milliseconds max_poll_time_milliseconds_;
- std::chrono::milliseconds communications_timeout_milliseconds_;
std::chrono::milliseconds session_timeout_milliseconds_;
std::unique_ptr<rd_kafka_t, utils::rd_kafka_consumer_deleter> consumer_;
diff --git a/extensions/librdkafka/PublishKafka.cpp b/extensions/librdkafka/PublishKafka.cpp
index d58c8e5..108d873 100644
--- a/extensions/librdkafka/PublishKafka.cpp
+++ b/extensions/librdkafka/PublishKafka.cpp
@@ -390,7 +390,7 @@ class ReadCallback : public InputStreamCallback {
status_ = 0;
called_ = true;
- gsl_Expects(max_seg_size_ != 0 || flow_size_ == 0 && "max_seg_size_ == 0 implies flow_size_ == 0");
+ gsl_Expects(max_seg_size_ != 0 || (flow_size_ == 0 && "max_seg_size_ == 0 implies flow_size_ == 0"));
// ^^ therefore checking max_seg_size_ == 0 handles both division by zero and flow_size_ == 0 cases
const size_t reserved_msg_capacity = max_seg_size_ == 0 ? 1 : utils::intdiv_ceil(flow_size_, max_seg_size_);
messages_->modifyResult(flow_file_index_, [reserved_msg_capacity](FlowFileResult& flow_file) {
@@ -443,7 +443,7 @@ class ReadCallback : public InputStreamCallback {
const size_t flow_file_index_;
int status_ = 0;
std::string error_;
- int read_size_ = 0;
+ uint32_t read_size_ = 0;
bool called_ = false;
const bool fail_empty_flow_files_ = true;
const std::shared_ptr<logging::Logger> logger_;
diff --git a/extensions/librdkafka/rdkafka_utils.cpp b/extensions/librdkafka/rdkafka_utils.cpp
index 6020cb6..baa3db3 100644
--- a/extensions/librdkafka/rdkafka_utils.cpp
+++ b/extensions/librdkafka/rdkafka_utils.cpp
@@ -39,7 +39,7 @@ void setKafkaConfigurationField(rd_kafka_conf_t& configuration, const std::strin
}
void print_topics_list(logging::Logger& logger, rd_kafka_topic_partition_list_t& kf_topic_partition_list) {
- for (std::size_t i = 0; i < kf_topic_partition_list.cnt; ++i) {
+ for (int i = 0; i < kf_topic_partition_list.cnt; ++i) {
logger.log_debug("kf_topic_partition_list: topic: %s, partition: %d, offset: %" PRId64 ".",
kf_topic_partition_list.elems[i].topic, kf_topic_partition_list.elems[i].partition, kf_topic_partition_list.elems[i].offset);
}
diff --git a/extensions/librdkafka/rdkafka_utils.h b/extensions/librdkafka/rdkafka_utils.h
index 4ea8f47..b08d1c4 100644
--- a/extensions/librdkafka/rdkafka_utils.h
+++ b/extensions/librdkafka/rdkafka_utils.h
@@ -47,7 +47,7 @@ struct rd_kafka_conf_deleter {
struct rd_kafka_producer_deleter {
void operator()(rd_kafka_t* ptr) const noexcept {
- rd_kafka_resp_err_t flush_ret = rd_kafka_flush(ptr, 10000 /* ms */); // Matching the wait time of KafkaConnection.cpp
+ rd_kafka_flush(ptr, 10000 /* ms */); // Matching the wait time of KafkaConnection.cpp
// If concerned, we could log potential errors here:
// if (RD_KAFKA_RESP_ERR__TIMED_OUT == flush_ret) {
// std::cerr << "Deleting producer failed: time-out while trying to flush" << std::endl;
diff --git a/extensions/librdkafka/tests/ConsumeKafkaTests.cpp b/extensions/librdkafka/tests/ConsumeKafkaTests.cpp
index bca26a9..0b06919 100644
--- a/extensions/librdkafka/tests/ConsumeKafkaTests.cpp
+++ b/extensions/librdkafka/tests/ConsumeKafkaTests.cpp
@@ -79,13 +79,13 @@ class KafkaTestProducer {
// Uses all the headers for every published message
void publish_messages_to_topic(
const std::vector<std::string>& messages_on_topic, const std::string& message_key, std::vector<PublishEvent> events,
- const std::vector<std::pair<std::string, std::string>>& message_headers, const optional<std::string>& message_header_encoding) {
+ const std::vector<std::pair<std::string, std::string>>& message_headers) {
auto next_message = messages_on_topic.cbegin();
for (const PublishEvent event : events) {
switch (event) {
case PublishEvent::PUBLISH:
REQUIRE(messages_on_topic.cend() != next_message);
- publish_message(*next_message, message_key, message_headers, message_header_encoding);
+ publish_message(*next_message, message_key, message_headers);
std::advance(next_message, 1);
break;
case PublishEvent::TRANSACTION_START:
@@ -105,7 +105,7 @@ class KafkaTestProducer {
private:
void publish_message(
- const std::string& message, const std::string& message_key, const std::vector<std::pair<std::string, std::string>>& message_headers, const optional<std::string>& message_header_encoding) {
+ const std::string& message, const std::string& message_key, const std::vector<std::pair<std::string, std::string>>& message_headers) {
logger_->log_debug("Producing: %s", message.c_str());
std::unique_ptr<rd_kafka_headers_t, utils::rd_kafka_headers_deleter> headers(rd_kafka_headers_new(message_headers.size()), utils::rd_kafka_headers_deleter());
if (!headers) {
@@ -241,7 +241,6 @@ class ConsumeKafkaPropertiesTest : public ConsumeKafkaTest {
void single_consumer_with_plain_text_test(
bool expect_config_valid,
- bool expect_fixed_message_order,
const std::vector<std::pair<std::string, std::string>>& expect_header_attributes,
const std::vector<std::string>& messages_on_topic,
const std::vector<KafkaTestProducer::PublishEvent>& transaction_events,
@@ -306,7 +305,7 @@ class ConsumeKafkaPropertiesTest : public ConsumeKafkaTest {
const bool transactions_committed = transaction_events.back() == KafkaTestProducer::PublishEvent::TRANSACTION_COMMIT;
KafkaTestProducer producer(kafka_brokers, PRODUCER_TOPIC, is_transactional);
- producer.publish_messages_to_topic(messages_on_topic, TEST_MESSAGE_KEY, transaction_events, message_headers, message_header_encoding);
+ producer.publish_messages_to_topic(messages_on_topic, TEST_MESSAGE_KEY, transaction_events, message_headers);
std::vector<std::shared_ptr<core::FlowFile>> flow_files_produced;
@@ -359,11 +358,11 @@ class ConsumeKafkaPropertiesTest : public ConsumeKafkaTest {
logger_->log_debug("************");
std::string expected = "Expected: ";
- for (int i = 0; i < sorted_split_messages.size(); ++i) {
+ for (std::size_t i = 0; i < sorted_split_messages.size(); ++i) {
expected += sorted_split_messages[i] + ", ";
}
std::string actual = " Actual: ";
- for (int i = 0; i < sorted_split_messages.size(); ++i) {
+ for (std::size_t i = 0; i < sorted_split_messages.size(); ++i) {
actual += flow_files_produced[i]->getAttribute(ATTRIBUTE_FOR_CAPTURING_CONTENT).value() + ", ";
}
logger_->log_debug("%s", expected.c_str());
@@ -412,7 +411,7 @@ class ConsumeKafkaContinuousPublishingTest : public ConsumeKafkaTest {
std::size_t num_messages_sent = 0;
std::this_thread::sleep_for(std::chrono::milliseconds(100));
while (!producer_loop_stop) {
- producer.publish_messages_to_topic({ "Message after " + std::to_string(msg_periodicity_ms * ++num_messages_sent) + " ms"}, TEST_MESSAGE_KEY, { PUBLISH }, {}, {});
+ producer.publish_messages_to_topic({ "Message after " + std::to_string(msg_periodicity_ms * ++num_messages_sent) + " ms"}, TEST_MESSAGE_KEY, { PUBLISH }, {});
std::this_thread::sleep_for(std::chrono::milliseconds(msg_periodicity_ms));
}
};
@@ -455,7 +454,7 @@ const std::chrono::seconds ConsumeKafkaTest::MAX_CONSUMEKAFKA_POLL_TIME_SECONDS{
TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "ConsumeKafka parses and uses kafka topics.", "[ConsumeKafka][Kafka][Topic]") {
auto run_tests = [&] (const std::vector<std::string>& messages_on_topic, const std::string& topic_names, const optional<std::string>& topic_name_format) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", topic_names, topic_name_format, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", topic_names, topic_name_format, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
};
run_tests({ "Ulysses", "James Joyce" }, "ConsumeKafkaTest", {});
run_tests({ "The Great Gatsby", "F. Scott Fitzgerald" }, "ConsumeKafkaTest", ConsumeKafka::TOPIC_FORMAT_NAMES);
@@ -468,18 +467,18 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Offsets are reset to the latest wh
auto run_tests = [&] (
const std::vector<std::string>& messages_on_topic,
const std::vector<KafkaTestProducer::PublishEvent>& transaction_events) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
};
KafkaTestProducer producer("localhost:9092", PRODUCER_TOPIC, false);
- producer.publish_messages_to_topic({"Dummy messages", "that should be ignored", "due to offset reset on ConsumeKafka startup"}, TEST_MESSAGE_KEY, {PUBLISH, PUBLISH, PUBLISH}, {}, {});
+ producer.publish_messages_to_topic({"Dummy messages", "that should be ignored", "due to offset reset on ConsumeKafka startup"}, TEST_MESSAGE_KEY, {PUBLISH, PUBLISH, PUBLISH}, {});
run_tests({"Brave New World", "Aldous Huxley"}, NON_TRANSACTIONAL_MESSAGES);
- producer.publish_messages_to_topic({"Dummy messages", "that should be ignored", "due to offset reset on ConsumeKafka startup"}, TEST_MESSAGE_KEY, {PUBLISH, PUBLISH, PUBLISH}, {}, {});
+ producer.publish_messages_to_topic({"Dummy messages", "that should be ignored", "due to offset reset on ConsumeKafka startup"}, TEST_MESSAGE_KEY, {PUBLISH, PUBLISH, PUBLISH}, {});
run_tests({"Call of the Wild", "Jack London"}, NON_TRANSACTIONAL_MESSAGES);
}
TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Key attribute is encoded according to the \"Key Attribute Encoding\" property.", "[ConsumeKafka][Kafka][KeyAttributeEncoding]") {
auto run_tests = [&] (const std::vector<std::string>& messages_on_topic, const optional<std::string>& key_attribute_encoding) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, key_attribute_encoding, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, key_attribute_encoding, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
};
run_tests({ "The Odyssey", "Ὅμηρος" }, {});
@@ -490,7 +489,7 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Key attribute is encoded according
TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Transactional behaviour is supported.", "[ConsumeKafka][Kafka][Transaction]") {
auto run_tests = [&] (const std::vector<std::string>& messages_on_topic, const std::vector<KafkaTestProducer::PublishEvent>& transaction_events, const optional<bool>& honor_transactions) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, honor_transactions, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
};
run_tests({ "Pride and Prejudice", "Jane Austen" }, SINGLE_COMMITTED_TRANSACTION, {});
run_tests({ "Dune", "Frank Herbert" }, TWO_SEPARATE_TRANSACTIONS, {});
@@ -507,7 +506,7 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Headers on consumed Kafka messages
const std::vector<std::pair<std::string, std::string>>& message_headers,
const optional<std::string>& headers_to_add_as_attributes,
const optional<std::string>& duplicate_header_handling) {
- single_consumer_with_plain_text_test(true, false, expect_header_attributes, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, message_headers, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, headers_to_add_as_attributes, duplicate_header_handling, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, expect_header_attributes, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, message_headers, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, headers_to_add_as_attributes, duplicate_header_handling, "1", "2 sec", "60 sec"); // NOLINT
};
run_tests({ "Homeland", "R. A. Salvatore"}, {}, {{{"Contains dark elves"}, {"Yes"}}}, {}, {});
run_tests({ "Magician", "Raymond E. Feist"}, {{{"Rating"}, {"10/10"}}}, {{{"Rating"}, {"10/10"}}}, {"Rating"}, {});
@@ -521,7 +520,7 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Messages are separated into multip
auto run_tests = [&] (
const std::vector<std::string>& messages_on_topic,
const optional<std::string>& message_demarcator) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, message_demarcator, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, message_demarcator, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
};
run_tests({"Barbapapa", "Anette Tison and Talus Taylor"}, "a");
}
@@ -531,7 +530,7 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "The maximum poll records allows Co
const std::vector<std::string>& messages_on_topic,
const std::vector<KafkaTestProducer::PublishEvent>& transaction_events,
const optional<std::string>& max_poll_records) {
- single_consumer_with_plain_text_test(true, false, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, max_poll_records, "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(true, {}, messages_on_topic, transaction_events, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, max_poll_records, "2 sec", "60 sec"); // NOLINT
};
run_tests({"The Count of Monte Cristo", "Alexandre Dumas"}, NON_TRANSACTIONAL_MESSAGES, "2");
@@ -561,12 +560,12 @@ TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "The maximum poll records allows Co
}
TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Non-plain text security context throws scheduling exceptions.", "[ConsumeKafka][Kafka][SecurityProtocol]") {
- single_consumer_with_plain_text_test(false, false, {}, { "Miyamoto Musashi", "Eiji Yoshikawa" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", ConsumeKafka::SECURITY_PROTOCOL_SSL, "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(false, {}, { "Miyamoto Musashi", "Eiji Yoshikawa" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", ConsumeKafka::SECURITY_PROTOCOL_SSL, "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
}
TEST_CASE_METHOD(ConsumeKafkaPropertiesTest, "Acceptable values for message header and key attribute encoding are \"UTF-8\" and \"hex\".", "[ConsumeKafka][Kafka][InvalidEncoding]") {
- single_consumer_with_plain_text_test(false, false, {}, { "Shogun", "James Clavell" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, "UTF-32", {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
- single_consumer_with_plain_text_test(false, false, {}, { "Alice's Adventures in Wonderland", "Lewis Carroll" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, "UTF-32", {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(false, {}, { "Shogun", "James Clavell" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, "UTF-32", {}, {}, {}, {}, "1", "2 sec", "60 sec"); // NOLINT
+ single_consumer_with_plain_text_test(false, {}, { "Alice's Adventures in Wonderland", "Lewis Carroll" }, NON_TRANSACTIONAL_MESSAGES, {}, "localhost:9092", "PLAINTEXT", "ConsumeKafkaTest", {}, {}, "test_group_id", {}, {}, {}, "UTF-32", {}, {}, "1", "2 sec", "60 sec"); // NOLINT
}
TEST_CASE_METHOD(ConsumeKafkaContinuousPublishingTest, "ConsumeKafka can spend no more time polling than allowed in the maximum poll time property.", "[ConsumeKafka][Kafka][Batching][MaxPollTime]") {
diff --git a/extensions/mqtt/processors/ConsumeMQTT.cpp b/extensions/mqtt/processors/ConsumeMQTT.cpp
index e48d6bf..9529afb 100644
--- a/extensions/mqtt/processors/ConsumeMQTT.cpp
+++ b/extensions/mqtt/processors/ConsumeMQTT.cpp
@@ -58,7 +58,7 @@ bool ConsumeMQTT::enqueueReceiveMQTTMsg(MQTTClient_message *message) {
logger_->log_warn("MQTT queue full");
return false;
} else {
- if (message->payloadlen > maxSegSize_)
+ if (gsl::narrow<uint64_t>(message->payloadlen) > maxSegSize_)
message->payloadlen = maxSegSize_;
queue_.enqueue(message);
logger_->log_debug("enqueue MQTT message length %d", message->payloadlen);
diff --git a/extensions/mqtt/processors/PublishMQTT.h b/extensions/mqtt/processors/PublishMQTT.h
index 7925596..b166a1a 100644
--- a/extensions/mqtt/processors/PublishMQTT.h
+++ b/extensions/mqtt/processors/PublishMQTT.h
@@ -109,7 +109,7 @@ class PublishMQTT : public processors::AbstractMQTTProcessor {
uint64_t max_seg_size_;
std::string key_;
MQTTClient client_;
- ;
+
int status_;
size_t read_size_;
int qos_;
diff --git a/extensions/opc/include/opc.h b/extensions/opc/include/opc.h
index 3eba077..c4fe45a 100644
--- a/extensions/opc/include/opc.h
+++ b/extensions/opc/include/opc.h
@@ -134,8 +134,6 @@ std::string OPCDateTime2String(UA_DateTime raw_date);
void logFunc(void *context, UA_LogLevel level, UA_LogCategory category, const char *msg, va_list args);
-static void logClear(void *context) {};
-
} /* namespace opc */
} /* namespace minifi */
} /* namespace nifi */
diff --git a/extensions/opc/src/fetchopc.cpp b/extensions/opc/src/fetchopc.cpp
index 0c2b46f..9b18284 100644
--- a/extensions/opc/src/fetchopc.cpp
+++ b/extensions/opc/src/fetchopc.cpp
@@ -116,7 +116,7 @@ namespace processors {
if(idType_ == opc::OPCNodeIDType::Int) {
try {
- int t = std::stoi(nodeID_);
+ std::stoi(nodeID_);
} catch(...) {
auto error_msg = utils::StringUtils::join_pack(nodeID_, " cannot be used as an int type node ID");
throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
@@ -185,7 +185,7 @@ namespace processors {
}
- bool FetchOPCProcessor::nodeFoundCallBack(opc::Client& client, const UA_ReferenceDescription *ref, const std::string& path,
+ bool FetchOPCProcessor::nodeFoundCallBack(opc::Client& /*client*/, const UA_ReferenceDescription *ref, const std::string& path,
const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
nodesFound_++;
if(ref->nodeClass == UA_NODECLASS_VARIABLE) {
@@ -215,7 +215,7 @@ namespace processors {
return true;
}
- void FetchOPCProcessor::OPCData2FlowFile(const opc::NodeData& opcnode, const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+ void FetchOPCProcessor::OPCData2FlowFile(const opc::NodeData& opcnode, const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSession> &session) {
auto flowFile = session->create();
if (flowFile == nullptr) {
logger_->log_error("Failed to create flowfile!");
diff --git a/extensions/opc/src/opc.cpp b/extensions/opc/src/opc.cpp
index d27afdc..6c36a6e 100644
--- a/extensions/opc/src/opc.cpp
+++ b/extensions/opc/src/opc.cpp
@@ -138,7 +138,8 @@ Client::Client(std::shared_ptr<core::logging::Logger> logger, const std::string&
memcpy(keyByteString.data, keyBuffer.data(), keyByteString.length);
// Trusted certificates
- UA_STACKARRAY(UA_ByteString, trustList, trustBuffers.size());
+ std::vector<UA_ByteString> trustList;
+ trustList.resize(trustBuffers.size());
for (size_t i = 0; i < trustBuffers.size(); i++) {
trustList[i] = UA_STRING_NULL;
trustList[i].length = trustBuffers[i].size();
@@ -146,7 +147,7 @@ Client::Client(std::shared_ptr<core::logging::Logger> logger, const std::string&
memcpy(trustList[i].data, trustBuffers[i].data(), trustList[i].length);
}
UA_StatusCode sc = UA_ClientConfig_setDefaultEncryption(cc, certByteString, keyByteString,
- trustList, trustBuffers.size(),
+ trustList.data(), trustBuffers.size(),
nullptr, 0);
UA_ByteString_clear(&certByteString);
UA_ByteString_clear(&keyByteString);
@@ -160,7 +161,7 @@ Client::Client(std::shared_ptr<core::logging::Logger> logger, const std::string&
}
}
- const UA_Logger MinifiUALogger = {logFunc, logger.get(), logClear};
+ const UA_Logger MinifiUALogger = {logFunc, logger.get(), [](void*){}};
UA_ClientConfig *configPtr = UA_Client_getConfig(client_);
configPtr->logger = MinifiUALogger;
@@ -321,17 +322,17 @@ void Client::traverse(UA_NodeId nodeId, std::function<nodeFoundCallBackFunc> cb,
}
}
}
-};
+}
bool Client::exists(UA_NodeId nodeId) {
bool retval = false;
- auto callback = [&retval](Client& client, const UA_ReferenceDescription *ref, const std::string& pat) -> bool {
+ auto callback = [&retval](Client& /*client*/, const UA_ReferenceDescription* /*ref*/, const std::string& /*pat*/) -> bool {
retval = true;
return false; // If any node is found, the given node exists, so traverse can be stopped
};
traverse(nodeId, callback, "", 1);
return retval;
-};
+}
UA_StatusCode Client::translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector<UA_NodeId>& foundNodeIDs, const std::shared_ptr<core::logging::Logger>& logger) {
logger->log_trace("Trying to find node id for %s", path.c_str());
@@ -420,7 +421,7 @@ UA_StatusCode Client::update_node(const UA_NodeId nodeId, T value) {
UA_StatusCode sc = UA_Client_writeValueAttribute(client_, nodeId, variant);
UA_Variant_delete(variant);
return sc;
-};
+}
std::unique_ptr<Client> Client::createClient(std::shared_ptr<core::logging::Logger> logger, const std::string& applicationURI,
const std::vector<char>& certBuffer, const std::vector<char>& keyBuffer,
@@ -570,7 +571,7 @@ std::string OPCDateTime2String(UA_DateTime raw_date) {
return std::string(charBuf.data(), sz);
}
-void logFunc(void *context, UA_LogLevel level, UA_LogCategory category, const char *msg, va_list args) {
+void logFunc(void *context, UA_LogLevel level, UA_LogCategory /*category*/, const char *msg, va_list args) {
char buffer[1024];
vsnprintf(buffer, 1024, msg, args);
auto loggerPtr = reinterpret_cast<core::logging::BaseLogger*>(context);
diff --git a/extensions/opc/src/opcbase.cpp b/extensions/opc/src/opcbase.cpp
index e2fe67d..e675fea 100644
--- a/extensions/opc/src/opcbase.cpp
+++ b/extensions/opc/src/opcbase.cpp
@@ -65,7 +65,7 @@ namespace processors {
core::PropertyBuilder::createProperty("Trusted server certificate path")
->withDescription("Path to the DER-encoded trusted server certificate")->build());
- void BaseOPCProcessor::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &factory) {
+ void BaseOPCProcessor::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*factory*/) {
logger_->log_trace("BaseOPCProcessor::onSchedule");
applicationURI_.clear();
diff --git a/extensions/opc/src/putopc.cpp b/extensions/opc/src/putopc.cpp
index 36f8739..1f3fe63 100644
--- a/extensions/opc/src/putopc.cpp
+++ b/extensions/opc/src/putopc.cpp
@@ -134,7 +134,7 @@ namespace processors {
if(idType_ == opc::OPCNodeIDType::Int) {
try {
- int t = std::stoi(nodeID_);
+ std::stoi(nodeID_);
} catch(...) {
auto error_msg = utils::StringUtils::join_pack(nodeID_, " cannot be used as an int type node ID");
throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
diff --git a/extensions/opencv/CaptureRTSPFrame.cpp b/extensions/opencv/CaptureRTSPFrame.cpp
index 50fac73..6c27706 100644
--- a/extensions/opencv/CaptureRTSPFrame.cpp
+++ b/extensions/opencv/CaptureRTSPFrame.cpp
@@ -75,7 +75,7 @@ void CaptureRTSPFrame::initialize() {
setSupportedRelationships(std::move(relationships));
}
-void CaptureRTSPFrame::onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) {
+void CaptureRTSPFrame::onSchedule(core::ProcessContext *context, core::ProcessSessionFactory* /*sessionFactory*/) {
std::string value;
diff --git a/extensions/opencv/CaptureRTSPFrame.h b/extensions/opencv/CaptureRTSPFrame.h
index 9a3f500..8fcdc9a 100644
--- a/extensions/opencv/CaptureRTSPFrame.h
+++ b/extensions/opencv/CaptureRTSPFrame.h
@@ -54,7 +54,7 @@ class CaptureRTSPFrame : public core::Processor {
void initialize() override;
void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) override;
- void onTrigger(core::ProcessContext *context, core::ProcessSession *session) override {
+ void onTrigger(core::ProcessContext* /*context*/, core::ProcessSession* /*session*/) override {
logger_->log_error("onTrigger invocation with raw pointers is not implemented");
}
void onTrigger(const std::shared_ptr<core::ProcessContext> &context,
diff --git a/extensions/opencv/FrameIO.h b/extensions/opencv/FrameIO.h
index 38733e4..73155a3 100644
--- a/extensions/opencv/FrameIO.h
+++ b/extensions/opencv/FrameIO.h
@@ -56,7 +56,7 @@ class FrameReadCallback : public InputStreamCallback {
int64_t ret = 0;
image_buf_.resize(stream->size());
ret = stream->read(image_buf_.data(), static_cast<int>(stream->size()));
- if (ret != stream->size()) {
+ if (ret < 0 || static_cast<std::size_t>(ret) != stream->size()) {
throw std::runtime_error("ImageReadCallback failed to fully read flow file input stream");
}
image_mat_ = cv::imdecode(image_buf_, -1);
diff --git a/extensions/opencv/MotionDetector.cpp b/extensions/opencv/MotionDetector.cpp
index 5234a35..1888a6c 100644
--- a/extensions/opencv/MotionDetector.cpp
+++ b/extensions/opencv/MotionDetector.cpp
@@ -66,7 +66,7 @@ void MotionDetector::initialize() {
}
void MotionDetector::onSchedule(const std::shared_ptr<core::ProcessContext> &context,
- const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+ const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
std::string value;
if (context->getProperty(ImageEncoding.getName(), value)) {
diff --git a/extensions/opencv/OpenCVLoader.h b/extensions/opencv/OpenCVLoader.h
index 153e6ee..46a5d53 100644
--- a/extensions/opencv/OpenCVLoader.h
+++ b/extensions/opencv/OpenCVLoader.h
@@ -70,7 +70,7 @@ class OpenCVObjectFactory : public core::ObjectFactory {
}
}
- virtual std::unique_ptr<core::ObjectFactoryInitializer> getInitializer() {
+ virtual std::unique_ptr<core::ObjectFactoryInitializer> getInitializer() override {
return std::unique_ptr<core::ObjectFactoryInitializer>(new OpenCVObjectFactoryInitializer());
}
diff --git a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp
index 1708323..2a177c4 100644
--- a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp
+++ b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp
@@ -249,11 +249,11 @@ bool SourceInitiatedSubscriptionListener::loadState() {
std::string SourceInitiatedSubscriptionListener::Handler::millisecondsToXsdDuration(int64_t milliseconds) {
char buf[1024];
- snprintf(buf, sizeof(buf), "PT%lld.%03lldS", milliseconds / 1000, milliseconds % 1000);
+ snprintf(buf, sizeof(buf), "PT%" PRId64 ".%03" PRId64 "S", milliseconds / 1000, milliseconds % 1000);
return buf;
}
-bool SourceInitiatedSubscriptionListener::Handler::handlePost(CivetServer* server, struct mg_connection* conn) {
+bool SourceInitiatedSubscriptionListener::Handler::handlePost(CivetServer* /*server*/, struct mg_connection* conn) {
const struct mg_request_info* req_info = mg_get_request_info(conn);
if (req_info == nullptr) {
processor_.logger_->log_error("Failed to get request info");
@@ -563,7 +563,7 @@ bool SourceInitiatedSubscriptionListener::Handler::handleSubscriptionManager(str
ws_xml_add_child(subscribe_node, XML_NS_EVENTING, WSEVENT_EXPIRES, millisecondsToXsdDuration(processor_.subscription_expiration_interval_).c_str());
// Body/Filter
- WsXmlNodeH filter_node = ws_xml_add_child(subscribe_node, XML_NS_WS_MAN, WSM_FILTER, processor_.xpath_xml_query_.c_str());
+ ws_xml_add_child(subscribe_node, XML_NS_WS_MAN, WSM_FILTER, processor_.xpath_xml_query_.c_str());
// ws_xml_add_node_attr(filter_node, nullptr, "Dialect", "http://schemas.microsoft.com/win/2004/08/events/eventquery");
// Body/Bookmark
@@ -684,7 +684,6 @@ bool SourceInitiatedSubscriptionListener::Handler::handleSubscriptions(struct mg
processor_.logger_->log_error("Received malformed Events request on %s from %s (%s), Events missing", endpoint.c_str(), machine_id.c_str(), remote_ip.c_str());
return false;
}
- const struct mg_request_info* req_info = mg_get_request_info(conn);
// Enumare Body/Events/Event nodes
auto session = processor_.session_factory_->createSession();
std::tuple<std::shared_ptr<core::ProcessSession>, std::shared_ptr<logging::Logger>, std::string, std::string> callback_args =
@@ -750,7 +749,7 @@ bool SourceInitiatedSubscriptionListener::Handler::handleSubscriptions(struct mg
return true;
}
-void SourceInitiatedSubscriptionListener::onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+void SourceInitiatedSubscriptionListener::onTrigger(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSession>& /*session*/) {
logger_->log_trace("SourceInitiatedSubscriptionListener onTrigger called");
}
diff --git a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
index 9ba0990..8e11292 100644
--- a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
+++ b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
@@ -84,12 +84,12 @@ class SourceInitiatedSubscriptionListener : public core::Processor {
void initialize() override;
void onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) override;
void notifyStop() override;
-
+
class Handler: public CivetHandler {
public:
explicit Handler(SourceInitiatedSubscriptionListener& processor);
bool handlePost(CivetServer* server, struct mg_connection* conn);
-
+
class WriteCallback : public OutputStreamCallback {
public:
explicit WriteCallback(char* text);
@@ -101,16 +101,16 @@ class SourceInitiatedSubscriptionListener : public core::Processor {
private:
SourceInitiatedSubscriptionListener& processor_;
-
+
bool handleSubscriptionManager(struct mg_connection* conn, const std::string& endpoint, WsXmlDocH request);
bool handleSubscriptions(struct mg_connection* conn, const std::string& endpoint, WsXmlDocH request);
-
+
static int enumerateEventCallback(WsXmlNodeH node, void* data);
std::string getSoapAction(WsXmlDocH doc);
std::string getMachineId(WsXmlDocH doc);
bool isAckRequested(WsXmlDocH doc);
void sendResponse(struct mg_connection* conn, const std::string& machineId, const std::string& remoteIp, char* xml_buf, size_t xml_buf_size);
-
+
static std::string millisecondsToXsdDuration(int64_t milliseconds);
};
@@ -137,7 +137,7 @@ class SourceInitiatedSubscriptionListener : public core::Processor {
std::unique_ptr<CivetServer> server_;
std::unique_ptr<Handler> handler_;
-
+
struct SubscriberData {
WsXmlDocH bookmark_;
std::string subscription_version_;
@@ -162,7 +162,7 @@ class SourceInitiatedSubscriptionListener : public core::Processor {
};
REGISTER_RESOURCE(SourceInitiatedSubscriptionListener, "This processor implements a Windows Event Forwarding Source Initiated Subscription server with the help of OpenWSMAN. "
- "Windows hosts can be set up to connect and forward Event Logs to this processor.")
+ "Windows hosts can be set up to connect and forward Event Logs to this processor.");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/pcap/CapturePacket.cpp b/extensions/pcap/CapturePacket.cpp
index b20d881..ed6c8c9 100644
--- a/extensions/pcap/CapturePacket.cpp
+++ b/extensions/pcap/CapturePacket.cpp
@@ -68,7 +68,7 @@ std::string CapturePacket::generate_new_pcap(const std::string &base_path) {
return path;
}
-void CapturePacket::packet_callback(pcpp::RawPacket* packet, pcpp::PcapLiveDevice* dev, void* data) {
+void CapturePacket::packet_callback(pcpp::RawPacket* packet, pcpp::PcapLiveDevice* /*dev*/, void* data) {
// parse the packet
PacketMovers* capture_mechanism = (PacketMovers*) data;
@@ -125,7 +125,7 @@ void CapturePacket::initialize() {
setSupportedRelationships(relationships);
}
-void CapturePacket::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void CapturePacket::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
std::string value;
if (context->getProperty(BatchSize.getName(), value)) {
core::Property::StringToInt(value, pcap_batch_size_);
diff --git a/extensions/pcap/CapturePacket.h b/extensions/pcap/CapturePacket.h
index 26f499a..6ea398d 100644
--- a/extensions/pcap/CapturePacket.h
+++ b/extensions/pcap/CapturePacket.h
@@ -167,7 +167,7 @@ class CapturePacket : public core::Processor {
REGISTER_RESOURCE(CapturePacket, "CapturePacket captures and writes one or more packets into a PCAP file that will be used as the content of a flow file."
" Configuration options exist to adjust the batching of PCAP files. PCAP batching will place a single PCAP into a flow file. "
- "A regular expression selects network interfaces. Bluetooth network interfaces can be selected through a separate option.")
+ "A regular expression selects network interfaces. Bluetooth network interfaces can be selected through a separate option.");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/rocksdb-repos/RocksDatabase.h b/extensions/rocksdb-repos/RocksDatabase.h
index e67520b..c29d528 100644
--- a/extensions/rocksdb-repos/RocksDatabase.h
+++ b/extensions/rocksdb-repos/RocksDatabase.h
@@ -85,7 +85,7 @@ class RocksDatabase {
RocksDatabase(const rocksdb::Options& options, const std::string& name, Mode mode = Mode::ReadWrite);
- virtual utils::optional<OpenRocksDB> open();
+ utils::optional<OpenRocksDB> open();
private:
/*
diff --git a/extensions/rocksdb-repos/controllers/RocksDbPersistableKeyValueStoreService.cpp b/extensions/rocksdb-repos/controllers/RocksDbPersistableKeyValueStoreService.cpp
index 2421dd4..58370bf 100644
--- a/extensions/rocksdb-repos/controllers/RocksDbPersistableKeyValueStoreService.cpp
+++ b/extensions/rocksdb-repos/controllers/RocksDbPersistableKeyValueStoreService.cpp
@@ -32,8 +32,8 @@ core::Property RocksDbPersistableKeyValueStoreService::Directory(
->isRequired(true)->build());
RocksDbPersistableKeyValueStoreService::RocksDbPersistableKeyValueStoreService(const std::string& name, utils::Identifier uuid /*= utils::Identifier()*/)
- : AbstractAutoPersistingKeyValueStoreService(name, uuid)
- , PersistableKeyValueStoreService(name, uuid)
+ : PersistableKeyValueStoreService(name, uuid)
+ , AbstractAutoPersistingKeyValueStoreService(name, uuid)
, logger_(logging::LoggerFactory<RocksDbPersistableKeyValueStoreService>::getLogger()) {
}
diff --git a/extensions/script/CMakeLists.txt b/extensions/script/CMakeLists.txt
index d9a7b1f..274458d 100644
--- a/extensions/script/CMakeLists.txt
+++ b/extensions/script/CMakeLists.txt
@@ -55,7 +55,7 @@ if (NOT DISABLE_PYTHON_SCRIPTING)
endif()
include_directories(${PYTHON_INCLUDE_DIR})
- include_directories(../../thirdparty/pybind11/include)
+ include_directories(SYSTEM ../../thirdparty/pybind11/include)
include_directories(python)
add_definitions(-DPYTHON_SUPPORT)
diff --git a/extensions/script/ExecuteScript.h b/extensions/script/ExecuteScript.h
index 37a6207..dd8e230 100644
--- a/extensions/script/ExecuteScript.h
+++ b/extensions/script/ExecuteScript.h
@@ -76,7 +76,7 @@ class ExecuteScript : public core::Processor {
engine->bind("REL_SUCCESS", Success);
engine->bind("REL_FAILURE", Failure);
- return std::move(engine);
+ return engine;
}
template<typename T>
diff --git a/extensions/script/ScriptEngine.h b/extensions/script/ScriptEngine.h
index ae0125e..062e527 100644
--- a/extensions/script/ScriptEngine.h
+++ b/extensions/script/ScriptEngine.h
@@ -41,6 +41,8 @@ class ScriptEngine {
* @param res_var
*/
virtual void evalFile(const std::string &file_name) = 0;
+
+ virtual ~ScriptEngine() = default;
};
} /* namespace script */
diff --git a/extensions/script/lua/LuaBaseStream.cpp b/extensions/script/lua/LuaBaseStream.cpp
index 92b52f5..1387fae 100644
--- a/extensions/script/lua/LuaBaseStream.cpp
+++ b/extensions/script/lua/LuaBaseStream.cpp
@@ -53,17 +53,19 @@ std::string LuaBaseStream::read(size_t len) {
//
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
auto read = stream_->read(reinterpret_cast<uint8_t *>(&buffer[0]), static_cast<int>(len));
+ if (read < 0) {
+ return nullptr;
+ }
- if (read != len) {
- buffer.resize(static_cast<size_t >(read));
+ if (gsl::narrow<size_t>(read) != len) {
+ buffer.resize(gsl::narrow<size_t>(read));
}
- return std::move(buffer);
+ return buffer;
}
size_t LuaBaseStream::write(std::string buf) {
- return static_cast<size_t>(stream_->write(reinterpret_cast<uint8_t *>(const_cast<char *>(buf.data())),
- static_cast<int>(buf.length())));
+ return static_cast<size_t>(stream_->write(reinterpret_cast<uint8_t *>(const_cast<char *>(buf.data())), static_cast<int>(buf.length())));
}
} /* namespace lua */
diff --git a/extensions/script/python/ExecutePythonProcessor.h b/extensions/script/python/ExecutePythonProcessor.h
index b347e54..3c87eb3 100644
--- a/extensions/script/python/ExecutePythonProcessor.h
+++ b/extensions/script/python/ExecutePythonProcessor.h
@@ -34,6 +34,8 @@
#include "PythonScriptEngine.h"
#include "core/Property.h"
+#pragma GCC visibility push(hidden)
+
namespace org {
namespace apache {
namespace nifi {
@@ -142,4 +144,6 @@ REGISTER_RESOURCE(
} /* namespace apache */
} /* namespace org */
+#pragma GCC visibility pop
+
#endif // EXTENSIONS_SCRIPT_PYTHON_EXECUTEPYTHONPROCESSOR_H_
diff --git a/extensions/script/python/PyProcCreator.h b/extensions/script/python/PyProcCreator.h
index f10bfda..dc3252b 100644
--- a/extensions/script/python/PyProcCreator.h
+++ b/extensions/script/python/PyProcCreator.h
@@ -23,6 +23,8 @@
#include "ExecutePythonProcessor.h"
#include "utils/StringUtils.h"
+#pragma GCC visibility push(hidden)
+
class PythonObjectFactory : public core::DefautObjectFactory<minifi::python::processors::ExecutePythonProcessor> {
public:
@@ -103,5 +105,6 @@ class PyProcCreator {
std::map<std::string, std::string> file_mapping_;
};
+#pragma GCC visibility pop
#endif /* EXTENSIONS_PYPROCESS_PYPROCCREATOR_H_ */
diff --git a/extensions/script/python/PythonScriptEngine.cpp b/extensions/script/python/PythonScriptEngine.cpp
index 98e1191..2a857fc 100644
--- a/extensions/script/python/PythonScriptEngine.cpp
+++ b/extensions/script/python/PythonScriptEngine.cpp
@@ -33,7 +33,7 @@ Interpreter *getInterpreter() {
}
PythonScriptEngine::PythonScriptEngine() {
- auto intepreter = getInterpreter();
+ getInterpreter();
py::gil_scoped_acquire gil { };
py::module::import("minifi_native");
bindings_.reset(new py::dict());
@@ -63,7 +63,7 @@ void PythonScriptEngine::evalFile(const std::string &file_name) {
}
void PythonScriptEngine::initialize() {
- auto intepreter = getInterpreter();
+ getInterpreter();
}
} /* namespace python */
diff --git a/extensions/script/python/PythonScriptEngine.h b/extensions/script/python/PythonScriptEngine.h
index bf5dcc0..734c688 100644
--- a/extensions/script/python/PythonScriptEngine.h
+++ b/extensions/script/python/PythonScriptEngine.h
@@ -53,7 +53,7 @@ struct Interpreter {
py::gil_scoped_release gil_release_;
};
-static Interpreter *getInterpreter();
+Interpreter *getInterpreter();
class PythonScriptEngine : public script::ScriptEngine {
public:
diff --git a/extensions/sensors/CMakeLists.txt b/extensions/sensors/CMakeLists.txt
index 14aa03a..78353b5 100644
--- a/extensions/sensors/CMakeLists.txt
+++ b/extensions/sensors/CMakeLists.txt
@@ -19,7 +19,7 @@
include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)
-include_directories(../../thirdparty/RTIMULib/RTIMULib)
+include_directories(SYSTEM ../../thirdparty/RTIMULib/RTIMULib)
file(GLOB SOURCES "*.cpp")
add_library(minifi-sensors STATIC ${SOURCES})
diff --git a/extensions/sensors/GetEnvironmentalSensors.h b/extensions/sensors/GetEnvironmentalSensors.h
index 0163e6c..bc02e5c 100644
--- a/extensions/sensors/GetEnvironmentalSensors.h
+++ b/extensions/sensors/GetEnvironmentalSensors.h
@@ -75,7 +75,7 @@ class GetEnvironmentalSensors : public SensorBase {
static std::shared_ptr<utils::IdGenerator> id_generator_;
};
-REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from known sensors to include humidity and pressure data")
+REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from known sensors to include humidity and pressure data");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/sensors/GetMovementSensors.h b/extensions/sensors/GetMovementSensors.h
index d462591..19ec823 100644
--- a/extensions/sensors/GetMovementSensors.h
+++ b/extensions/sensors/GetMovementSensors.h
@@ -67,7 +67,7 @@ class GetMovementSensors : public SensorBase {
std::shared_ptr<logging::Logger> logger_;
};
-REGISTER_RESOURCE(GetMovementSensors, "Defines a processor that is able to retrieve sensor information from a class of known servo sensors")
+REGISTER_RESOURCE(GetMovementSensors, "Defines a processor that is able to retrieve sensor information from a class of known servo sensors");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/sftp/client/SFTPClient.cpp b/extensions/sftp/client/SFTPClient.cpp
index 94861b9..e657d2e 100644
--- a/extensions/sftp/client/SFTPClient.cpp
+++ b/extensions/sftp/client/SFTPClient.cpp
@@ -247,7 +247,7 @@ void SFTPClient::setSendKeepAlive(bool send_keepalive) {
send_keepalive_ = send_keepalive;
}
-bool SFTPClient::setUseCompression(bool use_compression) {
+bool SFTPClient::setUseCompression(bool /*use_compression*/) {
return libssh2_session_flag(ssh_session_, LIBSSH2_FLAG_COMPRESS, 1) == 0;
}
@@ -526,7 +526,7 @@ bool SFTPClient::getFile(const std::string& path, io::BaseStream& output, int64_
}
} while (true);
- if (expected_size >= 0 && total_read != expected_size) {
+ if (expected_size >= 0 && total_read != gsl::narrow<uint64_t>(expected_size)) {
last_error_.setLibssh2Error(LIBSSH2_FX_OK);
logger_->log_error("Remote file \"%s\" has unexpected size, expected: %ld, actual: %lu", path.c_str(), expected_size, total_read);
return false;
@@ -590,7 +590,7 @@ bool SFTPClient::putFile(const std::string& path, io::BaseStream& input, bool ov
}
} while (true);
- if (expected_size >= 0 && total_read != expected_size) {
+ if (expected_size >= 0 && total_read != gsl::narrow<uint64_t>(expected_size)) {
last_error_.setLibssh2Error(LIBSSH2_FX_OK);
logger_->log_error("Input has unexpected size, expected: %ld, actual: %lu", path.c_str(), expected_size, total_read);
return false;
diff --git a/extensions/sftp/client/SFTPClient.h b/extensions/sftp/client/SFTPClient.h
index aba8307..6265573 100644
--- a/extensions/sftp/client/SFTPClient.h
+++ b/extensions/sftp/client/SFTPClient.h
@@ -48,7 +48,7 @@ SMART_ENUM(SFTPError,
(FileAlreadyExists, "File already exists"),
(CommunicationFailure, "Communication failure"),
(IoError, "IO error"),
- (Unexpected, "Unexpected"));
+ (Unexpected, "Unexpected"))
class SFTPException : public Exception {
public:
diff --git a/extensions/sftp/processors/FetchSFTP.cpp b/extensions/sftp/processors/FetchSFTP.cpp
index 560e98f..68ae388 100644
--- a/extensions/sftp/processors/FetchSFTP.cpp
+++ b/extensions/sftp/processors/FetchSFTP.cpp
@@ -124,7 +124,7 @@ FetchSFTP::FetchSFTP(std::string name, utils::Identifier uuid /*= utils::Identif
FetchSFTP::~FetchSFTP() = default;
-void FetchSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void FetchSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
parseCommonPropertiesOnSchedule(context);
std::string value;
diff --git a/extensions/sftp/processors/FetchSFTP.h b/extensions/sftp/processors/FetchSFTP.h
index 6beb40a..065a787 100644
--- a/extensions/sftp/processors/FetchSFTP.h
+++ b/extensions/sftp/processors/FetchSFTP.h
@@ -97,7 +97,7 @@ class FetchSFTP : public SFTPProcessorBase {
bool disable_directory_listing_;
};
-REGISTER_RESOURCE(FetchSFTP, "Fetches the content of a file from a remote SFTP server and overwrites the contents of an incoming FlowFile with the content of the remote file.")
+REGISTER_RESOURCE(FetchSFTP, "Fetches the content of a file from a remote SFTP server and overwrites the contents of an incoming FlowFile with the content of the remote file.");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/sftp/processors/ListSFTP.cpp b/extensions/sftp/processors/ListSFTP.cpp
index 8c6cfee..89449a2 100644
--- a/extensions/sftp/processors/ListSFTP.cpp
+++ b/extensions/sftp/processors/ListSFTP.cpp
@@ -193,7 +193,7 @@ ListSFTP::ListSFTP(std::string name, utils::Identifier uuid /*= utils::Identifie
ListSFTP::~ListSFTP() = default;
-void ListSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void ListSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
parseCommonPropertiesOnSchedule(context);
state_manager_ = context->getStateManager();
@@ -344,7 +344,7 @@ bool ListSFTP::filterFile(const std::string& parent_path, const std::string& fil
/* Age */
time_t now = time(nullptr);
- int64_t file_age = (now - attrs.mtime) * 1000;
+ uint64_t file_age = (now - attrs.mtime) * 1000;
if (file_age < minimum_file_age_) {
logger_->log_debug("Ignoring \"%s/%s\" because it is younger than the Minimum File Age: %ld ms < %lu ms",
parent_path.c_str(),
@@ -396,7 +396,7 @@ bool ListSFTP::filterFile(const std::string& parent_path, const std::string& fil
return true;
}
-bool ListSFTP::filterDirectory(const std::string& parent_path, const std::string& filename, const LIBSSH2_SFTP_ATTRIBUTES& attrs) {
+bool ListSFTP::filterDirectory(const std::string& parent_path, const std::string& filename, const LIBSSH2_SFTP_ATTRIBUTES& /*attrs*/) {
if (!search_recursively_) {
return false;
}
@@ -424,12 +424,12 @@ bool ListSFTP::createAndTransferFlowFileFromChild(
const std::string& username,
const ListSFTP::Child& child) {
/* Convert mtime to string */
- if (child.attrs.mtime > std::numeric_limits<int64_t>::max()) {
+ if (child.attrs.mtime > gsl::narrow<uint64_t>(std::numeric_limits<int64_t>::max())) {
logger_->log_error("Modification date %lu of \"%s/%s\" larger than int64_t max", child.attrs.mtime, child.parent_path.c_str(), child.filename.c_str());
return true;
}
std::string mtime_str;
- if (!utils::timeutils::getDateTimeStr(static_cast<int64_t>(child.attrs.mtime), mtime_str)) {
+ if (!utils::timeutils::getDateTimeStr(gsl::narrow<int64_t>(child.attrs.mtime), mtime_str)) {
logger_->log_error("Failed to convert modification date %lu of \"%s/%s\" to string", child.attrs.mtime, child.parent_path.c_str(), child.filename.c_str());
return true;
}
@@ -479,7 +479,7 @@ ListSFTP::ListedEntity::ListedEntity(uint64_t timestamp_, uint64_t size_)
, size(size_) {
}
-bool ListSFTP::persistTrackingTimestampsCache(const std::shared_ptr<core::ProcessContext>& context, const std::string& hostname, const std::string& username, const std::string& remote_path) {
+bool ListSFTP::persistTrackingTimestampsCache(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::string& hostname, const std::string& username, const std::string& remote_path) {
std::unordered_map<std::string, std::string> state;
state["listing_strategy"] = LISTING_STRATEGY_TRACKING_TIMESTAMPS;
state["hostname"] = hostname;
@@ -495,7 +495,7 @@ bool ListSFTP::persistTrackingTimestampsCache(const std::shared_ptr<core::Proces
return state_manager_->set(state);
}
-bool ListSFTP::updateFromTrackingTimestampsCache(const std::shared_ptr<core::ProcessContext>& context, const std::string& hostname, const std::string& username, const std::string& remote_path) {
+bool ListSFTP::updateFromTrackingTimestampsCache(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::string& hostname, const std::string& username, const std::string& remote_path) {
std::string state_listing_strategy;
std::string state_hostname;
std::string state_username;
@@ -738,7 +738,7 @@ void ListSFTP::listByTrackingTimestamps(
}
}
-bool ListSFTP::persistTrackingEntitiesCache(const std::shared_ptr<core::ProcessContext>& context, const std::string& hostname, const std::string& username, const std::string& remote_path) {
+bool ListSFTP::persistTrackingEntitiesCache(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::string& hostname, const std::string& username, const std::string& remote_path) {
std::unordered_map<std::string, std::string> state;
state["listing_strategy"] = listing_strategy_;
state["hostname"] = hostname;
@@ -754,7 +754,7 @@ bool ListSFTP::persistTrackingEntitiesCache(const std::shared_ptr<core::ProcessC
return state_manager_->set(state);
}
-bool ListSFTP::updateFromTrackingEntitiesCache(const std::shared_ptr<core::ProcessContext>& context, const std::string& hostname, const std::string& username, const std::string& remote_path) {
+bool ListSFTP::updateFromTrackingEntitiesCache(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::string& hostname, const std::string& username, const std::string& remote_path) {
std::string state_listing_strategy;
std::string state_hostname;
std::string state_username;
diff --git a/extensions/sftp/processors/ListSFTP.h b/extensions/sftp/processors/ListSFTP.h
index e1601ed..9c24dcc 100644
--- a/extensions/sftp/processors/ListSFTP.h
+++ b/extensions/sftp/processors/ListSFTP.h
@@ -197,7 +197,7 @@ class ListSFTP : public SFTPProcessorBase {
REGISTER_RESOURCE(ListSFTP, "Performs a listing of the files residing on an SFTP server. "
"For each file that is found on the remote server, a new FlowFile will be created with "
"the filename attribute set to the name of the file on the remote server. "
- "This can then be used in conjunction with FetchSFTP in order to fetch those files.")
+ "This can then be used in conjunction with FetchSFTP in order to fetch those files.");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/sftp/processors/PutSFTP.cpp b/extensions/sftp/processors/PutSFTP.cpp
index 1cb6115..b55148a 100644
--- a/extensions/sftp/processors/PutSFTP.cpp
+++ b/extensions/sftp/processors/PutSFTP.cpp
@@ -148,7 +148,7 @@ void PutSFTP::initialize() {
properties.insert(RemoteGroup);
properties.insert(UseCompression);
setSupportedProperties(properties);
-
+
// Set the supported relationships
std::set<core::Relationship> relationships;
relationships.insert(Success);
@@ -168,7 +168,7 @@ PutSFTP::PutSFTP(std::string name, utils::Identifier uuid /*= utils::Identifier(
PutSFTP::~PutSFTP() = default;
-void PutSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
+void PutSFTP::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
parseCommonPropertiesOnSchedule(context);
std::string value;
@@ -202,7 +202,6 @@ PutSFTP::ReadCallback::ReadCallback(const std::string& target_path,
utils::SFTPClient& client,
const std::string& conflict_resolution)
: logger_(logging::LoggerFactory<PutSFTP::ReadCallback>::getLogger())
- , write_succeeded_(false)
, target_path_(target_path)
, client_(client)
, conflict_resolution_(conflict_resolution) {
diff --git a/extensions/sftp/processors/PutSFTP.h b/extensions/sftp/processors/PutSFTP.h
index dff0671..8c5150f 100644
--- a/extensions/sftp/processors/PutSFTP.h
+++ b/extensions/sftp/processors/PutSFTP.h
@@ -102,7 +102,6 @@ namespace processors {
private:
std::shared_ptr<logging::Logger> logger_;
- bool write_succeeded_;
const std::string target_path_;
utils::SFTPClient& client_;
const std::string conflict_resolution_;
@@ -119,7 +118,7 @@ namespace processors {
bool processOne(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session);
};
-REGISTER_RESOURCE(PutSFTP, "Sends FlowFiles to an SFTP Server")
+REGISTER_RESOURCE(PutSFTP, "Sends FlowFiles to an SFTP Server");
} /* namespace processors */
} /* namespace minifi */
diff --git a/extensions/sql/CMakeLists.txt b/extensions/sql/CMakeLists.txt
index bc6a6e9..c649376 100644
--- a/extensions/sql/CMakeLists.txt
+++ b/extensions/sql/CMakeLists.txt
@@ -22,7 +22,7 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-include_directories(../../thirdparty/rapidjson-1.1.0/include/ ../../thirdparty/rapidjson-1.1.0/include/rapidjson)
+include_directories(SYSTEM ../../thirdparty/rapidjson-1.1.0/include/ ../../thirdparty/rapidjson-1.1.0/include/rapidjson)
include_directories(".")
file(GLOB SOURCES "*.cpp" "services/*.cpp" "processors/*.cpp" "data/*.cpp")
diff --git a/extensions/sql/data/DatabaseConnectors.h b/extensions/sql/data/DatabaseConnectors.h
index c310cb0..3328739 100644
--- a/extensions/sql/data/DatabaseConnectors.h
+++ b/extensions/sql/data/DatabaseConnectors.h
@@ -50,8 +50,8 @@ class Statement {
}
protected:
- std::string query_;
soci::session& session_;
+ std::string query_;
};
class Session {
diff --git a/extensions/sql/data/JSONSQLWriter.cpp b/extensions/sql/data/JSONSQLWriter.cpp
index f9a0384..6c24e73 100644
--- a/extensions/sql/data/JSONSQLWriter.cpp
+++ b/extensions/sql/data/JSONSQLWriter.cpp
@@ -43,10 +43,10 @@ void JSONSQLWriter::endProcessRow() {
jsonPayload_.PushBack(jsonRow_, jsonPayload_.GetAllocator());
}
-void JSONSQLWriter::processColumnName(const std::string& name) {}
+void JSONSQLWriter::processColumnName(const std::string& /*name*/) {}
void JSONSQLWriter::processColumn(const std::string& name, const std::string& value) {
- addToJSONRow(name, std::move(toJSONString(value)));
+ addToJSONRow(name, toJSONString(value));
}
void JSONSQLWriter::processColumn(const std::string& name, double value) {
@@ -66,7 +66,7 @@ void JSONSQLWriter::processColumn(const std::string& name, unsigned long long va
}
void JSONSQLWriter::processColumn(const std::string& name, const char* value) {
- addToJSONRow(name, std::move(toJSONString(value)));
+ addToJSONRow(name, toJSONString(value));
}
void JSONSQLWriter::addToJSONRow(const std::string& columnName, rapidjson::Value&& jsonValue) {
diff --git a/extensions/sql/data/MaxCollector.h b/extensions/sql/data/MaxCollector.h
index 3bccf84..8e38959 100644
--- a/extensions/sql/data/MaxCollector.h
+++ b/extensions/sql/data/MaxCollector.h
@@ -74,7 +74,7 @@ class MaxCollector: public SQLRowSubscriber {
updateMaxValue(name, value);
}
- void processColumn(const std::string& name, const char* value) override {}
+ void processColumn(const std::string& /*name*/, const char* /*value*/) override {}
template <typename T>
struct MaxValue {
@@ -147,7 +147,7 @@ class MaxCollector: public SQLRowSubscriber {
size_t countColumns_{};
bool columnsVerified_{false};
};
-
+
} /* namespace sql */
} /* namespace minifi */
} /* namespace nifi */
diff --git a/extensions/sql/processors/PutSQL.cpp b/extensions/sql/processors/PutSQL.cpp
index 70b8623..a76bab2 100644
--- a/extensions/sql/processors/PutSQL.cpp
+++ b/extensions/sql/processors/PutSQL.cpp
@@ -78,7 +78,7 @@ void PutSQL::processOnSchedule(core::ProcessContext& context) {
sqlStatements_ = utils::StringUtils::split(sqlStatements, ";");
}
-void PutSQL::processOnTrigger(core::ProcessSession& session) {
+void PutSQL::processOnTrigger(core::ProcessSession& /*session*/) {
const auto dbSession = connection_->getSession();
try {
diff --git a/extensions/sql/processors/QueryDatabaseTable.cpp b/extensions/sql/processors/QueryDatabaseTable.cpp
index 71b0e6f..25c7d8d 100644
--- a/extensions/sql/processors/QueryDatabaseTable.cpp
+++ b/extensions/sql/processors/QueryDatabaseTable.cpp
@@ -203,9 +203,9 @@ class LegacyState {
private:
std::unordered_map<std::string, std::string> mapState_;
- std::shared_ptr<logging::Logger> logger_;
std::string filePath_;
std::string tableName_;
+ std::shared_ptr<logging::Logger> logger_;
bool ok_{};
};
@@ -395,7 +395,7 @@ std::string QueryDatabaseTable::getSelectQuery() {
continue;
}
- // Logic to differentiate ">" vs ">=" based on index is copied from:
+ // Logic to differentiate ">" vs ">=" based on index is copied from:
// https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractQueryDatabaseTable.java
// (under comment "Add a condition for the WHERE clause"). And implementation explanation: https://issues.apache.org/jira/browse/NIFI-2712.
if (index == 0) {
diff --git a/extensions/sql/processors/SQLProcessor.h b/extensions/sql/processors/SQLProcessor.h
index d277449..900cf65 100644
--- a/extensions/sql/processors/SQLProcessor.h
+++ b/extensions/sql/processors/SQLProcessor.h
@@ -39,7 +39,7 @@ class SQLProcessor: public core::Processor {
: core::Processor(name, uuid), logger_(logging::LoggerFactory<T>::getLogger()) {
}
- void onSchedule(const std::shared_ptr<core::ProcessContext>& context, const std::shared_ptr<core::ProcessSessionFactory>& sessionFactory) override {
+ void onSchedule(const std::shared_ptr<core::ProcessContext>& context, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) override {
std::string controllerService;
context->getProperty(dbControllerService().getName(), controllerService);
@@ -82,7 +82,7 @@ class SQLProcessor: public core::Processor {
protected:
static const core::Property& dbControllerService() {
- static const core::Property s_dbControllerService =
+ static const core::Property s_dbControllerService =
core::PropertyBuilder::createProperty("DB Controller Service")->
isRequired(true)->
withDescription("Database Controller Service.")->
diff --git a/extensions/sqlite/ExecuteSQL.cpp b/extensions/sqlite/ExecuteSQL.cpp
index d2768b3..710ce57 100644
--- a/extensions/sqlite/ExecuteSQL.cpp
+++ b/extensions/sqlite/ExecuteSQL.cpp
@@ -56,7 +56,7 @@ void ExecuteSQL::initialize() {
}
void ExecuteSQL::onSchedule(core::ProcessContext *context,
- core::ProcessSessionFactory *sessionFactory) {
+ core::ProcessSessionFactory* /*sessionFactory*/) {
context->getProperty(ConnectionURL.getName(), db_url_);
if (db_url_.empty()) {
diff --git a/extensions/sqlite/ExecuteSQL.h b/extensions/sqlite/ExecuteSQL.h
index 63b11ec..04e59b1 100644
--- a/extensions/sqlite/ExecuteSQL.h
+++ b/extensions/sqlite/ExecuteSQL.h
@@ -47,7 +47,7 @@ class ExecuteSQL : public core::Processor {
void initialize() override;
void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) override;
- void onTrigger(core::ProcessContext *context, core::ProcessSession *session) override {
+ void onTrigger(core::ProcessContext* /*context*/, core::ProcessSession* /*session*/) override {
logger_->log_error("onTrigger invocation with raw pointers is not implemented");
}
void onTrigger(const std::shared_ptr<core::ProcessContext> &context,
diff --git a/extensions/sqlite/PutSQL.cpp b/extensions/sqlite/PutSQL.cpp
index c9d7bc8..0ad0082 100644
--- a/extensions/sqlite/PutSQL.cpp
+++ b/extensions/sqlite/PutSQL.cpp
@@ -61,7 +61,7 @@ void PutSQL::initialize() {
}
void PutSQL::onSchedule(core::ProcessContext *context,
- core::ProcessSessionFactory *sessionFactory) {
+ core::ProcessSessionFactory* /*sessionFactory*/) {
context->getProperty(ConnectionURL.getName(), db_url_);
if (db_url_.empty()) {
diff --git a/extensions/sqlite/PutSQL.h b/extensions/sqlite/PutSQL.h
index e071048..f4992e4 100644
--- a/extensions/sqlite/PutSQL.h
+++ b/extensions/sqlite/PutSQL.h
@@ -35,8 +35,8 @@ class PutSQL : public core::Processor {
public:
explicit PutSQL(const std::string &name, utils::Identifier uuid = utils::Identifier())
: Processor(name, uuid),
- batch_size_(100),
- logger_(logging::LoggerFactory<PutSQL>::getLogger()) {
+ logger_(logging::LoggerFactory<PutSQL>::getLogger()),
+ batch_size_(100) {
}
static core::Property ConnectionURL;
@@ -49,7 +49,7 @@ class PutSQL : public core::Processor {
void initialize() override;
void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) override;
- void onTrigger(core::ProcessContext *context, core::ProcessSession *session) override {
+ void onTrigger(core::ProcessContext* /*context*/, core::ProcessSession* /*session*/) override {
logger_->log_error("onTrigger invocation with raw pointers is not implemented");
}
void onTrigger(const std::shared_ptr<core::ProcessContext> &context,
diff --git a/extensions/standard-processors/controllers/UnorderedMapPersistableKeyValueStoreService.cpp b/extensions/standard-processors/controllers/UnorderedMapPersistableKeyValueStoreService.cpp
index f8e813c..e34ac94 100644
--- a/extensions/standard-processors/controllers/UnorderedMapPersistableKeyValueStoreService.cpp
+++ b/extensions/standard-processors/controllers/UnorderedMapPersistableKeyValueStoreService.cpp
@@ -59,16 +59,16 @@ core::Property UnorderedMapPersistableKeyValueStoreService::File(
->isRequired(true)->build());
UnorderedMapPersistableKeyValueStoreService::UnorderedMapPersistableKeyValueStoreService(const std::string& name, utils::Identifier uuid /*= utils::Identifier()*/)
- : AbstractAutoPersistingKeyValueStoreService(name, uuid)
+ : PersistableKeyValueStoreService(name, uuid)
+ , AbstractAutoPersistingKeyValueStoreService(name, uuid)
, UnorderedMapKeyValueStoreService(name, uuid)
- , PersistableKeyValueStoreService(name, uuid)
, logger_(logging::LoggerFactory<UnorderedMapPersistableKeyValueStoreService>::getLogger()) {
}
UnorderedMapPersistableKeyValueStoreService::UnorderedMapPersistableKeyValueStoreService(const std::string& name, const std::shared_ptr<Configure> &configuration)
- : AbstractAutoPersistingKeyValueStoreService(name)
+ : PersistableKeyValueStoreService(name)
+ , AbstractAutoPersistingKeyValueStoreService(name)
, UnorderedMapKeyValueStoreService(name)
- , PersistableKeyValueStoreService(name)
, logger_(logging::LoggerFactory<UnorderedMapPersistableKeyValueStoreService>::getLogger()) {
setConfiguration(configuration);
initializeNonVirtual();
diff --git a/extensions/standard-processors/processors/GenerateFlowFile.cpp b/extensions/standard-processors/processors/GenerateFlowFile.cpp
index bf38689..a29a9df 100644
--- a/extensions/standard-processors/processors/GenerateFlowFile.cpp
+++ b/extensions/standard-processors/processors/GenerateFlowFile.cpp
@@ -85,9 +85,7 @@ void generateData(std::vector<char>& data, bool textData = false) {
if (textData) {
const int index_of_last_char = gsl::narrow<int>(strlen(TEXT_CHARS)) - 1;
std::uniform_int_distribution<> distr(0, index_of_last_char);
- auto rand = std::bind(distr, eng);
- std::generate_n(data.begin(), data.size(), rand);
- std::for_each(data.begin(), data.end(), [](char & c) { c = TEXT_CHARS[c];});
+ std::generate_n(data.begin(), data.size(), [&] { return TEXT_CHARS[static_cast<uint8_t>(distr(eng))]; });
} else {
std::uniform_int_distribution<> distr(std::numeric_limits<char>::min(), std::numeric_limits<char>::max());
auto rand = std::bind(distr, eng);
diff --git a/extensions/standard-processors/processors/GetFile.cpp b/extensions/standard-processors/processors/GetFile.cpp
index 98f2dd5..41d43e0 100644
--- a/extensions/standard-processors/processors/GetFile.cpp
+++ b/extensions/standard-processors/processors/GetFile.cpp
@@ -42,9 +42,11 @@
#include "core/ProcessSession.h"
#include "core/TypedValues.h"
+#ifndef R_OK
#define R_OK 4 /* Test for read permission. */
#define W_OK 2 /* Test for write permission. */
#define F_OK 0 /* Test for existence. */
+#endif
namespace org {
namespace apache {
diff --git a/extensions/standard-processors/processors/ListenSyslog.cpp b/extensions/standard-processors/processors/ListenSyslog.cpp
index d271d5b..ed512d0 100644
--- a/extensions/standard-processors/processors/ListenSyslog.cpp
+++ b/extensions/standard-processors/processors/ListenSyslog.cpp
@@ -187,7 +187,7 @@ void ListenSyslog::runThread() {
struct sockaddr_in cli_addr;
clilen = sizeof(cli_addr);
int recvlen = recvfrom(_serverSocket, _buffer, sizeof(_buffer), 0, (struct sockaddr *) &cli_addr, &clilen);
- if (recvlen > 0 && (uint64_t) (recvlen + getEventQueueByteSize()) <= _recvBufSize) {
+ if (recvlen > 0 && (uint64_t) (recvlen + getEventQueueByteSize()) <= static_cast<uint64_t>(_recvBufSize)) {
uint8_t *payload = new uint8_t[recvlen];
memcpy(payload, _buffer, recvlen);
putEvent(payload, recvlen);
@@ -204,7 +204,7 @@ void ListenSyslog::runThread() {
logger_->log_debug("ListenSysLog client socket %d close", clientSocket);
it = _clientSockets.erase(it);
} else {
- if ((uint64_t) (recvlen + getEventQueueByteSize()) <= _recvBufSize) {
+ if ((uint64_t) (recvlen + getEventQueueByteSize()) <= static_cast<uint64_t>(_recvBufSize)) {
uint8_t *payload = new uint8_t[recvlen];
memcpy(payload, _buffer, recvlen);
putEvent(payload, recvlen);
diff --git a/extensions/standard-processors/processors/ListenSyslog.h b/extensions/standard-processors/processors/ListenSyslog.h
index fcf24a0..7bf0303 100644
--- a/extensions/standard-processors/processors/ListenSyslog.h
+++ b/extensions/standard-processors/processors/ListenSyslog.h
@@ -191,7 +191,7 @@ class ListenSyslog : public core::Processor {
void pollEvent(std::queue<SysLogEvent> &list, int maxSize) {
std::lock_guard<std::mutex> lock(mutex_);
- while (!_eventQueue.empty() && (maxSize == 0 || list.size() < maxSize)) {
+ while (!_eventQueue.empty() && (maxSize == 0 || list.size() < static_cast<uint32_t>(maxSize))) {
SysLogEvent event = _eventQueue.front();
_eventQueue.pop();
_eventQueueByteSize -= event.len;
diff --git a/extensions/standard-processors/processors/LogAttribute.h b/extensions/standard-processors/processors/LogAttribute.h
index 7694230..969f329 100644
--- a/extensions/standard-processors/processors/LogAttribute.h
+++ b/extensions/standard-processors/processors/LogAttribute.h
@@ -108,7 +108,7 @@ class LogAttribute : public core::Processor {
return 0U;
}
int ret = stream->read(buffer_.data(), gsl::narrow<int>(buffer_.size()));
- if (ret != buffer_.size()) {
+ if (ret < 0 || static_cast<uint64_t>(ret) != buffer_.size()) {
logger_->log_error("%zu bytes were requested from the stream but %d bytes were read. Rolling back.", buffer_.size(), ret);
throw Exception(PROCESSOR_EXCEPTION, "Failed to read the entire FlowFile.");
}
diff --git a/extensions/standard-processors/processors/TailFile.h b/extensions/standard-processors/processors/TailFile.h
index e4b00f9..4b5efbf 100644
--- a/extensions/standard-processors/processors/TailFile.h
+++ b/extensions/standard-processors/processors/TailFile.h
@@ -186,7 +186,7 @@ REGISTER_RESOURCE(TailFile, "\"Tails\" a file, or a list of files, ingesting dat
" as is generally the case with log files, an optional Rolling Filename Pattern can be used to retrieve data from files that have rolled over, even if the rollover"
" occurred while NiFi was not running (provided that the data still exists upon restart of NiFi). It is generally advisable to set the Run Schedule to a few seconds,"
" rather than running with the default value of 0 secs, as this Processor will consume a lot of resources if scheduled very aggressively. At this time, this Processor"
- " does not support ingesting files that have been compressed when 'rolled over'.")
+ " does not support ingesting files that have been compressed when 'rolled over'.");
} // namespace processors
} // namespace minifi
diff --git a/extensions/standard-processors/tests/integration/SecureSocketGetTCPTest.cpp b/extensions/standard-processors/tests/integration/SecureSocketGetTCPTest.cpp
index 58a331c..da29f4b 100644
--- a/extensions/standard-processors/tests/integration/SecureSocketGetTCPTest.cpp
+++ b/extensions/standard-processors/tests/integration/SecureSocketGetTCPTest.cpp
@@ -120,7 +120,7 @@ class SecureSocketTest : public IntegrationBase {
check = [this]() -> bool {
return isRunning_;
};
- handler = [this](std::vector<uint8_t> *b, int *size) {
+ handler = [](std::vector<uint8_t> *b, int *size) {
std::cout << "oh write!" << std::endl;
b->reserve(20);
memset(b->data(), 0x00, 20);
@@ -134,8 +134,8 @@ class SecureSocketTest : public IntegrationBase {
protected:
std::function<bool()> check;
std::function<int(std::vector<uint8_t>*b, int *size)> handler;
- std::atomic<bool> isRunning_;
bool isSecure;
+ std::atomic<bool> isRunning_;
std::string dir;
std::stringstream ss;
TestController testController;
diff --git a/extensions/standard-processors/tests/integration/TLSServerSocketSupportedProtocolsTest.cpp b/extensions/standard-processors/tests/integration/TLSServerSocketSupportedProtocolsTest.cpp
index 79b089f..9278b9d 100644
--- a/extensions/standard-processors/tests/integration/TLSServerSocketSupportedProtocolsTest.cpp
+++ b/extensions/standard-processors/tests/integration/TLSServerSocketSupportedProtocolsTest.cpp
@@ -151,10 +151,12 @@ class SimpleSSLTestClient {
gsl::not_null<std::shared_ptr<logging::Logger>> logger_{gsl::make_not_null(logging::LoggerFactory<SimpleSSLTestClient>::getLogger())};
static SocketDescriptor openConnection(const char *host_name, const char *port, logging::Logger& logger) {
- struct addrinfo hints = {0}, *addrs;
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
+ struct addrinfo *addrs;
const int status = getaddrinfo(host_name, port, &hints, &addrs);
assert(status == 0);
SocketDescriptor sfd = INVALID_SOCKET;
@@ -249,7 +251,7 @@ class TLSServerSocketSupportedProtocolsTest {
auto check = [this]() -> bool {
return is_running_;
};
- auto handler = [this](std::vector<uint8_t> *bytes_written, int *size) {
+ auto handler = [](std::vector<uint8_t> *bytes_written, int *size) {
std::string contents = "hello world";
*bytes_written = {contents.begin(), contents.end()};
bytes_written->push_back(0);
diff --git a/extensions/standard-processors/tests/unit/GetFileTests.cpp b/extensions/standard-processors/tests/unit/GetFileTests.cpp
index 53e393f..b6ce5ae 100644
--- a/extensions/standard-processors/tests/unit/GetFileTests.cpp
+++ b/extensions/standard-processors/tests/unit/GetFileTests.cpp
@@ -98,5 +98,5 @@ TEST_CASE("GetFile: Directory", "[getFileDir]") {
LogTestController::getInstance().setTrace<processors::GetFile>();
auto plan = testController.createPlan();
auto get_file = plan->addProcessor("GetFile", "Get");
- REQUIRE_THROWS_AS(plan->runNextProcessor(), minifi::Exception);
+ REQUIRE_THROWS_AS(plan->runNextProcessor(), minifi::Exception&);
}
diff --git a/extensions/standard-processors/tests/unit/GetTCPTests.cpp b/extensions/standard-processors/tests/unit/GetTCPTests.cpp
index 27e223b..91ca60e 100644
--- a/extensions/standard-processors/tests/unit/GetTCPTests.cpp
+++ b/extensions/standard-processors/tests/unit/GetTCPTests.cpp
@@ -37,8 +37,6 @@
#include "utils/gsl.h"
TEST_CASE("GetTCPWithoutEOM", "[GetTCP1]") {
- utils::Identifier ident = utils::Identifier();
-
TestController testController;
std::vector<uint8_t> buffer;
for (auto c : "Hello World\nHello Warld\nGoodByte Cruel world") {
diff --git a/extensions/standard-processors/tests/unit/ProcessorTests.cpp b/extensions/standard-processors/tests/unit/ProcessorTests.cpp
index 7ca8000..784ed11 100644
--- a/extensions/standard-processors/tests/unit/ProcessorTests.cpp
+++ b/extensions/standard-processors/tests/unit/ProcessorTests.cpp
@@ -343,7 +343,7 @@ TEST_CASE("LogAttributeTestInvalid", "[TestLogAttribute]") {
plan->setProperty(getfile, org::apache::nifi::minifi::processors::GetFile::Directory.getName(), dir);
plan->setProperty(getfile, org::apache::nifi::minifi::processors::GetFile::BatchSize.getName(), "1");
- REQUIRE_THROWS_AS(plan->setProperty(loggattr, org::apache::nifi::minifi::processors::LogAttribute::FlowFilesToLog.getName(), "-1"), utils::internal::ParseException);
+ REQUIRE_THROWS_AS(plan->setProperty(loggattr, org::apache::nifi::minifi::processors::LogAttribute::FlowFilesToLog.getName(), "-1"), utils::internal::ParseException&);
LogTestController::getInstance().reset();
}
diff --git a/extensions/standard-processors/tests/unit/TailFileTests.cpp b/extensions/standard-processors/tests/unit/TailFileTests.cpp
index e635ec7..ed0ba07 100644
--- a/extensions/standard-processors/tests/unit/TailFileTests.cpp
+++ b/extensions/standard-processors/tests/unit/TailFileTests.cpp
@@ -83,7 +83,6 @@ TEST_CASE("TailFile reads the file until the first delimiter", "[simple]") {
std::shared_ptr<TestPlan> plan = testController.createPlan();
std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc");
- auto id = tailfile->getUUIDStr();
plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true);
char format[] = "/var/tmp/gt.XXXXXX";
@@ -124,7 +123,6 @@ TEST_CASE("TailFile picks up the second line if a delimiter is written between r
std::shared_ptr<TestPlan> plan = testController.createPlan();
std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc");
- auto id = tailfile->getUUIDStr();
plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true);
@@ -169,7 +167,6 @@ TEST_CASE("TailFile re-reads the file if the state is deleted between runs", "[s
std::shared_ptr<TestPlan> plan = testController.createPlan();
std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc");
- auto id = tailfile->getUUIDStr();
plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true);
@@ -211,7 +208,6 @@ TEST_CASE("TailFile picks up the state correctly if it is rewritten between runs
std::shared_ptr<TestPlan> plan = testController.createPlan();
std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc");
- auto id = tailfile->getUUIDStr();
plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true);
@@ -692,7 +688,6 @@ TEST_CASE("TailFile processes a long line followed by multiple newlines correctl
std::shared_ptr<TestPlan> plan = testController.createPlan();
std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc");
- auto id = tailfile->getUUIDStr();
char format[] = "/var/tmp/gt.XXXXXX";
auto dir = minifi::utils::createTempDir(&testController, format);
std::stringstream temp_file;
diff --git a/extensions/standard-processors/tests/unit/YamlConfigurationTests.cpp b/extensions/standard-processors/tests/unit/YamlConfigurationTests.cpp
index b4b8f6b..368e740 100644
--- a/extensions/standard-processors/tests/unit/YamlConfigurationTests.cpp
+++ b/extensions/standard-processors/tests/unit/YamlConfigurationTests.cpp
@@ -189,7 +189,7 @@ TEST_CASE("Test YAML Config Processing", "[YamlConfiguration]") {
"\n";
std::istringstream configYamlStream(CONFIG_YAML_NO_RPG_PORT_ID);
- REQUIRE_THROWS_AS(yamlConfig.getYamlRoot(configYamlStream), std::invalid_argument);
+ REQUIRE_THROWS_AS(yamlConfig.getYamlRoot(configYamlStream), std::invalid_argument&);
}
}
@@ -316,7 +316,7 @@ NiFi Properties Overrides: {}
)";
std::istringstream configYamlStream(TEST_CONFIG_YAML);
- REQUIRE_THROWS_AS(yamlConfig.getYamlRoot(configYamlStream), minifi::Exception);
+ REQUIRE_THROWS_AS(yamlConfig.getYamlRoot(configYamlStream), minifi::Exception&);
}
TEST_CASE("Test YAML v3 Config Processing", "[YamlConfiguration3]") {
diff --git a/extensions/usb-camera/GetUSBCamera.cpp b/extensions/usb-camera/GetUSBCamera.cpp
index 523da22..5bb0886 100644
--- a/extensions/usb-camera/GetUSBCamera.cpp
+++ b/extensions/usb-camera/GetUSBCamera.cpp
@@ -20,6 +20,7 @@
#include <png.h>
#include <utility>
+#include <vector>
#include "GetUSBCamera.h"
@@ -285,8 +286,11 @@ void GetUSBCamera::onSchedule(core::ProcessContext *context, core::ProcessSessio
}
}
}
+ break;
- case UVC_VS_FORMAT_MJPEG:logger_->log_info("Skipping MJPEG frame formats");
+ case UVC_VS_FORMAT_MJPEG:
+ logger_->log_info("Skipping MJPEG frame formats");
+ break;
default:logger_->log_warn("Found unknown format");
}
@@ -377,7 +381,7 @@ void GetUSBCamera::cleanupUvc() {
}
}
-void GetUSBCamera::onTrigger(core::ProcessContext *context, core::ProcessSession *session) {
+void GetUSBCamera::onTrigger(core::ProcessContext* /*context*/, core::ProcessSession *session) {
auto flowFile = session->get();
if (flowFile) {
@@ -427,7 +431,7 @@ int64_t GetUSBCamera::PNGWriteCallback::process(const std::shared_ptr<io::BaseSt
auto this_callback = reinterpret_cast<PNGWriteCallback *>(png_get_io_ptr(out_png));
std::copy(out_data, out_data + num_bytes, std::back_inserter(this_callback->png_output_buf_));
},
- [](png_structp flush_png) {});
+ [](png_structp /*flush_png*/) {});
png_set_IHDR(png, info, width_, height_, 8,
PNG_COLOR_TYPE_RGB,
@@ -436,7 +440,8 @@ int64_t GetUSBCamera::PNGWriteCallback::process(const std::shared_ptr<io::BaseSt
PNG_FILTER_TYPE_DEFAULT);
png_write_info(png, info);
- png_bytep row_pointers[height_];
+ std::vector<png_bytep> row_pointers;
+ row_pointers.resize(height_);
for (uint32_t y = 0; y < height_; y++) {
row_pointers[y] = reinterpret_cast<png_byte *>(frame_->data) + width_ * y * 3;
diff --git a/extensions/usb-camera/GetUSBCamera.h b/extensions/usb-camera/GetUSBCamera.h
index 38c6884..15fc1fc 100644
--- a/extensions/usb-camera/GetUSBCamera.h
+++ b/extensions/usb-camera/GetUSBCamera.h
@@ -103,8 +103,8 @@ class GetUSBCamera : public core::Processor {
private:
std::shared_ptr<std::mutex> png_write_mtx_;
uvc_frame_t *frame_;
- uint32_t width_;
- uint32_t height_;
+ const uint32_t width_;
+ const uint32_t height_;
std::vector<uint8_t> png_output_buf_;
std::shared_ptr<logging::Logger> logger_;
};
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index c7140ca..613d26a 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -42,7 +42,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DYAML_SUPPORT")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DYAML_SUPPORT")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBDIFF")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBDIFF")
-#include_directories("../thirdparty/bsdiff/")
+#include_directories(SYSTEM "../thirdparty/bsdiff/")
ENDIF()
diff --git a/libminifi/include/c2/PayloadParser.h b/libminifi/include/c2/PayloadParser.h
index 46f0c46..d6a9764 100644
--- a/libminifi/include/c2/PayloadParser.h
+++ b/libminifi/include/c2/PayloadParser.h
@@ -55,7 +55,7 @@ class convert_if_base {
template<typename T>
struct convert_if {
- explicit convert_if(const std::shared_ptr<state::response::Value> &node) {
+ explicit convert_if(const std::shared_ptr<state::response::Value>& /*node*/) {
}
diff --git a/libminifi/include/c2/triggers/FileUpdateTrigger.h b/libminifi/include/c2/triggers/FileUpdateTrigger.h
index bf6588a..5edb371 100644
--- a/libminifi/include/c2/triggers/FileUpdateTrigger.h
+++ b/libminifi/include/c2/triggers/FileUpdateTrigger.h
@@ -116,7 +116,7 @@ class FileUpdateTrigger : public C2Trigger {
std::shared_ptr<logging::Logger> logger_;
};
// add the trigger to the known resources.
-REGISTER_RESOURCE(FileUpdateTrigger, "Defines a file update trigger when the last write time of a file has been changed.")
+REGISTER_RESOURCE(FileUpdateTrigger, "Defines a file update trigger when the last write time of a file has been changed.");
} // namespace c2
} // namespace minifi
diff --git a/libminifi/include/core/ConfigurationFactory.h b/libminifi/include/core/ConfigurationFactory.h
index 02aa931..e094b56 100644
--- a/libminifi/include/core/ConfigurationFactory.h
+++ b/libminifi/include/core/ConfigurationFactory.h
@@ -33,9 +33,9 @@ namespace core {
template<typename T>
typename std::enable_if<!class_operations<T>::value, T*>::type instantiate(
- const std::shared_ptr<core::Repository> &repo, const std::shared_ptr<core::Repository> &flow_file_repo,
- const std::shared_ptr<core::ContentRepository> &content_repo, std::shared_ptr<Configure> configuration,
- const utils::optional<std::string>& path, const std::shared_ptr<utils::file::FileSystem>& filesystem) {
+ const std::shared_ptr<core::Repository>& /*repo*/, const std::shared_ptr<core::Repository>& /*flow_file_repo*/,
+ const std::shared_ptr<core::ContentRepository>& /*content_repo*/, std::shared_ptr<Configure> /*configuration*/,
+ const utils::optional<std::string>& /*path*/, const std::shared_ptr<utils::file::FileSystem>& /*filesystem*/) {
throw std::runtime_error("Cannot instantiate class");
}
diff --git a/libminifi/include/core/Core.h b/libminifi/include/core/Core.h
index 810a528..f056faf 100644
--- a/libminifi/include/core/Core.h
+++ b/libminifi/include/core/Core.h
@@ -124,6 +124,7 @@ struct class_operations {
template<typename T>
typename std::enable_if<!class_operations<T>::value, std::shared_ptr<T>>::type instantiate(const std::string name = "") {
+ (void)name; // against unused variable warnings
throw std::runtime_error("Cannot instantiate class");
}
diff --git a/libminifi/include/core/Flow.h b/libminifi/include/core/Flow.h
index 2857aad..3013a83 100644
--- a/libminifi/include/core/Flow.h
+++ b/libminifi/include/core/Flow.h
@@ -46,10 +46,10 @@ class Flow {
virtual utils::Identifier getControllerUUID() const = 0;
std::shared_ptr<core::ProcessGroup> root_;
- std::unique_ptr<core::FlowConfiguration> flow_configuration_;
std::shared_ptr<core::Repository> provenance_repo_;
std::shared_ptr<core::Repository> flow_file_repo_;
std::shared_ptr<core::ContentRepository> content_repo_;
+ std::unique_ptr<core::FlowConfiguration> flow_configuration_;
};
} // namespace core
diff --git a/libminifi/include/core/ProcessContext.h b/libminifi/include/core/ProcessContext.h
index 044dc52..b57cc52 100644
--- a/libminifi/include/core/ProcessContext.h
+++ b/libminifi/include/core/ProcessContext.h
@@ -247,7 +247,7 @@ class ProcessContext : public controller::ControllerServiceLookup, public core::
auto create_provider = [&](
const std::string& type,
const std::string& longType,
- const std::unordered_map<std::string, std::string>& extraProperties = {}) -> std::shared_ptr<core::CoreComponentStateManagerProvider> {
+ const std::unordered_map<std::string, std::string>& extraProperties) -> std::shared_ptr<core::CoreComponentStateManagerProvider> {
node = controller_service_provider->createControllerService(type, longType, DefaultStateManagerProviderName, true /*firstTimeAdded*/);
if (node == nullptr) {
return nullptr;
@@ -303,7 +303,8 @@ class ProcessContext : public controller::ControllerServiceLookup, public core::
/* Fall back to volatile memory-backed provider */
if (preferredType.empty() || preferredType == "UnorderedMapKeyValueStoreService") {
auto provider = create_provider("UnorderedMapKeyValueStoreService",
- "org.apache.nifi.minifi.controllers.UnorderedMapKeyValueStoreService");
+ "org.apache.nifi.minifi.controllers.UnorderedMapKeyValueStoreService",
+ {});
if (provider != nullptr) {
return provider;
}
diff --git a/libminifi/include/core/Resource.h b/libminifi/include/core/Resource.h
index 8f41801..a0ecb0d 100644
--- a/libminifi/include/core/Resource.h
+++ b/libminifi/include/core/Resource.h
@@ -55,11 +55,11 @@ class StaticClassType {
#define REGISTER_RESOURCE(CLASSNAME, DESC) \
static core::StaticClassType<CLASSNAME> \
- CLASSNAME##_registrar(#CLASSNAME, DESC);
+ CLASSNAME##_registrar(#CLASSNAME, DESC)
#define REGISTER_RESOURCE_AS(CLASSNAME, NAME) \
static core::StaticClassType<CLASSNAME> \
- CLASSNAME##_registrar(#NAME);
+ CLASSNAME##_registrar(#NAME)
} // namespace core
} // namespace minifi
diff --git a/libminifi/include/core/repository/AtomicRepoEntries.h b/libminifi/include/core/repository/AtomicRepoEntries.h
index bcbe320..93f3537 100644
--- a/libminifi/include/core/repository/AtomicRepoEntries.h
+++ b/libminifi/include/core/repository/AtomicRepoEntries.h
@@ -342,7 +342,7 @@ class AtomicEntry {
* this atomic entry.
* @param freedValue informs the caller if an item was freed.
*/
- T testAndFree(std::function<bool(T)> releaseTest, bool &freedValue) {
+ T testAndFree(std::function<bool(T)> releaseTest, bool& /*freedValue*/) {
try_lock();
T ref;
if (!has_value_) {
diff --git a/libminifi/include/core/state/nodes/DeviceInformation.h b/libminifi/include/core/state/nodes/DeviceInformation.h
index 73e3ec9..8a85807 100644
--- a/libminifi/include/core/state/nodes/DeviceInformation.h
+++ b/libminifi/include/core/state/nodes/DeviceInformation.h
@@ -71,7 +71,7 @@ class Device {
initialize();
}
void initialize() {
- addrinfo hints = { sizeof(addrinfo) };
+ addrinfo hints;
memset(&hints, 0, sizeof hints); // make sure the struct is empty
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
diff --git a/libminifi/include/core/yaml/YamlConfiguration.h b/libminifi/include/core/yaml/YamlConfiguration.h
index 8342ccd..aafbeb8 100644
--- a/libminifi/include/core/yaml/YamlConfiguration.h
+++ b/libminifi/include/core/yaml/YamlConfiguration.h
@@ -284,9 +284,9 @@ class YamlConfiguration : public FlowConfiguration {
private:
PropertyValue getValidatedProcessorPropertyForDefaultTypeInfo(const core::Property& propertyFromProcessor, const YAML::Node& propertyValueNode);
- void parsePropertyValueSequence(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor, const std::string &yaml_section);
+ void parsePropertyValueSequence(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor);
void parseSingleProperty(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor);
- void parsePropertyNodeElement(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor, const std::string &yaml_section);
+ void parsePropertyNodeElement(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor);
std::shared_ptr<logging::Logger> logger_;
static std::shared_ptr<utils::IdGenerator> id_generator_;
diff --git a/libminifi/include/io/AtomicEntryStream.h b/libminifi/include/io/AtomicEntryStream.h
index 13679ce..75b2d4c 100644
--- a/libminifi/include/io/AtomicEntryStream.h
+++ b/libminifi/include/io/AtomicEntryStream.h
@@ -40,10 +40,10 @@ template<typename T>
class AtomicEntryStream : public BaseStream {
public:
AtomicEntryStream(const T key, core::repository::AtomicEntry<T> *entry)
- : key_(key),
- entry_(entry),
+ : length_(0),
offset_(0),
- length_(0),
+ key_(key),
+ entry_(entry),
logger_(logging::LoggerFactory<AtomicEntryStream()>::getLogger()) {
core::repository::RepoValue<T> *value;
if (entry_->getValue(key, &value)) {
diff --git a/libminifi/include/sitetosite/RawSocketProtocol.h b/libminifi/include/sitetosite/RawSocketProtocol.h
index 6a3c722..0a693dc 100644
--- a/libminifi/include/sitetosite/RawSocketProtocol.h
+++ b/libminifi/include/sitetosite/RawSocketProtocol.h
@@ -119,7 +119,7 @@ class RawSiteToSiteClient : public sitetosite::SiteToSiteClient {
* Provides a reference to the time out
* @returns timeout
*/
- const uint64_t getTimeOut() const {
+ uint64_t getTimeOut() const {
return _timeOut;
}
diff --git a/libminifi/include/sitetosite/SiteToSite.h b/libminifi/include/sitetosite/SiteToSite.h
index f6bbf2b..4f766bc 100644
--- a/libminifi/include/sitetosite/SiteToSite.h
+++ b/libminifi/include/sitetosite/SiteToSite.h
@@ -237,9 +237,9 @@ class Transaction {
* Create a new transaction
*/
explicit Transaction(TransferDirection direction, org::apache::nifi::minifi::io::CRCStream<SiteToSitePeer> &&stream)
- : uuid_(id_generator_->generate()),
- closed_(false),
- crcStream(std::move(stream)) {
+ : closed_(false),
+ crcStream(std::move(stream)),
+ uuid_(id_generator_->generate()) {
_state = TRANSACTION_STARTED;
_direction = direction;
_dataAvailable = false;
diff --git a/libminifi/include/utils/Monitors.h b/libminifi/include/utils/Monitors.h
index 2928f54..3b44656 100644
--- a/libminifi/include/utils/Monitors.h
+++ b/libminifi/include/utils/Monitors.h
@@ -40,9 +40,7 @@ class AfterExecute {
virtual ~AfterExecute() = default;
AfterExecute() = default;
-
- explicit AfterExecute(AfterExecute &&other) {
- }
+ AfterExecute(AfterExecute&& /*other*/) = default;
virtual bool isFinished(const T &result) = 0;
virtual bool isCancelled(const T &result) = 0;
/**
diff --git a/libminifi/include/utils/ProcessorConfigUtils.h b/libminifi/include/utils/ProcessorConfigUtils.h
index cb75bfc..a6a6cea 100644
--- a/libminifi/include/utils/ProcessorConfigUtils.h
+++ b/libminifi/include/utils/ProcessorConfigUtils.h
@@ -47,7 +47,6 @@ std::vector<std::string> listFromRequiredCommaSeparatedProperty(const core::Proc
}
bool parseBooleanPropertyOrThrow(core::ProcessContext* context, const std::string& property_name) {
- bool value;
const std::string value_str = getRequiredPropertyOrThrow(context, property_name);
utils::optional<bool> maybe_value = utils::StringUtils::toBool(value_str);
if (!maybe_value) {
diff --git a/libminifi/include/utils/file/FileManager.h b/libminifi/include/utils/file/FileManager.h
index f11e8bc..964c84e 100644
--- a/libminifi/include/utils/file/FileManager.h
+++ b/libminifi/include/utils/file/FileManager.h
@@ -80,6 +80,7 @@ class FileManager {
std::string unique_file(bool keep = false) {
#ifdef USE_BOOST
+ (void)keep; // against unused variable warnings
return boost::filesystem::unique_path().native();
#else // USE_BOOST
return unique_file(std::string{}, keep);
diff --git a/libminifi/src/c2/C2Payload.cpp b/libminifi/src/c2/C2Payload.cpp
index 910e6cd..f8caf61 100644
--- a/libminifi/src/c2/C2Payload.cpp
+++ b/libminifi/src/c2/C2Payload.cpp
@@ -33,9 +33,9 @@ C2Payload::C2Payload(Operation op, std::string identifier, bool isRaw)
C2Payload::C2Payload(Operation op, state::UpdateState state, std::string identifier, bool isRaw)
: state::Update(state::UpdateStatus(state, 0)),
+ ident_(std::move(identifier)),
op_(op),
- raw_(isRaw),
- ident_(std::move(identifier)) {
+ raw_(isRaw) {
}
diff --git a/libminifi/src/core/FlowFile.cpp b/libminifi/src/core/FlowFile.cpp
index 2476b25..6027ca8 100644
--- a/libminifi/src/core/FlowFile.cpp
+++ b/libminifi/src/core/FlowFile.cpp
@@ -38,14 +38,17 @@ std::shared_ptr<logging::Logger> FlowFile::logger_ = logging::LoggerFactory<Flow
FlowFile::FlowFile()
: CoreComponent("FlowFile"),
- size_(0),
stored(false),
- offset_(0),
+ marked_delete_(false),
+ entry_date_(0),
+ event_time_(0),
+ lineage_start_date_(0),
last_queue_date_(0),
+ size_(0),
+ id_(0),
+ offset_(0),
to_be_processed_after_(std::chrono::steady_clock::now()),
- event_time_(0),
- claim_(nullptr),
- marked_delete_(false) {
+ claim_(nullptr) {
id_ = numeric_id_generator_->generateId();
entry_date_ = utils::timeutils::getTimeMillis();
event_time_ = entry_date_;
diff --git a/libminifi/src/core/ProcessGroup.cpp b/libminifi/src/core/ProcessGroup.cpp
index ba28246..add7865 100644
--- a/libminifi/src/core/ProcessGroup.cpp
+++ b/libminifi/src/core/ProcessGroup.cpp
@@ -48,10 +48,10 @@ ProcessGroup::ProcessGroup(ProcessGroupType type, const std::string& name, const
ProcessGroup::ProcessGroup(ProcessGroupType type, const std::string& name, const utils::Identifier& uuid, int version, ProcessGroup *parent)
: CoreComponent(name, uuid, id_generator_),
- logger_(logging::LoggerFactory<ProcessGroup>::getLogger()),
- type_(type),
config_version_(version),
- parent_process_group_(parent) {
+ type_(type),
+ parent_process_group_(parent),
+ logger_(logging::LoggerFactory<ProcessGroup>::getLogger()) {
yield_period_msec_ = 0;
if (parent_process_group_ != 0) {
@@ -67,10 +67,10 @@ ProcessGroup::ProcessGroup(ProcessGroupType type, const std::string& name, const
ProcessGroup::ProcessGroup(ProcessGroupType type, const std::string& name)
: CoreComponent(name, {}, id_generator_),
- logger_(logging::LoggerFactory<ProcessGroup>::getLogger()),
- type_(type),
config_version_(0),
- parent_process_group_(0) {
+ type_(type),
+ parent_process_group_(0),
+ logger_(logging::LoggerFactory<ProcessGroup>::getLogger()) {
yield_period_msec_ = 0;
onschedule_retry_msec_ = ONSCHEDULE_RETRY_INTERVAL;
transmitting_ = false;
diff --git a/libminifi/src/core/ProcessSessionReadCallback.cpp b/libminifi/src/core/ProcessSessionReadCallback.cpp
index ff30f07..8a21f73 100644
--- a/libminifi/src/core/ProcessSessionReadCallback.cpp
+++ b/libminifi/src/core/ProcessSessionReadCallback.cpp
@@ -34,10 +34,10 @@ namespace core {
ProcessSessionReadCallback::ProcessSessionReadCallback(const std::string &tmpFile,
const std::string &destFile,
std::shared_ptr<logging::Logger> logger)
- : _tmpFile(tmpFile),
+ : logger_(logger),
_tmpFileOs(tmpFile, std::ios::binary),
- _destFile(destFile),
- logger_(logger) {
+ _tmpFile(tmpFile),
+ _destFile(destFile) {
}
// Copy the entire file contents to the temporary file
diff --git a/libminifi/src/core/ProcessorNode.cpp b/libminifi/src/core/ProcessorNode.cpp
index 7db71e2..cd0e719 100644
--- a/libminifi/src/core/ProcessorNode.cpp
+++ b/libminifi/src/core/ProcessorNode.cpp
@@ -25,9 +25,9 @@ namespace minifi {
namespace core {
ProcessorNode::ProcessorNode(const std::shared_ptr<Connectable> &processor)
- : processor_(processor),
+ : ConfigurableComponent(),
Connectable(processor->getName()),
- ConfigurableComponent() {
+ processor_(processor) {
setUUID(processor->getUUID());
}
diff --git a/libminifi/src/core/PropertyValidation.cpp b/libminifi/src/core/PropertyValidation.cpp
index 1be431c..ff6da98 100644
--- a/libminifi/src/core/PropertyValidation.cpp
+++ b/libminifi/src/core/PropertyValidation.cpp
@@ -31,9 +31,9 @@ StandardValidators::StandardValidators()
// name is used by java nifi validators, so we should keep this LONG and not change to reflect
// its internal use
UNSIGNED_LONG_VALIDATOR(std::make_shared<UnsignedLongValidator>("LONG_VALIDATOR")),
+ BOOLEAN_VALIDATOR(std::make_shared<BooleanValidator>("BOOLEAN_VALIDATOR")),
DATA_SIZE_VALIDATOR(std::make_shared<DataSizeValidator>("DATA_SIZE_VALIDATOR")),
TIME_PERIOD_VALIDATOR(std::make_shared<TimePeriodValidator>("TIME_PERIOD_VALIDATOR")),
- BOOLEAN_VALIDATOR(std::make_shared<BooleanValidator>("BOOLEAN_VALIDATOR")),
NON_BLANK_VALIDATOR(std::make_shared<NonBlankValidator>("NON_BLANK_VALIDATOR")),
VALID_VALIDATOR(std::make_shared<AlwaysValid>(true, "VALID")),
PORT_VALIDATOR(std::make_shared<PortValidator>("PORT_VALIDATOR")),
diff --git a/libminifi/src/core/logging/LoggerConfiguration.cpp b/libminifi/src/core/logging/LoggerConfiguration.cpp
index a53b669..a057541 100644
--- a/libminifi/src/core/logging/LoggerConfiguration.cpp
+++ b/libminifi/src/core/logging/LoggerConfiguration.cpp
@@ -74,8 +74,8 @@ std::vector<std::string> LoggerProperties::get_keys_of_type(const std::string &t
LoggerConfiguration::LoggerConfiguration()
: root_namespace_(create_default_root()),
loggers(std::vector<std::shared_ptr<LoggerImpl>>()),
- shorten_names_(false),
- formatter_(std::make_shared<spdlog::pattern_formatter>(spdlog_default_pattern)) {
+ formatter_(std::make_shared<spdlog::pattern_formatter>(spdlog_default_pattern)),
+ shorten_names_(false) {
controller_ = std::make_shared<LoggerControl>();
logger_ = std::shared_ptr<LoggerImpl>(
new LoggerImpl(core::getClassName<LoggerConfiguration>(), controller_, get_logger(nullptr, root_namespace_, core::getClassName<LoggerConfiguration>(), formatter_)));
diff --git a/libminifi/src/core/yaml/YamlConfiguration.cpp b/libminifi/src/core/yaml/YamlConfiguration.cpp
index 740af80..67d094b 100644
--- a/libminifi/src/core/yaml/YamlConfiguration.cpp
+++ b/libminifi/src/core/yaml/YamlConfiguration.cpp
@@ -668,8 +668,7 @@ void YamlConfiguration::parsePortYaml(YAML::Node *portNode, core::ProcessGroup *
}
}
-void YamlConfiguration::parsePropertyValueSequence(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor,
- const std::string &yaml_section) {
+void YamlConfiguration::parsePropertyValueSequence(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor) {
for (auto iter : propertyValueNode) {
if (iter.IsDefined()) {
YAML::Node nodeVal = iter.as<YAML::Node>();
@@ -762,14 +761,13 @@ void YamlConfiguration::parseSingleProperty(const std::string& propertyName, con
}
}
-void YamlConfiguration::parsePropertyNodeElement(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor,
- const std::string &yaml_section) {
+void YamlConfiguration::parsePropertyNodeElement(const std::string& propertyName, const YAML::Node& propertyValueNode, std::shared_ptr<core::ConfigurableComponent> processor) {
logger_->log_trace("Encountered %s", propertyName);
if (propertyValueNode.IsNull() || !propertyValueNode.IsDefined()) {
return;
}
if (propertyValueNode.IsSequence()) {
- parsePropertyValueSequence(propertyName, propertyValueNode, processor, yaml_section);
+ parsePropertyValueSequence(propertyName, propertyValueNode, processor);
} else {
parseSingleProperty(propertyName, propertyValueNode, processor);
}
@@ -782,7 +780,7 @@ void YamlConfiguration::parsePropertiesNodeYaml(YAML::Node *propertiesNode, std:
for (const auto propertyElem : *propertiesNode) {
const std::string propertyName = propertyElem.first.as<std::string>();
const YAML::Node propertyValueNode = propertyElem.second;
- parsePropertyNodeElement(propertyName, propertyValueNode, processor, yaml_section);
+ parsePropertyNodeElement(propertyName, propertyValueNode, processor);
}
validateComponentProperties(processor, component_name, yaml_section);
diff --git a/libminifi/src/io/FileStream.cpp b/libminifi/src/io/FileStream.cpp
index 20d4e6d..4f759ae 100644
--- a/libminifi/src/io/FileStream.cpp
+++ b/libminifi/src/io/FileStream.cpp
@@ -45,9 +45,9 @@ constexpr const char *SEEKG_CALL_ERROR_MSG = "seekg call on file stream failed";
constexpr const char *SEEKP_CALL_ERROR_MSG = "seekp call on file stream failed";
FileStream::FileStream(const std::string &path, bool append)
- : logger_(logging::LoggerFactory<FileStream>::getLogger()),
+ : offset_(0),
path_(path),
- offset_(0) {
+ logger_(logging::LoggerFactory<FileStream>::getLogger()) {
file_stream_ = std::unique_ptr<std::fstream>(new std::fstream());
if (append) {
file_stream_->open(path.c_str(), std::fstream::in | std::fstream::out | std::fstream::app | std::fstream::binary);
@@ -71,9 +71,9 @@ FileStream::FileStream(const std::string &path, bool append)
}
FileStream::FileStream(const std::string &path, uint32_t offset, bool write_enable)
- : logger_(logging::LoggerFactory<FileStream>::getLogger()),
+ : offset_(offset),
path_(path),
- offset_(offset) {
+ logger_(logging::LoggerFactory<FileStream>::getLogger()) {
file_stream_ = std::unique_ptr<std::fstream>(new std::fstream());
if (write_enable) {
file_stream_->open(path.c_str(), std::fstream::in | std::fstream::out | std::fstream::binary);
diff --git a/libminifi/src/io/ZlibStream.cpp b/libminifi/src/io/ZlibStream.cpp
index e944f3a..aaf66b9 100644
--- a/libminifi/src/io/ZlibStream.cpp
+++ b/libminifi/src/io/ZlibStream.cpp
@@ -27,8 +27,8 @@ namespace minifi {
namespace io {
ZlibBaseStream::ZlibBaseStream(gsl::not_null<OutputStream*> output)
- : output_{output},
- outputBuffer_(16384U) {
+ : outputBuffer_(16384U),
+ output_{output} {
strm_.zalloc = Z_NULL;
strm_.zfree = Z_NULL;
strm_.opaque = Z_NULL;
diff --git a/libminifi/src/io/tls/TLSSocket.cpp b/libminifi/src/io/tls/TLSSocket.cpp
index bf4eb09..776fa44 100644
--- a/libminifi/src/io/tls/TLSSocket.cpp
+++ b/libminifi/src/io/tls/TLSSocket.cpp
@@ -44,11 +44,11 @@ namespace io {
TLSContext::TLSContext(const std::shared_ptr<Configure> &configure, std::shared_ptr<minifi::controllers::SSLContextService> ssl_service)
: SocketContext(configure),
- error_value(TLS_GOOD),
- ctx(nullptr, deleteContext),
logger_(logging::LoggerFactory<TLSContext>::getLogger()),
configure_(configure),
- ssl_service_(std::move(ssl_service)) {
+ ssl_service_(std::move(ssl_service)),
+ ctx(nullptr, deleteContext),
+ error_value(TLS_GOOD) {
}
/**
@@ -387,7 +387,6 @@ int TLSSocket::read(uint8_t *buf, int buflen, bool /*retrieve_all_bytes*/) {
}
int TLSSocket::writeData(const uint8_t *value, unsigned int size, int fd) {
- gsl_Expects(size >= 0);
unsigned int bytes = 0;
int sent = 0;
auto fd_ssl = get_ssl(fd);
diff --git a/libminifi/src/provenance/Provenance.cpp b/libminifi/src/provenance/Provenance.cpp
index bff5e1d..f9af7f9 100644
--- a/libminifi/src/provenance/Provenance.cpp
+++ b/libminifi/src/provenance/Provenance.cpp
@@ -45,9 +45,9 @@ const char *ProvenanceEventRecord::ProvenanceEventTypeStr[REPLAY + 1] = { "CREAT
ProvenanceEventRecord::ProvenanceEventRecord(ProvenanceEventRecord::ProvenanceEventType event, std::string componentId, std::string componentType)
: core::SerializableComponent(core::getClassName<ProvenanceEventRecord>()),
- _eventDuration(0),
_entryDate(0),
- _lineageStartDate(0) {
+ _lineageStartDate(0),
+ _eventDuration(0) {
_eventType = event;
_componentId = componentId;
_componentType = componentType;
diff --git a/libminifi/src/utils/StringUtils.cpp b/libminifi/src/utils/StringUtils.cpp
index a9bdc6e..c9c8c2f 100644
--- a/libminifi/src/utils/StringUtils.cpp
+++ b/libminifi/src/utils/StringUtils.cpp
@@ -308,6 +308,7 @@ bool StringUtils::from_base64(uint8_t* data, size_t* data_length, const char* ba
return false;
case 2:
digits[2] = 0x00;
+ // fall through
case 3: {
digits[3] = 0x00;
diff --git a/libminifi/test/TestBase.cpp b/libminifi/test/TestBase.cpp
index 0caf275..a5c1abb 100644
--- a/libminifi/test/TestBase.cpp
+++ b/libminifi/test/TestBase.cpp
@@ -76,7 +76,6 @@ std::shared_ptr<core::Processor> TestPlan::addProcessor(const std::shared_ptr<co
return nullptr;
}
std::lock_guard<std::recursive_mutex> guard(mutex);
- utils::Identifier uuid = utils::IdGenerator::getIdGenerator()->generate();
processor->setStreamFactory(stream_factory);
// initialize the processor
processor->initialize();
@@ -317,7 +316,7 @@ bool TestPlan::runNextProcessor(std::function<void(const std::shared_ptr<core::P
return runProcessor(location, verify);
}
-bool TestPlan::runCurrentProcessor(std::function<void(const std::shared_ptr<core::ProcessContext>, const std::shared_ptr<core::ProcessSession>)> verify) {
+bool TestPlan::runCurrentProcessor(std::function<void(const std::shared_ptr<core::ProcessContext>, const std::shared_ptr<core::ProcessSession>)> /*verify*/) {
std::lock_guard<std::recursive_mutex> guard(mutex);
return runProcessor(location);
}
@@ -382,7 +381,7 @@ std::vector<minifi::Connection*> TestPlan::getProcessorOutboundConnections(const
for (auto relationship : relationships_) {
if (is_processor_outbound_connection(relationship)) {
connections.emplace_back(relationship.get());
- }
+ }
}
return connections;
}
diff --git a/libminifi/test/aws-tests/DeleteS3ObjectTests.cpp b/libminifi/test/aws-tests/DeleteS3ObjectTests.cpp
index aa73a66..7b8b280 100644
--- a/libminifi/test/aws-tests/DeleteS3ObjectTests.cpp
+++ b/libminifi/test/aws-tests/DeleteS3ObjectTests.cpp
@@ -78,7 +78,7 @@ TEST_CASE_METHOD(DeleteS3ObjectTestsFixture, "Test required property not set", "
plan->setProperty(s3_processor, "Region", "");
}
- REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception);
+ REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception&);
}
TEST_CASE_METHOD(DeleteS3ObjectTestsFixture, "Test proxy setting", "[awsS3Proxy]") {
diff --git a/libminifi/test/aws-tests/FetchS3ObjectTests.cpp b/libminifi/test/aws-tests/FetchS3ObjectTests.cpp
index dadb85d..3c9b80a 100644
--- a/libminifi/test/aws-tests/FetchS3ObjectTests.cpp
+++ b/libminifi/test/aws-tests/FetchS3ObjectTests.cpp
@@ -97,7 +97,7 @@ TEST_CASE_METHOD(FetchS3ObjectTestsFixture, "Test required property not set", "[
plan->setProperty(s3_processor, "Region", "");
}
- REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception);
+ REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception&);
}
TEST_CASE_METHOD(FetchS3ObjectTestsFixture, "Test proxy setting", "[awsS3Proxy]") {
diff --git a/libminifi/test/aws-tests/ListS3Tests.cpp b/libminifi/test/aws-tests/ListS3Tests.cpp
index 08e7f3c..dcdb12e 100644
--- a/libminifi/test/aws-tests/ListS3Tests.cpp
+++ b/libminifi/test/aws-tests/ListS3Tests.cpp
@@ -83,7 +83,7 @@ TEST_CASE_METHOD(ListS3TestsFixture, "Test listing without versioning", "[awsS3L
setRequiredProperties();
test_controller.runSession(plan, true);
- for (auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for (std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
REQUIRE(LogTestController::getInstance().contains("key:filename value:" + S3_KEY_PREFIX + std::to_string(i)));
REQUIRE(LogTestController::getInstance().contains("key:s3.etag value:" + S3_ETAG_PREFIX + std::to_string(i)));
}
@@ -104,7 +104,7 @@ TEST_CASE_METHOD(ListS3TestsFixture, "Test listing with versioning", "[awsS3List
plan->setProperty(s3_processor, "Use Versions", "true");
test_controller.runSession(plan, true);
- for (auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for (std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
// 2 versions of every object
REQUIRE(LogTestController::getInstance().countOccurrences("key:filename value:" + S3_KEY_PREFIX + std::to_string(i)) == 2);
REQUIRE(LogTestController::getInstance().countOccurrences("key:s3.etag value:" + S3_ETAG_PREFIX + std::to_string(i)) == 2);
@@ -185,7 +185,7 @@ TEST_CASE_METHOD(ListS3TestsFixture, "Test truncated listing without versioning"
setRequiredProperties();
mock_s3_request_sender_ptr->setListingTruncated(true);
test_controller.runSession(plan, true);
- for (auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for (std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
REQUIRE(LogTestController::getInstance().contains("key:filename value:" + S3_KEY_PREFIX + std::to_string(i)));
REQUIRE(LogTestController::getInstance().contains("key:s3.etag value:" + S3_ETAG_PREFIX + std::to_string(i)));
}
@@ -207,7 +207,7 @@ TEST_CASE_METHOD(ListS3TestsFixture, "Test truncated listing with versioning", "
plan->setProperty(s3_processor, "Use Versions", "true");
mock_s3_request_sender_ptr->setListingTruncated(true);
test_controller.runSession(plan, true);
- for (auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for (std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
// 2 versions of every object
REQUIRE(LogTestController::getInstance().countOccurrences("key:filename value:" + S3_KEY_PREFIX + std::to_string(i)) == 2);
REQUIRE(LogTestController::getInstance().countOccurrences("key:s3.etag value:" + S3_ETAG_PREFIX + std::to_string(i)) == 2);
diff --git a/libminifi/test/aws-tests/MockS3RequestSender.h b/libminifi/test/aws-tests/MockS3RequestSender.h
index 418cf8b..6c64ae5 100644
--- a/libminifi/test/aws-tests/MockS3RequestSender.h
+++ b/libminifi/test/aws-tests/MockS3RequestSender.h
@@ -58,7 +58,7 @@ const std::string S3_CONTINUATION_TOKEN = "continue";
class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
public:
MockS3RequestSender() {
- for(auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for(std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
Aws::S3::Model::ObjectVersion version;
version.SetKey(S3_KEY_PREFIX + std::to_string(i));
version.SetETag(S3_ETAG_PREFIX + std::to_string(i));
@@ -74,7 +74,7 @@ class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
listed_versions_.push_back(version);
}
- for(auto i = 0; i < S3_OBJECT_COUNT; ++i) {
+ for(std::size_t i = 0; i < S3_OBJECT_COUNT; ++i) {
Aws::S3::Model::Object object;
object.SetKey(S3_KEY_PREFIX + std::to_string(i));
object.SetETag(S3_ETAG_PREFIX + std::to_string(i));
@@ -129,7 +129,7 @@ class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
Aws::S3::Model::ListObjectsV2Result list_object_result;
if (!is_listing_truncated_) {
- for (auto i = 0; i < listed_objects_.size(); ++i) {
+ for (std::size_t i = 0; i < listed_objects_.size(); ++i) {
list_object_result.AddContents(listed_objects_[i]);
}
return list_object_result;
@@ -138,7 +138,7 @@ class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
if (request.GetContinuationToken().empty()) {
list_object_result.SetNextContinuationToken(S3_CONTINUATION_TOKEN);
list_object_result.SetIsTruncated(true);
- for (auto i = 0; i < listed_objects_.size() / 2; ++i) {
+ for (std::size_t i = 0; i < listed_objects_.size() / 2; ++i) {
list_object_result.AddContents(listed_objects_[i]);
}
} else {
@@ -155,7 +155,7 @@ class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
Aws::S3::Model::ListObjectVersionsResult list_version_result;
if (!is_listing_truncated_) {
- for (auto i = 0; i < listed_versions_.size(); ++i) {
+ for (std::size_t i = 0; i < listed_versions_.size(); ++i) {
list_version_result.AddVersions(listed_versions_[i]);
}
return list_version_result;
@@ -165,7 +165,7 @@ class MockS3RequestSender : public minifi::aws::s3::S3RequestSender {
list_version_result.SetNextKeyMarker(S3_KEY_MARKER);
list_version_result.SetNextVersionIdMarker(S3_VERSION_ID_MARKER);
list_version_result.SetIsTruncated(true);
- for (auto i = 0; i < listed_versions_.size() / 2; ++i) {
+ for (std::size_t i = 0; i < listed_versions_.size() / 2; ++i) {
list_version_result.AddVersions(listed_versions_[i]);
}
} else {
diff --git a/libminifi/test/aws-tests/PutS3ObjectTests.cpp b/libminifi/test/aws-tests/PutS3ObjectTests.cpp
index 547c4ca..b091ac3 100644
--- a/libminifi/test/aws-tests/PutS3ObjectTests.cpp
+++ b/libminifi/test/aws-tests/PutS3ObjectTests.cpp
@@ -104,7 +104,7 @@ TEST_CASE_METHOD(PutS3ObjectTestsFixture, "Test required property not set", "[aw
plan->setProperty(s3_processor, "Server Side Encryption", "");
}
- REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception);
+ REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception&);
}
TEST_CASE_METHOD(PutS3ObjectTestsFixture, "Check default client configuration", "[awsS3ClientConfig]") {
diff --git a/libminifi/test/bustache-tests/CMakeLists.txt b/libminifi/test/bustache-tests/CMakeLists.txt
index bea91ec..45fba05 100644
--- a/libminifi/test/bustache-tests/CMakeLists.txt
+++ b/libminifi/test/bustache-tests/CMakeLists.txt
@@ -25,7 +25,7 @@ FOREACH(testfile ${BUSTACHE_INTEGRATION_TESTS})
add_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/bustache")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/bustache/include")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/bustache/include")
target_wholearchive_library(${testfilename} minifi-bustache-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
diff --git a/libminifi/test/flow-tests/CustomProcessors.h b/libminifi/test/flow-tests/CustomProcessors.h
index 530950c..2408677 100644
--- a/libminifi/test/flow-tests/CustomProcessors.h
+++ b/libminifi/test/flow-tests/CustomProcessors.h
@@ -94,6 +94,7 @@ class TestFlowFileGenerator : public processors::GenerateFlowFile, public Proces
TestFlowFileGenerator(const std::string& name, const utils::Identifier &uuid) : GenerateFlowFile(name, uuid) {}
TestFlowFileGenerator(const std::string& name) : GenerateFlowFile(name) {}
+ using processors::GenerateFlowFile::onTrigger;
void onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) override {
++trigger_count;
if (onTriggerCb_) {
diff --git a/libminifi/test/jni-tests/CMakeLists.txt b/libminifi/test/jni-tests/CMakeLists.txt
index 6c0e082..2135cf9 100644
--- a/libminifi/test/jni-tests/CMakeLists.txt
+++ b/libminifi/test/jni-tests/CMakeLists.txt
@@ -24,8 +24,8 @@ FOREACH(testfile ${KAFKA_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/librdkafka")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src-cpp")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src-cpp")
createTests("${testfilename}")
target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
target_wholearchive_library(${testfilename} minifi-jni)
diff --git a/libminifi/test/kafka-tests/CMakeLists.txt b/libminifi/test/kafka-tests/CMakeLists.txt
index d337bd3..52b8a17 100644
--- a/libminifi/test/kafka-tests/CMakeLists.txt
+++ b/libminifi/test/kafka-tests/CMakeLists.txt
@@ -24,8 +24,8 @@ FOREACH(testfile ${KAFKA_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/librdkafka")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.4/src")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.4/src-cpp")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.4/src")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.4/src-cpp")
createTests("${testfilename}")
target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
target_wholearchive_library(${testfilename} minifi-rdkafka-extensions)
diff --git a/libminifi/test/mqtt-tests/CMakeLists.txt b/libminifi/test/mqtt-tests/CMakeLists.txt
index 3b0d482..5f9edda 100644
--- a/libminifi/test/mqtt-tests/CMakeLists.txt
+++ b/libminifi/test/mqtt-tests/CMakeLists.txt
@@ -24,8 +24,8 @@ FOREACH(testfile ${KAFKA_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/librdkafka")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src")
- target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src-cpp")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src-cpp")
createTests("${testfilename}")
target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
target_wholearchive_library(${testfilename} minifi-mqtt-extensions)
diff --git a/libminifi/test/pcap-tests/PcapTest.cpp b/libminifi/test/pcap-tests/PcapTest.cpp
index 7b3effb..7c1a1f3 100644
--- a/libminifi/test/pcap-tests/PcapTest.cpp
+++ b/libminifi/test/pcap-tests/PcapTest.cpp
@@ -52,7 +52,7 @@ class PcapTestHarness : public IntegrationBase {
dir = testController.createTempDirectory(format);
}
- void testSetup() {
+ void testSetup() override {
LogTestController::getInstance().setTrace<minifi::processors::CapturePacket>();
LogTestController::getInstance().setDebug<minifi::FlowController>();
LogTestController::getInstance().setDebug<minifi::SchedulingAgent>();
@@ -67,7 +67,7 @@ class PcapTestHarness : public IntegrationBase {
IntegrationBase::cleanup();
}
- void runAssertions() {
+ void runAssertions() override {
using org::apache::nifi::minifi::utils::verifyLogLinePresenceInPollTime;
assert(verifyLogLinePresenceInPollTime(std::chrono::milliseconds(wait_time_),
// FIXME(fgerlits): These assertions don't work, but the test is still useful to check that the processor starts
@@ -78,7 +78,7 @@ class PcapTestHarness : public IntegrationBase {
"because it matches .*"));
}
- void updateProperties(std::shared_ptr<minifi::FlowController> fc) {
+ void updateProperties(std::shared_ptr<minifi::FlowController> fc) override {
auto components = fc->getComponents("pcap");
for (const auto& component : components) {
auto proccontroller = std::dynamic_pointer_cast<minifi::state::ProcessorController>(component);
diff --git a/libminifi/test/persistence-tests/CMakeLists.txt b/libminifi/test/persistence-tests/CMakeLists.txt
index a2ae85c..65910b1 100644
--- a/libminifi/test/persistence-tests/CMakeLists.txt
+++ b/libminifi/test/persistence-tests/CMakeLists.txt
@@ -27,7 +27,7 @@ FOREACH(testfile ${PERSISTENCE_TESTS})
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/libarchive")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/rocksdb-repos/")
- target_include_directories(${testfilename} BEFORE PRIVATE "${ROCKSDB_THIRDPARTY_ROOT}/include")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${ROCKSDB_THIRDPARTY_ROOT}/include")
target_wholearchive_library(${testfilename} minifi-archive-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
target_wholearchive_library(${testfilename} minifi-rocksdb-repos)
diff --git a/libminifi/test/rocksdb-tests/CMakeLists.txt b/libminifi/test/rocksdb-tests/CMakeLists.txt
index 67b4a46..8ee423d 100644
--- a/libminifi/test/rocksdb-tests/CMakeLists.txt
+++ b/libminifi/test/rocksdb-tests/CMakeLists.txt
@@ -23,8 +23,8 @@ FOREACH(testfile ${ROCKSDB_UNIT_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/rocksdb-repos/")
- target_include_directories(${testfilename} BEFORE PRIVATE "${ROCKSDB_THIRDPARTY_ROOT}/include")
- createTests("${testfilename}")
+ target_include_directories(${testfilename} SYSTEM BEFORE PRIVATE "${ROCKSDB_THIRDPARTY_ROOT}/include")
+ createTests("${testfilename}")
target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
target_wholearchive_library(${testfilename} minifi-rocksdb-repos)
target_wholearchive_library(${testfilename} minifi-standard-processors)
diff --git a/libminifi/test/rocksdb-tests/ContentSessionTests.cpp b/libminifi/test/rocksdb-tests/ContentSessionTests.cpp
index 0b58d0d..059dfa9 100644
--- a/libminifi/test/rocksdb-tests/ContentSessionTests.cpp
+++ b/libminifi/test/rocksdb-tests/ContentSessionTests.cpp
@@ -56,12 +56,12 @@ const std::shared_ptr<minifi::io::BaseStream>& operator>>(const std::shared_ptr<
str = "";
uint8_t buffer[4096]{};
while (true) {
- size_t ret = stream->read(buffer, sizeof(buffer));
+ auto ret = stream->read(buffer, sizeof(buffer));
REQUIRE(ret >= 0);
if (ret == 0) {
break;
}
- str += std::string{reinterpret_cast<char*>(buffer), ret};
+ str += std::string{reinterpret_cast<char*>(buffer), static_cast<std::size_t>(ret)};
}
return stream;
}
diff --git a/libminifi/test/script-tests/CMakeLists.txt b/libminifi/test/script-tests/CMakeLists.txt
index c1141c1..5b4255d 100644
--- a/libminifi/test/script-tests/CMakeLists.txt
+++ b/libminifi/test/script-tests/CMakeLists.txt
@@ -40,7 +40,7 @@ FOREACH(testfile ${EXECUTESCRIPT_PYTHON_INTEGRATION_TESTS})
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script/python")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/pybind11/include")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/pybind11/include")
add_definitions(-DPYTHON_SUPPORT)
target_wholearchive_library(${testfilename} minifi-script-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
@@ -54,14 +54,14 @@ FOREACH(testfile ${EXECUTEPYTHONPROCESSOR_UNIT_TESTS})
add_executable("${testfilename}" "${testfile}")
include_directories(${PYTHON_INCLUDE_DIR})
- include_directories(../../thirdparty/pybind11/include)
+ include_directories(SYSTEM ../../thirdparty/pybind11/include)
include_directories(python)
add_definitions(-DPYTHON_SUPPORT)
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script/python")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/pybind11/include")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/pybind11/include")
target_wholearchive_library(${testfilename} minifi-script-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
@@ -77,7 +77,7 @@ FOREACH(testfile ${EXECUTESCRIPT_LUA_INTEGRATION_TESTS})
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script/lua")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/sol2-2.17.5")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/sol2-2.17.5")
add_definitions(-DLUA_SUPPORT)
target_wholearchive_library(${testfilename} minifi-script-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
diff --git a/libminifi/test/sensors-tests/CMakeLists.txt b/libminifi/test/sensors-tests/CMakeLists.txt
index 8f99d79..b8961c6 100644
--- a/libminifi/test/sensors-tests/CMakeLists.txt
+++ b/libminifi/test/sensors-tests/CMakeLists.txt
@@ -25,7 +25,7 @@ FOREACH(testfile ${SENSORS_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}" )
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/test/")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/RTIMULib/RTIMULib/")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/RTIMULib/RTIMULib/")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/sensors/")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_BINARY_DIR}/extensions/sensors/")
createTests("${testfilename}")
diff --git a/libminifi/test/sqlite-tests/CMakeLists.txt b/libminifi/test/sqlite-tests/CMakeLists.txt
index 939246c..c31609c 100644
--- a/libminifi/test/sqlite-tests/CMakeLists.txt
+++ b/libminifi/test/sqlite-tests/CMakeLists.txt
@@ -25,7 +25,7 @@ FOREACH(testfile ${SQLITE_INTEGRATION_TESTS})
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors/processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/sqlite")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/sqlite")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/sqlite")
target_wholearchive_library(${testfilename} minifi-sqlite-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
diff --git a/libminifi/test/unit/DecryptorTests.cpp b/libminifi/test/unit/DecryptorTests.cpp
index 404c8aa..da79a7c 100644
--- a/libminifi/test/unit/DecryptorTests.cpp
+++ b/libminifi/test/unit/DecryptorTests.cpp
@@ -51,37 +51,37 @@ TEST_CASE("Decryptor will throw if the value is incorrect", "[decrypt]") {
REQUIRE_THROWS_AS(decryptor.decrypt( // this is not even close
"some totally incorrect value"),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // separator missing
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOuErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // separator wrong
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOu__ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // more than one separator
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOu||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo=||extra+stuff"),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // nonce is off by one char
"L3WY1V27knTiPa6jVX0jrq4qjmKsySOu||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // ciphertext is off by one char
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOu||erntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // nonce is too short
"l3WY1V27knTiPa6jVX0rq4qjmKsySOu||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // nonce is too long
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOup||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // ciphertext-and-mac is too short
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOu||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUU5EyMloTtSytk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // ciphertext-and-mac is too long
"l3WY1V27knTiPa6jVX0jrq4qjmKsySOu||ErntqZpHP1M+6OkA14p5sdnqJhuNHWHDVUUU5EyMloTtSytKk9a5xNKo="),
- std::exception);
+ std::exception&);
REQUIRE_THROWS_AS(decryptor.decrypt( // correct format but random value
"81hf/4bHIRVd2pYglniBW3zOUcaLe+Cw||mkN2sKHS+nepRTcBhOJ5tFW4GXvaywYLD8xzIEbCP0lgUA6Qf3jZ/oMi"),
- std::exception);
+ std::exception&);
}
TEST_CASE("Decryptor can decrypt a configuration file", "[decryptSensitiveProperties]") {
diff --git a/libminifi/test/unit/GeneralUtilsTest.cpp b/libminifi/test/unit/GeneralUtilsTest.cpp
index f24b88c..e9b0bfb 100644
--- a/libminifi/test/unit/GeneralUtilsTest.cpp
+++ b/libminifi/test/unit/GeneralUtilsTest.cpp
@@ -129,9 +129,8 @@ TEST_CASE("GeneralUtils::invoke FunctionObject", "[invoke function object]") {
REQUIRE(true == utils::invoke(&free_function, true));
REQUIRE(false == utils::invoke(&free_function, false));
- const auto n = 3;
- const auto int_timesn = [n](const int i) { return n * i; };
+ const auto int_timesn = [](const int i) { return 3 * i; };
- // lambda with capture
+ // invoking lambda
REQUIRE(60 == utils::invoke(int_timesn, 20));
}
diff --git a/libminifi/test/unit/MockClasses.h b/libminifi/test/unit/MockClasses.h
index c55851d..2d07538 100644
--- a/libminifi/test/unit/MockClasses.h
+++ b/libminifi/test/unit/MockClasses.h
@@ -84,7 +84,7 @@ class MockProcessor : public core::Processor {
~MockProcessor() = default;
- virtual void initialize() {
+ void initialize() override {
core::Property property("linkedService", "Linked service");
std::set<core::Property> properties;
properties.insert(property);
@@ -93,7 +93,7 @@ class MockProcessor : public core::Processor {
}
// OnTrigger method, implemented by NiFi Processor Designer
- virtual void onTrigger(core::ProcessContext *context, core::ProcessSession* /*session*/) {
+ void onTrigger(core::ProcessContext *context, core::ProcessSession* /*session*/) override {
std::string linked_service = "";
getProperty("linkedService", linked_service);
diff --git a/libminifi/test/unit/PayloadParserTests.cpp b/libminifi/test/unit/PayloadParserTests.cpp
index 9ce6757..c2114e1 100644
--- a/libminifi/test/unit/PayloadParserTests.cpp
+++ b/libminifi/test/unit/PayloadParserTests.cpp
@@ -47,7 +47,7 @@ TEST_CASE("Test Invalid not found", "[tv2]") {
payload2.addContent(std::move(response));
payload.addPayload(std::move(payload2));
payload.addPayload(minifi::c2::C2Payload(minifi::c2::Operation::ACKNOWLEDGE, chips));
- REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheese").getAs<std::string>("type"), minifi::c2::PayloadParseException);
+ REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheese").getAs<std::string>("type"), minifi::c2::PayloadParseException&);
}
@@ -62,7 +62,7 @@ TEST_CASE("Test Invalid coercion", "[tv3]") {
payload2.addContent(std::move(response));
payload.addPayload(std::move(payload2));
payload.addPayload(minifi::c2::C2Payload(minifi::c2::Operation::ACKNOWLEDGE, chips));
- REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheese").getAs<uint64_t>("type"), minifi::c2::PayloadParseException);
+ REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheese").getAs<uint64_t>("type"), minifi::c2::PayloadParseException&);
}
TEST_CASE("Test Invalid not there", "[tv4]") {
@@ -76,7 +76,7 @@ TEST_CASE("Test Invalid not there", "[tv4]") {
payload2.addContent(std::move(response));
payload.addPayload(std::move(payload2));
payload.addPayload(minifi::c2::C2Payload(minifi::c2::Operation::ACKNOWLEDGE, chips));
- REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheeses").getAs<uint64_t>("type"), minifi::c2::PayloadParseException);
+ REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("cheeses").getAs<uint64_t>("type"), minifi::c2::PayloadParseException&);
}
TEST_CASE("Test typed conversions", "[tv5]") {
@@ -111,5 +111,5 @@ TEST_CASE("Test Invalid not there deep", "[tv6]") {
payload2.addContent(std::move(response));
payload.addPayload(std::move(payload2));
payload.addPayload(minifi::c2::C2Payload(minifi::c2::Operation::ACKNOWLEDGE, chips));
- REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("chips").getAs<uint64_t>("type"), minifi::c2::PayloadParseException);
+ REQUIRE_THROWS_AS(minifi::c2::PayloadParser::getInstance(payload).in("chips").getAs<uint64_t>("type"), minifi::c2::PayloadParseException&);
}
diff --git a/libminifi/test/unit/ProcessSessionTests.cpp b/libminifi/test/unit/ProcessSessionTests.cpp
index 45b592c..06a921e 100644
--- a/libminifi/test/unit/ProcessSessionTests.cpp
+++ b/libminifi/test/unit/ProcessSessionTests.cpp
@@ -27,7 +27,7 @@ class DummyProcessor : public core::Processor {
using core::Processor::Processor;
};
-REGISTER_RESOURCE(DummyProcessor, "A processor that does nothing.")
+REGISTER_RESOURCE(DummyProcessor, "A processor that does nothing.");
class Fixture {
public:
diff --git a/libminifi/test/unit/PropertyValidationTests.cpp b/libminifi/test/unit/PropertyValidationTests.cpp
index 5a50164..bc19631 100644
--- a/libminifi/test/unit/PropertyValidationTests.cpp
+++ b/libminifi/test/unit/PropertyValidationTests.cpp
@@ -46,7 +46,8 @@ TEST_CASE("Converting invalid PropertyValue") {
->withDefaultValue<int>(0)
->build();
REQUIRE_THROWS_AS(prop.setValue("not int"), ParseException&);
- REQUIRE_THROWS_AS(static_cast<int>(prop.getValue()), InvalidValueException&);
+ auto cast_check = [&]{ return static_cast<int>(prop.getValue()) == 0; }; // To avoid unused-value warning
+ REQUIRE_THROWS_AS(cast_check(), InvalidValueException&);
}
TEST_CASE("Parsing int has baggage after") {
diff --git a/libminifi/test/usb-camera-tests/CMakeLists.txt b/libminifi/test/usb-camera-tests/CMakeLists.txt
index 242131c..9ac5c5f 100644
--- a/libminifi/test/usb-camera-tests/CMakeLists.txt
+++ b/libminifi/test/usb-camera-tests/CMakeLists.txt
@@ -24,7 +24,7 @@ FOREACH(testfile ${USB_CAMERA_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}" "${TEST_DIR}/TestBase.cpp")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/usb-camera")
- target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/libuvc-0.0.6/include")
+ target_include_directories(${testfilename} SYSTEM PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/libuvc-0.0.6/include")
createTests("${testfilename}")
target_wholearchive_library(${testfilename} minifi-usb-camera-extensions)
target_wholearchive_library(${testfilename} minifi-standard-processors)
diff --git a/main/AgentDocs.cpp b/main/AgentDocs.cpp
index 7307828..bb9c94f 100644
--- a/main/AgentDocs.cpp
+++ b/main/AgentDocs.cpp
@@ -125,7 +125,7 @@ void AgentDocs::generate(const std::string &docsdir, std::ostream &genStream) {
std::map<std::string,std::string> fileList;
- auto fileFind = [&fileList,this](const std::string& base_path, const std::string& file) -> bool {
+ auto fileFind = [&fileList](const std::string& base_path, const std::string& file) -> bool {
if (file.find(".extra") == std::string::npos)
fileList.insert(std::make_pair(file, base_path + utils::file::FileUtils::get_separator() + file));
return true;
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 0cfd81f..b81e08f 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -15,7 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-#
+#
cmake_minimum_required(VERSION 2.6)
@@ -77,7 +77,7 @@ if(NOT WIN32 AND ENABLE_JNI AND NOT DISABLE_JEMALLOC)
endif()
if (WIN32)
- include_directories("../thirdparty/Simple-Windows-Posix-Semaphore")
+ include_directories(SYSTEM "../thirdparty/Simple-Windows-Posix-Semaphore")
target_link_libraries(minifiexe semaphore)
endif()
diff --git a/nanofi/examples/generate_flow.c b/nanofi/examples/generate_flow.c
index 5323b6b..596cadb 100644
--- a/nanofi/examples/generate_flow.c
+++ b/nanofi/examples/generate_flow.c
@@ -43,7 +43,7 @@ int main(int argc, char **argv) {
nifi_instance *instance = create_instance(instance_str, &port);
flow *new_flow = create_new_flow(instance);
- processor *generate_proc = add_processor(new_flow, "GenerateFlowFile");
+ add_processor(new_flow, "GenerateFlowFile");
flow_file_record *record = get_next_flow_file(instance, new_flow);
diff --git a/nanofi/examples/hash_file.c b/nanofi/examples/hash_file.c
index f083bf0..1b3d9de 100644
--- a/nanofi/examples/hash_file.c
+++ b/nanofi/examples/hash_file.c
@@ -85,7 +85,7 @@ int main(int argc, char **argv) {
exit(1);
}
- add_custom_processor("md5proc", custom_processor_logic);
+ add_custom_processor("md5proc", custom_processor_logic, NULL);
standalone_processor *standalone_proc = create_processor("md5proc");
diff --git a/nanofi/examples/monitor_directory.c b/nanofi/examples/monitor_directory.c
index 6491b11..ec0975a 100644
--- a/nanofi/examples/monitor_directory.c
+++ b/nanofi/examples/monitor_directory.c
@@ -41,6 +41,7 @@ pthread_cond_t condition;
int stopped;
int stop_callback(char *c) {
+ (void)c; // against unused variable warnings
pthread_mutex_lock(&mutex);
stopped = 1;
pthread_cond_signal(&condition);
@@ -49,6 +50,7 @@ int stop_callback(char *c) {
}
int is_stopped(void *ptr) {
+ (void)ptr; // against unused variable warnings
int is_stop = 0;
pthread_mutex_lock(&mutex);
is_stop = stopped;
@@ -75,16 +77,8 @@ int main(int argc, char **argv) {
port.port_id = portStr;
- C2_Server server;
- server.url = argv[4];
- server.ack_url = argv[5];
- server.identifier = "monitor_directory";
- server.type = REST;
-
nifi_instance *instance = create_instance(instance_str, &port);
- // enable_async_c2(instance, &server, stop_callback, NULL, NULL);
-
flow *new_flow = monitor_directory(instance, directory, 0x00, KEEP_SOURCE);
transmit_to_nifi(instance, new_flow, is_stopped);
diff --git a/nanofi/examples/terminate_handler.c b/nanofi/examples/terminate_handler.c
index 45405d1..999cced 100644
--- a/nanofi/examples/terminate_handler.c
+++ b/nanofi/examples/terminate_handler.c
@@ -30,7 +30,7 @@ void example_terminate_handler() {
exit(0);
}
-int main(int argc, char **argv) {
+int main() {
nifi_port port;
@@ -42,7 +42,7 @@ int main(int argc, char **argv) {
flow *new_flow = create_new_flow(instance);
- processor *generate_proc = add_processor(new_flow, "GenerateFlowFile");
+ add_processor(new_flow, "GenerateFlowFile");
processor *put_proc = add_processor(new_flow, "PutFile");
diff --git a/nanofi/examples/transmit_flow.c b/nanofi/examples/transmit_flow.c
index 7739e54..e822a9b 100644
--- a/nanofi/examples/transmit_flow.c
+++ b/nanofi/examples/transmit_flow.c
@@ -33,8 +33,6 @@ int is_dir(const char *path) {
}
void transfer_file_or_directory(nifi_instance *instance, char *file_or_dir) {
- int size = 1;
-
if (is_dir(file_or_dir)) {
DIR *d;
diff --git a/nanofi/include/api/nanofi.h b/nanofi/include/api/nanofi.h
index ba971d8..64fc9d7 100644
--- a/nanofi/include/api/nanofi.h
+++ b/nanofi/include/api/nanofi.h
@@ -43,7 +43,7 @@ extern "C" {
#define NULL_CHECK(ret_val, ...) \
do { \
const void *_p[] = { __VA_ARGS__ }; \
- int _i; \
+ unsigned int _i; \
for (_i = 0; _i < sizeof(_p)/sizeof(*_p); _i++) { \
if (_p[_i] == NULL) { \
return ret_val; \
@@ -76,7 +76,7 @@ nifi_instance *create_instance_repo(const char *url, nifi_port *port, const char
* @param port remote port the instance connects to
* @return pointer to the new instance
**/
-static nifi_instance *create_instance(const char *url, nifi_port *port){
+static inline nifi_instance *create_instance(const char *url, nifi_port *port){
return create_instance_repo(url, port, "filesystemrepository");
}
diff --git a/nanofi/include/core/log.h b/nanofi/include/core/log.h
index 405b7c4..dda84f6 100644
--- a/nanofi/include/core/log.h
+++ b/nanofi/include/core/log.h
@@ -61,7 +61,7 @@ static const char *log_level_str[trace+1] = { "OFF", "CRITICAL", "ERROR", "WARN"
} while (0)
#endif // C99 compiler support
-static void set_log_level(log_level lvl) {
+static inline void set_log_level(log_level lvl) {
if(lvl >= off && lvl <= trace) {
global_log_level = lvl;
logc(info, "Log level was set to %s", log_level_str[lvl]);
diff --git a/nanofi/include/sitetosite/CPeer.h b/nanofi/include/sitetosite/CPeer.h
index 12af30e..7b618cb 100644
--- a/nanofi/include/sitetosite/CPeer.h
+++ b/nanofi/include/sitetosite/CPeer.h
@@ -53,11 +53,11 @@ struct SiteToSiteCPeer {
enum Bool _owns_resource;
};
-static const char * getURL(const struct SiteToSiteCPeer * peer) {
+static inline const char * getURL(const struct SiteToSiteCPeer * peer) {
return peer->_url;
}
-static void setHostName(struct SiteToSiteCPeer * peer, const char * hostname) {
+static inline void setHostName(struct SiteToSiteCPeer * peer, const char * hostname) {
if(peer->_host) {
free(peer->_host);
}
@@ -74,17 +74,15 @@ static void setHostName(struct SiteToSiteCPeer * peer, const char * hostname) {
peer->_url = (char*)malloc(host_len + 14); // +1 for trailing zero, 1 for ':', at most 5 for port, 7 for "nifi://" suffix
memset(peer->_url, 0, host_len + 14); // make sure to have zero padding no matter the length of the port
strncpy(peer->_host, hostname, host_len);
- strncpy(peer->_url, "nifi://", 7);
- strncpy(peer->_url + 7, hostname, host_len);
+ snprintf(peer->_url, host_len + 14, "nifi://%s:", hostname);
peer->_host[host_len] = '\0';
- peer->_url[host_len + 7] = ':';
if(peer->_port != 0) {
snprintf(peer->_url + host_len + 8, 6, "%d", peer->_port);
}
return;
}
-static void setPort(struct SiteToSiteCPeer * peer, uint16_t port) {
+static inline void setPort(struct SiteToSiteCPeer * peer, uint16_t port) {
peer->_port = port;
if(peer->_url != NULL) {
int i;
@@ -98,7 +96,7 @@ static void setPort(struct SiteToSiteCPeer * peer, uint16_t port) {
}
}
-static void initPeer(struct SiteToSiteCPeer * peer, const char * host, uint16_t port) {
+static inline void initPeer(struct SiteToSiteCPeer * peer, const char * host, uint16_t port) {
peer->_stream = NULL;
peer->_host = NULL;
peer->_url = NULL;
@@ -107,7 +105,7 @@ static void initPeer(struct SiteToSiteCPeer * peer, const char * host, uint16_t
setPort(peer, port);
}
-static void freePeer(struct SiteToSiteCPeer * peer) {
+static inline void freePeer(struct SiteToSiteCPeer * peer) {
closePeer(peer);
setHostName(peer, NULL);
diff --git a/nanofi/include/sitetosite/CRawSocketProtocol.h b/nanofi/include/sitetosite/CRawSocketProtocol.h
index aead12a..b3941db 100644
--- a/nanofi/include/sitetosite/CRawSocketProtocol.h
+++ b/nanofi/include/sitetosite/CRawSocketProtocol.h
@@ -76,23 +76,15 @@ int16_t sendPacket(struct CRawSiteToSiteClient * client, const char * transactio
CTransaction* createTransaction(struct CRawSiteToSiteClient * client, TransferDirection direction);
-static const char * getResourceName() {
+static inline const char * getResourceName() {
return "SocketFlowFileProtocol";
}
-static const char * getCodecResourceName() {
+static inline const char * getCodecResourceName() {
return "StandardFlowFileCodec";
}
-static RespondCodeContext *getRespondCodeContext(RespondCode code) {
- unsigned int i;
- for (i = 0; i < sizeof(respondCodeContext) / sizeof(RespondCodeContext); i++) {
- if (respondCodeContext[i].code == code) {
- return &respondCodeContext[i];
- }
- }
- return NULL;
-}
+RespondCodeContext *getRespondCodeContext(RespondCode code);
// RawSiteToSiteClient Class
struct CRawSiteToSiteClient {
@@ -139,11 +131,11 @@ struct CRawSiteToSiteClient {
int _currentCodecVersionIndex;
};
-static const char * getPortId(const struct CRawSiteToSiteClient * client) {
+static inline const char * getPortId(const struct CRawSiteToSiteClient * client) {
return client->_port_id_str;
}
-static void setPortId(struct CRawSiteToSiteClient * client, const char * id) {
+static inline void setPortId(struct CRawSiteToSiteClient * client, const char * id) {
strncpy(client->_port_id_str, id, 37);
client->_port_id_str[36] = '\0';
int i;
@@ -152,23 +144,23 @@ static void setPortId(struct CRawSiteToSiteClient * client, const char * id) {
}
}
-static void setBatchSize(struct CRawSiteToSiteClient *client, uint64_t size) {
+static inline void setBatchSize(struct CRawSiteToSiteClient *client, uint64_t size) {
client->_batch_size = size;
}
-static void setBatchCount(struct CRawSiteToSiteClient *client, uint64_t count) {
+static inline void setBatchCount(struct CRawSiteToSiteClient *client, uint64_t count) {
client->_batch_count = count;
}
-static void setBatchDuration(struct CRawSiteToSiteClient *client, uint64_t duration) {
+static inline void setBatchDuration(struct CRawSiteToSiteClient *client, uint64_t duration) {
client->_batch_duration = duration;
}
-static uint64_t getTimeOut(const struct CRawSiteToSiteClient *client) {
+static inline uint64_t getTimeOut(const struct CRawSiteToSiteClient *client) {
return client->_timeout;
}
-static void initRawClient(struct CRawSiteToSiteClient *client, struct SiteToSiteCPeer * peer) {
+static inline void initRawClient(struct CRawSiteToSiteClient *client, struct SiteToSiteCPeer * peer) {
client->_owns_resource = False;
client->_peer = peer;
client->_peer_state = IDLE;
@@ -191,7 +183,7 @@ static void initRawClient(struct CRawSiteToSiteClient *client, struct SiteToSite
memset(client->_description_buffer, 0, DESCRIPTION_BUFFER_SIZE);
}
-static struct CRawSiteToSiteClient* createClient(const char * host, uint16_t port, const char * nifi_port) {
+static inline struct CRawSiteToSiteClient* createClient(const char * host, uint16_t port, const char * nifi_port) {
struct SiteToSiteCPeer * peer = (struct SiteToSiteCPeer *)malloc(sizeof(struct SiteToSiteCPeer));
initPeer(peer, host, port);
struct CRawSiteToSiteClient* client = (struct CRawSiteToSiteClient*)malloc(sizeof(struct CRawSiteToSiteClient));
@@ -201,7 +193,7 @@ static struct CRawSiteToSiteClient* createClient(const char * host, uint16_t por
return client;
}
-static void destroyClient(struct CRawSiteToSiteClient * client){
+static inline void destroyClient(struct CRawSiteToSiteClient * client){
tearDown(client);
if(client->_owns_resource == True) {
freePeer(client->_peer);
diff --git a/nanofi/include/sitetosite/CSiteToSite.h b/nanofi/include/sitetosite/CSiteToSite.h
index a72d6b6..83cd98b 100644
--- a/nanofi/include/sitetosite/CSiteToSite.h
+++ b/nanofi/include/sitetosite/CSiteToSite.h
@@ -220,36 +220,6 @@ typedef struct {
const char *description; int hasDescription;
} RespondCodeContext;
-
-
-// Request Type Str
-static const char *RequestTypeStr[MAX_REQUEST_TYPE] = { "NEGOTIATE_FLOWFILE_CODEC", "REQUEST_PEER_LIST", "SEND_FLOWFILES", "RECEIVE_FLOWFILES", "SHUTDOWN" };
-static RespondCodeContext respondCodeContext[21] = { //NOLINT
- { RESERVED, "Reserved for Future Use", 0 }, //NOLINT
- { PROPERTIES_OK, "Properties OK", 0 }, //NOLINT
- { UNKNOWN_PROPERTY_NAME, "Unknown Property Name", 1 }, //NOLINT
- { ILLEGAL_PROPERTY_VALUE, "Illegal Property Value", 1 }, //NOLINT
- { MISSING_PROPERTY, "Missing Property", 1 }, //NOLINT
- { CONTINUE_TRANSACTION, "Continue Transaction", 0 }, //NOLINT
- { FINISH_TRANSACTION, "Finish Transaction", 0 }, //NOLINT
- { CONFIRM_TRANSACTION, "Confirm Transaction", 1 }, //NOLINT
- { TRANSACTION_FINISHED, "Transaction Finished", 0 }, //NOLINT
- { TRANSACTION_FINISHED_BUT_DESTINATION_FULL, "Transaction Finished But Destination is Full", 0 }, //NOLINT
- { CANCEL_TRANSACTION, "Cancel Transaction", 1 }, //NOLINT
- { BAD_CHECKSUM, "Bad Checksum", 0 }, //NOLINT
- { MORE_DATA, "More Data Exists", 0 }, //NOLINT
- { NO_MORE_DATA, "No More Data Exists", 0 }, //NOLINT
- { UNKNOWN_PORT, "Unknown Port", 0 }, //NOLINT
- { PORT_NOT_IN_VALID_STATE, "Port Not in a Valid State", 1 }, //NOLINT
- { PORTS_DESTINATION_FULL, "Port's Destination is Full", 0 }, //NOLINT
- { UNAUTHORIZED, "User Not Authorized", 1 }, //NOLINT
- { ABORT, "Abort", 1 }, //NOLINT
- { UNRECOGNIZED_RESPONSE_CODE, "Unrecognized Response Code", 0 }, //NOLINT
- { END_OF_STREAM, "End of Stream", 0 }
-};
-
-
-
// Transaction Class
typedef struct {
@@ -278,7 +248,7 @@ typedef struct {
UT_hash_handle hh;
} CTransaction;
-static void InitTransaction(CTransaction * transaction, TransferDirection direction, cstream * stream) {
+static inline void InitTransaction(CTransaction * transaction, TransferDirection direction, cstream * stream) {
transaction->_stream = stream;
transaction->_state = TRANSACTION_STARTED;
transaction->_direction = direction;
@@ -294,35 +264,35 @@ static void InitTransaction(CTransaction * transaction, TransferDirection direct
transaction->_uuid_str[36]='\0';
}
-static TransferDirection getDirection(const CTransaction * transaction) {
+static inline TransferDirection getDirection(const CTransaction * transaction) {
return transaction->_direction;
}
-static TransactionState getState(const CTransaction * transaction) {
+static inline TransactionState getState(const CTransaction * transaction) {
return transaction->_state;
}
-static int isDataAvailable(const CTransaction * transaction) {
+static inline int isDataAvailable(const CTransaction * transaction) {
return transaction->_dataAvailable;
}
-static void setDataAvailable(CTransaction * transaction, int available) {
+static inline void setDataAvailable(CTransaction * transaction, int available) {
transaction->_dataAvailable = available;
}
-static uint64_t getCRC(const CTransaction * transaction) {
+static inline uint64_t getCRC(const CTransaction * transaction) {
return transaction->_crc;
}
-static const char * getUUIDStr(const CTransaction * transation) {
+static inline const char * getUUIDStr(const CTransaction * transation) {
return transation->_uuid_str;
}
-static void updateCRC(CTransaction * transaction, const uint8_t *buffer, uint32_t length) {
+static inline void updateCRC(CTransaction * transaction, const uint8_t *buffer, uint32_t length) {
transaction->_crc = crc32(transaction->_crc, buffer, length);
}
-static int writeData(CTransaction * transaction, const uint8_t *value, int size) {
+static inline int writeData(CTransaction * transaction, const uint8_t *value, int size) {
int ret = write_buffer(value, size, transaction->_stream);
if (ret > 0) {
transaction->_crc = crc32(transaction->_crc, value, ret);
@@ -330,7 +300,7 @@ static int writeData(CTransaction * transaction, const uint8_t *value, int size)
return ret;
}
-static int readData(CTransaction * transaction, uint8_t *buf, int buflen) {
+static inline int readData(CTransaction * transaction, uint8_t *buf, int buflen) {
int ret = read_buffer(buf, buflen, transaction->_stream);
if (ret > 0) {
transaction->_crc = crc32(transaction->_crc, buf, ret);
@@ -338,28 +308,28 @@ static int readData(CTransaction * transaction, uint8_t *buf, int buflen) {
return ret;
}
-static int write_uint64t(CTransaction * transaction, uint64_t base_value) {
+static inline int write_uint64t(CTransaction * transaction, uint64_t base_value) {
const uint64_t value = htonll_r(base_value);
const uint8_t * buf = (uint8_t*)(&value);
return writeData(transaction, buf, sizeof(uint64_t));
}
-static int write_uint32t(CTransaction * transaction, uint32_t base_value) {
+static inline int write_uint32t(CTransaction * transaction, uint32_t base_value) {
const uint32_t value = htonl(base_value);
const uint8_t * buf = (uint8_t*)(&value);
return writeData(transaction, buf, sizeof(uint32_t));
}
-static int write_uint16t(CTransaction * transaction, uint16_t base_value) {
+static inline int write_uint16t(CTransaction * transaction, uint16_t base_value) {
const uint16_t value = htons(base_value);
const uint8_t *buf = (uint8_t *) (&value);
return writeData(transaction, buf, sizeof(uint16_t));
}
-static int write_UTF_len(CTransaction * transaction, const char * str, size_t len, enum Bool widen) {
+static inline int write_UTF_len(CTransaction * transaction, const char * str, size_t len, enum Bool widen) {
if (len > 65535) {
return -1;
}
@@ -387,7 +357,7 @@ static int write_UTF_len(CTransaction * transaction, const char * str, size_t le
return ret;
}
-static int write_UTF(CTransaction * transaction, const char * str, enum Bool widen) {
+static inline int write_UTF(CTransaction * transaction, const char * str, enum Bool widen) {
return write_UTF_len(transaction, str, strlen(str), widen);
}
@@ -401,7 +371,7 @@ typedef struct {
const char * payload_;
} CDataPacket;
-static void initPacket(CDataPacket * packet, CTransaction* transaction, const attribute_set * attributes, const char * payload) {
+static inline void initPacket(CDataPacket * packet, CTransaction* transaction, const attribute_set * attributes, const char * payload) {
packet->payload_ = payload;
packet->transaction_ = transaction;
packet->_attributes = attributes;
diff --git a/nanofi/src/api/ecu.c b/nanofi/src/api/ecu.c
index 709c681..d557a7f 100644
--- a/nanofi/src/api/ecu.c
+++ b/nanofi/src/api/ecu.c
@@ -14,6 +14,10 @@
#include <signal.h>
#include <sys/stat.h>
+#ifndef UNUSED
+#define UNUSED(x) (void)(x)
+#endif
+
processor_params * procparams = NULL;
volatile sig_atomic_t stopped = 0;
@@ -100,7 +104,7 @@ int validate_input_params(tailfile_input_params * params, uint64_t * intrvl, uin
void setup_signal_action() {
struct sigaction action;
- memset(&action, 0, sizeof(sigaction));
+ memset(&action, 0, sizeof(action));
action.sa_handler = signal_handler;
sigaction(SIGTERM, &action, NULL);
sigaction(SIGINT, &action, NULL);
@@ -112,7 +116,7 @@ nifi_proc_params setup_nifi_processor(tailfile_input_params * input_params, cons
port.port_id = input_params->nifi_port_uuid;
nifi_instance * instance = create_instance(input_params->instance, &port);
- add_custom_processor(processor_name, callback);
+ add_custom_processor(processor_name, callback, NULL);
standalone_processor * proc = create_processor(processor_name, instance);
params.instance = instance;
params.processor = proc;
@@ -241,7 +245,7 @@ void add_processor_properties(const char * uuid, struct proc_properties * const
}
void on_trigger_tailfilechunk(processor_session * ps, processor_context * ctx) {
-
+ UNUSED(ps);
char uuid_str[37];
get_proc_uuid_from_context(ctx, uuid_str);
@@ -410,6 +414,7 @@ struct proc_properties * get_properties(const char * uuid, processor_context * c
}
void on_trigger_logaggregator(processor_session * ps, processor_context * ctx) {
+ UNUSED(ps);
char uuid_str[37];
get_proc_uuid_from_context(ctx, uuid_str);
@@ -468,6 +473,7 @@ flow_file_list * add_flow_file_to_proc_params(const char * uuid, flow_file_recor
}
void on_trigger_tailfiledelimited(processor_session * ps, processor_context * ctx) {
+ UNUSED(ps);
char uuid_str[37];
get_proc_uuid_from_context(ctx, uuid_str);
diff --git a/nanofi/src/api/nanofi.cpp b/nanofi/src/api/nanofi.cpp
index 326759d..1ba73af 100644
--- a/nanofi/src/api/nanofi.cpp
+++ b/nanofi/src/api/nanofi.cpp
@@ -457,7 +457,11 @@ int get_content(const flow_file_record* ff, uint8_t* target, int size) {
return stream->read(target, size);
} else {
file_buffer fb = file_to_buffer(ff->contentLocation);
- size_t copy_size = size < fb.file_len ? size : gsl::narrow<size_t>(fb.file_len);
+ if (size < 0) {
+ return 0;
+ }
+
+ size_t copy_size = static_cast<size_t>(size) < fb.file_len ? size : gsl::narrow<size_t>(fb.file_len);
memcpy(target, fb.buffer, copy_size*sizeof(uint8_t));
free(fb.buffer);
return copy_size;
diff --git a/nanofi/src/core/file_utils.c b/nanofi/src/core/file_utils.c
index d3c1547..1cc7228 100644
--- a/nanofi/src/core/file_utils.c
+++ b/nanofi/src/core/file_utils.c
@@ -48,6 +48,7 @@ const char * get_separator(int force_posix) {
return "\\";
}
#endif
+ (void)force_posix; // against unused variable warnings
return "/";
}
@@ -69,7 +70,6 @@ void remove_directory(const char * dir_path) {
return;
}
- uint64_t path_len = strlen(dir_path);
struct dirent * dir;
DIR * d = opendir(dir_path);
diff --git a/nanofi/src/cxx/Plan.cpp b/nanofi/src/cxx/Plan.cpp
index 9edeb6c..4c52e67 100644
--- a/nanofi/src/cxx/Plan.cpp
+++ b/nanofi/src/cxx/Plan.cpp
@@ -89,8 +89,6 @@ std::shared_ptr<core::Processor> ExecutionPlan::addProcessor(const std::shared_p
return nullptr;
}
- utils::Identifier uuid = id_generator_->generate();
-
processor->setStreamFactory(stream_factory);
// initialize the processor
processor->initialize();
diff --git a/nanofi/src/sitetosite/CRawSocketProtocol.c b/nanofi/src/sitetosite/CRawSocketProtocol.c
index 9a4062c..2b345c8 100644
--- a/nanofi/src/sitetosite/CRawSocketProtocol.c
+++ b/nanofi/src/sitetosite/CRawSocketProtocol.c
@@ -64,6 +64,32 @@ static const char *HandShakePropertyStr[MAX_HANDSHAKE_PROPERTY] = {
*/
"BATCH_DURATION" };
+// Request Type Str
+static const char *RequestTypeStr[MAX_REQUEST_TYPE] = { "NEGOTIATE_FLOWFILE_CODEC", "REQUEST_PEER_LIST", "SEND_FLOWFILES", "RECEIVE_FLOWFILES", "SHUTDOWN" };
+static RespondCodeContext respondCodeContext[21] = { //NOLINT
+ { RESERVED, "Reserved for Future Use", 0 }, //NOLINT
+ { PROPERTIES_OK, "Properties OK", 0 }, //NOLINT
+ { UNKNOWN_PROPERTY_NAME, "Unknown Property Name", 1 }, //NOLINT
+ { ILLEGAL_PROPERTY_VALUE, "Illegal Property Value", 1 }, //NOLINT
+ { MISSING_PROPERTY, "Missing Property", 1 }, //NOLINT
+ { CONTINUE_TRANSACTION, "Continue Transaction", 0 }, //NOLINT
+ { FINISH_TRANSACTION, "Finish Transaction", 0 }, //NOLINT
+ { CONFIRM_TRANSACTION, "Confirm Transaction", 1 }, //NOLINT
+ { TRANSACTION_FINISHED, "Transaction Finished", 0 }, //NOLINT
+ { TRANSACTION_FINISHED_BUT_DESTINATION_FULL, "Transaction Finished But Destination is Full", 0 }, //NOLINT
+ { CANCEL_TRANSACTION, "Cancel Transaction", 1 }, //NOLINT
+ { BAD_CHECKSUM, "Bad Checksum", 0 }, //NOLINT
+ { MORE_DATA, "More Data Exists", 0 }, //NOLINT
+ { NO_MORE_DATA, "No More Data Exists", 0 }, //NOLINT
+ { UNKNOWN_PORT, "Unknown Port", 0 }, //NOLINT
+ { PORT_NOT_IN_VALID_STATE, "Port Not in a Valid State", 1 }, //NOLINT
+ { PORTS_DESTINATION_FULL, "Port's Destination is Full", 0 }, //NOLINT
+ { UNAUTHORIZED, "User Not Authorized", 1 }, //NOLINT
+ { ABORT, "Abort", 1 }, //NOLINT
+ { UNRECOGNIZED_RESPONSE_CODE, "Unrecognized Response Code", 0 }, //NOLINT
+ { END_OF_STREAM, "End of Stream", 0 }
+};
+
typedef struct {
const char * name;
char value[40];
@@ -352,7 +378,7 @@ CTransaction* createTransaction(struct CRawSiteToSiteClient * client, TransferDi
if (ret <= 0)
return transaction;
}
-
+
switch (code) {
case MORE_DATA:
dataAvailable = 1;
@@ -387,6 +413,16 @@ CTransaction* createTransaction(struct CRawSiteToSiteClient * client, TransferDi
}
}
+RespondCodeContext *getRespondCodeContext(RespondCode code) {
+ unsigned int i;
+ for (i = 0; i < sizeof(respondCodeContext) / sizeof(RespondCodeContext); i++) {
+ if (respondCodeContext[i].code == code) {
+ return &respondCodeContext[i];
+ }
+ }
+ return NULL;
+}
+
int transmitPayload(struct CRawSiteToSiteClient * client, const char * payload, const attribute_set * attributes) {
CTransaction* transaction = NULL;
diff --git a/nanofi/tests/CAPITests.cpp b/nanofi/tests/CAPITests.cpp
index 1590c10..c425703 100644
--- a/nanofi/tests/CAPITests.cpp
+++ b/nanofi/tests/CAPITests.cpp
@@ -25,7 +25,7 @@
const std::string test_file_content = "C API raNdOMcaSe test d4t4 th1s is!";
const std::string test_file_name = "tstFile.ext";
-static nifi_instance *create_instance_obj(const char *name = "random_instance") {
+static nifi_instance *create_instance_obj() {
nifi_port port;
auto port_str = utils::IdGenerator::getIdGenerator()->generate().to_string();
port.port_id = const_cast<char*>(port_str.c_str());
@@ -238,7 +238,7 @@ TEST_CASE("Test manipulation of attributes", "[testAttributes]") {
bool test_attr_found = false;
bool updated_attr_found = false;
- for (int i = 0; i < attr_set.size; ++i) {
+ for (size_t i = 0; i < attr_set.size; ++i) {
if (strcmp(attr_set.attributes[i].key, test_attr.key) == 0) {
test_attr_found = true;
REQUIRE(std::string(static_cast<char*>(attr_set.attributes[i].value), attr_set.attributes[i].value_size) == new_testattr_value);
diff --git a/nanofi/tests/CSite2SiteTests.cpp b/nanofi/tests/CSite2SiteTests.cpp
index 120787d..ebbb449 100644
--- a/nanofi/tests/CSite2SiteTests.cpp
+++ b/nanofi/tests/CSite2SiteTests.cpp
@@ -115,7 +115,7 @@ void accept_transfer(minifi::io::BaseStream* stream, const std::string& crcstr,
s2s_data.request_type_ok = true;
stream->read(s2s_data.attr_num);
std::string key, value;
- for(int i = 0; i < s2s_data.attr_num; ++i) {
+ for(uint32_t i = 0; i < s2s_data.attr_num; ++i) {
stream->read(key, true);
stream->read(value, true);
s2s_data.attributes[key] = value;
@@ -142,7 +142,7 @@ void sunny_path_bootstrap(minifi::io::BaseStream* stream, TransferState& transfe
// just consume handshake data
bool found_codec = false;
- int read_len = 0;
+ size_t read_len = 0;
while(!found_codec) {
uint8_t handshake_data[1000];
int actual_len = stream->read(handshake_data+read_len, 1000-read_len);
diff --git a/nanofi/tests/CTestsBase.h b/nanofi/tests/CTestsBase.h
index 8c37e3a..e3a6cfe 100644
--- a/nanofi/tests/CTestsBase.h
+++ b/nanofi/tests/CTestsBase.h
@@ -94,7 +94,7 @@ public:
port.port_id = const_cast<char*>(port_str.c_str());
const char * instance_str = "nifi";
instance_ = create_instance(instance_str, &port);
- add_custom_processor(processor_name.c_str(), callback);
+ add_custom_processor(processor_name.c_str(), callback, nullptr);
processor_ = create_processor(processor_name.c_str(), instance_);
}
diff --git a/nanofi/tests/CUUIDTests.cpp b/nanofi/tests/CUUIDTests.cpp
index 0802e31..03b0c75 100644
--- a/nanofi/tests/CUUIDTests.cpp
+++ b/nanofi/tests/CUUIDTests.cpp
@@ -28,7 +28,7 @@ bool verify_uuid(const char * uuid) {
if(strlen(uuid_str.c_str()) != 36) {
return false;
}
- for(int i = 0; i < uuid_str.length(); ++i) {
+ for(std::size_t i = 0; i < uuid_str.length(); ++i) {
if(i % 5 == 3 && i > 5 && i < 25) {
if (uuid_str[i] != '-') {
return false;
diff --git a/python/library/CMakeLists.txt b/python/library/CMakeLists.txt
index 4a94271..ca7204c 100644
--- a/python/library/CMakeLists.txt
+++ b/python/library/CMakeLists.txt
@@ -23,6 +23,7 @@ IF(POLICY CMP0048)
CMAKE_POLICY(SET CMP0048 OLD)
ENDIF(POLICY CMP0048)
+include_directories(SYSTEM ../../thirdparty/)
include_directories(../../nanofi/include/ ../../libminifi/include ../../libminifi/include/c2 ../../libminifi/include/c2/protocols/ ../../libminifi/include/core/state ./libminifi/include/core/statemanagement/metrics ../../libminifi/include/core/yaml ../../libminifi/include/core ../../thirdparty/)
if(WIN32)
include_directories(../../libminifi/opsys/win)
diff --git a/thirdparty/open62541/open62541.patch b/thirdparty/open62541/open62541.patch
index b6cfaf4..2d36e2a 100644
--- a/thirdparty/open62541/open62541.patch
+++ b/thirdparty/open62541/open62541.patch
@@ -40,3 +40,16 @@ index d426e1da..5f1a4044 100644
endif()
if(UA_ENABLE_AMALGAMATION)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94ceb127..5d0ea914 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -405,7 +405,7 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID
+ -fno-strict-aliasing # fewer compiler assumptions about pointer types
+ -fexceptions # recommended for multi-threaded C code, also in combination with C++ code
+ )
+- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
++ # set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
+
+ if (NOT MINGW)
+ if(UA_ENABLE_HARDENING)
diff --git a/thirdparty/pybind11/include/pybind11/cast.h b/thirdparty/pybind11/include/pybind11/cast.h
index 80abb2b..ee9bb3c 100644
--- a/thirdparty/pybind11/include/pybind11/cast.h
+++ b/thirdparty/pybind11/include/pybind11/cast.h
@@ -2008,7 +2008,7 @@ private:
args_list.append(a);
}
- void process(list &/*args_list*/, arg_v a) {
+ void process(list& /*args_list*/, arg_v a) {
if (!a.name)
#if defined(NDEBUG)
nameless_argument_error();
@@ -2033,7 +2033,7 @@ private:
m_kwargs[a.name] = a.value;
}
- void process(list &/*args_list*/, detail::kwargs_proxy kp) {
+ void process(list& /*args_list*/, detail::kwargs_proxy kp) {
if (!kp)
return;
for (const auto &k : reinterpret_borrow<dict>(kp)) {