From 12494aac45d00e1440c9f75654ad025445e6cd6d Mon Sep 17 00:00:00 2001 From: Tomer Lev Date: Tue, 1 Nov 2022 18:26:08 +0200 Subject: [PATCH] Fixed initial CR comments --- .cirrus.yml | 2 +- CMakeLists.txt | 15 --------------- COPYING.3rdparty | 28 ++++++++++++++++++++++++++++ src/CMakeLists.txt | 1 + src/IntrusivePtr.h | 2 +- src/fuzzers/FuzzBuffer.cc | 4 ++-- src/plugin/Manager.cc | 1 + src/util.h | 2 -- 8 files changed, 34 insertions(+), 21 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index faf44239ec..85902c4d81 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -59,7 +59,7 @@ ci_template: &CI_TEMPLATE only_if: > ( $CIRRUS_REPO_NAME != 'zeek-security' || $CIRRUS_OS != "darwin" ) && ( ( $CIRRUS_PR != '' && $CIRRUS_BRANCH !=~ 'dependabot/.*' ) || - ( $CIRRUS_REPO_NAME == 'ms-zeek' && + ( $CIRRUS_REPO_NAME == 'zeek' && ( $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'release/.*' diff --git a/CMakeLists.txt b/CMakeLists.txt index f629292c0e..e811f2948f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,25 +103,10 @@ if ( MSVC ) # Disable Spicy as it is not yet supported in Windows. set(DISABLE_SPICY true) - - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) else () include(GNUInstallDirs) endif () -if ( CMAKE_SYSTEM_NAME STREQUAL Linux ) - set(CMAKE_DL_LIBS pthread ${CMAKE_DL_LIBS}) -endif () - -if ( NOT CMAKE_INSTALL_LIBDIR ) - # Currently, some sub-projects may use GNUInstallDirs.cmake to choose the - # library install dir, while others just default to "lib". For sake of - # consistency, this just overrides the former to always use "lib" in case - # it would have chosen something else, like "lib64", but a thing for the - # future may be to standardize all sub-projects to use GNUInstallDirs. - set(CMAKE_INSTALL_LIBDIR lib) -endif () - include(cmake/CommonCMakeConfig.cmake) include(cmake/FindClangTidy.cmake) include(cmake/CheckCompilerArch.cmake) diff --git a/COPYING.3rdparty b/COPYING.3rdparty index e984d6eb40..a023dc9efc 100644 --- a/COPYING.3rdparty +++ b/COPYING.3rdparty @@ -754,3 +754,31 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +============================================================================== + +%%% auxil/libunistd + +============================================================================== + +The MIT License (MIT) + +Copyright (c) 2015 Robin Rowe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dafb4662f4..2fe0a31c1e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -491,6 +491,7 @@ elseif (${COMPILER_ARCHITECTURE} STREQUAL "power") elseif(${COMPILER_ARCHITECTURE} STREQUAL "x86_64") if (MSVC) set(_avx_flag /arch:AVX2) + # Using an undocumentd compiler flag: https://stackoverflow.com/questions/64053597/how-do-i-enable-sse4-1-and-sse3-but-not-avx-in-msvc/69328426#69328426 set(_sse_flag /d2archSSE42) else() set(_avx_flag -mavx2) diff --git a/src/IntrusivePtr.h b/src/IntrusivePtr.h index bdeb501e85..7d9578d29f 100644 --- a/src/IntrusivePtr.h +++ b/src/IntrusivePtr.h @@ -28,7 +28,7 @@ struct NewRef }; /** - * This has to be forward decalred and known here in order for us to be able + * This has to be forward declared and known here in order for us to be able * cast this in the `Unref` function. */ class OpaqueVal; diff --git a/src/fuzzers/FuzzBuffer.cc b/src/fuzzers/FuzzBuffer.cc index 81251473a4..5ea074f5c3 100644 --- a/src/fuzzers/FuzzBuffer.cc +++ b/src/fuzzers/FuzzBuffer.cc @@ -2,12 +2,12 @@ #define _GNU_SOURCE #endif +#include "zeek/fuzzers/FuzzBuffer.h" + #ifdef _MSC_VER #include #endif -#include "zeek/fuzzers/FuzzBuffer.h" - #include namespace zeek::detail diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index fa127419c3..e52185bd33 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -162,6 +162,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir) bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_not_found, std::vector* errors) { +// Loading dynamic plugins is not currently supported on Windows platform. #if defined(_MSC_VER) return false; #else diff --git a/src/util.h b/src/util.h index 8919b8276a..7019560058 100644 --- a/src/util.h +++ b/src/util.h @@ -110,8 +110,6 @@ namespace zeek class ODesc; class RecordVal; - - namespace util { namespace detail