diff options
241 files changed, 1715 insertions, 3471 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f1fbb1bb1..70ad660bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,5 @@ -# This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions) -cmake_minimum_required(VERSION 2.4 FATAL_ERROR) -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) +# This usage of CMake requires at least version 2.8 +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) # If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows) if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32) @@ -13,60 +10,6 @@ endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT W project(Anope CXX) enable_language(C) -# Detect the version of CMake for the later conditional checks -execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) -string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}") -string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}") -if(HAS_PATCH) - string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}") - string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}") -else(HAS_PATCH) - string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}") - if(HAS_DOT) - string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}") - string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}") - else(HAS_DOT) - string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}") - if(MINOR_VERSION STREQUAL "4-1\n") - set(PATCH_VERSION 1) - else(MINOR_VERSION STREQUAL "4-1\n") - set(PATCH_VERSION 0) - endif(MINOR_VERSION STREQUAL "4-1\n") - set(MINOR_VERSION 4) - endif(HAS_DOT) -endif(HAS_PATCH) - -# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does -if(MINOR_VERSION GREATER 5) - set(CMAKE26_OR_BETTER TRUE) - set(CMAKE248_OR_BETTER TRUE) - set(CMAKE244_OR_BETTER TRUE) - set(CMAKE242_OR_BETTER TRUE) -else(MINOR_VERSION GREATER 5) - set(CMAKE26_OR_BETTER FALSE) - # Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is non-existant in earlier versions - if(PATCH_VERSION GREATER 7) - set(CMAKE248_OR_BETTER TRUE) - set(CMAKE244_OR_BETTER TRUE) - set(CMAKE242_OR_BETTER TRUE) - else(PATCH_VERSION GREATER 7) - set(CMAKE248_OR_BETTER FALSE) - # Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are non-existant in earlier versions - if(PATCH_VERSION GREATER 3) - set(CMAKE244_OR_BETTER TRUE) - set(CMAKE242_OR_BETTER TRUE) - else(PATCH_VERSION GREATER 3) - set(CMAKE244_OR_BETTER FALSE) - # ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions - if(PATCH_VERSION GREATER 1) - set(CMAKE242_OR_BETTER TRUE) - else(PATCH_VERSION GREATER 1) - set(CMAKE242_OR_BETTER FALSE) - endif(PATCH_VERSION GREATER 1) - endif(PATCH_VERSION GREATER 3) - endif(PATCH_VERSION GREATER 7) -endif(MINOR_VERSION GREATER 5) - # Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake) @@ -75,110 +18,6 @@ include(Anope) # Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language set(ENV{LC_ALL} C) -# Start with empty defaults for library and include directories, to be used by GNU compilers only -set(DEFAULT_LIBRARY_DIRS) -set(DEFAULT_INCLUDE_DIRS) - -# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes -if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # First look for the compiler's default library directories - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE) - # Find only the part after "libraries: " - string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}") - # Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line - if(NOT MINGW) - string(REGEX REPLACE ":" ";" LIBRARIES ${LINE}) - else(NOT MINGW) - set(LIBRARIES "${LINE}") - endif(NOT MINGW) - # Iterate through the libraries - foreach(LIBRARY ${LIBRARIES}) - # Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways - string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR) - if(NOT FIRST_CHAR STREQUAL "=") - # If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories - get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE) - append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY}) - endif(NOT FIRST_CHAR STREQUAL "=") - endforeach(LIBRARY) - # Remove duplicate entries from the list - if(DEFAULT_LIBRARY_DIRS) - remove_list_duplicates(DEFAULT_LIBRARY_DIRS) - endif(DEFAULT_LIBRARY_DIRS) - # Create a temporary file to test for the default include directories - FILE(WRITE empty.cpp "") - # Next, we look for the compiler's default include directories - # Run the command to find the default include directories - execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) - # Remove the empty file, it is no longer needed - FILE(REMOVE empty.cpp) - # Convert the new lines to semicolons - string(REGEX REPLACE "\n" ";" LINES ${LINES}) - # Temporary variable saying if we are in the search list or not - set(IN_SEARCH_LIST FALSE) - # Iterate through the lines - foreach(LINE ${LINES}) - # If the line has the following on it, the next lines will contain directory names - if(LINE STREQUAL "#include <...> search starts here:") - set(IN_SEARCH TRUE) - else(LINE STREQUAL "#include <...> search starts here:") - # If the line has the following on it, we hit the end of the list - if(LINE STREQUAL "End of search list.") - set(IN_SEARCH FALSE) - else(LINE STREQUAL "End of search list.") - # If we are within the block between the above two lines... - if(IN_SEARCH) - # Get everything but the first character of the line - string(LENGTH ${LINE} LINE_LENGTH) - math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1") - string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE) - # For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off - string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE}) - # Convert the path to an absolute one, just in case it wasn't - get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE) - # Add that directory to the list of default include directories - append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE}) - endif(IN_SEARCH) - endif(LINE STREQUAL "End of search list.") - endif(LINE STREQUAL "#include <...> search starts here:") - endforeach(LINE) - # Remove duplicate entries from the list - if(DEFAULT_INCLUDE_DIRS) - remove_list_duplicates(DEFAULT_INCLUDE_DIRS) - endif(DEFAULT_INCLUDE_DIRS) -endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - -# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed -if(MSVC) - # If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path - # Look for the 2008 SDK under HKLM first - get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) - if(WSDK2008_PATH STREQUAL "/registry") - # If not found, look for the 2003 SDK under HKLM - get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE) - if(WSDK2003_PATH STREQUAL "/registry") - # If not found, look for the 2008 SDK under HKCU - get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) - if(WSDK2008_PATH STREQUAL "/registry") - # If not found, look for the 2003 SDK under HKCU - get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE) - if(WSDK2003_PATH STREQUAL "/registry") - # The SDK was never found, set the path to nothing - set(WSDK_PATH "") - else(WSDK2003_PATH STREQUAL "/registry") - set(WSDK_PATH "${WSDK2003_PATH}") - endif(WSDK2003_PATH STREQUAL "/registry") - else(WSDK2008_PATH STREQUAL "/registry") - set(WSDK_PATH "${WSDK2008_PATH}") - endif(WSDK2008_PATH STREQUAL "/registry") - else(WSDK2003_PATH STREQUAL "/registry") - set(WSDK_PATH "${WSDK2003_PATH}") - endif(WSDK2003_PATH STREQUAL "/registry") - else(WSDK2008_PATH STREQUAL "/registry") - set(WSDK_PATH "${WSDK2008_PATH}") - endif(WSDK2008_PATH STREQUAL "/registry") -endif(MSVC) - # If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition # and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE # to Debug @@ -191,23 +30,20 @@ if(NOT MSVC) endif(CMAKE_BUILD_TYPE) endif(NOT MSVC) -# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake) -if(MINGW) - set(CMAKE_RC_COMPILER_INIT windres) - enable_language(RC) - set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>") -endif(MINGW) - # Include the checking functions used later in this CMakeLists.txt include(CheckFunctionExists) include(CheckIncludeFile) include(CheckTypeSize) include(CheckLibraryExists) -if(CMAKE244_OR_BETTER) - include(CheckCXXCompilerFlag) -else(CMAKE244_OR_BETTER) - include(TestCXXAcceptsFlag) -endif(CMAKE244_OR_BETTER) +include(CheckCXXCompilerFlag) + +if(NOT MSVC) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + if(NOT COMPILER_SUPPORTS_CXX11) + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a newer compiler.") + endif(NOT COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif(NOT MSVC) # If extra include directories were specified, tell cmake about them. if(EXTRA_INCLUDE) @@ -224,7 +60,6 @@ find_package(Gettext) # Add an optional variable for using run-cc.pl for building, Perl will be checked later regardless of this setting option(USE_RUN_CC_PL "Use run-cc.pl for building" OFF) -option(USE_PCH "Use precompiled headers" OFF) # Use the following directories as includes # Note that it is important the binary include directory comes before the @@ -257,25 +92,14 @@ else(MSVC) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore") endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # If we aren't on a *nix system, we are using MinGW - else(UNIX) - # Also, if we are building under MinGW, add another define for MinGW - if(MINGW) - add_definitions(-DMINGW) - endif(MINGW) endif(UNIX) endif(MSVC) # If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags if(CMAKE_DL_LIBS) - append_to_list(LINK_LIBS ${CMAKE_DL_LIBS}) + list(APPEND LINK_LIBS ${CMAKE_DL_LIBS}) endif(CMAKE_DL_LIBS) -# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries -if(MINGW) - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}") -endif(MINGW) - # Under Windows, we set the executable name for Anope to be anope if(WIN32) set(PROGRAM_NAME anope) @@ -287,13 +111,7 @@ endif(WIN32) # If we are not using Visual Studio, we'll run the following checks if(NOT MSVC) # Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works - if(CMAKE244_OR_BETTER) - # If using CMake 2.4.4 or better, we can use check_cxx_compiler_flag - check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG) - else(CMAKE244_OR_BETTER) - # If using CMake 2.4.3 or older, we will use check_cxx_accepts_flags instead - check_cxx_accepts_flag(-pipe HAVE_PIPE_FLAG) - endif(CMAKE244_OR_BETTER) + check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG) # If the flag was accepted, add it to the list of flags if(HAVE_PIPE_FLAG) set(CXXFLAGS "${CXXFLAGS} -pipe") @@ -304,12 +122,12 @@ if(NOT MSVC) # Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed check_library_exists(socket socket "" HAVE_SOCKET_LIB) if(HAVE_SOCKET_LIB) - append_to_list(LINK_LIBS socket) + list(APPEND LINK_LIBS socket) endif(HAVE_SOCKET_LIB) # Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed check_library_exists(nsl inet_addr "" HAVE_NSL_LIB) if(HAVE_NSL_LIB) - append_to_list(LINK_LIBS nsl) + list(APPEND LINK_LIBS nsl) endif(HAVE_NSL_LIB) # Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed check_library_exists(pthread pthread_create "" HAVE_PTHREAD) @@ -337,14 +155,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINF set(DEBUG_BUILD TRUE) endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") -# Check for the existance of the following include files -check_include_file(cstdint HAVE_CSTDINT) -check_include_file(stdint.h HAVE_STDINT_H) -check_include_file(strings.h HAVE_STRINGS_H) - # Check for the existance of the following functions -check_function_exists(strcasecmp HAVE_STRCASECMP) -check_function_exists(stricmp HAVE_STRICMP) check_function_exists(umask HAVE_UMASK) check_function_exists(epoll_wait HAVE_EPOLL) check_function_exists(poll HAVE_POLL) @@ -352,25 +163,23 @@ check_function_exists(kqueue HAVE_KQUEUE) # Strip the leading and trailing spaces from the compile flags if(CXXFLAGS) - strip_string(${CXXFLAGS} CXXFLAGS) + string(STRIP ${CXXFLAGS} CXXFLAGS) endif(CXXFLAGS) # Strip the leading and trailing spaces from the linker flags if(LDFLAGS) - strip_string(${LDFLAGS} LDFLAGS) + string(STRIP ${LDFLAGS} LDFLAGS) endif(LDFLAGS) # Search for the following programs -find_program(GREP grep) -find_program(SH sh) find_program(CHGRP chgrp) find_program(CHMOD chmod) find_program(PERL perl) # If perl is included on the system and the user wants to use run-cc.pl, change the commands for compiling and linking if(PERL AND USE_RUN_CC_PL) - set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_COMPILE_OBJECT}") - set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_LINK_EXECUTABLE}") - set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_CREATE_SHARED_MODULE}") + set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/cmake/run-cc.pl -q ${CMAKE_CXX_COMPILE_OBJECT}") + set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/cmake/run-cc.pl -q ${CMAKE_CXX_LINK_EXECUTABLE}") + set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/cmake/run-cc.pl -q ${CMAKE_CXX_CREATE_SHARED_MODULE}") endif(PERL AND USE_RUN_CC_PL) # If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory @@ -405,7 +214,7 @@ endif(NOT LOGS_DIR) # Version number processing # Find all lines in src/version.sh that start with VERSION_ -read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS) +file(STRINGS ${Anope_SOURCE_DIR}/src/version.sh VERSIONS REGEX "^VERSION_") # Iterate through the strings found foreach(VERSION_STR ${VERSIONS}) # Get the length of the string @@ -426,7 +235,7 @@ set(VERSION_BUILD 0) # Only change the build number if version.h exists if(EXISTS "${Anope_SOURCE_DIR}/include/version.h") # Attempt to read the build number from include/version.h - read_from_file(${Anope_SOURCE_DIR}/include/version.h "^#define VERSION_BUILD" VERSIONS) + file(STRINGS ${Anope_SOURCE_DIR}/include/version.h VERSIONS REGEX "^#defineVERSION_BUILD") foreach(VERSION_STR ${VERSIONS}) # Get the length of the string string(LENGTH ${VERSION_STR} VERSION_LEN) @@ -42,7 +42,6 @@ Run_Build_System () { WITH_PERM="" EXTRA_INCLUDE="" EXTRA_LIBS="" - GEN_TYPE="" if [ "$INSTDIR" != "" ] ; then WITH_INST="-DINSTDIR:STRING=$INSTDIR" @@ -68,12 +67,6 @@ Run_Build_System () { RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF" fi - if [ "$USE_PCH" = "yes" ] ; then - PCH="-DUSE_PCH:BOOLEAN=ON" - else - PCH="-DUSE_PCH:BOOLEAN=OFF" - fi - if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS" fi @@ -82,12 +75,6 @@ Run_Build_System () { EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS" fi - case `uname -s` in - MINGW*) - GEN_TYPE="-G\"MSYS Makefiles\"" - ;; - esac - if [ "$SOURCE_DIR" = "." ] ; then pwdsave=`pwd` test -d build || mkdir build @@ -97,9 +84,9 @@ Run_Build_System () { REAL_SOURCE_DIR="$SOURCE_DIR" fi - echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR" + echo "cmake $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR" - cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR + cmake $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR echo "" if [ "$SOURCE_DIR" = "." ] ; then @@ -132,7 +119,6 @@ RUNGROUP= UMASK= DEBUG="no" USE_RUN_CC_PL="no" -USE_PCH="no" EXTRA_INCLUDE_DIRS= EXTRA_LIB_DIRS= EXTRA_CONFIG_ARGS= @@ -378,25 +364,6 @@ echo "" #### -TEMP_YN="n" -if [ "$USE_PCH" = "yes" ] ; then - TEMP_YN="y" -fi -echo "Do you want to build using precompiled headers? This can speed up" -echo "the build, but uses more disk space." -echo2 "[$TEMP_YN] " -read YN -if [ "$YN" ] ; then - if [ "$YN" = "y" ] ; then - USE_PCH="yes" - else - USE_PCH="no" - fi -fi -echo "" - -#### - echo "Are there any extra include directories you wish to use?" echo "You may only need to do this if CMake is unable to locate" echo "missing dependencies without hints." @@ -460,7 +427,6 @@ RUNGROUP="$RUNGROUP" UMASK=$UMASK DEBUG="$DEBUG" USE_RUN_CC_PL="$USE_RUN_CC_PL" -USE_PCH="$USE_PCH" EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS" EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS" EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS" diff --git a/Config.exe b/Config.exe Binary files differindex e9393e089..3be910bb0 100644 --- a/Config.exe +++ b/Config.exe diff --git a/cmake/Anope.cmake b/cmake/Anope.cmake index 587e32980..aeeb9eb27 100644 --- a/cmake/Anope.cmake +++ b/cmake/Anope.cmake @@ -1,422 +1,4 @@ ############################################################################### -# strip_string(<input string> <output string>) -# -# A macro to handle stripping the leading and trailing spaces from a string, -# uses string(STRIP) if using CMake 2.6.x or better, otherwise uses -# string(REGEX REPLACE). -############################################################################### -macro(strip_string INPUT_STRING OUTPUT_STRING) - if(CMAKE26_OR_BETTER) - # For CMake 2.6.x or better, we can just use the STRIP sub-command of string() - string(STRIP ${INPUT_STRING} ${OUTPUT_STRING}) - else(CMAKE26_OR_BETTER) - # For CMake 2.4.x, we will have to use the REGEX REPLACE sub-command of string() instead - # First check if the input string is empty or not - if (${INPUT_STRING} STREQUAL "") - set(${OUTPUT_STRING} "") - else(${INPUT_STRING} STREQUAL "") - # Determine if the string is entirely empty or not - string(REGEX MATCH "^[ \t]*$" EMPTY_STRING "${INPUT_STRING}") - if(EMPTY_STRING) - set(${OUTPUT_STRING} "") - else(EMPTY_STRING) - # We detect if there is any leading whitespace and remove any if there is - string(SUBSTRING "${INPUT_STRING}" 0 1 FIRST_CHAR) - if(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t") - string(REGEX REPLACE "^[ \t]+" "" TEMP_STRING "${INPUT_STRING}") - else(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t") - set(TEMP_STRING "${INPUT_STRING}") - endif(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t") - # Next we detect if there is any trailing whitespace and remove any if there is - string(LENGTH "${TEMP_STRING}" STRING_LEN) - math(EXPR STRING_LEN "${STRING_LEN} - 1") - string(SUBSTRING "${TEMP_STRING}" ${STRING_LEN} 1 LAST_CHAR) - if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t") - string(REGEX REPLACE "[ \t]+$" "" ${OUTPUT_STRING} "${TEMP_STRING}") - else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t") - set(${OUTPUT_STRING} "${TEMP_STRING}") - endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t") - endif(EMPTY_STRING) - endif(${INPUT_STRING} STREQUAL "") - endif(CMAKE26_OR_BETTER) -endmacro(strip_string) - -############################################################################### -# append_to_list(<list> <args>...) -# -# A macro to handle appending to lists, uses list(APPEND) if using CMake 2.4.2 -# or better, otherwise uses set() instead. -############################################################################### -macro(append_to_list LIST) - if(CMAKE242_OR_BETTER) - # For CMake 2.4.2 or better, we can just use the APPEND sub-command of list() - list(APPEND ${LIST} ${ARGN}) - else(CMAKE242_OR_BETTER) - # For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead - set(${LIST} ${${LIST}} ${ARGN}) - endif(CMAKE242_OR_BETTER) -endmacro(append_to_list) - -############################################################################### -# find_in_list(<list> <value> <output variable>) -# -# A macro to handle searching within a list, will store the result in the -# given <output variable>, uses list(FIND) if using CMake 2.6.x or better -# (or CMake 2.4.8 or better), otherwise it iterates through the list to find -# the item. -############################################################################### -macro(find_in_list LIST ITEM_TO_FIND FOUND) - if(CMAKE248_OR_BETTER) - # For CMake 2.4.8 or better, we can use the FIND sub-command of list() - list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND) - else(CMAKE248_OR_BETTER) - # For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well) - # Firstly we set the position to -1 indicating nothing found, we also use a temporary position - set(ITEM_FOUND -1) - set(POS 0) - # Iterate through the list - foreach(ITEM ${${LIST}}) - # If the item we are looking at is the item we are trying to find, set that we've found the item - if(${ITEM} STREQUAL ${ITEM_TO_FIND}) - set(ITEM_FOUND ${POS}) - endif(${ITEM} STREQUAL ${ITEM_TO_FIND}) - # Increase the position value by 1 - math(EXPR POS "${POS} + 1") - endforeach(ITEM) - endif(CMAKE248_OR_BETTER) - # Set the given FOUND variable to the result - set(${FOUND} ${ITEM_FOUND}) -endmacro(find_in_list) - -############################################################################### -# remove_list_duplicates(<list>) -# -# A macro to handle removing duplicates from a list, uses -# list(REMOVE_DUPLICATES) if using CMake 2.6.x or better, otherwise it uses -# a slower method of creating a temporary list and only adding to it when -# a duplicate item hasn't been found. -############################################################################### -macro(remove_list_duplicates LIST) - if(CMAKE26_OR_BETTER) - # For CMake 2.6.x or better, this can be done automatically - list(REMOVE_DUPLICATES ${LIST}) - else(CMAKE26_OR_BETTER) - # For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list - set(NEW_LIST) - # Iterate through the old list - foreach(ITEM ${${LIST}}) - # Check if the item is in the new list - find_in_list(NEW_LIST ${ITEM} FOUND_ITEM) - if(FOUND_ITEM EQUAL -1) - # If the item was not found, append it to the list - append_to_list(NEW_LIST ${ITEM}) - endif(FOUND_ITEM EQUAL -1) - endforeach(ITEM) - # Replace the old list with the new list - set(${LIST} ${NEW_LIST}) - endif(CMAKE26_OR_BETTER) -endmacro(remove_list_duplicates) - -############################################################################### -# remove_item_from_list(<list> <value>) -# -# A macro to handle removing a value from a list, uses list(REMOVE_ITEM) in -# both cases, but can remove the value itself using CMake 2.4.2 or better, -# while older versions use a slower method of iterating the list to find the -# index of the value to remove. -############################################################################### -macro(remove_item_from_list LIST VALUE) - if(CMAKE242_OR_BETTER) - # For CMake 2.4.2 or better, this can be done automatically - list(REMOVE_ITEM ${LIST} ${VALUE}) - else(CMAKE242_OR_BETTER) - # For CMake 2.4.x before 2.4.2, we have to do this ourselves, firstly we set the index and a variable to indicate if the item was found - set(INDEX 0) - set(FOUND FALSE) - # Iterate through the old list - foreach(ITEM ${${LIST}}) - # If the item hasn't been found yet, but the current item is the same, remove it - if(NOT FOUND) - if(ITEM STREQUAL ${VALUE}) - set(FOUND TRUE) - list(REMOVE_ITEM ${LIST} ${INDEX}) - endif(ITEM STREQUAL ${VALUE}) - endif(NOT FOUND) - # Increase the index value by 1 - math(EXPR INDEX "${INDEX} + 1") - endforeach(ITEM) - endif(CMAKE242_OR_BETTER) -endmacro(remove_item_from_list) - -############################################################################### -# sort_list(<list>) -# -# A macro to handle sorting a list, uses list(SORT) if using CMake 2.4.4 or -# better, otherwise it uses a slower method of creating a temporary list and -# adding elements in alphabetical order. -############################################################################### -macro(sort_list LIST) - if(CMAKE244_OR_BETTER) - # For CMake 2.4.4 or better, this can be done automatically - list(SORT ${LIST}) - else(CMAKE244_OR_BETTER) - # For CMake 2.4.x before 2.4.4, we have to do this ourselves, firstly we'll create a teporary list - set(NEW_LIST) - # Iterate through the old list - foreach(ITEM ${${LIST}}) - # Temporary index position for the new list, as well as temporary value to store if the item was ever found - set(INDEX 0) - set(FOUND FALSE) - # Iterate through the new list - foreach(NEW_ITEM ${NEW_LIST}) - # Compare the items, only if nothing was found before - if(NOT FOUND) - if(NEW_ITEM STRGREATER "${ITEM}") - set(FOUND TRUE) - list(INSERT NEW_LIST ${INDEX} ${ITEM}) - endif(NEW_ITEM STRGREATER "${ITEM}") - endif(NOT FOUND) - # Increase the index value by 1 - math(EXPR INDEX "${INDEX} + 1") - endforeach(NEW_ITEM) - # If the item was never found, just append it to the end - if(NOT FOUND) - append_to_list(NEW_LIST ${ITEM}) - endif(NOT FOUND) - endforeach(ITEM) - # Replace the old list with the new list - set(${LIST} ${NEW_LIST}) - endif(CMAKE244_OR_BETTER) -endmacro(sort_list) - -############################################################################### -# read_from_file(<filename> <regex> <output variable>) -# -# A macro to handle reading specific lines from a file, uses file(STRINGS) if -# using CMake 2.6.x or better, otherwise we read in the entire file and -# perform a string(REGEX MATCH) on each line of the file instead. This -# macro can also be used to read in all the lines of a file if REGEX is set -# to "". -############################################################################### -macro(read_from_file FILE REGEX STRINGS) - if(CMAKE26_OR_BETTER) - # For CMake 2.6.x or better, we can just use the STRINGS sub-command to get the lines that match the given regular expression (if one is given, otherwise get all lines) - if(REGEX STREQUAL "") - file(STRINGS ${FILE} RESULT) - else(REGEX STREQUAL "") - file(STRINGS ${FILE} RESULT REGEX ${REGEX}) - endif(REGEX STREQUAL "") - else(CMAKE26_OR_BETTER) - # For CMake 2.4.x, we need to do this manually, firstly we read the file in - execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS) - # Next we replace all newlines with semicolons - string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS}) - if(REGEX STREQUAL "") - # For no regular expression, just set the result to all the lines - set(RESULT ${ALL_STRINGS}) - else(REGEX STREQUAL "") - # Clear the result list - set(RESULT) - # Iterate through all the lines of the file - foreach(STRING ${ALL_STRINGS}) - # Check for a match against the given regular expression - string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING}) - # If we had a match, append the match to the list - if(STRING_MATCH) - append_to_list(RESULT ${STRING}) - endif(STRING_MATCH) - endforeach(STRING) - endif(REGEX STREQUAL "") - endif(CMAKE26_OR_BETTER) - # Set the given STRINGS variable to the result - set(${STRINGS} ${RESULT}) -endmacro(read_from_file) - -############################################################################### -# extract_include_filename(<line> <output variable> [<optional output variable of quote type>]) -# -# This macro will take a #include line and extract the filename. -############################################################################### -macro(extract_include_filename INCLUDE FILENAME) - # Strip the leading and trailing spaces from the include line - strip_string(${INCLUDE} INCLUDE_STRIPPED) - # Make sure to only do the following if there is a string - if(INCLUDE_STRIPPED STREQUAL "") - set(FILE "") - else(INCLUDE_STRIPPED STREQUAL "") - # Extract the filename including the quotes or angle brackets - string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}") - # If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed - if(${ARGC} GREATER 2) - string(SUBSTRING ${FILE} 0 1 QUOTE) - if(QUOTE STREQUAL "<") - set(${ARGV2} "angle brackets") - else(QUOTE STREQUAL "<") - set(${ARGV2} "quotes") - endif(QUOTE STREQUAL "<") - endif(${ARGC} GREATER 2) - # Now remove the quotes or angle brackets - string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}") - endif(INCLUDE_STRIPPED STREQUAL "") - # Set the filename to the the given variable - set(${FILENAME} "${FILE}") -endmacro(extract_include_filename) - -############################################################################### -# find_includes(<source filename> <output variable>) -# -# This macro will search through a file for #include lines, regardless of -# whitespace, but only returns the lines that are valid for the current -# platform CMake is running on. -############################################################################### -macro(find_includes SRC INCLUDES) - # Read all lines from the file that start with #, regardless of whitespace before the # - read_from_file(${SRC} "^[ \t]*#.*$" LINES) - # Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef - set(VALID_LINE TRUE) - set(LAST_DEF) - set(LAST_CHECK) - # Create an empty include list - set(INCLUDES_LIST) - # Iterate through all the # lines - foreach(LINE ${LINES}) - # Search for #ifdef, #ifndef, #else, #endif, and #include - string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE}) - string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE}) - string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE}) - string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE}) - string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE}) - # If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake - if(FOUND_IFDEF) - # Extract the define - string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE}) - # Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32 - if(DEFINE STREQUAL "_WIN32") - set(DEFINE WIN32) - endif(DEFINE STREQUAL "_WIN32") - # Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check - set(LAST_DEF ${DEFINE}) - set(LAST_CHECK TRUE) - # If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped - if(${DEFINE}) - set(VALID_LINE TRUE) - else(${DEFINE}) - set(VALID_LINE FALSE) - endif(${DEFINE}) - else(FOUND_IFDEF) - # If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction - if(FOUND_IFNDEF) - # Extract the define - string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE}) - # Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32 - if(DEFINE STREQUAL "_WIN32") - set(DEFINE WIN32) - endif(DEFINE STREQUAL "_WIN32") - # Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check - set(LAST_DEF ${DEFINE}) - set(LAST_CHECK FALSE) - # If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped - if(${DEFINE}) - set(VALID_LINE FALSE) - else(${DEFINE}) - set(VALUE_LINE TRUE) - endif(${DEFINE}) - else(FOUND_IFNDEF) - # If we found a #else on the line, we check the last define in the opposite direction - if(FOUND_ELSE) - # When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check - if(LAST_CHECK) - if(${LAST_DEF}) - set(VALID_LINE FALSE) - else(${LAST_DEF}) - set(VALID_LINE TRUE) - endif(${LAST_DEF}) - # When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check - else(LAST_CHECK) - if(${LAST_DEF}) - set(VALID_LINE TRUE) - else(${LAST_DEF}) - set(VALID_LINE FALSE) - endif(${LAST_DEF}) - endif(LAST_CHECK) - else(FOUND_ELSE) - # If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines - if(FOUND_ENDIF) - set(VALID_LINE TRUE) - else(FOUND_ENDIF) - # If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid - if(FOUND_INCLUDE) - if(VALID_LINE) - append_to_list(INCLUDES_LIST "${LINE}") - endif(VALID_LINE) - endif(FOUND_INCLUDE) - endif(FOUND_ENDIF) - endif(FOUND_ELSE) - endif(FOUND_IFNDEF) - endif(FOUND_IFDEF) - endforeach(LINE) - set(${INCLUDES} ${INCLUDES_LIST}) -endmacro(find_includes) - -############################################################################### -# calculate_depends(<source filename> [<optional output variable for includes>]) -# -# This macro is used in most of the src (sub)directories to calculate the -# header file dependencies for the given source file. -############################################################################### -macro(calculate_depends SRC) - # Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not - set(CHECK_ANGLE_INCLUDES FALSE) - # Check for a third argument - if(${ARGC} GREATER 1) - set(CHECK_ANGLE_INCLUDES TRUE) - endif(${ARGC} GREATER 1) - # Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on - find_includes(${SRC} INCLUDES) - # Reset the list of headers to empty - set(HEADERS) - # Iterate through the strings containing #include (if any) - foreach(INCLUDE ${INCLUDES}) - # Extract the filename from the #include line - extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE) - if(QUOTE_TYPE STREQUAL "angle brackets") - # The following checks will only be done if there was a request for angle includes to be checked - if(CHECK_ANGLE_INCLUDES) - # Find the path of the include file - if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) - find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include ${EXTRA_INCLUDE}) - else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) - find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} ${EXTRA_INCLUDE}) - endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) - # If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler - if(FOUND_${FILENAME}_INCLUDE) - # This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here - set(FOUND_IN_DEFAULTS -1) - foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS}) - string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR}) - string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE}) - if(FOUND_DEFAULT) - set(FOUND_IN_DEFAULTS 0) - endif(FOUND_DEFAULT) - endforeach(DEFAULT_INCLUDE_DIR) - if(FOUND_IN_DEFAULTS EQUAL -1) - find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES) - if(FOUND_IN_INCLUDES EQUAL -1) - append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}") - endif(FOUND_IN_INCLUDES EQUAL -1) - endif(FOUND_IN_DEFAULTS EQUAL -1) - else(FOUND_${FILENAME}_INCLUDE) - # XXX - if(NOT ${FILENAME} STREQUAL "libintl.h") - message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") - endif(NOT ${FILENAME} STREQUAL "libintl.h") - endif(FOUND_${FILENAME}_INCLUDE) - endif(CHECK_ANGLE_INCLUDES) - endif(QUOTE_TYPE STREQUAL "angle brackets") - endforeach(INCLUDE) -endmacro(calculate_depends) - -############################################################################### # calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>) # # This macro is used in most of the module (sub)directories to calculate the @@ -432,7 +14,7 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) # Reset libraries set(LIBRARIES) # Check to see if there are any lines matching: /* RequiredLibraries: [something] */ - read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES) + file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/") # Iterate through those lines foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES}) # Strip off the /* RequiredLibraries: and */ from the line @@ -442,22 +24,18 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) # Iterate through the libraries given foreach(LIBRARY ${REQUIRED_LIBRARY}) # Locate the library to see if it exists - if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) - find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS}) - else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) - find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS}) - endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) + find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS}) # If the library was found, we will add it to the linker flags if(FOUND_${LIBRARY}_LIBRARY) # Get the path only of the library, to add it to linker flags get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH) if(MSVC) # For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies - append_to_list(EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}") + list(APPEND EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}") else(MSVC) # For all others, add the library paths and libraries - append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}") - append_to_list(LIBRARIES "${LIBRARY}") + list(APPEND LIBRARY_PATHS "${LIBRARY_PATH}") + list(APPEND LIBRARIES "${LIBRARY}") endif(MSVC) else(FOUND_${LIBRARY}_LIBRARY) # In the case of the library not being found, we fatally error so CMake stops trying to generate @@ -467,58 +45,25 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) endforeach(REQUIRED_LIBRARY) # Remove duplicates from the library paths if(LIBRARY_PATHS) - remove_list_duplicates(LIBRARY_PATHS) + list(REMOVE_DUPLICATES LIBRARY_PATHS) endif(LIBRARY_PATHS) # Remove diplicates from the libraries if(LIBRARIES) - remove_list_duplicates(LIBRARIES) + list(REMOVE_DUPLICATES LIBRARIES) endif(LIBRARIES) # Iterate through library paths and add them to the linker flags foreach(LIBRARY_PATH ${LIBRARY_PATHS}) - find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS) - if(FOUND_IN_DEFAULTS EQUAL -1) - set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}") - endif(FOUND_IN_DEFAULTS EQUAL -1) + set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}") endforeach(LIBRARY_PATH) # Iterate through libraries and add them to the linker flags foreach(LIBRARY ${LIBRARIES}) - append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}") + list(APPEND EXTRA_DEPENDENCIES "${LIBRARY}") endforeach(LIBRARY) set(${SRC_LDFLAGS} "${THIS_LDFLAGS}") set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}") endmacro(calculate_libraries) ############################################################################### -# check_functions(<source filename> <output variable set to TRUE on success>) -# -# This macro is used in most of the module (sub)directories to calculate the -# fcuntion dependencies for the given source file. -############################################################################### -macro(check_functions SRC SUCCESS) - # Default to true - set(${SUCCESS} TRUE) - # Check to see if there are any lines matching: /* RequiredFunctions: [something] */ - read_from_file(${SRC} "/\\\\*[ \t]*RequiredFunctions:[ \t]*.*[ \t]*\\\\*/" REQUIRED_FUNCTIONS) - # Iterate through those lines - foreach(REQUIRED_FUNCTION ${REQUIRED_FUNCTIONS}) - # Strip off the /* RequiredFunctions: and */ from the line - string(REGEX REPLACE "/\\*[ \t]*RequiredFunctions:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_FUNCTION ${REQUIRED_FUNCTION}) - # Replace all commas with semicolons - string(REGEX REPLACE "," ";" REQUIRED_FUNCTION ${REQUIRED_FUNCTION}) - # Iterate through the functions given - foreach(FUNCTION ${REQUIRED_FUNCTION}) - # Check if the function exists - check_function_exists(${REQUIRED_FUNCTION} HAVE_${REQUIRED_FUNCTION}) - # If we don't have the function warn the user and set SUCCESS to FALSE - if(NOT HAVE_${REQUIRED_FUNCTION}) - message("${SRC} needs function ${REQUIRED_FUNCTION} but we were unable to locate that function!") - set(${SUCCESS} FALSE) - endif(NOT HAVE_${REQUIRED_FUNCTION}) - endforeach(FUNCTION) - endforeach(REQUIRED_FUNCTION) -endmacro(check_functions) - -############################################################################### # add_to_cpack_ignored_files(<item> [TRUE]) # # A macro to update the environment variable CPACK_IGNORED_FILES which diff --git a/cmake/FindGettext.cmake b/cmake/FindGettext.cmake index e97bfef36..e3279a8b8 100644 --- a/cmake/FindGettext.cmake +++ b/cmake/FindGettext.cmake @@ -8,12 +8,12 @@ if(NOT WIN32) set(GETTEXT_FOUND TRUE) endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT) else(NOT WIN32) - find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE}) - find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) - find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) - find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) - find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) - find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE}) + find_path(GETTEXT_INCLUDE libintl.h $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE}) + find_library(GETTEXT_LIBRARY libintl PATHS $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) + find_library(ICONV_LIBRARY libiconv PATHS $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) + find_library(MINGWEX_LIBRARY libmingwex PATHS $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) + find_library(GCC_LIBRARY libgcc PATHS $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) + find_program(GETTEXT_MSGFMT msgfmt PATHS $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE}) if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY) set(GETTEXT_FOUND TRUE) endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY) diff --git a/cmake/ReadFile.cmake b/cmake/ReadFile.cmake deleted file mode 100644 index be60f1fa7..000000000 --- a/cmake/ReadFile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# This file is external to the read_from_file macro in Anope.cmake in order to -# get around a possible memory leak in older versions of CMake. - -file(READ "${FILE}" RESULT) -message("${RESULT}") diff --git a/run-cc.pl b/cmake/run-cc.pl index fe28dee10..fe28dee10 100755 --- a/run-cc.pl +++ b/cmake/run-cc.pl diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 6170cde27..7476edfe7 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -17,47 +17,5 @@ if(NOT WIN32) add_to_cpack_ignored_files("version.h$" TRUE) endif(NOT WIN32) -set(PCH_SOURCES_GCH "") -if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX) - string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}") - - file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") - sort_list(PCH_SOURCES) - - foreach(PCH_SOURCE ${PCH_SOURCES}) - find_includes(${PCH_SOURCE} INCLUDES) - set(INCLUDES_LIST) - append_to_list(INCLUDES_LIST ${PCH_SOURCE}) - foreach(INCLUDE ${INCLUDES}) - # Extract the filename from the #include line - extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE) - if(QUOTE_TYPE STREQUAL "quotes") - find_in_list(PCH_SOURCES "${FILENAME}" FOUND) - if(NOT FOUND EQUAL -1) - append_to_list(INCLUDES_LIST ${FILENAME}) - endif(NOT FOUND EQUAL -1) - endif(QUOTE_TYPE STREQUAL "quotes") - endforeach(INCLUDE) - - set(PCH_EXTRAFLAGS "") - if(DEBUG_BUILD) - set(PCH_EXTRAFLAGS "-g") - endif(DEBUG_BUILD) - if(PCH_SOURCE STREQUAL "module.h") - set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC) - endif(PCH_SOURCE STREQUAL "module.h") - if(GETTEXT_INCLUDE) - set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}") - endif(GETTEXT_INCLUDE) - - set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch") - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch - COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS} - ${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch - DEPENDS ${INCLUDES_LIST} VERBATIM - ) - endforeach(PCH_SOURCE ${PCH_SOURCES}) -endif(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX) - # Add a custom target to the above file -add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version_build ${PCH_SOURCES_GCH}) +add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version_build) diff --git a/include/access.h b/include/access.h index 57229abab..292e95228 100644 --- a/include/access.h +++ b/include/access.h @@ -10,8 +10,7 @@ * */ -#ifndef ACCESS_H -#define ACCESS_H +#pragma once #include "services.h" #include "anope.h" @@ -96,7 +95,7 @@ class CoreExport ChanAccess : public Serializable ChanAccess(AccessProvider *p); virtual ~ChanAccess(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Check if this access entry matches the given user or account @@ -168,5 +167,3 @@ class CoreExport AccessGroup : public std::vector<ChanAccess *> bool operator<=(const AccessGroup &other) const; }; -#endif - diff --git a/include/account.h b/include/account.h index 2c8c6ecb5..381047ac4 100644 --- a/include/account.h +++ b/include/account.h @@ -10,8 +10,7 @@ * */ -#ifndef ACCOUNT_H -#define ACCOUNT_H +#pragma once #include "extensible.h" #include "serialize.h" @@ -53,7 +52,7 @@ class CoreExport NickAlias : public Serializable, public Extensible NickAlias(const Anope::string &nickname, NickCore *nickcore); ~NickAlias(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Set a vhost for the user @@ -145,7 +144,7 @@ class CoreExport NickCore : public Serializable, public Extensible NickCore(const Anope::string &nickdisplay); ~NickCore(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Changes the display for this account @@ -278,5 +277,3 @@ class CoreExport IdentifyRequest static void ModuleUnload(Module *m); }; - -#endif // ACCOUNT_H diff --git a/include/anope.h b/include/anope.h index 638661440..bb20299e4 100644 --- a/include/anope.h +++ b/include/anope.h @@ -10,8 +10,7 @@ * */ -#ifndef ANOPE_H -#define ANOPE_H +#pragma once #include <signal.h> @@ -313,7 +312,7 @@ namespace Anope { inline size_t operator()(const string &s) const { - return TR1NS::hash<std::string>()(s.lower().str()); + return std::hash<std::string>()(s.lower().str()); } }; @@ -321,7 +320,7 @@ namespace Anope { inline size_t operator()(const string &s) const { - return TR1NS::hash<std::string>()(s.str()); + return std::hash<std::string>()(s.str()); } }; @@ -335,7 +334,7 @@ namespace Anope template<typename T> class map : public std::map<string, T, ci::less> { }; template<typename T> class multimap : public std::multimap<string, T, ci::less> { }; - template<typename T> class hash_map : public TR1NS::unordered_map<string, T, hash_ci, compare> { }; + template<typename T> class hash_map : public std::unordered_map<string, T, hash_ci, compare> { }; static const char *const compiled = __TIME__ " " __DATE__; @@ -776,5 +775,3 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr) return static_cast<T>(ptr); } #endif - -#endif // ANOPE_H diff --git a/include/base.h b/include/base.h index e64af87a4..a28695c5f 100644 --- a/include/base.h +++ b/include/base.h @@ -7,8 +7,7 @@ * */ -#ifndef BASE_H -#define BASE_H +#pragma once #include "services.h" @@ -141,5 +140,3 @@ class Reference : public ReferenceBase } }; -#endif // BASE_H - diff --git a/include/bots.h b/include/bots.h index bab3931c5..353be89cb 100644 --- a/include/bots.h +++ b/include/bots.h @@ -7,8 +7,7 @@ * */ -#ifndef BOTS_H -#define BOTS_H +#pragma once #include "users.h" #include "anope.h" @@ -133,4 +132,3 @@ class CoreExport BotInfo : public User, public Serializable static BotInfo* Find(const Anope::string &nick, bool nick_only = false); }; -#endif // BOTS_H diff --git a/include/channels.h b/include/channels.h index 27119adf4..69d7ee787 100644 --- a/include/channels.h +++ b/include/channels.h @@ -7,8 +7,7 @@ * */ -#ifndef CHANNELS_H -#define CHANNELS_H +#pragma once #include "anope.h" #include "extensible.h" @@ -301,4 +300,3 @@ class CoreExport Channel : public Base, public Extensible static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime); }; -#endif // CHANNELS_H diff --git a/include/commands.h b/include/commands.h index f2b0592d4..2be64d00d 100644 --- a/include/commands.h +++ b/include/commands.h @@ -9,8 +9,7 @@ * Based on the original code of Services by Andy Church. */ -#ifndef COMMAND_H -#define COMMAND_H +#pragma once #include "service.h" #include "anope.h" @@ -180,4 +179,3 @@ class CoreExport Command : public Service static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name); }; -#endif // COMMANDS_H diff --git a/include/config.h b/include/config.h index 308775e41..ccb04ce55 100644 --- a/include/config.h +++ b/include/config.h @@ -10,8 +10,7 @@ * */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "account.h" #include "regchannel.h" @@ -177,4 +176,3 @@ class ConfigException : public CoreException extern Configuration::File ServicesConf; extern CoreExport Configuration::Conf *Config; -#endif // CONFIG_H diff --git a/include/extensible.h b/include/extensible.h index f33312393..ef429b919 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -7,8 +7,7 @@ * */ -#ifndef EXTENSIBLE_H -#define EXTENSIBLE_H +#pragma once #include "anope.h" #include "serialize.h" @@ -92,7 +91,7 @@ class BaseExtensibleItem : public ExtensibleBase return t; } - void Unset(Extensible *obj) anope_override + void Unset(Extensible *obj) override { T *value = Get(obj); items.erase(obj); @@ -127,7 +126,7 @@ template<typename T> class ExtensibleItem : public BaseExtensibleItem<T> { protected: - T* Create(Extensible *obj) anope_override + T* Create(Extensible *obj) override { return new T(obj); } @@ -139,7 +138,7 @@ template<typename T> class PrimitiveExtensibleItem : public BaseExtensibleItem<T> { protected: - T* Create(Extensible *obj) anope_override + T* Create(Extensible *obj) override { return new T(); } @@ -151,7 +150,7 @@ template<> class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool> { protected: - bool* Create(Extensible *) anope_override + bool* Create(Extensible *) override { return NULL; } @@ -165,13 +164,13 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem<T> public: SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { T* t = this->Get(e); data[this->name] << *t; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { T t; if (data[this->name] >> t) @@ -185,12 +184,12 @@ class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool> public: SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { data[this->name] << true; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { bool b = false; data[this->name] >> b; @@ -255,4 +254,3 @@ void Extensible::Shrink(const Anope::string &name) Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this); } -#endif // EXTENSIBLE_H diff --git a/include/hashcomp.h b/include/hashcomp.h index 140131e72..2364975b9 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -7,19 +7,11 @@ * */ -#ifndef HASHCOMP_H -#define HASHCOMP_H +#pragma once #include <string> #include <locale> - -#if defined _LIBCPP_VERSION || defined _WIN32 #include <unordered_map> -#define TR1NS std -#else -#include <tr1/unordered_map> -#define TR1NS std::tr1 -#endif #include "services.h" @@ -39,7 +31,7 @@ namespace Anope class ascii_ctype : public std::ctype<char_type> { public: - char_type do_toupper(char_type c) const anope_override + char_type do_toupper(char_type c) const override { if (c >= 'a' && c <= 'z') return c - 32; @@ -47,7 +39,7 @@ namespace Anope return c; } - char_type do_tolower(char_type c) const anope_override + char_type do_tolower(char_type c) const override { if (c >= 'A' && c <= 'Z') return c + 32; @@ -61,7 +53,7 @@ namespace Anope class rfc1459_ctype : public ascii_ctype<char_type> { public: - char_type do_toupper(char_type c) const anope_override + char_type do_toupper(char_type c) const override { if (c == '{' || c == '}' || c == '|') return c - 32; @@ -69,7 +61,7 @@ namespace Anope return ascii_ctype<char_type>::do_toupper(c); } - char_type do_tolower(char_type c) const anope_override + char_type do_tolower(char_type c) const override { if (c == '[' || c == ']' || c == '\\') return c + 32; @@ -197,4 +189,3 @@ inline bool operator!=(const std::string &leftval, const ci::string &rightval) return !(leftval.c_str() == rightval); } -#endif // HASHCOMP_H diff --git a/include/lists.h b/include/lists.h index 980f8b533..36e5ae30d 100644 --- a/include/lists.h +++ b/include/lists.h @@ -10,8 +10,7 @@ * */ -#ifndef LISTS_H -#define LISTS_H +#pragma once #include "services.h" #include "anope.h" @@ -92,5 +91,3 @@ class CoreExport InfoFormatter void AddOption(const Anope::string &opt); }; -#endif // LISTS_H - diff --git a/include/logger.h b/include/logger.h index 31fd4f627..73180e66e 100644 --- a/include/logger.h +++ b/include/logger.h @@ -10,8 +10,7 @@ * */ -#ifndef LOGGER_H -#define LOGGER_H +#pragma once #include "anope.h" #include "defs.h" @@ -137,5 +136,3 @@ class CoreExport LogInfo void ProcessMessage(const Log *l); }; -#endif // LOGGER_H - diff --git a/include/mail.h b/include/mail.h index 5a355ab5f..2f59b5000 100644 --- a/include/mail.h +++ b/include/mail.h @@ -11,8 +11,7 @@ * */ -#ifndef MAIL_H -#define MAIL_H +#pragma once #include "anope.h" #include "threadengine.h" @@ -50,9 +49,8 @@ namespace Mail ~Message(); /* Called from within the thread to actually send the mail */ - void Run() anope_override; + void Run() override; }; } // namespace Mail -#endif // MAIL_H diff --git a/include/memo.h b/include/memo.h index 75691d89f..103f00ca1 100644 --- a/include/memo.h +++ b/include/memo.h @@ -10,8 +10,7 @@ * */ -#ifndef MEMO_H -#define MEMO_H +#pragma once #include "anope.h" #include "serialize.h" @@ -24,7 +23,7 @@ class CoreExport Memo : public Serializable Memo(); ~Memo(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); Anope::string owner; @@ -52,4 +51,3 @@ struct CoreExport MemoInfo static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan); }; -#endif // MEMO_H diff --git a/include/messages.h b/include/messages.h index e805903b3..070fcb84f 100644 --- a/include/messages.h +++ b/include/messages.h @@ -24,35 +24,35 @@ namespace Message { Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Capab : IRCDMessage { Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Error : IRCDMessage { Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Invite : IRCDMessage { Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Join : IRCDMessage { Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; typedef std::pair<ChannelStatus, User *> SJoinUser; @@ -70,106 +70,105 @@ namespace Message { Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Kill : IRCDMessage { Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Mode : IRCDMessage { Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport MOTD : IRCDMessage { MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Notice : IRCDMessage { Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Part : IRCDMessage { Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Ping : IRCDMessage { Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Privmsg : IRCDMessage { Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Quit : IRCDMessage { Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport SQuit : IRCDMessage { SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Stats : IRCDMessage { Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Time : IRCDMessage { Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Topic : IRCDMessage { Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Version : IRCDMessage { Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; struct CoreExport Whois : IRCDMessage { Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override; }; } // namespace Message - diff --git a/include/modes.h b/include/modes.h index 8f67959e8..279d1dbc1 100644 --- a/include/modes.h +++ b/include/modes.h @@ -6,8 +6,7 @@ * Please read COPYING and README for further details. */ -#ifndef MODES_H -#define MODES_H +#pragma once #include "anope.h" #include "base.h" @@ -102,7 +101,7 @@ class CoreExport ChannelMode : public Mode */ ChannelMode(const Anope::string &name, char mc); - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** This is a mode for lists, eg b/e/I. These modes should inherit from this @@ -207,7 +206,7 @@ class CoreExport UserModeOperOnly : public UserMode public: UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; class CoreExport UserModeNoone : public UserMode @@ -215,7 +214,7 @@ class CoreExport UserModeNoone : public UserMode public: UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** Channel mode +k (key) @@ -225,7 +224,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam public: ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { } - bool IsValid(const Anope::string &value) const anope_override; + bool IsValid(const Anope::string &value) const override; }; /** This class is used for oper only channel modes @@ -236,7 +235,7 @@ class CoreExport ChannelModeOperOnly : public ChannelMode ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } /* Opers only */ - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** This class is used for channel modes only servers may set @@ -246,7 +245,7 @@ class CoreExport ChannelModeNoone : public ChannelMode public: ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** This is the mode manager @@ -384,5 +383,3 @@ class CoreExport Entry */ bool Matches(User *u, bool full = false) const; }; - -#endif // MODES_H diff --git a/include/module.h b/include/module.h index d7845f65a..7bfc40cfe 100644 --- a/include/module.h +++ b/include/module.h @@ -9,8 +9,7 @@ * Based on the original code of Services by Andy Church. */ -#ifndef MODULE_H -#define MODULE_H +#pragma once #include "access.h" #include "account.h" @@ -51,4 +50,3 @@ #include "modules/pseudoclients/memoserv.h" #include "modules/pseudoclients/nickserv.h" -#endif // MODULE_H diff --git a/include/modules.h b/include/modules.h index 0d121089a..05a763b00 100644 --- a/include/modules.h +++ b/include/modules.h @@ -10,11 +10,9 @@ * */ -#include "serialize.h" - -#ifndef MODULES_H -#define MODULES_H +#pragma once +#include "serialize.h" #include "base.h" #include "modes.h" #include "timers.h" @@ -1203,4 +1201,3 @@ class CoreExport ModuleManager static ModuleReturn DeleteModule(Module *m); }; -#endif // MODULES_H diff --git a/include/modules/dns.h b/include/modules/dns.h index 37af05cc9..59fc83e64 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -165,7 +165,7 @@ namespace DNS /** Used to time out the query, xalls OnError and lets the TimerManager * delete this request. */ - void Tick(time_t) anope_override + void Tick(time_t) override { Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name; Query rr(*this); diff --git a/include/modules/os_session.h b/include/modules/os_session.h index 65f1c6f75..ac6bf9395 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -20,14 +20,14 @@ struct Exception : Serializable time_t expires; /* Time when it expires. 0 == no expiry */ Exception() : Serializable("Exception") { } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; class SessionService : public Service { public: - typedef TR1NS::unordered_map<cidr, Session *, cidr::hash> SessionMap; + typedef std::unordered_map<cidr, Session *, cidr::hash> SessionMap; typedef std::vector<Exception *> ExceptionVector; SessionService(Module *m) : Service(m, "SessionService", "session") { } diff --git a/include/modules/sasl.h b/include/modules/sasl.h index ec6d741ca..dbe6441e9 100644 --- a/include/modules/sasl.h +++ b/include/modules/sasl.h @@ -80,7 +80,7 @@ namespace SASL public: IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : ::IdentifyRequest(m, acc, pass), uid(id) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!sasl) return; @@ -98,7 +98,7 @@ namespace SASL } } - void OnFail() anope_override + void OnFail() override { if (!sasl) return; diff --git a/include/modules/sql.h b/include/modules/sql.h index 789bec98b..9cde772dc 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -20,7 +20,7 @@ namespace SQL Clear(); } - std::iostream& operator[](const Anope::string &key) anope_override + std::iostream& operator[](const Anope::string &key) override { std::stringstream *&ss = data[key]; if (!ss) @@ -28,7 +28,7 @@ namespace SQL return *ss; } - std::set<Anope::string> KeySet() const anope_override + std::set<Anope::string> KeySet() const override { std::set<Anope::string> keys; for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -36,7 +36,7 @@ namespace SQL return keys; } - size_t Hash() const anope_override + size_t Hash() const override { size_t hash = 0; for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -60,12 +60,12 @@ namespace SQL this->data.clear(); } - void SetType(const Anope::string &key, Type t) anope_override + void SetType(const Anope::string &key, Type t) override { this->types[key] = t; } - Type GetType(const Anope::string &key) const anope_override + Type GetType(const Anope::string &key) const override { std::map<Anope::string, Type>::const_iterator it = this->types.find(key); if (it != this->types.end()) diff --git a/include/opertype.h b/include/opertype.h index fed40104c..9cbd3347a 100644 --- a/include/opertype.h +++ b/include/opertype.h @@ -6,8 +6,7 @@ * */ -#ifndef OPERTYPE_H -#define OPERTYPE_H +#pragma once #include "services.h" #include "account.h" @@ -124,4 +123,3 @@ class CoreExport OperType const std::list<Anope::string> GetPrivs() const; }; -#endif // OPERTYPE_H diff --git a/include/protocol.h b/include/protocol.h index 8f4f2ea58..06f9d35c9 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -10,8 +10,7 @@ * */ -#ifndef PROTOCOL_H -#define PROTOCOL_H +#pragma once #include "services.h" #include "anope.h" @@ -274,4 +273,3 @@ class CoreExport IRCDMessage : public Service extern CoreExport IRCDProto *IRCD; -#endif // PROTOCOL_H diff --git a/include/pstdint.h b/include/pstdint.h deleted file mode 100644 index fa64dbe70..000000000 --- a/include/pstdint.h +++ /dev/null @@ -1,800 +0,0 @@ -/* A portable stdint.h
- ****************************************************************************
- * BSD License:
- ****************************************************************************
- *
- * Copyright (c) 2005-2011 Paul Hsieh
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************
- *
- * Version 0.1.12
- *
- * The ANSI C standard committee, for the C99 standard, specified the
- * inclusion of a new standard include file called stdint.h. This is
- * a very useful and long desired include file which contains several
- * very precise definitions for integer scalar types that is
- * critically important for making portable several classes of
- * applications including cryptography, hashing, variable length
- * integer libraries and so on. But for most developers its likely
- * useful just for programming sanity.
- *
- * The problem is that most compiler vendors have decided not to
- * implement the C99 standard, and the next C++ language standard
- * (which has a lot more mindshare these days) will be a long time in
- * coming and its unknown whether or not it will include stdint.h or
- * how much adoption it will have. Either way, it will be a long time
- * before all compilers come with a stdint.h and it also does nothing
- * for the extremely large number of compilers available today which
- * do not include this file, or anything comparable to it.
- *
- * So that's what this file is all about. Its an attempt to build a
- * single universal include file that works on as many platforms as
- * possible to deliver what stdint.h is supposed to. A few things
- * that should be noted about this file:
- *
- * 1) It is not guaranteed to be portable and/or present an identical
- * interface on all platforms. The extreme variability of the
- * ANSI C standard makes this an impossibility right from the
- * very get go. Its really only meant to be useful for the vast
- * majority of platforms that possess the capability of
- * implementing usefully and precisely defined, standard sized
- * integer scalars. Systems which are not intrinsically 2s
- * complement may produce invalid constants.
- *
- * 2) There is an unavoidable use of non-reserved symbols.
- *
- * 3) Other standard include files are invoked.
- *
- * 4) This file may come in conflict with future platforms that do
- * include stdint.h. The hope is that one or the other can be
- * used with no real difference.
- *
- * 5) In the current verison, if your platform can't represent
- * int32_t, int16_t and int8_t, it just dumps out with a compiler
- * error.
- *
- * 6) 64 bit integers may or may not be defined. Test for their
- * presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
- * Note that this is different from the C99 specification which
- * requires the existence of 64 bit support in the compiler. If
- * this is not defined for your platform, yet it is capable of
- * dealing with 64 bits then it is because this file has not yet
- * been extended to cover all of your system's capabilities.
- *
- * 7) (u)intptr_t may or may not be defined. Test for its presence
- * with the test: #ifdef PTRDIFF_MAX. If this is not defined
- * for your platform, then it is because this file has not yet
- * been extended to cover all of your system's capabilities, not
- * because its optional.
- *
- * 8) The following might not been defined even if your platform is
- * capable of defining it:
- *
- * WCHAR_MIN
- * WCHAR_MAX
- * (u)int64_t
- * PTRDIFF_MIN
- * PTRDIFF_MAX
- * (u)intptr_t
- *
- * 9) The following have not been defined:
- *
- * WINT_MIN
- * WINT_MAX
- *
- * 10) The criteria for defining (u)int_least(*)_t isn't clear,
- * except for systems which don't have a type that precisely
- * defined 8, 16, or 32 bit types (which this include file does
- * not support anyways). Default definitions have been given.
- *
- * 11) The criteria for defining (u)int_fast(*)_t isn't something I
- * would trust to any particular compiler vendor or the ANSI C
- * committee. It is well known that "compatible systems" are
- * commonly created that have very different performance
- * characteristics from the systems they are compatible with,
- * especially those whose vendors make both the compiler and the
- * system. Default definitions have been given, but its strongly
- * recommended that users never use these definitions for any
- * reason (they do *NOT* deliver any serious guarantee of
- * improved performance -- not in this file, nor any vendor's
- * stdint.h).
- *
- * 12) The following macros:
- *
- * PRINTF_INTMAX_MODIFIER
- * PRINTF_INT64_MODIFIER
- * PRINTF_INT32_MODIFIER
- * PRINTF_INT16_MODIFIER
- * PRINTF_LEAST64_MODIFIER
- * PRINTF_LEAST32_MODIFIER
- * PRINTF_LEAST16_MODIFIER
- * PRINTF_INTPTR_MODIFIER
- *
- * are strings which have been defined as the modifiers required
- * for the "d", "u" and "x" printf formats to correctly output
- * (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
- * (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
- * PRINTF_INTPTR_MODIFIER is not defined for some systems which
- * provide their own stdint.h. PRINTF_INT64_MODIFIER is not
- * defined if INT64_MAX is not defined. These are an extension
- * beyond what C99 specifies must be in stdint.h.
- *
- * In addition, the following macros are defined:
- *
- * PRINTF_INTMAX_HEX_WIDTH
- * PRINTF_INT64_HEX_WIDTH
- * PRINTF_INT32_HEX_WIDTH
- * PRINTF_INT16_HEX_WIDTH
- * PRINTF_INT8_HEX_WIDTH
- * PRINTF_INTMAX_DEC_WIDTH
- * PRINTF_INT64_DEC_WIDTH
- * PRINTF_INT32_DEC_WIDTH
- * PRINTF_INT16_DEC_WIDTH
- * PRINTF_INT8_DEC_WIDTH
- *
- * Which specifies the maximum number of characters required to
- * print the number of that type in either hexadecimal or decimal.
- * These are an extension beyond what C99 specifies must be in
- * stdint.h.
- *
- * Compilers tested (all with 0 warnings at their highest respective
- * settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
- * bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
- * .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
- *
- * This file should be considered a work in progress. Suggestions for
- * improvements, especially those which increase coverage are strongly
- * encouraged.
- *
- * Acknowledgements
- *
- * The following people have made significant contributions to the
- * development and testing of this file:
- *
- * Chris Howie
- * John Steele Scott
- * Dave Thorup
- * John Dill
- *
- */
-
-#include <stddef.h>
-#include <limits.h>
-#include <signal.h>
-
-/*
- * For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
- * do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
- */
-
-#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
-#include <stdint.h>
-#define _PSTDINT_H_INCLUDED
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
-# endif
-# ifndef PRINTF_INT64_HEX_WIDTH
-# define PRINTF_INT64_HEX_WIDTH "16"
-# endif
-# ifndef PRINTF_INT32_HEX_WIDTH
-# define PRINTF_INT32_HEX_WIDTH "8"
-# endif
-# ifndef PRINTF_INT16_HEX_WIDTH
-# define PRINTF_INT16_HEX_WIDTH "4"
-# endif
-# ifndef PRINTF_INT8_HEX_WIDTH
-# define PRINTF_INT8_HEX_WIDTH "2"
-# endif
-# ifndef PRINTF_INT64_DEC_WIDTH
-# define PRINTF_INT64_DEC_WIDTH "20"
-# endif
-# ifndef PRINTF_INT32_DEC_WIDTH
-# define PRINTF_INT32_DEC_WIDTH "10"
-# endif
-# ifndef PRINTF_INT16_DEC_WIDTH
-# define PRINTF_INT16_DEC_WIDTH "5"
-# endif
-# ifndef PRINTF_INT8_DEC_WIDTH
-# define PRINTF_INT8_DEC_WIDTH "3"
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
-# endif
-
-/*
- * Something really weird is going on with Open Watcom. Just pull some of
- * these duplicated definitions from Open Watcom's stdint.h file for now.
- */
-
-# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
-# if !defined (INT64_C)
-# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
-# endif
-# if !defined (UINT64_C)
-# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
-# endif
-# if !defined (INT32_C)
-# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
-# endif
-# if !defined (UINT32_C)
-# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
-# endif
-# if !defined (INT16_C)
-# define INT16_C(x) (x)
-# endif
-# if !defined (UINT16_C)
-# define UINT16_C(x) (x)
-# endif
-# if !defined (INT8_C)
-# define INT8_C(x) (x)
-# endif
-# if !defined (UINT8_C)
-# define UINT8_C(x) (x)
-# endif
-# if !defined (UINT64_MAX)
-# define UINT64_MAX 18446744073709551615ULL
-# endif
-# if !defined (INT64_MAX)
-# define INT64_MAX 9223372036854775807LL
-# endif
-# if !defined (UINT32_MAX)
-# define UINT32_MAX 4294967295UL
-# endif
-# if !defined (INT32_MAX)
-# define INT32_MAX 2147483647L
-# endif
-# if !defined (INTMAX_MAX)
-# define INTMAX_MAX INT64_MAX
-# endif
-# if !defined (INTMAX_MIN)
-# define INTMAX_MIN INT64_MIN
-# endif
-# endif
-#endif
-
-#ifndef _PSTDINT_H_INCLUDED
-#define _PSTDINT_H_INCLUDED
-
-#ifndef SIZE_MAX
-# define SIZE_MAX (~(size_t)0)
-#endif
-
-/*
- * Deduce the type assignments from limits.h under the assumption that
- * integer sizes in bits are powers of 2, and follow the ANSI
- * definitions.
- */
-
-#ifndef UINT8_MAX
-# define UINT8_MAX 0xff
-#endif
-#ifndef uint8_t
-# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
- typedef unsigned char uint8_t;
-# define UINT8_C(v) ((uint8_t) v)
-# else
-# error "Platform not supported"
-# endif
-#endif
-
-#ifndef INT8_MAX
-# define INT8_MAX 0x7f
-#endif
-#ifndef INT8_MIN
-# define INT8_MIN INT8_C(0x80)
-#endif
-#ifndef int8_t
-# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
- typedef signed char int8_t;
-# define INT8_C(v) ((int8_t) v)
-# else
-# error "Platform not supported"
-# endif
-#endif
-
-#ifndef UINT16_MAX
-# define UINT16_MAX 0xffff
-#endif
-#ifndef uint16_t
-#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
- typedef unsigned int uint16_t;
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER ""
-# endif
-# define UINT16_C(v) ((uint16_t) (v))
-#elif (USHRT_MAX == UINT16_MAX)
- typedef unsigned short uint16_t;
-# define UINT16_C(v) ((uint16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef INT16_MAX
-# define INT16_MAX 0x7fff
-#endif
-#ifndef INT16_MIN
-# define INT16_MIN INT16_C(0x8000)
-#endif
-#ifndef int16_t
-#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
- typedef signed int int16_t;
-# define INT16_C(v) ((int16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER ""
-# endif
-#elif (SHRT_MAX == INT16_MAX)
- typedef signed short int16_t;
-# define INT16_C(v) ((int16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef UINT32_MAX
-# define UINT32_MAX (0xffffffffUL)
-#endif
-#ifndef uint32_t
-#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
- typedef unsigned long uint32_t;
-# define UINT32_C(v) v ## UL
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-#elif (UINT_MAX == UINT32_MAX)
- typedef unsigned int uint32_t;
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-# define UINT32_C(v) v ## U
-#elif (USHRT_MAX == UINT32_MAX)
- typedef unsigned short uint32_t;
-# define UINT32_C(v) ((unsigned short) (v))
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef INT32_MAX
-# define INT32_MAX (0x7fffffffL)
-#endif
-#ifndef INT32_MIN
-# define INT32_MIN INT32_C(0x80000000)
-#endif
-#ifndef int32_t
-#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
- typedef signed long int32_t;
-# define INT32_C(v) v ## L
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-#elif (INT_MAX == INT32_MAX)
- typedef signed int int32_t;
-# define INT32_C(v) v
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#elif (SHRT_MAX == INT32_MAX)
- typedef signed short int32_t;
-# define INT32_C(v) ((short) (v))
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-/*
- * The macro stdint_int64_defined is temporarily used to record
- * whether or not 64 integer support is available. It must be
- * defined for any 64 integer extensions for new platforms that are
- * added.
- */
-
-#undef stdint_int64_defined
-#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
-# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
-# define stdint_int64_defined
- typedef long long int64_t;
- typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# endif
-#endif
-
-#if !defined (stdint_int64_defined)
-# if defined(__GNUC__)
-# define stdint_int64_defined
- __extension__ typedef long long int64_t;
- __extension__ typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
-# define stdint_int64_defined
- typedef long long int64_t;
- typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
-# define stdint_int64_defined
- typedef __int64 int64_t;
- typedef unsigned __int64 uint64_t;
-# define UINT64_C(v) v ## UI64
-# define INT64_C(v) v ## I64
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "I64"
-# endif
-# endif
-#endif
-
-#if !defined (LONG_LONG_MAX) && defined (INT64_C)
-# define LONG_LONG_MAX INT64_C (9223372036854775807)
-#endif
-#ifndef ULONG_LONG_MAX
-# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
-#endif
-
-#if !defined (INT64_MAX) && defined (INT64_C)
-# define INT64_MAX INT64_C (9223372036854775807)
-#endif
-#if !defined (INT64_MIN) && defined (INT64_C)
-# define INT64_MIN INT64_C (-9223372036854775808)
-#endif
-#if !defined (UINT64_MAX) && defined (INT64_C)
-# define UINT64_MAX UINT64_C (18446744073709551615)
-#endif
-
-/*
- * Width of hexadecimal for number field.
- */
-
-#ifndef PRINTF_INT64_HEX_WIDTH
-# define PRINTF_INT64_HEX_WIDTH "16"
-#endif
-#ifndef PRINTF_INT32_HEX_WIDTH
-# define PRINTF_INT32_HEX_WIDTH "8"
-#endif
-#ifndef PRINTF_INT16_HEX_WIDTH
-# define PRINTF_INT16_HEX_WIDTH "4"
-#endif
-#ifndef PRINTF_INT8_HEX_WIDTH
-# define PRINTF_INT8_HEX_WIDTH "2"
-#endif
-
-#ifndef PRINTF_INT64_DEC_WIDTH
-# define PRINTF_INT64_DEC_WIDTH "20"
-#endif
-#ifndef PRINTF_INT32_DEC_WIDTH
-# define PRINTF_INT32_DEC_WIDTH "10"
-#endif
-#ifndef PRINTF_INT16_DEC_WIDTH
-# define PRINTF_INT16_DEC_WIDTH "5"
-#endif
-#ifndef PRINTF_INT8_DEC_WIDTH
-# define PRINTF_INT8_DEC_WIDTH "3"
-#endif
-
-/*
- * Ok, lets not worry about 128 bit integers for now. Moore's law says
- * we don't need to worry about that until about 2040 at which point
- * we'll have bigger things to worry about.
- */
-
-#ifdef stdint_int64_defined
- typedef int64_t intmax_t;
- typedef uint64_t uintmax_t;
-# define INTMAX_MAX INT64_MAX
-# define INTMAX_MIN INT64_MIN
-# define UINTMAX_MAX UINT64_MAX
-# define UINTMAX_C(v) UINT64_C(v)
-# define INTMAX_C(v) INT64_C(v)
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
-# endif
-#else
- typedef int32_t intmax_t;
- typedef uint32_t uintmax_t;
-# define INTMAX_MAX INT32_MAX
-# define UINTMAX_MAX UINT32_MAX
-# define UINTMAX_C(v) UINT32_C(v)
-# define INTMAX_C(v) INT32_C(v)
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
-# endif
-#endif
-
-/*
- * Because this file currently only supports platforms which have
- * precise powers of 2 as bit sizes for the default integers, the
- * least definitions are all trivial. Its possible that a future
- * version of this file could have different definitions.
- */
-
-#ifndef stdint_least_defined
- typedef int8_t int_least8_t;
- typedef uint8_t uint_least8_t;
- typedef int16_t int_least16_t;
- typedef uint16_t uint_least16_t;
- typedef int32_t int_least32_t;
- typedef uint32_t uint_least32_t;
-# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
-# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
-# define UINT_LEAST8_MAX UINT8_MAX
-# define INT_LEAST8_MAX INT8_MAX
-# define UINT_LEAST16_MAX UINT16_MAX
-# define INT_LEAST16_MAX INT16_MAX
-# define UINT_LEAST32_MAX UINT32_MAX
-# define INT_LEAST32_MAX INT32_MAX
-# define INT_LEAST8_MIN INT8_MIN
-# define INT_LEAST16_MIN INT16_MIN
-# define INT_LEAST32_MIN INT32_MIN
-# ifdef stdint_int64_defined
- typedef int64_t int_least64_t;
- typedef uint64_t uint_least64_t;
-# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
-# define UINT_LEAST64_MAX UINT64_MAX
-# define INT_LEAST64_MAX INT64_MAX
-# define INT_LEAST64_MIN INT64_MIN
-# endif
-#endif
-#undef stdint_least_defined
-
-/*
- * The ANSI C committee pretending to know or specify anything about
- * performance is the epitome of misguided arrogance. The mandate of
- * this file is to *ONLY* ever support that absolute minimum
- * definition of the fast integer types, for compatibility purposes.
- * No extensions, and no attempt to suggest what may or may not be a
- * faster integer type will ever be made in this file. Developers are
- * warned to stay away from these types when using this or any other
- * stdint.h.
- */
-
-typedef int_least8_t int_fast8_t;
-typedef uint_least8_t uint_fast8_t;
-typedef int_least16_t int_fast16_t;
-typedef uint_least16_t uint_fast16_t;
-typedef int_least32_t int_fast32_t;
-typedef uint_least32_t uint_fast32_t;
-#define UINT_FAST8_MAX UINT_LEAST8_MAX
-#define INT_FAST8_MAX INT_LEAST8_MAX
-#define UINT_FAST16_MAX UINT_LEAST16_MAX
-#define INT_FAST16_MAX INT_LEAST16_MAX
-#define UINT_FAST32_MAX UINT_LEAST32_MAX
-#define INT_FAST32_MAX INT_LEAST32_MAX
-#define INT_FAST8_MIN INT_LEAST8_MIN
-#define INT_FAST16_MIN INT_LEAST16_MIN
-#define INT_FAST32_MIN INT_LEAST32_MIN
-#ifdef stdint_int64_defined
- typedef int_least64_t int_fast64_t;
- typedef uint_least64_t uint_fast64_t;
-# define UINT_FAST64_MAX UINT_LEAST64_MAX
-# define INT_FAST64_MAX INT_LEAST64_MAX
-# define INT_FAST64_MIN INT_LEAST64_MIN
-#endif
-
-#undef stdint_int64_defined
-
-/*
- * Whatever piecemeal, per compiler thing we can do about the wchar_t
- * type limits.
- */
-
-#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
-# include <wchar.h>
-# ifndef WCHAR_MIN
-# define WCHAR_MIN 0
-# endif
-# ifndef WCHAR_MAX
-# define WCHAR_MAX ((wchar_t)-1)
-# endif
-#endif
-
-/*
- * Whatever piecemeal, per compiler/platform thing we can do about the
- * (u)intptr_t types and limits.
- */
-
-#if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
-# define STDINT_H_UINTPTR_T_DEFINED
-#endif
-
-#ifndef STDINT_H_UINTPTR_T_DEFINED
-# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
-# define stdint_intptr_bits 64
-# elif defined (__WATCOMC__) || defined (__TURBOC__)
-# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
-# define stdint_intptr_bits 16
-# else
-# define stdint_intptr_bits 32
-# endif
-# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
-# define stdint_intptr_bits 32
-# elif defined (__INTEL_COMPILER)
-/* TODO -- what did Intel do about x86-64? */
-# endif
-
-# ifdef stdint_intptr_bits
-# define stdint_intptr_glue3_i(a,b,c) a##b##c
-# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
-# ifndef PRINTF_INTPTR_MODIFIER
-# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
-# endif
-# ifndef PTRDIFF_MAX
-# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef PTRDIFF_MIN
-# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
-# endif
-# ifndef UINTPTR_MAX
-# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef INTPTR_MAX
-# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef INTPTR_MIN
-# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
-# endif
-# ifndef INTPTR_C
-# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
-# endif
-# ifndef UINTPTR_C
-# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
-# endif
- typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
- typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
-# else
-/* TODO -- This following is likely wrong for some platforms, and does
- nothing for the definition of uintptr_t. */
- typedef ptrdiff_t intptr_t;
-# endif
-# define STDINT_H_UINTPTR_T_DEFINED
-#endif
-
-/*
- * Assumes sig_atomic_t is signed and we have a 2s complement machine.
- */
-
-#ifndef SIG_ATOMIC_MAX
-# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
-#endif
-
-#endif
-
-#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
-
-/*
- * Please compile with the maximum warning settings to make sure macros are not
- * defined more than once.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define glue3_aux(x,y,z) x ## y ## z
-#define glue3(x,y,z) glue3_aux(x,y,z)
-
-#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,=) glue3(UINT,bits,_C) (0);
-#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,=) glue3(INT,bits,_C) (0);
-
-#define DECL(us,bits) glue3(DECL,us,) (bits)
-
-#define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if (glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with UINT%d_MAX\n", bits)
-
-int main () {
- DECL(I,8)
- DECL(U,8)
- DECL(I,16)
- DECL(U,16)
- DECL(I,32)
- DECL(U,32)
-#ifdef INT64_MAX
- DECL(I,64)
- DECL(U,64)
-#endif
- intmax_t imax = INTMAX_C(0);
- uintmax_t umax = UINTMAX_C(0);
- char str0[256], str1[256];
-
- sprintf (str0, "%d %x\n", 0, ~0);
-
- sprintf (str1, "%d %x\n", i8, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", str1);
- sprintf (str1, "%u %x\n", u8, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with u8 : %s\n", str1);
- sprintf (str1, "%d %x\n", i16, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : %s\n", str1);
- sprintf (str1, "%u %x\n", u16, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1);
- sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : %s\n", str1);
- sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : %s\n", str1);
-#ifdef INT64_MAX
- sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : %s\n", str1);
-#endif
- sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : %s\n", str1);
- sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1);
-
- TESTUMAX(8);
- TESTUMAX(16);
- TESTUMAX(32);
-#ifdef INT64_MAX
- TESTUMAX(64);
-#endif
-
- return EXIT_SUCCESS;
-}
-
-#endif
diff --git a/include/regchannel.h b/include/regchannel.h index 416b0280d..402ed065b 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -7,8 +7,7 @@ * */ -#ifndef REGCHANNEL_H -#define REGCHANNEL_H +#pragma once #include "memo.h" #include "modes.h" @@ -39,7 +38,7 @@ class CoreExport AutoKick : public Serializable AutoKick(); ~AutoKick(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); }; @@ -95,7 +94,7 @@ class CoreExport ChannelInfo : public Serializable, public Extensible ~ChannelInfo(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Change the founder of the channek @@ -245,4 +244,3 @@ class CoreExport ChannelInfo : public Serializable, public Extensible */ extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci); -#endif // REGCHANNEL_H diff --git a/include/regexpr.h b/include/regexpr.h index c46179d68..d8b96d750 100644 --- a/include/regexpr.h +++ b/include/regexpr.h @@ -10,8 +10,7 @@ * */ -#ifndef REGEXPR_H -#define REGEXPR_H +#pragma once #include "services.h" #include "anope.h" @@ -43,5 +42,3 @@ class CoreExport RegexProvider : public Service virtual Regex *Compile(const Anope::string &) = 0; }; -#endif // REGEXPR_H - diff --git a/include/serialize.h b/include/serialize.h index 496110fda..4bfdd0cb3 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -10,8 +10,7 @@ * */ -#ifndef SERIALIZE_H -#define SERIALIZE_H +#pragma once #include <sstream> @@ -333,4 +332,3 @@ class Serialize::Reference : public ReferenceBase } }; -#endif // SERIALIZE_H diff --git a/include/servers.h b/include/servers.h index 7a2a594f1..743dc5d9c 100644 --- a/include/servers.h +++ b/include/servers.h @@ -10,8 +10,7 @@ * */ -#ifndef SERVERS_H -#define SERVERS_H +#pragma once #include "services.h" #include "anope.h" @@ -189,4 +188,3 @@ class CoreExport Server : public Extensible static Server *Find(const Anope::string &name, bool name_only = false); }; -#endif // SERVERS_H diff --git a/include/service.h b/include/service.h index 8142363d6..32686afb5 100644 --- a/include/service.h +++ b/include/service.h @@ -10,8 +10,7 @@ * */ -#ifndef SERVICE_H -#define SERVICE_H +#pragma once #include "services.h" #include "anope.h" @@ -135,7 +134,7 @@ class ServiceReference : public Reference<T> this->invalid = true; } - operator bool() anope_override + operator bool() override { if (this->invalid) { @@ -171,5 +170,3 @@ class ServiceAlias } }; -#endif // SERVICE_H - diff --git a/include/services.h b/include/services.h index af585dcd6..45eb84c32 100644 --- a/include/services.h +++ b/include/services.h @@ -10,8 +10,7 @@ * */ -#ifndef SERVICES_H -#define SERVICES_H +#pragma once #include "sysconf.h" @@ -20,12 +19,10 @@ #include <cstdio> #include <cstdlib> #include <cstdarg> +#include <cstdint> #include <stdexcept> #include <string.h> -#if HAVE_STRINGS_H -# include <strings.h> -#endif #ifndef _WIN32 #include <unistd.h> @@ -49,14 +46,6 @@ #define _(x) x -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -# define anope_override override -# define anope_final final -#else -# define anope_override -# define anope_final -#endif - #ifndef _WIN32 # define DllExport # define CoreExport @@ -66,4 +55,3 @@ # include "anope_windows.h" #endif -#endif // SERVICES_H diff --git a/include/socketengine.h b/include/socketengine.h index 8772b14a6..ac6f2a35b 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -10,8 +10,7 @@ * */ -#ifndef SOCKETENGINE_H -#define SOCKETENGINE_H +#pragma once #include "services.h" #include "sockets.h" @@ -48,4 +47,3 @@ class CoreExport SocketEngine static bool IgnoreErrno(); }; -#endif // SOCKETENGINE_H diff --git a/include/sockets.h b/include/sockets.h index 0dfa5d9d0..a2c713207 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -10,8 +10,7 @@ * */ -#ifndef SOCKETS_H -#define SOCKETS_H +#pragma once #ifndef _WIN32 #include <netinet/in.h> @@ -284,12 +283,12 @@ class CoreExport BufferedSocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite() anope_override; + bool ProcessWrite() override; /** Gets the new line from the input buffer, if any */ @@ -338,12 +337,12 @@ class CoreExport BinarySocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite() anope_override; + bool ProcessWrite() override; /** Write data to the socket * @param buffer The data to write @@ -401,12 +400,12 @@ class CoreExport ConnectionSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process() anope_override; + bool Process() override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError() anope_override; + void ProcessError() override; /** Called on a successful connect */ @@ -436,12 +435,12 @@ class CoreExport ClientSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process() anope_override; + bool Process() override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError() anope_override; + void ProcessError() override; /** Called when a client has been accepted() successfully. */ @@ -465,7 +464,7 @@ class CoreExport Pipe : public Socket /** Called when data is to be read, reads the data then calls OnNotify */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Write data to this pipe * @param data The data to write @@ -501,4 +500,3 @@ extern CoreExport uint32_t TotalRead; extern CoreExport uint32_t TotalWritten; extern CoreExport SocketIO NormalSocketIO; -#endif // SOCKET_H diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake index 5f0e275c3..3742e4954 100644 --- a/include/sysconf.h.cmake +++ b/include/sysconf.h.cmake @@ -1,47 +1,8 @@ -#ifndef _SYSCONF_H_ -#define _SYSCONF_H_ +#pragma once #cmakedefine DEBUG_BUILD #cmakedefine DEFUMASK @DEFUMASK@ -#cmakedefine HAVE_CSTDINT 1 -#cmakedefine HAVE_STDINT_H 1 -#cmakedefine HAVE_STDDEF_H 1 -#cmakedefine HAVE_STRCASECMP 1 -#cmakedefine HAVE_STRICMP 1 -#cmakedefine HAVE_STRINGS_H 1 #cmakedefine HAVE_UMASK 1 -#cmakedefine HAVE_EVENTFD 1 -#cmakedefine HAVE_EPOLL 1 -#cmakedefine HAVE_POLL 1 #cmakedefine GETTEXT_FOUND 1 -#ifdef HAVE_CSTDINT -# include <cstdint> -#else -# ifdef HAVE_STDINT_H -# include <stdint.h> -# else -# include "pstdint.h" -# endif -#endif -#ifdef HAVE_STDDEF_H -# include <stddef.h> -#endif - -#ifdef _WIN32 -# define popen _popen -# define pclose _pclose -# define ftruncate _chsize -# ifdef MSVCPP -# define PATH_MAX MAX_PATH -# endif -# define MAXPATHLEN MAX_PATH -# define bzero(buf, size) memset(buf, 0, size) -# ifdef MSVCPP -# define strcasecmp stricmp -# endif -# define sleep(x) Sleep(x * 1000) -#endif - -#endif diff --git a/include/threadengine.h b/include/threadengine.h index 6672fa0e6..61e8822d2 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -10,8 +10,7 @@ * */ -#ifndef THREADENGINE_H -#define THREADENGINE_H +#pragma once #include "sockets.h" #include "extensible.h" @@ -118,4 +117,3 @@ class CoreExport Condition : public Mutex void Wait(); }; -#endif // THREADENGINE_H diff --git a/include/timers.h b/include/timers.h index 6ea48bcfd..043e526e4 100644 --- a/include/timers.h +++ b/include/timers.h @@ -10,8 +10,7 @@ * */ -#ifndef TIMERS_H -#define TIMERS_H +#pragma once #include "anope.h" @@ -129,4 +128,3 @@ class CoreExport TimerManager static void DeleteTimersFor(Module *m); }; -#endif // TIMERS_H diff --git a/include/uplink.h b/include/uplink.h index c7e3e1ccf..95f924093 100644 --- a/include/uplink.h +++ b/include/uplink.h @@ -10,8 +10,7 @@ * */ -#ifndef UPLINK_H -#define UPLINK_H +#pragma once #include "sockets.h" #include "protocol.h" @@ -27,9 +26,9 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket public: UplinkSocket(); ~UplinkSocket(); - bool ProcessRead() anope_override; - void OnConnect() anope_override; - void OnError(const Anope::string &) anope_override; + bool ProcessRead() override; + void OnConnect() override; + void OnError(const Anope::string &) override; /* A message sent over the uplink socket */ class CoreExport Message @@ -50,5 +49,3 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket }; extern CoreExport UplinkSocket *UplinkSock; -#endif // UPLINK_H - diff --git a/include/users.h b/include/users.h index 73c373938..5a0bb46a9 100644 --- a/include/users.h +++ b/include/users.h @@ -11,8 +11,7 @@ * */ -#ifndef USERS_H -#define USERS_H +#pragma once #include "anope.h" #include "modes.h" @@ -191,7 +190,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe * @param ... any number of parameters */ void SendMessage(BotInfo *source, const char *fmt, ...); - void SendMessage(BotInfo *source, const Anope::string &msg) anope_override; + void SendMessage(BotInfo *source, const Anope::string &msg) override; /** Identify the user to a nick. * updates last_seen, logs the user in, @@ -373,4 +372,3 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe static void QuitUsers(); }; -#endif // USERS_H diff --git a/include/xline.h b/include/xline.h index fa3f5ba6c..ae9a1919b 100644 --- a/include/xline.h +++ b/include/xline.h @@ -7,8 +7,7 @@ * */ -#ifndef XLINE_H -#define XLINE_H +#pragma once #include "serialize.h" #include "service.h" @@ -42,7 +41,7 @@ class CoreExport XLine : public Serializable bool HasNickOrReal() const; bool IsRegex() const; - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -177,4 +176,3 @@ class CoreExport XLineManager : public Service virtual void SendDel(XLine *x) = 0; }; -#endif // XLINE_H diff --git a/language/CMakeLists.txt b/language/CMakeLists.txt index 577e132a3..ff5ae2b8f 100644 --- a/language/CMakeLists.txt +++ b/language/CMakeLists.txt @@ -2,7 +2,7 @@ if(GETTEXT_FOUND) # Get all of the .po files file(GLOB LANG_SRCS_PO RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.*.po") - sort_list(LANG_SRCS_PO) + list(SORT LANG_SRCS_PO) foreach(LANG_PO ${LANG_SRCS_PO}) # Get the domain for this language file diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index e9afbf45b..1ae397cc3 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -19,14 +19,6 @@ macro(build_modules SRC) file(RELATIVE_PATH FNAME ${SRC} ${MODULE_SRC}) # Convert the real source file extension to have a .so extension string(REGEX REPLACE "\\.cpp$" ".so" SO ${FNAME}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${MODULE_SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) # Reset linker flags set(TEMP_LDFLAGS) @@ -34,44 +26,37 @@ macro(build_modules SRC) set(TEMP_DEPENDENCIES) # Calculate the library dependencies for the given source file calculate_libraries(${MODULE_SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES) - # Reset has_function - set(HAS_FUNCTION) - # Check the function dependencies for the given source file - check_functions(${MODULE_SRC} HAS_FUNCTION) - # Only continue if this module has all of the required functions - if(HAS_FUNCTION) - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - # Generate the module and set its linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${MODULE_SRC}) - # Windows requires this because it's weird - if(WIN32) - set(WIN32_NO_LIBS "/nodefaultlib:\"libcmt.lib\"") - else(WIN32) - set(WIN32_NO_LIBS) - endif(WIN32) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON) - add_dependencies(${SO} ${PROGRAM_NAME}) - if(GETTEXT_FOUND) - add_dependencies(${SO} module_language) - endif(GETTEXT_FOUND) - target_link_libraries(${SO} ${TEMP_DEPENDENCIES}) - # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set its version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - else(WIN32) - if(APPLE) - target_link_libraries(${SO} ${PROGRAM_NAME}) - endif(APPLE) - endif(WIN32) - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules) - endif(HAS_FUNCTION) + # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators + if(MSVC) + set(WIN32_MEMORY win32_memory) + else(MSVC) + set(WIN32_MEMORY) + endif(MSVC) + # Generate the module and set its linker flags, also set it to depend on the main Anope executable to be built beforehand + add_library(${SO} MODULE ${MODULE_SRC}) + # Windows requires this because it's weird + if(WIN32) + set(WIN32_NO_LIBS "/nodefaultlib:\"libcmt.lib\"") + else(WIN32) + set(WIN32_NO_LIBS) + endif(WIN32) + set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON) + add_dependencies(${SO} ${PROGRAM_NAME}) + if(GETTEXT_FOUND) + add_dependencies(${SO} module_language) + endif(GETTEXT_FOUND) + target_link_libraries(${SO} ${TEMP_DEPENDENCIES}) + # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set its version + if(WIN32) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY}) + set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") + else(WIN32) + if(APPLE) + target_link_libraries(${SO} ${PROGRAM_NAME}) + endif(APPLE) + endif(WIN32) + # Set the module to be installed to the module directory under the data directory + install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules) endif(CPP) endif(IS_DIRECTORY "${MODULE_SRC}") endforeach(MODULE_SRC ${MODULES_SRCS}) @@ -80,7 +65,7 @@ endmacro(build_modules) macro(build_subdir) file(GLOB_RECURSE MODULES_SUBDIR_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") - sort_list(MODULES_SUBDIR_SRCS) + list(SORT MODULES_SUBDIR_SRCS) GET_FILENAME_COMPONENT(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) set(SO "${FOLDER_NAME}.so") @@ -88,77 +73,58 @@ macro(build_subdir) # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) set_source_files_properties(${MODULES_SUBDIR_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - set(HAS_FUNCTION TRUE) - # Iterate through the source files in the subdirectory foreach(SRC ${MODULES_SUBDIR_SRCS}) - if(HAS_FUNCTION) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - include_directories(${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) - - # Reset linker flags - set(TEMP_LDFLAGS) - # Reset extra dependencies - set(TEMP_DEPENDENCIES) - # Calculate the library dependencies for the given source file - calculate_libraries(${SRC} SKIP_LIBRARIES MODULE TEMP_LDFLAGS TEMP_DEPENDENCIES) - # Check the function dependencies for the given source file - check_functions(${SRC} HAS_FUNCTION) - - # Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append - if(TEMP_DEPENDENCIES) - append_to_list(SUBDIR_EXTRA_DEPENDS ${TEMP_DEPDENCIES}) - endif(TEMP_DEPENDENCIES) - endif(HAS_FUNCTION) + # Reset linker flags + set(TEMP_LDFLAGS) + # Reset extra dependencies + set(TEMP_DEPENDENCIES) + # Calculate the library dependencies for the given source file + calculate_libraries(${SRC} SKIP_LIBRARIES MODULE TEMP_LDFLAGS TEMP_DEPENDENCIES) + + # Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append + if(TEMP_DEPENDENCIES) + append_to_list(SUBDIR_EXTRA_DEPENDS ${TEMP_DEPDENCIES}) + endif(TEMP_DEPENDENCIES) endforeach(SRC ${MODULES_SUBDIR_SRCS}) - # Continue if library and function requirements are met - if(HAS_FUNCTION) - # Remove duplicates from the linker flags - if(SUBDIR_LDFLAGS) - remove_list_duplicates(SUBDIR_LDFLAGS) - endif(SUBDIR_LDFLAGS) - - # Remove duplicates from the extra dependencies - if(SUBDIR_EXTRA_DEPENDS) - remove_list_duplicates(SUBDIR_EXTRA_DEPENDS) - endif(SUBDIR_EXTRA_DEPENDS) - - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - - # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON) - add_dependencies(${SO} ${PROGRAM_NAME}) - if(GETTEXT_FOUND) - add_dependencies(${SO} module_language) - endif(GETTEXT_FOUND) - target_link_libraries(${SO} ${SUBDIR_EXTRA_DEPENDS}) - # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - else(WIN32) - if(APPLE) - target_link_libraries(${SO} ${PROGRAM_NAME}) - endif(APPLE) - endif(WIN32) - - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules) - - endif(HAS_FUNCTION) + # Remove duplicates from the linker flags + if(SUBDIR_LDFLAGS) + list(REMOVE_DUPLICATES SUBDIR_LDFLAGS) + endif(SUBDIR_LDFLAGS) + + # Remove duplicates from the extra dependencies + if(SUBDIR_EXTRA_DEPENDS) + list(REMOVE_DUPLICATES SUBDIR_EXTRA_DEPENDS) + endif(SUBDIR_EXTRA_DEPENDS) + + # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators + if(MSVC) + set(WIN32_MEMORY win32_memory) + else(MSVC) + set(WIN32_MEMORY) + endif(MSVC) + + # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand + add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS}) + set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON) + add_dependencies(${SO} ${PROGRAM_NAME}) + if(GETTEXT_FOUND) + add_dependencies(${SO} module_language) + endif(GETTEXT_FOUND) + target_link_libraries(${SO} ${SUBDIR_EXTRA_DEPENDS}) + # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version + if(WIN32) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY}) + set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") + else(WIN32) + if(APPLE) + target_link_libraries(${SO} ${PROGRAM_NAME}) + endif(APPLE) + endif(WIN32) + + # Set the module to be installed to the module directory under the data directory + install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules) endmacro(build_subdir) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 4c41ad357..f13843648 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -16,7 +16,7 @@ class BSAutoAssign : public Module { } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot"); if (bot.empty()) diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 82572d0eb..3bd00a372 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -20,7 +20,7 @@ class CommandBSAssign : public Command this->SetSyntax(_("\037channel\037 \037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &nick = params[1]; @@ -71,7 +71,7 @@ class CommandBSAssign : public Command source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -91,7 +91,7 @@ class CommandBSUnassign : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -132,7 +132,7 @@ class CommandBSUnassign : public Command source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -154,7 +154,7 @@ class CommandBSSetNoBot : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -191,7 +191,7 @@ class CommandBSSetNoBot : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -217,7 +217,7 @@ class BSAssign : public Module { } - void OnInvite(User *source, Channel *c, User *targ) anope_override + void OnInvite(User *source, Channel *c, User *targ) override { BotInfo *bi; if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast<BotInfo *>(targ))) @@ -246,7 +246,7 @@ class BSAssign : public Module targ->SendMessage(bi, _("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), c->name.c_str()); } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (nobot.HasExt(ci)) info.AddOption(_("No bot")); diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index c4155bbc1..551e89987 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -17,7 +17,7 @@ struct BadWordImpl : BadWord, Serializable BadWordImpl() : Serializable("BadWord") { } ~BadWordImpl(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << this->chan; data["word"] << this->word; @@ -37,7 +37,7 @@ struct BadWordsImpl : BadWords ~BadWordsImpl(); - BadWord* AddBadWord(const Anope::string &word, BadWordType type) anope_override + BadWord* AddBadWord(const Anope::string &word, BadWordType type) override { BadWordImpl *bw = new BadWordImpl(); bw->chan = ci->name; @@ -51,7 +51,7 @@ struct BadWordsImpl : BadWords return bw; } - BadWord* GetBadWord(unsigned index) const anope_override + BadWord* GetBadWord(unsigned index) const override { if (this->badwords->empty() || index >= this->badwords->size()) return NULL; @@ -61,12 +61,12 @@ struct BadWordsImpl : BadWords return bw; } - unsigned GetBadWordCount() const anope_override + unsigned GetBadWordCount() const override { return this->badwords->size(); } - void EraseBadWord(unsigned index) anope_override + void EraseBadWord(unsigned index) override { if (this->badwords->empty() || index >= this->badwords->size()) return; @@ -76,13 +76,13 @@ struct BadWordsImpl : BadWords delete this->badwords->at(index); } - void ClearBadWords() anope_override + void ClearBadWords() override { while (!this->badwords->empty()) delete this->badwords->back(); } - void Check() anope_override + void Check() override { if (this->badwords->empty()) ci->Shrink<BadWords>("badwords"); @@ -169,7 +169,7 @@ class BadwordsDelCallback : public NumberList source.Reply(_("Deleted %d entries from %s bad words list."), deleted, ci->name.c_str()); } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!bw || !Number || Number > bw->GetBadWordCount()) return; @@ -208,7 +208,7 @@ class CommandBSBadwords : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > bw->GetBadWordCount()) return; @@ -373,7 +373,7 @@ class CommandBSBadwords : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[1]; const Anope::string &word = params.size() > 2 ? params[2] : ""; @@ -416,7 +416,7 @@ class CommandBSBadwords : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index e25ba8ff0..46550603d 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -264,7 +264,7 @@ class CommandBSBot : public Command this->SetSyntax(_("\002DEL \037nick\037\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -337,7 +337,7 @@ class CommandBSBot : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index 33141d255..2bab21881 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -19,7 +19,7 @@ class CommandBSBotList : public Command this->SetDesc(_("Lists available bots")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { unsigned count = 0; ListFormatter list(source.GetAccount()); @@ -57,7 +57,7 @@ class CommandBSBotList : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 0307c6abf..0843c6150 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -20,7 +20,7 @@ class CommandBSSay : public Command this->SetSyntax(_("\037channel\037 \037text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &text = params[1]; @@ -62,7 +62,7 @@ class CommandBSSay : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -80,7 +80,7 @@ class CommandBSAct : public Command this->SetSyntax(_("\037channel\037 \037text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string message = params[1]; @@ -120,7 +120,7 @@ class CommandBSAct : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 55ccc0b13..b04a62c8f 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -42,7 +42,7 @@ class CommandBSInfo : public Command this->SetSyntax(_("{\037channel\037 | \037nickname\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &query = params[0]; @@ -102,7 +102,7 @@ class CommandBSInfo : public Command source.Reply(_("\002%s\002 is not a valid bot or registered channel."), query.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -114,7 +114,7 @@ class CommandBSInfo : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Allows you to see %s information about a channel or a bot")), source.service->nick.c_str()); } diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index c08376e3c..242043105 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -31,7 +31,7 @@ struct KickerDataImpl : KickerData dontkickops = dontkickvoices = false; } - void Check(ChannelInfo *ci) anope_override + void Check(ChannelInfo *ci) override { if (amsgs || badwords || bolds || caps || colors || flood || italics || repeat || reverses || underlines) return; @@ -43,7 +43,7 @@ struct KickerDataImpl : KickerData { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem<KickerDataImpl>(m, ename) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -73,7 +73,7 @@ struct KickerDataImpl : KickerData data["ttb"] << kd->ttb[i] << " "; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -122,12 +122,12 @@ class CommandBSKick : public Command this->SetSyntax(_("\037option\037 \037channel\037 {\037ON|OFF\037} [\037settings\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -167,9 +167,9 @@ class CommandBSKickBase : public Command { } - virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override = 0; + virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override = 0; - virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0; + virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0; protected: bool CheckArguments(CommandSource &source, const std::vector<Anope::string> ¶ms, ChannelInfo* &ci) @@ -254,7 +254,7 @@ class CommandBSKickAMSG : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -265,7 +265,7 @@ class CommandBSKickAMSG : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -290,7 +290,7 @@ class CommandBSKickBadwords : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -302,7 +302,7 @@ class CommandBSKickBadwords : public CommandBSKickBase } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -329,7 +329,7 @@ class CommandBSKickBolds : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -340,7 +340,7 @@ class CommandBSKickBolds : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -363,7 +363,7 @@ class CommandBSKickCaps : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037min\037 [\037percent\037]]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -431,7 +431,7 @@ class CommandBSKickCaps : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -459,7 +459,7 @@ class CommandBSKickColors : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -470,7 +470,7 @@ class CommandBSKickColors : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -493,7 +493,7 @@ class CommandBSKickFlood : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037ln\037 [\037secs\037]]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -566,7 +566,7 @@ class CommandBSKickFlood : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -591,7 +591,7 @@ class CommandBSKickItalics : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -602,7 +602,7 @@ class CommandBSKickItalics : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -625,7 +625,7 @@ class CommandBSKickRepeat : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037num\037]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -688,7 +688,7 @@ class CommandBSKickRepeat : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -713,7 +713,7 @@ class CommandBSKickReverses : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -724,7 +724,7 @@ class CommandBSKickReverses : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -747,7 +747,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -758,7 +758,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -781,7 +781,7 @@ class CommandBSSetDontKickOps : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -826,7 +826,7 @@ class CommandBSSetDontKickOps : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -846,7 +846,7 @@ class CommandBSSetDontKickVoices : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -891,7 +891,7 @@ class CommandBSSetDontKickVoices : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -978,7 +978,7 @@ class BanDataPurger : public Timer public: BanDataPurger(Module *o) : Timer(o, 300, Anope::CurTime, true) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Log(LOG_DEBUG) << "bs_main: Running bandata purger"; @@ -1095,7 +1095,7 @@ class BSKick : public Module } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (!ci) return; @@ -1210,7 +1210,7 @@ class BSKick : public Module info.AddOption(_("Voices protection")); } - void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override + void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override { /* Now we can make kicker stuff. We try to order the checks * from the fastest one to the slowest one, since there's diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 2d08d9ec6..a69ebb8cf 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -20,12 +20,12 @@ class CommandBSSet : public Command this->SetSyntax(_("\037option\037 \037(channel | bot)\037 \037settings\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -65,7 +65,7 @@ class CommandBSSetBanExpire : public Command public: UnbanTimer(Module *creator, const Anope::string &ch, const Anope::string &bmask, time_t t) : Timer(creator, t), chname(ch), mask(bmask) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Channel *c = Channel::Find(chname); if (c) @@ -79,7 +79,7 @@ class CommandBSSetBanExpire : public Command this->SetSyntax(_("\037channel\037 \037time\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &arg = params[1]; @@ -129,7 +129,7 @@ class CommandBSSetBanExpire : public Command source.Reply(_("Bot bans will automatically expire after %s."), Anope::Duration(ci->banexpire, source.GetAccount()).c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -150,7 +150,7 @@ class CommandBSSetPrivate : public Command this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { BotInfo *bi = BotInfo::Find(params[0], true); const Anope::string &value = params[1]; @@ -181,7 +181,7 @@ class CommandBSSetPrivate : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -204,7 +204,7 @@ class BSSet : public Module { } - void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) anope_override + void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) override { if (!ci->banexpire) return; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index b4f682c66..59e028d6c 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -29,7 +29,7 @@ class AccessChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &name) const anope_override + bool HasPriv(const Anope::string &name) const override { return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name); } @@ -39,7 +39,7 @@ class AccessChanAccess : public ChanAccess return stringify(this->level); } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { try { @@ -50,7 +50,7 @@ class AccessChanAccess : public ChanAccess } } - bool operator>(const ChanAccess &other) const anope_override + bool operator>(const ChanAccess &other) const override { if (this->provider != other.provider) return ChanAccess::operator>(other); @@ -58,7 +58,7 @@ class AccessChanAccess : public ChanAccess return this->level > anope_dynamic_static_cast<const AccessChanAccess *>(&other)->level; } - bool operator<(const ChanAccess &other) const anope_override + bool operator<(const ChanAccess &other) const override { if (this->provider != other.provider) return ChanAccess::operator<(other); @@ -77,7 +77,7 @@ class AccessAccessProvider : public AccessProvider me = this; } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new AccessChanAccess(this); } @@ -274,7 +274,7 @@ class CommandCSAccess : public Command } } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > ci->GetAccessCount()) return; @@ -355,7 +355,7 @@ class CommandCSAccess : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAccessCount()) return; @@ -499,7 +499,7 @@ class CommandCSAccess : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[1]; const Anope::string &nick = params.size() > 2 ? params[2] : ""; @@ -555,7 +555,7 @@ class CommandCSAccess : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -739,7 +739,7 @@ class CommandCSLevels : public Command this->SetSyntax(_("\037channel\037 RESET")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[1]; const Anope::string &what = params.size() > 2 ? params[2] : ""; @@ -775,7 +775,7 @@ class CommandCSLevels : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.equals_ci("DESC")) { @@ -842,7 +842,7 @@ class CSAccess : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { defaultLevels.clear(); @@ -868,12 +868,12 @@ class CSAccess : public Module } } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { reset_levels(ci); } - EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) anope_override + EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) override { if (group->ci == NULL) return EVENT_CONTINUE; diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 873b1cb43..1aff37eb5 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -203,7 +203,7 @@ class CommandCSAKick : public Command source.Reply(_("Deleted %d entries from %s autokick list."), deleted, ci->name.c_str()); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAkickCount()) return; @@ -268,7 +268,7 @@ class CommandCSAKick : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAkickCount()) return; @@ -428,7 +428,7 @@ class CommandCSAKick : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string chan = params[0]; Anope::string cmd = params[1]; @@ -465,7 +465,7 @@ class CommandCSAKick : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { BotInfo *bi = Config->GetClient("NickServ"); this->SendSyntax(source); @@ -518,7 +518,7 @@ class CSAKick : public Module { } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (!c->ci || c->MatchesList(u, "EXCEPT")) return EVENT_CONTINUE; diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 0395ddd92..3a5e335f1 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -23,7 +23,7 @@ class TempBan : public Timer public: TempBan(time_t seconds, Channel *c, const Anope::string &banmask) : Timer(me, seconds), channel(c->name), mask(banmask) { } - void Tick(time_t ctime) anope_override + void Tick(time_t ctime) override { Channel *c = Channel::Find(this->channel); if (c) @@ -40,7 +40,7 @@ class CommandCSBan : public Command this->SetSyntax(_("\037channel\037 [+\037expiry\037] {\037nick\037 | \037mask\037} [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; @@ -198,7 +198,7 @@ class CommandCSBan : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index e93029466..bfe21783b 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -21,7 +21,7 @@ public: this->SetSyntax(_("\037channel\037 \037target\037 [\037what\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &channel = params[0]; const Anope::string &target = params[1]; @@ -187,7 +187,7 @@ public: Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 401573ea2..03d24a18d 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -20,7 +20,7 @@ class CommandCSDrop : public Command this->SetSyntax(_("\037channel\037 \037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; @@ -66,7 +66,7 @@ class CommandCSDrop : public Command c->CheckModes(); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 0a4eae539..5ea267e6f 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -228,7 +228,7 @@ class CommandCSEnforce : public Command this->SetSyntax(_("\037channel\037 \037what\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &what = params.size() > 1 ? params[1] : ""; @@ -256,7 +256,7 @@ class CommandCSEnforce : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 4eec3e07d..d9948a52f 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -28,7 +28,7 @@ struct EntryMsgImpl : EntryMsg, Serializable ~EntryMsgImpl(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << this->chan; data["creator"] << this->creator; @@ -43,7 +43,7 @@ struct EntryMessageListImpl : EntryMessageList { EntryMessageListImpl(Extensible *) { } - EntryMsg* Create() anope_override + EntryMsg* Create() override { return new EntryMsgImpl(); } @@ -197,7 +197,7 @@ class CommandEntryMessage : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -232,7 +232,7 @@ class CommandEntryMessage : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -270,7 +270,7 @@ class CSEntryMessage : public Module { } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (u && c && c->ci && u->server->IsSynced()) { diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 01314e2d3..b2ade785f 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -22,7 +22,7 @@ class FlagsChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &priv) const anope_override + bool HasPriv(const Anope::string &priv) const override { std::map<Anope::string, char>::iterator it = defaultFlags.find(priv); if (it != defaultFlags.end() && this->flags.count(it->second) > 0) @@ -35,7 +35,7 @@ class FlagsChanAccess : public ChanAccess return Anope::string(this->flags.begin(), this->flags.end()); } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { for (unsigned i = data.length(); i > 0; --i) this->flags.insert(data[i - 1]); @@ -69,7 +69,7 @@ class FlagsAccessProvider : public AccessProvider ap = this; } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new FlagsChanAccess(this); } @@ -376,7 +376,7 @@ class CommandCSFlags : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &cmd = params.size() > 1 ? params[1] : ""; @@ -411,7 +411,7 @@ class CommandCSFlags : public Command this->OnSyntaxError(source, cmd); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -464,7 +464,7 @@ class CSFlags : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { defaultFlags.clear(); diff --git a/modules/commands/cs_getkey.cpp b/modules/commands/cs_getkey.cpp index c6d57f3b4..187c01c68 100644 --- a/modules/commands/cs_getkey.cpp +++ b/modules/commands/cs_getkey.cpp @@ -20,7 +20,7 @@ class CommandCSGetKey : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; @@ -50,7 +50,7 @@ class CommandCSGetKey : public Command source.Reply(_("Key for channel \002%s\002 is \002%s\002."), chan.c_str(), key.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index af12aba78..06130f15e 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -21,7 +21,7 @@ class CommandCSInfo : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; @@ -69,7 +69,7 @@ class CommandCSInfo : public Command source.Reply(replies[i]); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index 1f39eaf7b..0058f4ee6 100644 --- a/modules/commands/cs_invite.cpp +++ b/modules/commands/cs_invite.cpp @@ -20,7 +20,7 @@ class CommandCSInvite : public Command this->SetSyntax(_("\037channel\037 [\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; @@ -84,7 +84,7 @@ class CommandCSInvite : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index dded149eb..55e0a6718 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -21,7 +21,7 @@ class CommandCSKick : public Command this->SetSyntax(_("\037channel\037 \037mask\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &target = params[1]; @@ -108,7 +108,7 @@ class CommandCSKick : public Command source.Reply(NICK_X_NOT_IN_USE, target.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index d58d105b7..735a836de 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -20,7 +20,7 @@ class CommandCSList : public Command this->SetSyntax(_("\037pattern\037 [SUSPENDED] [NOEXPIRE]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string pattern = params[0]; unsigned nchans; @@ -124,7 +124,7 @@ class CommandCSList : public Command source.Reply(_("End of list - %d/%d matches shown."), nchans > listmax ? listmax : nchans, nchans); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -175,7 +175,7 @@ class CommandCSSetPrivate : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -219,7 +219,7 @@ class CommandCSSetPrivate : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -247,7 +247,7 @@ class CSList : public Module { } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 03342ebcf..8fb253321 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -33,7 +33,7 @@ struct LogSettingImpl : LogSetting, Serializable } } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << chan; data["service_name"] << service_name; @@ -91,7 +91,7 @@ struct LogSettingsImpl : LogSettings } } - LogSetting *Create() anope_override + LogSetting *Create() override { return new LogSettingImpl(); } @@ -107,7 +107,7 @@ public: this->SetSyntax(_("\037channel\037 \037command\037 \037method\037 [\037status\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &channel = params[0]; @@ -251,7 +251,7 @@ public: this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -301,7 +301,7 @@ class CSLog : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); defaults.clear(); @@ -320,7 +320,7 @@ class CSLog : public Module } } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { if (defaults.empty()) return; @@ -353,7 +353,7 @@ class CSLog : public Module } } - void OnLog(Log *l) anope_override + void OnLog(Log *l) override { if (l->type != LOG_COMMAND || l->u == NULL || l->c == NULL || l->ci == NULL || !Me || !Me->IsSynced()) return; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index a13610d23..ed54c5164 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -29,7 +29,7 @@ struct ModeLockImpl : ModeLock, Serializable } } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -52,7 +52,7 @@ struct ModeLocksImpl : ModeLocks } } - bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const anope_override + bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const override { if (!mode) return false; @@ -68,7 +68,7 @@ struct ModeLocksImpl : ModeLocks return false; } - bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m, Anope::string setter, time_t created = Anope::CurTime) anope_override + bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m, Anope::string setter, time_t created = Anope::CurTime) override { if (!mode) return false; @@ -98,7 +98,7 @@ struct ModeLocksImpl : ModeLocks return true; } - bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") anope_override + bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") override { if (!mode) return false; @@ -127,14 +127,14 @@ struct ModeLocksImpl : ModeLocks return false; } - void RemoveMLock(ModeLock *mlock) anope_override + void RemoveMLock(ModeLock *mlock) override { ModeList::iterator it = std::find(this->mlocks->begin(), this->mlocks->end(), mlock); if (it != this->mlocks->end()) this->mlocks->erase(it); } - void ClearMLock() anope_override + void ClearMLock() override { ModeList ml; this->mlocks->swap(ml); @@ -142,12 +142,12 @@ struct ModeLocksImpl : ModeLocks delete ml[i]; } - const ModeList &GetMLock() const anope_override + const ModeList &GetMLock() const override { return this->mlocks; } - std::list<ModeLock *> GetModeLockList(const Anope::string &name) anope_override + std::list<ModeLock *> GetModeLockList(const Anope::string &name) override { std::list<ModeLock *> mlist; for (ModeList::const_iterator it = this->mlocks->begin(); it != this->mlocks->end(); ++it) @@ -159,7 +159,7 @@ struct ModeLocksImpl : ModeLocks return mlist; } - const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") anope_override + const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") override { for (ModeList::const_iterator it = this->mlocks->begin(); it != this->mlocks->end(); ++it) { @@ -172,7 +172,7 @@ struct ModeLocksImpl : ModeLocks return NULL; } - Anope::string GetMLockAsString(bool complete) const anope_override + Anope::string GetMLockAsString(bool complete) const override { Anope::string pos = "+", neg = "-", params; @@ -201,7 +201,7 @@ struct ModeLocksImpl : ModeLocks return pos + neg + params; } - void Check() anope_override + void Check() override { if (this->mlocks->empty()) ci->Shrink<ModeLocks>("modelocks"); @@ -682,7 +682,7 @@ class CommandCSMode : public Command this->SetSyntax(_("\037channel\037 CLEAR [\037what\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &subcommand = params[1]; @@ -712,7 +712,7 @@ class CommandCSMode : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -753,7 +753,7 @@ class CommandCSModes : public Command this->SetSyntax(_("\037channel\037 [\037user\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(), *targ = params.size() > 1 ? User::Find(params[1], true) : u; @@ -825,7 +825,7 @@ class CommandCSModes : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "on " << targ->nick; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { const std::pair<bool, Anope::string> &m = modes[source.command]; if (!m.second.empty()) @@ -839,7 +839,7 @@ class CommandCSModes : public Command return ""; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { const std::pair<bool, Anope::string> &m = modes[source.command]; if (m.second.empty()) @@ -878,7 +878,7 @@ class CSMode : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { modes.clear(); @@ -902,7 +902,7 @@ class CSMode : public Module } } - void OnCheckModes(Reference<Channel> &c) anope_override + void OnCheckModes(Reference<Channel> &c) override { if (!c || !c->ci) return; @@ -951,7 +951,7 @@ class CSMode : public Module } } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { ModeLocks *ml = modelocks.Require(ci); Anope::string mlock; @@ -977,7 +977,7 @@ class CSMode : public Module ml->Check(); } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { if (!show_hidden) return; diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 2904f5b51..dda906fcd 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -20,7 +20,7 @@ class CommandCSRegister : public Command this->SetSyntax(_("\037channel\037 [\037description\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &chdesc = params.size() > 1 ? params[1] : ""; @@ -79,7 +79,7 @@ class CommandCSRegister : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index c6dbec9a9..db0195aa3 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -44,7 +44,7 @@ struct SeenInfo : Serializable database.erase(iter); } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << nick; data["vhost"] << vhost; @@ -120,7 +120,7 @@ class CommandOSSeen : public Command this->SetSyntax(_("CLEAR \037time\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params[0].equals_ci("STATS")) { @@ -166,7 +166,7 @@ class CommandOSSeen : public Command this->SendSyntax(source); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -258,7 +258,7 @@ class CommandSeen : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &target = params[0]; @@ -355,7 +355,7 @@ class CommandSeen : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -376,12 +376,12 @@ class CSSeen : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { simple = conf->GetModule(this)->Get<bool>("simple"); } - void OnExpireTick() anope_override + void OnExpireTick() override { size_t previous_size = database.size(); time_t purgetime = Config->GetModule(this)->Get<time_t>("purgetime"); @@ -401,34 +401,34 @@ class CSSeen : public Module Log(LOG_DEBUG) << "cs_seen: Purged database, checked " << previous_size << " nicks and removed " << (previous_size - database.size()) << " old entries."; } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting()) UpdateUser(u, NEW, u->nick, "", "", ""); } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { UpdateUser(u, NICK_TO, oldnick, u->nick, "", ""); UpdateUser(u, NICK_FROM, u->nick, oldnick, "", ""); } - void OnUserQuit(User *u, const Anope::string &msg) anope_override + void OnUserQuit(User *u, const Anope::string &msg) override { UpdateUser(u, QUIT, u->nick, "", "", msg); } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { UpdateUser(u, JOIN, u->nick, "", c->name, ""); } - void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) anope_override + void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) override { UpdateUser(u, PART, u->nick, "", channel, msg); } - void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) anope_override + void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) override { UpdateUser(cu->user, KICK, cu->user->nick, source.GetSource(), cu->chan->name, msg); } diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 1109c888e..503941c82 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -21,12 +21,12 @@ class CommandCSSet : public Command this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -72,7 +72,7 @@ class CommandCSSetAutoOp : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -114,7 +114,7 @@ class CommandCSSetAutoOp : public Command this->OnSyntaxError(source, "AUTOOP"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -135,7 +135,7 @@ class CommandCSSetBanType : public Command this->SetSyntax(_("\037channel\037 \037bantype\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -176,7 +176,7 @@ class CommandCSSetBanType : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -202,7 +202,7 @@ class CommandCSSetDescription : public Command this->SetSyntax(_("\037channel\037 [\037description\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -245,7 +245,7 @@ class CommandCSSetDescription : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -264,7 +264,7 @@ class CommandCSSetFounder : public Command this->SetSyntax(_("\037channel\037 \037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -314,7 +314,7 @@ class CommandCSSetFounder : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -333,7 +333,7 @@ class CommandCSSetKeepModes : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -378,7 +378,7 @@ class CommandCSSetKeepModes : public Command this->OnSyntaxError(source, "KEEPMODES"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -398,7 +398,7 @@ class CommandCSSetPeace : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -442,7 +442,7 @@ class CommandCSSetPeace : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -470,7 +470,7 @@ class CommandCSSetPersist : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -594,7 +594,7 @@ class CommandCSSetPersist : public Command this->OnSyntaxError(source, "PERSIST"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *BotServ = Config->GetClient("BotServ"); BotInfo *ChanServ = Config->GetClient("ChanServ"); @@ -633,7 +633,7 @@ class CommandCSSetRestricted : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -675,7 +675,7 @@ class CommandCSSetRestricted : public Command this->OnSyntaxError(source, "RESTRICTED"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -695,7 +695,7 @@ class CommandCSSetSecure : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -737,7 +737,7 @@ class CommandCSSetSecure : public Command this->OnSyntaxError(source, "SECURE"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -759,7 +759,7 @@ class CommandCSSetSecureFounder : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -801,7 +801,7 @@ class CommandCSSetSecureFounder : public Command this->OnSyntaxError(source, "SECUREFOUNDER"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -823,7 +823,7 @@ class CommandCSSetSecureOps : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -865,7 +865,7 @@ class CommandCSSetSecureOps : public Command this->OnSyntaxError(source, "SECUREOPS"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -885,7 +885,7 @@ class CommandCSSetSignKick : public Command this->SetSyntax(_("\037channel\037 {ON | LEVEL | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -937,7 +937,7 @@ class CommandCSSetSignKick : public Command this->OnSyntaxError(source, "SIGNKICK"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -962,7 +962,7 @@ class CommandCSSetSuccessor : public Command this->SetSyntax(_("\037channel\037 \037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1022,7 +1022,7 @@ class CommandCSSetSuccessor : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1048,7 +1048,7 @@ class CommandCSSetNoexpire : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1087,7 +1087,7 @@ class CommandCSSetNoexpire : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1106,7 +1106,7 @@ class CSSet : public Module { KeepModes(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { SerializableExtensibleItem<bool>::ExtensibleSerialize(e, s, data); @@ -1126,7 +1126,7 @@ class CSSet : public Module data["last_modes"] << modes; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { SerializableExtensibleItem<bool>::ExtensibleUnserialize(e, s, data); @@ -1151,7 +1151,7 @@ class CSSet : public Module { Persist(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { SerializableExtensibleItem<bool>::ExtensibleUnserialize(e, s, data); @@ -1225,17 +1225,17 @@ class CSSet : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { persist_lower_ts = conf->GetModule(this)->Get<bool>("persist_lower_ts"); } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { ci->bantype = Config->GetModule(this)->Get<int>("defbantype", "2"); } - void OnChannelCreate(Channel *c) anope_override + void OnChannelCreate(Channel *c) override { if (c->ci && keep_modes.HasExt(c->ci)) { @@ -1245,12 +1245,12 @@ class CSSet : public Module } } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { OnChannelCreate(c); } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (!c->ci || !restricted.HasExt(c->ci) || c->MatchesList(u, "EXCEPT")) return EVENT_CONTINUE; @@ -1261,14 +1261,14 @@ class CSSet : public Module return EVENT_CONTINUE; } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (ci->c && persist.HasExt(ci)) ci->c->RemoveMode(ci->WhoSends(), "PERM", "", false); persist.Unset(ci); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (c->ci) { @@ -1283,7 +1283,7 @@ class CSSet : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (mode->name == "PERM") { @@ -1297,14 +1297,14 @@ class CSSet : public Module return EVENT_CONTINUE; } - EventReturn OnCheckDelete(Channel *c) anope_override + EventReturn OnCheckDelete(Channel *c) override { if (c->ci && persist.HasExt(c->ci)) return EVENT_STOP; return EVENT_CONTINUE; } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (persist_lower_ts && c->ci && persist.HasExt(c->ci) && c->creation_time > c->ci->time_registered) { @@ -1315,7 +1315,7 @@ class CSSet : public Module } } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { if (chan->ci) { @@ -1327,13 +1327,13 @@ class CSSet : public Module } } - void OnPreChanExpire(ChannelInfo *ci, bool &expire) anope_override + void OnPreChanExpire(ChannelInfo *ci, bool &expire) override { if (noexpire.HasExt(ci)) expire = false; } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 3457bbed3..41abd6138 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -18,7 +18,7 @@ static std::map<Anope::string, Anope::string> descriptions; struct CSMiscData; static Anope::map<ExtensibleItem<CSMiscData> *> items; -static ExtensibleItem<CSMiscData> *GetItem(const Anope::string &name) anope_override +static ExtensibleItem<CSMiscData> *GetItem(const Anope::string &name) { ExtensibleItem<CSMiscData>* &it = items[name]; if (!it) @@ -41,7 +41,7 @@ struct CSMiscData : MiscData, Serializable data = d; } - void Serialize(Serialize::Data &sdata) const anope_override + void Serialize(Serialize::Data &sdata) const override { sdata["ci"] << this->object; sdata["name"] << this->name; @@ -95,7 +95,7 @@ class CommandCSSetMisc : public Command this->SetSyntax(_("\037channel\037 [\037parameters\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -142,7 +142,7 @@ class CommandCSSetMisc : public Command } } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (descriptions.count(source.command)) { @@ -151,7 +151,7 @@ class CommandCSSetMisc : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (descriptions.count(source.command)) { @@ -180,7 +180,7 @@ class CSSetMisc : public Module delete it->second; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { descriptions.clear(); @@ -201,7 +201,7 @@ class CSSetMisc : public Module } } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool) override { for (Anope::map<ExtensibleItem<CSMiscData> *>::iterator it = items.begin(); it != items.end(); ++it) { diff --git a/modules/commands/cs_status.cpp b/modules/commands/cs_status.cpp index 2ecaf8e9f..659119d06 100644 --- a/modules/commands/cs_status.cpp +++ b/modules/commands/cs_status.cpp @@ -20,7 +20,7 @@ public: this->SetSyntax(_("\037channel\037 [\037user\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &channel = params[0]; @@ -84,7 +84,7 @@ public: } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index 4ebb6eecb..b7d22ae41 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -16,7 +16,7 @@ struct CSSuspendInfo : SuspendInfo, Serializable { CSSuspendInfo(Extensible *) : Serializable("CSSuspendInfo") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["chan"] << what; data["by"] << by; @@ -59,7 +59,7 @@ class CommandCSSuspend : public Command this->SetSyntax(_("\037channel\037 [+\037expiry\037] [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; Anope::string expiry = params[1]; @@ -127,7 +127,7 @@ class CommandCSSuspend : public Command FOREACH_MOD(OnChanSuspend, (ci)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -152,7 +152,7 @@ class CommandCSUnSuspend : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) @@ -184,7 +184,7 @@ class CommandCSUnSuspend : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -208,7 +208,7 @@ class CSSuspend : public Module { } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { CSSuspendInfo *si = suspend.Get(ci); if (si) @@ -225,7 +225,7 @@ class CSSuspend : public Module } } - void OnPreChanExpire(ChannelInfo *ci, bool &expire) anope_override + void OnPreChanExpire(ChannelInfo *ci, bool &expire) override { CSSuspendInfo *si = suspend.Get(ci); if (!si) @@ -245,7 +245,7 @@ class CSSuspend : public Module } } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (u->HasMode("OPER") || !c->ci || !suspend.HasExt(c->ci)) return EVENT_CONTINUE; @@ -254,7 +254,7 @@ class CSSuspend : public Module return EVENT_STOP; } - EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) anope_override + EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) override { CSSuspendInfo *si = suspend.Get(ci); if (si && !source.HasCommand("chanserv/drop")) diff --git a/modules/commands/cs_sync.cpp b/modules/commands/cs_sync.cpp index 81d82b5a3..0251b95be 100644 --- a/modules/commands/cs_sync.cpp +++ b/modules/commands/cs_sync.cpp @@ -20,7 +20,7 @@ class CommandCSSync : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); @@ -42,7 +42,7 @@ class CommandCSSync : public Command } } - bool OnHelp(CommandSource &source, const Anope::string ¶ms) anope_override + bool OnHelp(CommandSource &source, const Anope::string ¶ms) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index bc5b9c000..9b4752d20 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -21,7 +21,7 @@ class CommandCSSetKeepTopic : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -63,7 +63,7 @@ class CommandCSSetKeepTopic : public Command this->OnSyntaxError(source, "KEEPTOPIC"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -159,7 +159,7 @@ class CommandCSTopic : public Command this->SetSyntax(_("\037channel\037 [UNLOCK|LOCK]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &subcmd = params[1]; @@ -182,7 +182,7 @@ class CommandCSTopic : public Command this->SendSyntax(source); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -211,7 +211,7 @@ class CSTopic : public Module } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (c->ci) { @@ -223,7 +223,7 @@ class CSTopic : public Module } } - void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override + void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) override { if (!c->ci) return; @@ -245,7 +245,7 @@ class CSTopic : public Module } } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (keeptopic.HasExt(ci)) info.AddOption(_("Topic retention")); diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index 56a482985..936de6b41 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -20,7 +20,7 @@ class CommandCSUnban : public Command this->SetSyntax(_("\037channel\037 [\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) { @@ -87,7 +87,7 @@ class CommandCSUnban : public Command source.Reply(_("\002%s\002 has been unbanned from \002%s\002."), u2->nick.c_str(), ci->c->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_updown.cpp b/modules/commands/cs_updown.cpp index b0488de26..294d46680 100644 --- a/modules/commands/cs_updown.cpp +++ b/modules/commands/cs_updown.cpp @@ -49,7 +49,7 @@ class CommandCSUp : public Command this->SetSyntax(_("[\037channel\037 [\037nick\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) { @@ -113,7 +113,7 @@ class CommandCSUp : public Command } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -141,7 +141,7 @@ class CommandCSDown : public Command this->SetSyntax(_("[\037channel\037 [\037nick\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) { @@ -204,7 +204,7 @@ class CommandCSDown : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 72b1e0def..49cb96eb4 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -26,7 +26,7 @@ class XOPChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &priv) const anope_override + bool HasPriv(const Anope::string &priv) const override { for (std::vector<Anope::string>::iterator it = std::find(order.begin(), order.end(), this->type); it != order.end(); ++it) { @@ -42,7 +42,7 @@ class XOPChanAccess : public ChanAccess return this->type; } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { this->type = data; } @@ -88,7 +88,7 @@ class XOPAccessProvider : public AccessProvider { } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new XOPChanAccess(this); } @@ -308,7 +308,7 @@ class CommandCSXOP : public Command } } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAccessCount()) return; @@ -393,7 +393,7 @@ class CommandCSXOP : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > ci->GetAccessCount()) return; @@ -489,7 +489,7 @@ class CommandCSXOP : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Modify the list of %s users")), source.command.upper().c_str()); } @@ -518,7 +518,7 @@ class CommandCSXOP : public Command } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { const Anope::string &cmd = source.command.upper(); @@ -600,7 +600,7 @@ class CSXOP : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { order.clear(); permissions.clear(); diff --git a/modules/commands/gl_global.cpp b/modules/commands/gl_global.cpp index 10b8a3677..48152cd0b 100644 --- a/modules/commands/gl_global.cpp +++ b/modules/commands/gl_global.cpp @@ -22,7 +22,7 @@ class CommandGLGlobal : public Command this->SetSyntax(_("\037message\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &msg = params[0]; @@ -35,7 +35,7 @@ class CommandGLGlobal : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/greet.cpp b/modules/commands/greet.cpp index 664fd5efc..52213acec 100644 --- a/modules/commands/greet.cpp +++ b/modules/commands/greet.cpp @@ -20,7 +20,7 @@ class CommandBSSetGreet : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -63,7 +63,7 @@ class CommandBSSetGreet : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -119,12 +119,12 @@ class CommandNSSetGreet : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params.size() > 0 ? params[0] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -145,12 +145,12 @@ class CommandNSSASetGreet : public CommandNSSetGreet this->SetSyntax(_("\037nickname\037 \037message\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -182,7 +182,7 @@ class Greet : public Module { } - void OnJoinChannel(User *user, Channel *c) anope_override + void OnJoinChannel(User *user, Channel *c) override { /* Only display the greet if the main uplink we're connected * to has synced, or we'll get greet-floods when the net @@ -199,14 +199,14 @@ class Greet : public Module } } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { Anope::string *greet = ns_greet.Get(na->nc); if (greet != NULL) info[_("Greet")] = *greet; } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (bs_greet.HasExt(ci)) info.AddOption(_("Greet")); diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index c306cb119..33ac00a60 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -34,7 +34,7 @@ class CommandHelp : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { EventReturn MOD_RESULT; FOREACH_RESULT(OnPreHelp, MOD_RESULT, (source, params)); diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 76951de46..5c74eb8ac 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -20,7 +20,7 @@ class CommandHSDel : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -41,7 +41,7 @@ class CommandHSDel : public Command source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -60,7 +60,7 @@ class CommandHSDelAll : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -86,7 +86,7 @@ class CommandHSDelAll : public Command source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index a238c3f99..ca3aa9742 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -42,7 +42,7 @@ class CommandHSGroup : public Command this->SetDesc(_("Syncs the vhost for all nicks in a group")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -65,7 +65,7 @@ class CommandHSGroup : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -88,7 +88,7 @@ class HSGroup : public Module { } - void OnSetVhost(NickAlias *na) anope_override + void OnSetVhost(NickAlias *na) override { if (!synconset) return; @@ -96,7 +96,7 @@ class HSGroup : public Module commandhsgroup.Sync(na); } - void OnNickGroup(User *u, NickAlias *na) anope_override + void OnNickGroup(User *u, NickAlias *na) override { if (!syncongroup) return; @@ -104,7 +104,7 @@ class HSGroup : public Module commandhsgroup.Sync(na); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); syncongroup = block->Get<bool>("syncongroup"); diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index e372860e2..5f9a60110 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -20,7 +20,7 @@ class CommandHSList : public Command this->SetSyntax(_("[\037key\037|\037#X-Y\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &key = !params.empty() ? params[0] : ""; int from = 0, to = 0, counter = 1; @@ -129,7 +129,7 @@ class CommandHSList : public Command source.Reply(replies[i]); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_off.cpp b/modules/commands/hs_off.cpp index 96d5fccca..93060432a 100644 --- a/modules/commands/hs_off.cpp +++ b/modules/commands/hs_off.cpp @@ -20,7 +20,7 @@ class CommandHSOff : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); const NickAlias *na = NickAlias::Find(u->nick); @@ -37,7 +37,7 @@ class CommandHSOff : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_on.cpp b/modules/commands/hs_on.cpp index d6897283a..182e1013e 100644 --- a/modules/commands/hs_on.cpp +++ b/modules/commands/hs_on.cpp @@ -20,7 +20,7 @@ class CommandHSOn : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSetVHost) return; // HostServ wouldn't even be loaded at this point @@ -46,7 +46,7 @@ class CommandHSOn : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index cd1a85c0a..f5eb5317d 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -30,7 +30,7 @@ struct HostRequest : Serializable HostRequest(Extensible *) : Serializable("HostRequest") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << this->nick; data["ident"] << this->ident; @@ -80,7 +80,7 @@ class CommandHSRequest : public Command this->SetSyntax(_("vhost")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -167,7 +167,7 @@ class CommandHSRequest : public Command Log(LOG_COMMAND, source, this) << "to request new vhost " << (!user.empty() ? user + "@" : "") << host; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -187,7 +187,7 @@ class CommandHSActivate : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -215,7 +215,7 @@ class CommandHSActivate : public Command source.Reply(_("No request for nick %s found."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -236,7 +236,7 @@ class CommandHSReject : public Command this->SetSyntax(_("\037nick\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -271,7 +271,7 @@ class CommandHSReject : public Command source.Reply(_("No request for nick %s found."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -291,7 +291,7 @@ class CommandHSWaiting : public Command this->SetDesc(_("Retrieves the vhost requests")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { unsigned counter = 0; unsigned display_counter = 0, listmax = Config->GetModule(this->owner)->Get<unsigned>("listmax"); @@ -332,7 +332,7 @@ class CommandHSWaiting : public Command source.Reply(_("Displayed \002%d\002 records (\002%d\002 total)."), display_counter, counter); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_set.cpp b/modules/commands/hs_set.cpp index 2940227aa..770aa6695 100644 --- a/modules/commands/hs_set.cpp +++ b/modules/commands/hs_set.cpp @@ -20,7 +20,7 @@ class CommandHSSet : public Command this->SetSyntax(_("\037nick\037 \037hostmask\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -92,7 +92,7 @@ class CommandHSSet : public Command source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -126,7 +126,7 @@ class CommandHSSetAll : public Command this->SetSyntax(_("\037nick\037 \037hostmask\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -199,7 +199,7 @@ class CommandHSSetAll : public Command source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp index 300836ffa..86d70732e 100644 --- a/modules/commands/ms_cancel.cpp +++ b/modules/commands/ms_cancel.cpp @@ -20,7 +20,7 @@ class CommandMSCancel : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -57,7 +57,7 @@ class CommandMSCancel : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_check.cpp b/modules/commands/ms_check.cpp index c0deabf65..3cb116088 100644 --- a/modules/commands/ms_check.cpp +++ b/modules/commands/ms_check.cpp @@ -20,7 +20,7 @@ class CommandMSCheck : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &recipient = params[0]; @@ -62,7 +62,7 @@ class CommandMSCheck : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index fc7c1d931..4b6c7d95f 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -21,7 +21,7 @@ class MemoDelCallback : public NumberList { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -42,7 +42,7 @@ class CommandMSDel : public Command this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | ALL}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -114,7 +114,7 @@ class CommandMSDel : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp index 4483f9684..d7683d651 100644 --- a/modules/commands/ms_ignore.cpp +++ b/modules/commands/ms_ignore.cpp @@ -22,7 +22,7 @@ class CommandMSIgnore : public Command this->SetSyntax(_("[\037channel\037] LIST")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -100,7 +100,7 @@ class CommandMSIgnore : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp index 00df72769..fe008b484 100644 --- a/modules/commands/ms_info.cpp +++ b/modules/commands/ms_info.cpp @@ -20,7 +20,7 @@ class CommandMSInfo : public Command this->SetSyntax(_("[\037nick\037 | \037channel\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { NickCore *nc = source.nc; const MemoInfo *mi; @@ -180,7 +180,7 @@ class CommandMSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index 0121d0e9c..936dbc750 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -20,7 +20,7 @@ class CommandMSList : public Command this->SetSyntax(_("[\037channel\037] [\037list\037 | NEW]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string param = !params.empty() ? params[0] : "", chan; @@ -75,7 +75,7 @@ class CommandMSList : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -135,7 +135,7 @@ class CommandMSList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index 82a3831ff..9cc0be881 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -57,7 +57,7 @@ class MemoListCallback : public NumberList { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -104,7 +104,7 @@ class CommandMSRead : public Command this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | NEW}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { MemoInfo *mi; @@ -176,7 +176,7 @@ class CommandMSRead : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp index 66f3e0bae..0ecdf5d7e 100644 --- a/modules/commands/ms_rsend.cpp +++ b/modules/commands/ms_rsend.cpp @@ -25,7 +25,7 @@ class CommandMSRSend : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037} \037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -73,7 +73,7 @@ class CommandMSRSend : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index eb3c98eca..2d796b505 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -25,7 +25,7 @@ class CommandMSSend : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037} \037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -50,7 +50,7 @@ class CommandMSSend : public Command source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_sendall.cpp b/modules/commands/ms_sendall.cpp index 1017c86c9..a48eb3fa5 100644 --- a/modules/commands/ms_sendall.cpp +++ b/modules/commands/ms_sendall.cpp @@ -25,7 +25,7 @@ class CommandMSSendAll : public Command this->SetSyntax(_("\037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -45,7 +45,7 @@ class CommandMSSendAll : public Command source.Reply(_("A massmemo has been sent to all registered users.")); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_set.cpp b/modules/commands/ms_set.cpp index c3394f14d..81388bc3d 100644 --- a/modules/commands/ms_set.cpp +++ b/modules/commands/ms_set.cpp @@ -207,7 +207,7 @@ class CommandMSSet : public Command this->SetSyntax(_("\037option\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; MemoInfo *mi = &source.nc->memos; @@ -226,7 +226,7 @@ class CommandMSSet : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.empty()) { diff --git a/modules/commands/ms_staff.cpp b/modules/commands/ms_staff.cpp index 150c120b2..e0cfe3f5d 100644 --- a/modules/commands/ms_staff.cpp +++ b/modules/commands/ms_staff.cpp @@ -25,7 +25,7 @@ class CommandMSStaff : public Command this->SetSyntax(_("\037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -41,7 +41,7 @@ class CommandMSStaff : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index dfafdb37f..facf7cf9c 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -104,7 +104,7 @@ class CommandNSAccess : public Command this->SetSyntax(_("LIST [\037nickname\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; Anope::string nick, mask; @@ -159,7 +159,7 @@ class CommandNSAccess : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -196,7 +196,7 @@ class NSAccess : public Module { } - void OnNickRegister(User *u, NickAlias *na) anope_override + void OnNickRegister(User *u, NickAlias *na) override { if (u && Config->GetModule(this)->Get<bool>("addaccessonreg")) na->nc->AddAccess(u->Mask()); diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 54caaaf7e..cbbf544e6 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -38,7 +38,7 @@ struct AJoinEntry : Serializable } } - void Serialize(Serialize::Data &sd) const anope_override + void Serialize(Serialize::Data &sd) const override { if (!this->owner) return; @@ -233,7 +233,7 @@ class CommandNSAJoin : public Command this->SetSyntax(_("LIST [\037nickname\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; Anope::string nick, param, param2; @@ -285,7 +285,7 @@ class CommandNSAJoin : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -314,7 +314,7 @@ class NSAJoin : public Module } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { BotInfo *NickServ = Config->GetClient("NickServ"); if (!NickServ) diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp index 46981dc95..51f87f156 100644 --- a/modules/commands/ns_alist.cpp +++ b/modules/commands/ns_alist.cpp @@ -25,7 +25,7 @@ class CommandNSAList : public Command this->SetSyntax(_("[\037nickname\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string nick = source.GetNick(); NickCore *nc = source.nc; @@ -111,7 +111,7 @@ class CommandNSAList : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index 81a782045..e8c858f42 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -18,7 +18,7 @@ struct CertServiceImpl : CertService { CertServiceImpl(Module *o) : CertService(o) { } - NickCore* FindAccountFromCert(const Anope::string &cert) anope_override + NickCore* FindAccountFromCert(const Anope::string &cert) override { Anope::hash_map<NickCore *>::iterator it = certmap.find(cert); if (it != certmap.end()) @@ -46,7 +46,7 @@ struct NSCertListImpl : NSCertList * * Adds a new entry into the cert list. */ - void AddCert(const Anope::string &entry) anope_override + void AddCert(const Anope::string &entry) override { this->certs.push_back(entry); certmap[entry] = nc; @@ -60,14 +60,14 @@ struct NSCertListImpl : NSCertList * * Retrieves an entry from the certificate list corresponding to the given index. */ - Anope::string GetCert(unsigned entry) const anope_override + Anope::string GetCert(unsigned entry) const override { if (entry >= this->certs.size()) return ""; return this->certs[entry]; } - unsigned GetCertCount() const anope_override + unsigned GetCertCount() const override { return this->certs.size(); } @@ -79,7 +79,7 @@ struct NSCertListImpl : NSCertList * * Search for an fingerprint within the cert list. */ - bool FindCert(const Anope::string &entry) const anope_override + bool FindCert(const Anope::string &entry) const override { return std::find(this->certs.begin(), this->certs.end(), entry) != this->certs.end(); } @@ -90,7 +90,7 @@ struct NSCertListImpl : NSCertList * * Removes the specified fingerprint from the cert list. */ - void EraseCert(const Anope::string &entry) anope_override + void EraseCert(const Anope::string &entry) override { std::vector<Anope::string>::iterator it = std::find(this->certs.begin(), this->certs.end(), entry); if (it != this->certs.end()) @@ -105,7 +105,7 @@ struct NSCertListImpl : NSCertList * * Deletes all the memory allocated in the certificate list vector and then clears the vector. */ - void ClearCert() anope_override + void ClearCert() override { FOREACH_MOD(OnNickClearCert, (this->nc)); for (unsigned i = 0; i < certs.size(); ++i) @@ -113,7 +113,7 @@ struct NSCertListImpl : NSCertList this->certs.clear(); } - void Check() anope_override + void Check() override { if (this->certs.empty()) nc->Shrink<NSCertList>("certificates"); @@ -123,7 +123,7 @@ struct NSCertListImpl : NSCertList { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem<NSCertListImpl>(m, ename) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { if (s->GetSerializableType()->GetName() != "NickCore") return; @@ -137,7 +137,7 @@ struct NSCertListImpl : NSCertList data["cert"] << c->GetCert(i) << " "; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { if (s->GetSerializableType()->GetName() != "NickCore") return; @@ -260,7 +260,7 @@ class CommandNSCert : public Command this->SetSyntax(_("LIST [\037nickname\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; Anope::string nick, certfp; @@ -312,7 +312,7 @@ class CommandNSCert : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -352,7 +352,7 @@ class NSCert : public Module throw ModuleException("Your IRCd does not support ssl client certificates"); } - void OnFingerprint(User *u) anope_override + void OnFingerprint(User *u) override { BotInfo *NickServ = Config->GetClient("NickServ"); if (!NickServ || u->IsIdentified()) @@ -372,7 +372,7 @@ class NSCert : public Module Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint"; } - EventReturn OnNickValidate(User *u, NickAlias *na) anope_override + EventReturn OnNickValidate(User *u, NickAlias *na) override { NSCertList *cl = certs.Get(na->nc); if (!u->fingerprint.empty() && cl && cl->FindCert(u->fingerprint)) diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index 45a85697d..dc6b00184 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -20,7 +20,7 @@ class CommandNSDrop : public Command this->SetDesc(_("Cancel the registration of a nickname")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; @@ -54,7 +54,7 @@ class CommandNSDrop : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_getemail.cpp b/modules/commands/ns_getemail.cpp index 8d7976bb0..3790bca6a 100644 --- a/modules/commands/ns_getemail.cpp +++ b/modules/commands/ns_getemail.cpp @@ -24,7 +24,7 @@ class CommandNSGetEMail : public Command this->SetSyntax(_("\037email\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &email = params[0]; int j = 0; @@ -51,7 +51,7 @@ class CommandNSGetEMail : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_getpass.cpp b/modules/commands/ns_getpass.cpp index 17d98bceb..871b8a685 100644 --- a/modules/commands/ns_getpass.cpp +++ b/modules/commands/ns_getpass.cpp @@ -20,7 +20,7 @@ class CommandNSGetPass : public Command this->SetSyntax(_("\037nickname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; Anope::string tmp_pass; @@ -43,7 +43,7 @@ class CommandNSGetPass : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 04842b3e3..d8af7d18a 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -22,7 +22,7 @@ class NSGroupRequest : public IdentifyRequest public: NSGroupRequest(Module *o, CommandSource &src, Command *c, const Anope::string &n, NickAlias *targ, const Anope::string &pass) : IdentifyRequest(o, targ->nc->display, pass), source(src), cmd(c), nick(n), target(targ) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!source.GetUser() || source.GetUser()->nick != nick || !target || !target->nc) return; @@ -53,7 +53,7 @@ class NSGroupRequest : public IdentifyRequest } - void OnFail() anope_override + void OnFail() override { if (!source.GetUser()) return; @@ -80,7 +80,7 @@ class CommandNSGroup : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -181,7 +181,7 @@ class CommandNSGroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -225,7 +225,7 @@ class CommandNSUngroup : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); Anope::string nick = !params.empty() ? params[0] : ""; @@ -266,7 +266,7 @@ class CommandNSUngroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -287,7 +287,7 @@ class CommandNSGList : public Command this->SetDesc(_("Lists all nicknames in your group")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = !params.empty() ? params[0] : ""; const NickCore *nc; @@ -345,7 +345,7 @@ class CommandNSGList : public Command source.Reply(_("%d nickname(s) in the group."), nc->aliases->size()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (source.IsServicesOper()) source.Reply(_("Syntax: \002%s [\037nickname\037]\002\n" diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index ce564321c..3404536e9 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -19,7 +19,7 @@ class NSIdentifyRequest : public IdentifyRequest public: NSIdentifyRequest(Module *o, CommandSource &s, Command *c, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(o, acc, pass), source(s), cmd(c) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!source.GetUser()) return; @@ -40,7 +40,7 @@ class NSIdentifyRequest : public IdentifyRequest } } - void OnFail() anope_override + void OnFail() override { if (source.GetUser()) { @@ -68,7 +68,7 @@ class CommandNSIdentify : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -89,7 +89,7 @@ class CommandNSIdentify : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 5d9ff8c7a..75c82bd3e 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -21,7 +21,7 @@ class CommandNSInfo : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params.size() ? params[0] : (source.nc ? source.nc->display : source.GetNick()); @@ -114,7 +114,7 @@ class CommandNSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -207,12 +207,12 @@ class CommandNSSetHide : public Command this->OnSyntaxError(source, "HIDE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -235,13 +235,13 @@ class CommandNSSASetHide : public CommandNSSetHide this->SetSyntax(_("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->ClearSyntax(); this->Run(source, params[0], params[1], params[2]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index 679071746..6aedbf666 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -20,7 +20,7 @@ class CommandNSList : public Command this->SetSyntax(_("\037pattern\037 [SUSPENDED] [NOEXPIRE] [UNCONFIRMED]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string pattern = params[0]; @@ -132,7 +132,7 @@ class CommandNSList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -224,12 +224,12 @@ class CommandNSSetPrivate : public Command this->OnSyntaxError(source, "PRIVATE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -252,12 +252,12 @@ class CommandNSSASetPrivate : public CommandNSSetPrivate this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -288,7 +288,7 @@ class NSList : public Module { } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/ns_logout.cpp b/modules/commands/ns_logout.cpp index d8f7b2486..6697e583f 100644 --- a/modules/commands/ns_logout.cpp +++ b/modules/commands/ns_logout.cpp @@ -22,7 +22,7 @@ class CommandNSLogout : public Command this->SetSyntax(_("[\037nickname\037 [REVALIDATE]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = !params.empty() ? params[0] : ""; @@ -59,7 +59,7 @@ class CommandNSLogout : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 5bf38946b..c469fc17b 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -25,7 +25,7 @@ class NSRecoverRequest : public IdentifyRequest public: NSRecoverRequest(Module *o, CommandSource &src, Command *c, const Anope::string &nick, const Anope::string &pass) : IdentifyRequest(o, nick, pass), source(src), cmd(c), user(nick) { } - void OnSuccess() anope_override + void OnSuccess() override { User *u = User::Find(user, true); if (!source.GetUser() || !source.service) @@ -104,7 +104,7 @@ class NSRecoverRequest : public IdentifyRequest } } - void OnFail() anope_override + void OnFail() override { if (NickAlias::Find(GetAccount()) != NULL) { @@ -131,7 +131,7 @@ class CommandNSRecover : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; const Anope::string &pass = params.size() > 1 ? params[1] : ""; @@ -184,7 +184,7 @@ class CommandNSRecover : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -213,7 +213,7 @@ class NSRecover : public Module } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { if (Config->GetModule(this)->Get<bool>("restoreonrecover")) { @@ -236,7 +236,7 @@ class NSRecover : public Module } } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (Config->GetModule(this)->Get<bool>("restoreonrecover")) { diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index c3d678cf1..052a0a799 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -23,7 +23,7 @@ class CommandNSConfirm : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &passcode = params[0]; @@ -72,7 +72,7 @@ class CommandNSConfirm : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -90,7 +90,7 @@ class CommandNSConfirm : public Command return true; } - void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) anope_override + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) override { source.Reply(NICK_CONFIRM_INVALID); } @@ -109,7 +109,7 @@ class CommandNSRegister : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); Anope::string u_nick = source.GetNick(); @@ -231,7 +231,7 @@ class CommandNSRegister : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -281,7 +281,7 @@ class CommandNSResend : public Command this->SetDesc(_("Resend registration confirmation email")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) { @@ -312,7 +312,7 @@ class CommandNSResend : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) return false; @@ -323,7 +323,7 @@ class CommandNSResend : public Command return true; } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) Command::OnServHelp(source); @@ -348,7 +348,7 @@ class NSRegister : public Module throw ModuleException("Module " + this->name + " will not load with registration disabled."); } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { BotInfo *NickServ; if (unconfirmed.HasExt(u->Account()) && (NickServ = Config->GetClient("NickServ"))) @@ -366,7 +366,7 @@ class NSRegister : public Module } } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { if (unconfirmed.HasExt(na->nc)) { diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index c7c0302e7..7494fca04 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -23,7 +23,7 @@ class CommandNSResetPass : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const NickAlias *na; @@ -43,7 +43,7 @@ class CommandNSResetPass : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -73,7 +73,7 @@ class NSResetPass : public Module throw ModuleException("Not using mail."); } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (command->name == "nickserv/confirm" && params.size() > 1) { diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index e6526a913..013843360 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -20,13 +20,13 @@ class CommandNSSet : public Command this->SetSyntax(_("\037option\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -72,13 +72,13 @@ class CommandNSSASet : public Command this->SetSyntax(_("\037option\037 \037nickname\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -117,7 +117,7 @@ class CommandNSSetPassword : public Command this->SetSyntax(_("\037new-password\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string ¶m = params[1]; unsigned len = param.length(); @@ -149,7 +149,7 @@ class CommandNSSetPassword : public Command source.Reply(_("Password for \002%s\002 changed."), source.nc->display.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -168,7 +168,7 @@ class CommandNSSASetPassword : public Command this->SetSyntax(_("\037nickname\037 \037new-password\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -212,7 +212,7 @@ class CommandNSSASetPassword : public Command source.Reply(_("Password for \002%s\002 changed."), nc->display.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -267,12 +267,12 @@ class CommandNSSetAutoOp : public Command this->OnSyntaxError(source, "AUTOOP"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *bi = Config->GetClient("ChanServ"); this->SendSyntax(source); @@ -294,12 +294,12 @@ class CommandNSSASetAutoOp : public CommandNSSetAutoOp this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *bi = Config->GetClient("ChanServ"); this->SendSyntax(source); @@ -359,12 +359,12 @@ class CommandNSSetDisplay : public Command source.Reply(NICK_SET_DISPLAY_CHANGED, user_na->nc->display.c_str()); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -383,12 +383,12 @@ class CommandNSSASetDisplay : public CommandNSSetDisplay this->SetSyntax(_("\037nickname\037 \037new-display\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -498,12 +498,12 @@ class CommandNSSetEmail : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params.size() ? params[0] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -523,12 +523,12 @@ class CommandNSSASetEmail : public CommandNSSetEmail this->SetSyntax(_("\037nickname\037 \037address\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -583,12 +583,12 @@ class CommandNSSetKeepModes : public Command this->OnSyntaxError(source, ""); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -608,12 +608,12 @@ class CommandNSSASetKeepModes : public CommandNSSetKeepModes this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -703,12 +703,12 @@ class CommandNSSetKill : public Command return; } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -737,12 +737,12 @@ class CommandNSSASetKill : public CommandNSSetKill this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -810,12 +810,12 @@ class CommandNSSetLanguage : public Command source.Reply(_("Language changed to \002English\002.")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override { this->Run(source, source.nc->display, param[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -846,12 +846,12 @@ class CommandNSSASetLanguage : public CommandNSSetLanguage this->SetSyntax(_("\037nickname\037 \037language\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -923,12 +923,12 @@ class CommandNSSetMessage : public Command this->OnSyntaxError(source, "MSG"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { Anope::string cmd = source.command; size_t i = cmd.find_last_of(' '); @@ -943,7 +943,7 @@ class CommandNSSetMessage : public Command return true; } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (!Config->GetBlock("options")->Get<bool>("useprivmsg")) Command::OnServHelp(source); @@ -959,7 +959,7 @@ class CommandNSSASetMessage : public CommandNSSetMessage this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -969,7 +969,7 @@ class CommandNSSASetMessage : public CommandNSSetMessage return true; } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } @@ -1021,12 +1021,12 @@ class CommandNSSetSecure : public Command this->OnSyntaxError(source, "SECURE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1050,12 +1050,12 @@ class CommandNSSASetSecure : public CommandNSSetSecure this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1079,7 +1079,7 @@ class CommandNSSASetNoexpire : public Command this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1112,7 +1112,7 @@ class CommandNSSASetNoexpire : public Command this->OnSyntaxError(source, "NOEXPIRE"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1163,7 +1163,7 @@ class NSSet : public Module { KeepModes(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { SerializableExtensibleItem<bool>::ExtensibleSerialize(e, s, data); @@ -1183,7 +1183,7 @@ class NSSet : public Module data["last_modes"] << modes; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { SerializableExtensibleItem<bool>::ExtensibleUnserialize(e, s, data); @@ -1231,7 +1231,7 @@ class NSSet : public Module } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { NickCore *uac = source.nc; @@ -1254,7 +1254,7 @@ class NSSet : public Module return EVENT_CONTINUE; } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { if (chan->ci) { @@ -1263,13 +1263,13 @@ class NSSet : public Module } } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { if (noexpire.HasExt(na)) expire = false; } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { if (!show_hidden) return; @@ -1292,19 +1292,19 @@ class NSSet : public Module info.AddOption(_("Keep modes")); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (u->Account() && setter.GetUser() == u) u->Account()->last_modes = u->GetModeList(); } - void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override { if (u->Account() && setter.GetUser() == u) u->Account()->last_modes = u->GetModeList(); } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { if (keep_modes.HasExt(u->Account())) { diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 496e3a4e2..73e3b169a 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -42,7 +42,7 @@ struct NSMiscData : MiscData, Serializable data = d; } - void Serialize(Serialize::Data &sdata) const anope_override + void Serialize(Serialize::Data &sdata) const override { sdata["nc"] << this->object; sdata["name"] << this->name; @@ -135,12 +135,12 @@ class CommandNSSetMisc : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, !params.empty() ? params[0] : ""); } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (descriptions.count(source.command)) { @@ -149,7 +149,7 @@ class CommandNSSetMisc : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (descriptions.count(source.command)) { @@ -169,7 +169,7 @@ class CommandNSSASetMisc : public CommandNSSetMisc this->SetSyntax(_("\037nickname\037 [\037parameter\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } @@ -194,7 +194,7 @@ class NSSetMisc : public Module delete it->second; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { descriptions.clear(); @@ -217,7 +217,7 @@ class NSSetMisc : public Module } } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool) override { for (Anope::map<ExtensibleItem<NSMiscData> *>::iterator it = items.begin(); it != items.end(); ++it) { diff --git a/modules/commands/ns_status.cpp b/modules/commands/ns_status.cpp index dcf85e2bf..e0f068490 100644 --- a/modules/commands/ns_status.cpp +++ b/modules/commands/ns_status.cpp @@ -21,7 +21,7 @@ class CommandNSStatus : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = !params.empty() ? params[0] : source.GetNick(); const NickAlias *na = NickAlias::Find(nick); @@ -48,7 +48,7 @@ class CommandNSStatus : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index 241997d1c..27bb5c0bb 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -18,7 +18,7 @@ struct NSSuspendInfo : SuspendInfo, Serializable { NSSuspendInfo(Extensible *) : Serializable("NSSuspendInfo") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << what; data["by"] << by; @@ -61,7 +61,7 @@ class CommandNSSuspend : public Command this->SetSyntax(_("\037nickname\037 [+\037expiry\037] [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; @@ -140,7 +140,7 @@ class CommandNSSuspend : public Command FOREACH_MOD(OnNickSuspend, (na)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -161,7 +161,7 @@ class CommandNSUnSuspend : public Command this->SetSyntax(_("\037nickname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; @@ -192,7 +192,7 @@ class CommandNSUnSuspend : public Command FOREACH_MOD(OnNickUnsuspended, (na)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -215,7 +215,7 @@ class NSSuspend : public Module { } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { NSSuspendInfo *s = suspend.Get(na->nc); if (s) @@ -232,7 +232,7 @@ class NSSuspend : public Module } } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { NSSuspendInfo *s = suspend.Get(na->nc); if (!s) @@ -252,7 +252,7 @@ class NSSuspend : public Module } } - EventReturn OnNickValidate(User *u, NickAlias *na) anope_override + EventReturn OnNickValidate(User *u, NickAlias *na) override { NSSuspendInfo *s = suspend.Get(na->nc); if (!s) diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index a56304b5e..8f5ddc330 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -20,7 +20,7 @@ class CommandNSUpdate : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); NickAlias *na = NickAlias::Find(u->nick); @@ -36,7 +36,7 @@ class CommandNSUpdate : public Command source.Reply(_("Status updated (memos, vhost, chmodes, flags).")); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index c81a6b515..44c8fb23d 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -33,7 +33,7 @@ class AkillDelCallback : public NumberList source.Reply(_("Deleted %d entries from the AKILL list."), deleted); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -265,7 +265,7 @@ class CommandOSAKill : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -379,7 +379,7 @@ class CommandOSAKill : public Command this->SetSyntax("CLEAR"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -402,7 +402,7 @@ class CommandOSAKill : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_chankill.cpp b/modules/commands/os_chankill.cpp index 238c3c94d..ef569912b 100644 --- a/modules/commands/os_chankill.cpp +++ b/modules/commands/os_chankill.cpp @@ -22,7 +22,7 @@ class CommandOSChanKill : public Command this->SetSyntax(_("[+\037expiry\037] \037channel\037 \037reason\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!akills) return; @@ -89,7 +89,7 @@ class CommandOSChanKill : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_config.cpp b/modules/commands/os_config.cpp index b286a3238..e12338924 100644 --- a/modules/commands/os_config.cpp +++ b/modules/commands/os_config.cpp @@ -20,7 +20,7 @@ class CommandOSConfig : public Command this->SetSyntax(_("{\037MODIFY\037|\037VIEW\037} [\037block name\037 \037item name\037 \037item value\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &what = params[0]; @@ -120,7 +120,7 @@ class CommandOSConfig : public Command this->OnSyntaxError(source, what); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index afd5dc7d6..8b2f8a1c8 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -120,7 +120,7 @@ class DefConTimeout : public Timer timeout = NULL; } - void Tick(time_t) anope_override + void Tick(time_t) override { if (DConfig.defaultlevel != level) { @@ -177,7 +177,7 @@ class CommandOSDefcon : public Command this->SetSyntax(_("[\0021\002|\0022\002|\0023\002|\0024\002|\0025\002]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &lvl = params[0]; @@ -233,7 +233,7 @@ class CommandOSDefcon : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -335,7 +335,7 @@ class OSDefcon : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); DefconConfig dconfig; @@ -407,7 +407,7 @@ class OSDefcon : public Module this->ParseModeString(); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOff.count(mode->name) && source.GetUser() && !source.GetBot()) { @@ -419,7 +419,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOn.count(mode->name) && source.GetUser() && !source.GetBot()) { @@ -437,7 +437,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (command->name == "nickserv/register" || command->name == "nickserv/group") { @@ -475,7 +475,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (exempt || u->Quitting() || !u->server->IsSynced() || u->server->IsULined()) return; @@ -532,13 +532,13 @@ class OSDefcon : public Module } } - void OnChannelModeAdd(ChannelMode *cm) anope_override + void OnChannelModeAdd(ChannelMode *cm) override { if (DConfig.chanmodes.find(cm->mchar) != Anope::string::npos) this->ParseModeString(); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES)) c->SetModes(Config->GetClient("OperServ"), false, "%s", DConfig.chanmodes.c_str()); diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index 6a930980f..f58c29e98 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -35,7 +35,7 @@ struct DNSZone : Serializable zones->erase(it); } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["name"] << name; unsigned count = 0; @@ -138,7 +138,7 @@ class DNSServer : public Serializable } } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["server_name"] << server_name; for (unsigned i = 0; i < ips.size(); ++i) @@ -667,7 +667,7 @@ class CommandOSDNS : public Command this->SetSyntax(_("DEPOOL \037server.name\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) this->DisplayPoolState(source); @@ -693,7 +693,7 @@ class CommandOSDNS : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -752,7 +752,7 @@ class ModuleDNS : public Module delete dns_servers->at(i - 1); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->ttl = block->Get<time_t>("ttl"); @@ -763,7 +763,7 @@ class ModuleDNS : public Module this->readd_connected_servers = block->Get<bool>("readd_connected_servers"); } - void OnNewServer(Server *s) anope_override + void OnNewServer(Server *s) override { if (s == Me || s->IsJuped()) return; @@ -778,7 +778,7 @@ class ModuleDNS : public Module } } - void OnServerQuit(Server *s) anope_override + void OnServerQuit(Server *s) override { DNSServer *dns = DNSServer::Find(s->GetName()); if (remove_split_servers && dns && dns->Pooled() && dns->Active()) @@ -791,7 +791,7 @@ class ModuleDNS : public Module } } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting() && u->server) { @@ -805,7 +805,7 @@ class ModuleDNS : public Module } } - void OnPreUserLogoff(User *u) anope_override + void OnPreUserLogoff(User *u) override { if (u && u->server) { @@ -850,7 +850,7 @@ class ModuleDNS : public Module } } - void OnDnsRequest(DNS::Query &req, DNS::Query *packet) anope_override + void OnDnsRequest(DNS::Query &req, DNS::Query *packet) override { if (req.questions.empty()) return; diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 11215ab05..f13b72cf9 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -17,7 +17,7 @@ static ServiceReference<NickServService> nickserv("NickServService", "NickServ") struct ForbidDataImpl : ForbidData, Serializable { ForbidDataImpl() : Serializable("ForbidData") { } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -75,12 +75,12 @@ class MyForbidService : public ForbidService delete f[i]; } - void AddForbid(ForbidData *d) anope_override + void AddForbid(ForbidData *d) override { this->forbids(d->type).push_back(d); } - void RemoveForbid(ForbidData *d) anope_override + void RemoveForbid(ForbidData *d) override { std::vector<ForbidData *>::iterator it = std::find(this->forbids(d->type).begin(), this->forbids(d->type).end(), d); if (it != this->forbids(d->type).end()) @@ -88,12 +88,12 @@ class MyForbidService : public ForbidService delete d; } - ForbidData *CreateForbid() anope_override + ForbidData *CreateForbid() override { return new ForbidDataImpl(); } - ForbidData *FindForbid(const Anope::string &mask, ForbidType ftype) anope_override + ForbidData *FindForbid(const Anope::string &mask, ForbidType ftype) override { for (unsigned i = this->forbids(ftype).size(); i > 0; --i) { @@ -105,7 +105,7 @@ class MyForbidService : public ForbidService return NULL; } - std::vector<ForbidData *> GetForbids() anope_override + std::vector<ForbidData *> GetForbids() override { std::vector<ForbidData *> f; for (unsigned j = FT_NICK; j < FT_SIZE; ++j) @@ -147,7 +147,7 @@ class CommandOSForbid : public Command this->SetSyntax("LIST [NICK|CHAN|EMAIL|REGISTER]"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->fs) return; @@ -402,7 +402,7 @@ class CommandOSForbid : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -434,7 +434,7 @@ class OSForbid : public Module } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (u->Quitting() || exempt) return; @@ -442,7 +442,7 @@ class OSForbid : public Module this->OnUserNickChange(u, ""); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { if (u->HasMode("OPER")) return; @@ -460,7 +460,7 @@ class OSForbid : public Module } } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { BotInfo *OperServ = Config->GetClient("OperServ"); if (u->HasMode("OPER") || !OperServ) @@ -489,7 +489,7 @@ class OSForbid : public Module return EVENT_CONTINUE; } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (command->name == "nickserv/info" && params.size() > 0) { diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index e00b4dd31..d5a2774bc 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -16,7 +16,7 @@ struct IgnoreDataImpl : IgnoreData, Serializable { IgnoreDataImpl() : Serializable("IgnoreData") { } ~IgnoreDataImpl(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -64,19 +64,19 @@ class OSIgnoreService : public IgnoreService public: OSIgnoreService(Module *o) : IgnoreService(o), ignores("IgnoreData") { } - void AddIgnore(IgnoreData *ign) anope_override + void AddIgnore(IgnoreData *ign) override { ignores->push_back(ign); } - void DelIgnore(IgnoreData *ign) anope_override + void DelIgnore(IgnoreData *ign) override { std::vector<IgnoreData *>::iterator it = std::find(ignores->begin(), ignores->end(), ign); if (it != ignores->end()) ignores->erase(it); } - void ClearIgnores() anope_override + void ClearIgnores() override { for (unsigned i = ignores->size(); i > 0; --i) { @@ -85,12 +85,12 @@ class OSIgnoreService : public IgnoreService } } - IgnoreData *Create() anope_override + IgnoreData *Create() override { return new IgnoreDataImpl(); } - IgnoreData *Find(const Anope::string &mask) anope_override + IgnoreData *Find(const Anope::string &mask) override { User *u = User::Find(mask, true); std::vector<IgnoreData *>::iterator ign = this->ignores->begin(), ign_end = this->ignores->end(); @@ -148,7 +148,7 @@ class OSIgnoreService : public IgnoreService return NULL; } - std::vector<IgnoreData *> &GetIgnores() anope_override + std::vector<IgnoreData *> &GetIgnores() override { return *ignores; } @@ -345,7 +345,7 @@ class CommandOSIgnore : public Command this->SetSyntax("CLEAR"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -363,7 +363,7 @@ class CommandOSIgnore : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -404,7 +404,7 @@ class OSIgnore : public Module } - EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) override { if (!u->HasMode("OPER") && this->osignoreservice.Find(u->nick)) return EVENT_STOP; diff --git a/modules/commands/os_info.cpp b/modules/commands/os_info.cpp index c4d03e066..462fbbc4c 100644 --- a/modules/commands/os_info.cpp +++ b/modules/commands/os_info.cpp @@ -21,7 +21,7 @@ struct OperInfo : Serializable ~OperInfo(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["target"] << target; data["info"] << info; @@ -104,7 +104,7 @@ class CommandOSInfo : public Command this->SetSyntax(_("CLEAR \037target\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0], target = params[1], info = params.size() > 2 ? params[2] : ""; @@ -236,7 +236,7 @@ class CommandOSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -276,12 +276,12 @@ class OSInfo : public Module } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { OnInfo(source, na->nc, info); } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { OnInfo(source, ci, info); } diff --git a/modules/commands/os_jupe.cpp b/modules/commands/os_jupe.cpp index 7d9c2dd6a..3e0fad425 100644 --- a/modules/commands/os_jupe.cpp +++ b/modules/commands/os_jupe.cpp @@ -20,7 +20,7 @@ class CommandOSJupe : public Command this->SetSyntax(_("\037server\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &jserver = params[0]; const Anope::string &reason = params.size() > 1 ? params[1] : ""; @@ -49,7 +49,7 @@ class CommandOSJupe : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_kick.cpp b/modules/commands/os_kick.cpp index b9867c7a5..20a967575 100644 --- a/modules/commands/os_kick.cpp +++ b/modules/commands/os_kick.cpp @@ -20,7 +20,7 @@ class CommandOSKick : public Command this->SetSyntax(_("\037channel\037 \037user\037 \037reason\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &nick = params[1]; @@ -49,7 +49,7 @@ class CommandOSKick : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_kill.cpp b/modules/commands/os_kill.cpp index 23d78d459..b36e68df9 100644 --- a/modules/commands/os_kill.cpp +++ b/modules/commands/os_kill.cpp @@ -20,7 +20,7 @@ class CommandOSKill : public Command this->SetSyntax(_("\037user\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; Anope::string reason = params.size() > 1 ? params[1] : ""; @@ -41,7 +41,7 @@ class CommandOSKill : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index 7bafd8b4d..d91b68938 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -20,7 +20,7 @@ class CommandOSChanList : public Command this->SetSyntax(_("[{\037pattern\037 | \037nick\037} [\037SECRET\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; @@ -95,7 +95,7 @@ class CommandOSChanList : public Command source.Reply(_("End of channel list.")); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -128,7 +128,7 @@ class CommandOSUserList : public Command this->SetSyntax(_("[{\037pattern\037 | \037channel\037} [\037INVISIBLE\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; @@ -206,7 +206,7 @@ class CommandOSUserList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 4d7b1d9fd..d21eef468 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -21,7 +21,7 @@ class CommandOSLogin : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &password = params[0]; @@ -46,7 +46,7 @@ class CommandOSLogin : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -56,7 +56,7 @@ class CommandOSLogin : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Login to %s")), source.service->nick.c_str()); } @@ -70,7 +70,7 @@ class CommandOSLogout : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); Oper *o = source.nc->o; @@ -88,7 +88,7 @@ class CommandOSLogout : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -98,7 +98,7 @@ class CommandOSLogout : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Logout from %s")), source.service->nick.c_str()); } @@ -117,7 +117,7 @@ class OSLogin : public Module } - EventReturn IsServicesOper(User *u) anope_override + EventReturn IsServicesOper(User *u) override { if (!u->Account()->o->password.empty()) { diff --git a/modules/commands/os_logsearch.cpp b/modules/commands/os_logsearch.cpp index 5f159ddf5..fb9a75637 100644 --- a/modules/commands/os_logsearch.cpp +++ b/modules/commands/os_logsearch.cpp @@ -31,7 +31,7 @@ class CommandOSLogSearch : public Command this->SetSyntax(_("[+\037days\037d] [+\037limit\037l] \037pattern\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { int days = 7, replies = 50; @@ -123,7 +123,7 @@ class CommandOSLogSearch : public Command source.Reply(_("Showed %d/%d matches for \002%s\002."), matches.size(), found, search_string.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_mode.cpp b/modules/commands/os_mode.cpp index 16c29c8de..167f654af 100644 --- a/modules/commands/os_mode.cpp +++ b/modules/commands/os_mode.cpp @@ -21,7 +21,7 @@ class CommandOSMode : public Command this->SetSyntax(_("\037channel\037 CLEAR [ALL]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &target = params[0]; const Anope::string &modes = params[1]; @@ -118,7 +118,7 @@ class CommandOSMode : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -139,7 +139,7 @@ class CommandOSUMode : public Command this->SetSyntax(_("\037user\037 \037modes\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &target = params[0]; const Anope::string &modes = params[1]; @@ -158,7 +158,7 @@ class CommandOSUMode : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_modinfo.cpp b/modules/commands/os_modinfo.cpp index a5cb04d2d..f8b05bff8 100644 --- a/modules/commands/os_modinfo.cpp +++ b/modules/commands/os_modinfo.cpp @@ -20,7 +20,7 @@ class CommandOSModInfo : public Command this->SetSyntax(_("\037modname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &file = params[0]; @@ -63,7 +63,7 @@ class CommandOSModInfo : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -81,7 +81,7 @@ class CommandOSModList : public Command this->SetSyntax("[all|third|vendor|extra|database|encryption|pseudoclient|protocol]"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string ¶m = !params.empty() ? params[0] : ""; @@ -189,7 +189,7 @@ class CommandOSModList : public Command source.Reply(_("%d modules loaded."), count); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_module.cpp b/modules/commands/os_module.cpp index 55040721e..f1d113265 100644 --- a/modules/commands/os_module.cpp +++ b/modules/commands/os_module.cpp @@ -20,7 +20,7 @@ class CommandOSModLoad : public Command this->SetSyntax(_("\037modname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &mname = params[0]; @@ -38,7 +38,7 @@ class CommandOSModLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -57,7 +57,7 @@ class CommandOSModReLoad : public Command this->SetSyntax(_("\037modname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &mname = params[0]; @@ -111,7 +111,7 @@ class CommandOSModReLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -129,7 +129,7 @@ class CommandOSModUnLoad : public Command this->SetSyntax(_("\037modname\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &mname = params[0]; @@ -161,7 +161,7 @@ class CommandOSModUnLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index b74ca3b57..1ecc9773d 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -61,7 +61,7 @@ struct NewsMessages msgarray[] = { struct MyNewsItem : NewsItem { - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["type"] << this->type; data["text"] << this->text; @@ -106,7 +106,7 @@ class MyNewsService : public NewsService delete newsItems[i][j]; } - NewsItem *CreateNewsItem() anope_override + NewsItem *CreateNewsItem() override { return new MyNewsItem(); } @@ -297,12 +297,12 @@ class CommandOSLogonNews : public NewsBase this->SetDesc(_("Define messages to be shown to users at logon")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_LOGON); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -324,12 +324,12 @@ class CommandOSOperNews : public NewsBase this->SetDesc(_("Define messages to be shown to users who oper")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_OPER); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -351,12 +351,12 @@ class CommandOSRandomNews : public NewsBase this->SetDesc(_("Define messages to be randomly shown to users at logon")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_RANDOM); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -434,20 +434,20 @@ class OSNews : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { oper_announcer = conf->GetModule(this)->Get<const Anope::string>("oper_announcer", "OperServ"); announcer = conf->GetModule(this)->Get<const Anope::string>("announcer", "Global"); news_count = conf->GetModule(this)->Get<unsigned>("newscount", "3"); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (mname == "OPER") DisplayNews(u, NEWS_OPER); } - void OnUserConnect(User *user, bool &) anope_override + void OnUserConnect(User *user, bool &) override { if (user->Quitting() || !user->server->IsSynced()) return; diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 560f68f27..2eb818451 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -21,7 +21,7 @@ class CommandOSNOOP : public Command this->SetSyntax(_("REVOKE \037server\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; const Anope::string &server = params[1]; @@ -61,7 +61,7 @@ class CommandOSNOOP : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -85,7 +85,7 @@ class OSNOOP : public Module } - void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) override { Anope::string *setter; if (mname == "OPER" && (setter = noop.Get(u->server))) diff --git a/modules/commands/os_oline.cpp b/modules/commands/os_oline.cpp index 3123bda4f..143924b47 100644 --- a/modules/commands/os_oline.cpp +++ b/modules/commands/os_oline.cpp @@ -20,7 +20,7 @@ class CommandOSOLine : public Command this->SetSyntax(_("\037nick\037 \037flags\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; const Anope::string &flag = params[1]; @@ -49,7 +49,7 @@ class CommandOSOLine : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 70256b254..cd9eddfdb 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -15,7 +15,7 @@ struct MyOper : Oper, Serializable { MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["name"] << this->name; data["type"] << this->ot->GetName(); @@ -73,7 +73,7 @@ class CommandOSOper : public Command this->SetSyntax("LIST"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &subcommand = params[0]; @@ -218,7 +218,7 @@ class CommandOSOper : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_reload.cpp b/modules/commands/os_reload.cpp index 13b0a8254..140118ba4 100644 --- a/modules/commands/os_reload.cpp +++ b/modules/commands/os_reload.cpp @@ -19,7 +19,7 @@ class CommandOSReload : public Command this->SetDesc(_("Reload services' configuration file")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { try { @@ -37,7 +37,7 @@ class CommandOSReload : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index edf9458f8..94a2f9f0f 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -42,24 +42,24 @@ class MySessionService : public SessionService public: MySessionService(Module *m) : SessionService(m), Exceptions("Exception") { } - Exception *CreateException() anope_override + Exception *CreateException() override { return new Exception(); } - void AddException(Exception *e) anope_override + void AddException(Exception *e) override { this->Exceptions->push_back(e); } - void DelException(Exception *e) anope_override + void DelException(Exception *e) override { ExceptionVector::iterator it = std::find(this->Exceptions->begin(), this->Exceptions->end(), e); if (it != this->Exceptions->end()) this->Exceptions->erase(it); } - Exception *FindException(User *u) anope_override + Exception *FindException(User *u) override { for (std::vector<Exception *>::const_iterator it = this->Exceptions->begin(), it_end = this->Exceptions->end(); it != it_end; ++it) { @@ -73,7 +73,7 @@ class MySessionService : public SessionService return NULL; } - Exception *FindException(const Anope::string &host) anope_override + Exception *FindException(const Anope::string &host) override { for (std::vector<Exception *>::const_iterator it = this->Exceptions->begin(), it_end = this->Exceptions->end(); it != it_end; ++it) { @@ -88,7 +88,7 @@ class MySessionService : public SessionService return NULL; } - ExceptionVector &GetExceptions() anope_override + ExceptionVector &GetExceptions() override { return this->Exceptions; } @@ -98,7 +98,7 @@ class MySessionService : public SessionService this->Sessions.erase(s->addr); } - Session *FindSession(const Anope::string &ip) anope_override + Session *FindSession(const Anope::string &ip) override { cidr c(ip, ip.find(':') != Anope::string::npos ? ipv6_cidr : ipv4_cidr); if (!c.valid()) @@ -122,7 +122,7 @@ class MySessionService : public SessionService return this->Sessions[ip]; } - SessionMap &GetSessions() anope_override + SessionMap &GetSessions() override { return this->Sessions; } @@ -149,7 +149,7 @@ class ExceptionDelCallback : public NumberList source.Reply(_("Deleted %d entries from session-limit exception list."), deleted); } - virtual void HandleNumber(unsigned number) anope_override + virtual void HandleNumber(unsigned number) override { if (!number || number > session_service->GetExceptions().size()) return; @@ -247,7 +247,7 @@ class CommandOSSession : public Command this->SetSyntax(_("VIEW \037host\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -263,7 +263,7 @@ class CommandOSSession : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -483,7 +483,7 @@ class CommandOSException : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > session_service->GetExceptions().size()) return; @@ -565,7 +565,7 @@ class CommandOSException : public Command this->SetSyntax(_("VIEW [\037mask\037 | \037list\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -585,7 +585,7 @@ class CommandOSException : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -643,7 +643,7 @@ class OSSession : public Module ModuleManager::SetPriority(this, PRIORITY_FIRST); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = Config->GetModule(this); @@ -663,7 +663,7 @@ class OSSession : public Module throw ConfigException(this->name + ": session CIDR value out of range"); } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (u->Quitting() || !session_limit || exempt || !u->server || u->server->IsULined()) return; @@ -733,7 +733,7 @@ class OSSession : public Module } } - void OnUserQuit(User *u, const Anope::string &msg) anope_override + void OnUserQuit(User *u, const Anope::string &msg) override { if (!session_limit || !u->server || u->server->IsULined()) return; @@ -756,7 +756,7 @@ class OSSession : public Module sessions.erase(sit); } - void OnExpireTick() anope_override + void OnExpireTick() override { if (Anope::NoExpire) return; diff --git a/modules/commands/os_set.cpp b/modules/commands/os_set.cpp index bc73cc6e7..1f8959408 100644 --- a/modules/commands/os_set.cpp +++ b/modules/commands/os_set.cpp @@ -170,7 +170,7 @@ class CommandOSSet : public Command this->SetSyntax(_("\037option\037 \037setting\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &option = params[0]; @@ -190,7 +190,7 @@ class CommandOSSet : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.empty()) { diff --git a/modules/commands/os_shutdown.cpp b/modules/commands/os_shutdown.cpp index 3c788f8dc..fde5c38e1 100644 --- a/modules/commands/os_shutdown.cpp +++ b/modules/commands/os_shutdown.cpp @@ -19,7 +19,7 @@ class CommandOSQuit : public Command this->SetDesc(_("Terminate Services WITHOUT saving")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -27,7 +27,7 @@ class CommandOSQuit : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -47,7 +47,7 @@ class CommandOSRestart : public Command this->SetDesc(_("Save databases and restart Services")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -56,7 +56,7 @@ class CommandOSRestart : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(_("Causes Services to save all databases and then restart\n" @@ -73,7 +73,7 @@ class CommandOSShutdown : public Command this->SetDesc(_("Terminate services with save")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -82,7 +82,7 @@ class CommandOSShutdown : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp index 85088f385..c5ab3459c 100644 --- a/modules/commands/os_stats.cpp +++ b/modules/commands/os_stats.cpp @@ -16,7 +16,7 @@ struct Stats : Serializable { Stats() : Serializable("Stats") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["maxusercnt"] << MaxUserCount; data["maxusertime"] << MaxUserTime; @@ -197,7 +197,7 @@ class CommandOSStats : public Command this->SetSyntax("[AKILL | HASH | UPLINK | UPTIME | ALL | RESET]"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string extra = !params.empty() ? params[0] : ""; @@ -222,7 +222,7 @@ class CommandOSStats : public Command source.Reply(_("Unknown STATS option: \002%s\002"), extra.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_svs.cpp b/modules/commands/os_svs.cpp index 35ad1aa1e..ee0ff666d 100644 --- a/modules/commands/os_svs.cpp +++ b/modules/commands/os_svs.cpp @@ -20,7 +20,7 @@ class CommandOSSVSNick : public Command this->SetSyntax(_("\037nick\037 \037newnick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = params[0]; Anope::string newnick = params[1]; @@ -61,7 +61,7 @@ class CommandOSSVSNick : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -79,7 +79,7 @@ class CommandOSSVSJoin : public Command this->SetSyntax(_("\037nick\037 \037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSVSJoin) { @@ -105,7 +105,7 @@ class CommandOSSVSJoin : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -123,7 +123,7 @@ class CommandOSSVSPart : public Command this->SetSyntax(_("\037nick\037 \037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSVSJoin) { @@ -149,7 +149,7 @@ class CommandOSSVSPart : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 455422845..87d8efe5d 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -32,7 +32,7 @@ class SXLineDelCallback : public NumberList source.Reply(_("Deleted %d entries from the %s list."), deleted, source.command.c_str()); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -128,7 +128,7 @@ class CommandOSSXLineBase : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -222,12 +222,12 @@ class CommandOSSXLineBase : public Command { } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Manipulate the %s list")), source.command.upper().c_str()); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &cmd = params[0]; @@ -257,7 +257,7 @@ class CommandOSSNLine : public CommandOSSXLineBase return this->snlines; } - void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->xlm()) return; @@ -422,7 +422,7 @@ class CommandOSSNLine : public CommandOSSXLineBase this->SetSyntax("CLEAR"); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -482,7 +482,7 @@ class CommandOSSQLine : public CommandOSSXLineBase return this->sqlines; } - void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->xlm()) return; @@ -655,7 +655,7 @@ class CommandOSSQLine : public CommandOSSXLineBase this->SetSyntax("CLEAR"); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_update.cpp b/modules/commands/os_update.cpp index e2f0d3376..50be11d85 100644 --- a/modules/commands/os_update.cpp +++ b/modules/commands/os_update.cpp @@ -19,7 +19,7 @@ class CommandOSUpdate : public Command this->SetDesc(_("Force the Services databases to be updated immediately")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); source.Reply(_("Updating databases.")); @@ -27,7 +27,7 @@ class CommandOSUpdate : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/cs_statusupdate.cpp b/modules/cs_statusupdate.cpp index 5954cf1d0..2696d6c1a 100644 --- a/modules/cs_statusupdate.cpp +++ b/modules/cs_statusupdate.cpp @@ -15,7 +15,7 @@ class StatusUpdate : public Module } - void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override + void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) override { if (ci->c) for (Channel::ChanUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) @@ -38,7 +38,7 @@ class StatusUpdate : public Module } } - void OnAccessDel(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override + void OnAccessDel(ChannelInfo *ci, CommandSource &, ChanAccess *access) override { if (ci->c) for (Channel::ChanUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 694ff69a4..c4b2254c8 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -22,7 +22,7 @@ class SaveData : public Serialize::Data SaveData() : fs(NULL) { } - std::iostream& operator[](const Anope::string &key) anope_override + std::iostream& operator[](const Anope::string &key) override { if (key != last) { @@ -45,7 +45,7 @@ class LoadData : public Serialize::Data LoadData() : fs(NULL), id(0), read(false) { } - std::iostream& operator[](const Anope::string &key) anope_override + std::iostream& operator[](const Anope::string &key) override { if (!read) { @@ -77,7 +77,7 @@ class LoadData : public Serialize::Data return this->ss; } - std::set<Anope::string> KeySet() const anope_override + std::set<Anope::string> KeySet() const override { std::set<Anope::string> keys; for (std::map<Anope::string, Anope::string>::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -85,7 +85,7 @@ class LoadData : public Serialize::Data return keys; } - size_t Hash() const anope_override + size_t Hash() const override { size_t hash = 0; for (std::map<Anope::string, Anope::string>::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -173,12 +173,12 @@ class DBFlatFile : public Module, public Pipe } #ifndef _WIN32 - void OnRestart() anope_override + void OnRestart() override { OnShutdown(); } - void OnShutdown() anope_override + void OnShutdown() override { if (child_pid > -1) { @@ -192,7 +192,7 @@ class DBFlatFile : public Module, public Pipe } #endif - void OnNotify() anope_override + void OnNotify() override { char buf[512]; int i = this->Read(buf, sizeof(buf) - 1); @@ -214,7 +214,7 @@ class DBFlatFile : public Module, public Pipe Anope::Quitting = true; } - EventReturn OnLoadDatabase() anope_override + EventReturn OnLoadDatabase() override { const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder(); std::set<Anope::string> tried_dbs; @@ -264,7 +264,7 @@ class DBFlatFile : public Module, public Pipe } - void OnSaveDatabase() anope_override + void OnSaveDatabase() override { if (child_pid > -1) { @@ -371,7 +371,7 @@ class DBFlatFile : public Module, public Pipe } /* Load just one type. Done if a module is reloaded during runtime */ - void OnSerializeTypeCreate(Serialize::Type *stype) anope_override + void OnSerializeTypeCreate(Serialize::Type *stype) override { if (!loaded) return; diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index b49a6c46e..82f26e064 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -1310,7 +1310,7 @@ class DBOld : public Module throw ModuleException("Invalid hash method"); } - EventReturn OnLoadDatabase() anope_override + EventReturn OnLoadDatabase() override { LoadNicks(); LoadVHosts(); @@ -1323,7 +1323,7 @@ class DBOld : public Module return EVENT_STOP; } - void OnUplinkSync(Server *s) anope_override + void OnUplinkSync(Server *s) override { for (registered_channel_map::iterator it = RegisteredChannelList->begin(), it_end = RegisteredChannelList->end(); it != it_end; ++it) { diff --git a/modules/database/db_redis.cpp b/modules/database/db_redis.cpp index 3cd023ed6..d7585bc32 100644 --- a/modules/database/db_redis.cpp +++ b/modules/database/db_redis.cpp @@ -27,7 +27,7 @@ class Data : public Serialize::Data delete it->second; } - std::iostream& operator[](const Anope::string &key) anope_override + std::iostream& operator[](const Anope::string &key) override { std::stringstream* &stream = data[key]; if (!stream) @@ -35,7 +35,7 @@ class Data : public Serialize::Data return *stream; } - std::set<Anope::string> KeySet() const anope_override + std::set<Anope::string> KeySet() const override { std::set<Anope::string> keys; for (std::map<Anope::string, std::stringstream *>::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -43,7 +43,7 @@ class Data : public Serialize::Data return keys; } - size_t Hash() const anope_override + size_t Hash() const override { size_t hash = 0; for (std::map<Anope::string, std::stringstream *>::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -59,7 +59,7 @@ class TypeLoader : public Interface public: TypeLoader(Module *creator, const Anope::string &t) : Interface(creator), type(t) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class ObjectLoader : public Interface @@ -70,7 +70,7 @@ class ObjectLoader : public Interface public: ObjectLoader(Module *creator, const Anope::string &t, int64_t i) : Interface(creator), type(t), id(i) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class IDInterface : public Interface @@ -79,7 +79,7 @@ class IDInterface : public Interface public: IDInterface(Module *creator, Serializable *obj) : Interface(creator), o(obj) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class Deleter : public Interface @@ -89,7 +89,7 @@ class Deleter : public Interface public: Deleter(Module *creator, const Anope::string &t, int64_t i) : Interface(creator), type(t), id(i) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class Updater : public Interface @@ -99,7 +99,7 @@ class Updater : public Interface public: Updater(Module *creator, const Anope::string &t, int64_t i) : Interface(creator), type(t), id(i) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class ModifiedObject : public Interface @@ -109,7 +109,7 @@ class ModifiedObject : public Interface public: ModifiedObject(Module *creator, const Anope::string &t, int64_t i) : Interface(creator), type(t), id(i) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class SubscriptionListener : public Interface @@ -117,7 +117,7 @@ class SubscriptionListener : public Interface public: SubscriptionListener(Module *creator) : Interface(creator) { } - void OnResult(const Reply &r) anope_override; + void OnResult(const Reply &r) override; }; class DatabaseRedis : public Module, public Pipe @@ -161,7 +161,7 @@ class DatabaseRedis : public Module, public Pipe } } - void OnNotify() anope_override + void OnNotify() override { for (std::set<Serializable *>::iterator it = this->updated_items.begin(), it_end = this->updated_items.end(); it != it_end; ++it) { @@ -173,13 +173,13 @@ class DatabaseRedis : public Module, public Pipe this->updated_items.clear(); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->redis = ServiceReference<Provider>("Redis::Provider", block->Get<const Anope::string>("engine", "redis/main")); } - EventReturn OnLoadDatabase() anope_override + EventReturn OnLoadDatabase() override { const std::vector<Anope::string> type_order = Serialize::Type::GetTypeOrder(); for (unsigned i = 0; i < type_order.size(); ++i) @@ -195,7 +195,7 @@ class DatabaseRedis : public Module, public Pipe return EVENT_STOP; } - void OnSerializeTypeCreate(Serialize::Type *sb) anope_override + void OnSerializeTypeCreate(Serialize::Type *sb) override { if (!redis) return; @@ -207,13 +207,13 @@ class DatabaseRedis : public Module, public Pipe redis->SendCommand(new TypeLoader(this, sb->GetName()), args); } - void OnSerializableConstruct(Serializable *obj) anope_override + void OnSerializableConstruct(Serializable *obj) override { this->updated_items.insert(obj); this->Notify(); } - void OnSerializableDestruct(Serializable *obj) anope_override + void OnSerializableDestruct(Serializable *obj) override { Serialize::Type *t = obj->GetSerializableType(); @@ -229,7 +229,7 @@ class DatabaseRedis : public Module, public Pipe this->Notify(); } - void OnSerializableUpdate(Serializable *obj) anope_override + void OnSerializableUpdate(Serializable *obj) override { this->updated_items.insert(obj); this->Notify(); diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index b56f884f6..34ae7cfea 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -18,12 +18,12 @@ class SQLSQLInterface : public Interface public: SQLSQLInterface(Module *o) : Interface(o) { } - void OnResult(const Result &r) anope_override + void OnResult(const Result &r) override { Log(LOG_DEBUG) << "SQL successfully executed query: " << r.finished_query; } - void OnError(const Result &r) anope_override + void OnError(const Result &r) override { if (!r.GetQuery().query.empty()) Log(LOG_DEBUG) << "Error executing query " << r.finished_query << ": " << r.GetError(); @@ -39,7 +39,7 @@ class ResultSQLSQLInterface : public SQLSQLInterface public: ResultSQLSQLInterface(Module *o, Serializable *ob) : SQLSQLInterface(o), obj(ob) { } - void OnResult(const Result &r) anope_override + void OnResult(const Result &r) override { SQLSQLInterface::OnResult(r); if (r.GetID() > 0 && this->obj) @@ -47,7 +47,7 @@ public: delete this; } - void OnError(const Result &r) anope_override + void OnError(const Result &r) override { SQLSQLInterface::OnError(r); delete this; @@ -97,7 +97,7 @@ class DBSQL : public Module, public Pipe throw ModuleException("db_sql can not be loaded after db_sql_live"); } - void OnNotify() anope_override + void OnNotify() override { for (std::set<Serializable *>::iterator it = this->updated_items.begin(), it_end = this->updated_items.end(); it != it_end; ++it) { @@ -144,7 +144,7 @@ class DBSQL : public Module, public Pipe this->imported = true; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine")); @@ -152,18 +152,18 @@ class DBSQL : public Module, public Pipe this->import = block->Get<bool>("import"); } - void OnShutdown() anope_override + void OnShutdown() override { this->shutting_down = true; this->OnNotify(); } - void OnRestart() anope_override + void OnRestart() override { this->OnShutdown(); } - EventReturn OnLoadDatabase() anope_override + EventReturn OnLoadDatabase() override { if (!this->sql) { @@ -186,7 +186,7 @@ class DBSQL : public Module, public Pipe return EVENT_STOP; } - void OnSerializableConstruct(Serializable *obj) anope_override + void OnSerializableConstruct(Serializable *obj) override { if (this->shutting_down || this->loading_databases) return; @@ -195,7 +195,7 @@ class DBSQL : public Module, public Pipe this->Notify(); } - void OnSerializableDestruct(Serializable *obj) anope_override + void OnSerializableDestruct(Serializable *obj) override { if (this->shutting_down) return; @@ -205,7 +205,7 @@ class DBSQL : public Module, public Pipe this->updated_items.erase(obj); } - void OnSerializableUpdate(Serializable *obj) anope_override + void OnSerializableUpdate(Serializable *obj) override { if (this->shutting_down || obj->IsTSCached()) return; @@ -214,7 +214,7 @@ class DBSQL : public Module, public Pipe this->Notify(); } - void OnSerializeTypeCreate(Serialize::Type *sb) anope_override + void OnSerializeTypeCreate(Serialize::Type *sb) override { if (!this->loading_databases && !this->loaded) return; diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index b9b8ef57c..0099ff5e2 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -75,7 +75,7 @@ class DBMySQL : public Module, public Pipe throw ModuleException("If db_sql_live is loaded it must be the first database module loaded."); } - void OnNotify() anope_override + void OnNotify() override { if (!this->CheckInit()) return; @@ -115,30 +115,30 @@ class DBMySQL : public Module, public Pipe this->updated_items.clear(); } - EventReturn OnLoadDatabase() anope_override + EventReturn OnLoadDatabase() override { init = true; return EVENT_STOP; } - void OnShutdown() anope_override + void OnShutdown() override { init = false; } - void OnRestart() anope_override + void OnRestart() override { init = false; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine")); this->prefix = block->Get<const Anope::string>("prefix", "anope_db_"); } - void OnSerializableConstruct(Serializable *obj) anope_override + void OnSerializableConstruct(Serializable *obj) override { if (!this->CheckInit()) return; @@ -147,7 +147,7 @@ class DBMySQL : public Module, public Pipe this->Notify(); } - void OnSerializableDestruct(Serializable *obj) anope_override + void OnSerializableDestruct(Serializable *obj) override { if (!this->CheckInit()) return; @@ -161,7 +161,7 @@ class DBMySQL : public Module, public Pipe this->updated_items.erase(obj); } - void OnSerializeCheck(Serialize::Type *obj) anope_override + void OnSerializeCheck(Serialize::Type *obj) override { if (!this->CheckInit() || obj->GetTimestamp() == Anope::CurTime) return; @@ -240,7 +240,7 @@ class DBMySQL : public Module, public Pipe } } - void OnSerializableUpdate(Serializable *obj) anope_override + void OnSerializableUpdate(Serializable *obj) override { if (!this->CheckInit() || obj->IsTSCached()) return; diff --git a/modules/encryption/enc_bcrypt.cpp b/modules/encryption/enc_bcrypt.cpp index 2c50d5137..8ed5695ac 100644 --- a/modules/encryption/enc_bcrypt.cpp +++ b/modules/encryption/enc_bcrypt.cpp @@ -886,14 +886,14 @@ class EBCRYPT : public Module throw ModuleException("BCrypt could not load!"); } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { dest = "bcrypt:" + Generate(src, Salt()); Log(LOG_DEBUG_2) << "(enc_bcrypt) hashed password from [" << src << "] to [" << dest << "]"; return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) @@ -933,7 +933,7 @@ class EBCRYPT : public Module } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); rounds = block->Get<unsigned int>("rounds", "10"); diff --git a/modules/encryption/enc_md5.cpp b/modules/encryption/enc_md5.cpp index b56f03324..b49390d56 100644 --- a/modules/encryption/enc_md5.cpp +++ b/modules/encryption/enc_md5.cpp @@ -250,7 +250,7 @@ class MD5Context : public Encryption::Context * operation, processing another message block, and updating the * context. */ - void Update(const unsigned char *input, size_t len) anope_override + void Update(const unsigned char *input, size_t len) override { unsigned i, index, partLen; @@ -285,7 +285,7 @@ class MD5Context : public Encryption::Context /* MD5 finalization. Ends an MD5 message-digest opera * the message digest and zeroizing the context. */ - void Finalize() anope_override + void Finalize() override { unsigned char bits[8]; unsigned index, padLen; @@ -309,7 +309,7 @@ class MD5Context : public Encryption::Context memset(this->buffer, 0, sizeof(this->buffer)); } - Encryption::Hash GetFinalizedHash() anope_override + Encryption::Hash GetFinalizedHash() override { Encryption::Hash hash; hash.first = this->digest; @@ -323,12 +323,12 @@ class MD5Provider : public Encryption::Provider public: MD5Provider(Module *creator) : Encryption::Provider(creator, "md5") { } - Encryption::Context *CreateContext(Encryption::IV *iv) anope_override + Encryption::Context *CreateContext(Encryption::IV *iv) override { return new MD5Context(iv); } - Encryption::IV GetDefaultIV() anope_override + Encryption::IV GetDefaultIV() override { Encryption::IV iv; iv.first = md5_iv; @@ -348,7 +348,7 @@ class EMD5 : public Module } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { MD5Context context; @@ -364,7 +364,7 @@ class EMD5 : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) diff --git a/modules/encryption/enc_none.cpp b/modules/encryption/enc_none.cpp index 744c788f5..ae698914c 100644 --- a/modules/encryption/enc_none.cpp +++ b/modules/encryption/enc_none.cpp @@ -17,7 +17,7 @@ class ENone : public Module } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { Anope::string buf = "plain:"; Anope::string cpass; @@ -28,7 +28,7 @@ class ENone : public Module return EVENT_ALLOW; } - EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) override { if (!hashm.equals_cs("plain")) return EVENT_CONTINUE; @@ -38,7 +38,7 @@ class ENone : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) diff --git a/modules/encryption/enc_old.cpp b/modules/encryption/enc_old.cpp index c8c1093da..89c228b1d 100644 --- a/modules/encryption/enc_old.cpp +++ b/modules/encryption/enc_old.cpp @@ -19,14 +19,14 @@ class OldMD5Provider : public Encryption::Provider public: OldMD5Provider(Module *creator) : Encryption::Provider(creator, "oldmd5") { } - Encryption::Context *CreateContext(Encryption::IV *iv) anope_override + Encryption::Context *CreateContext(Encryption::IV *iv) override { if (md5) return md5->CreateContext(iv); return NULL; } - Encryption::IV GetDefaultIV() anope_override + Encryption::IV GetDefaultIV() override { if (md5) return md5->GetDefaultIV(); @@ -51,7 +51,7 @@ class EOld : public Module } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { if (!md5) return EVENT_CONTINUE; @@ -79,7 +79,7 @@ class EOld : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) diff --git a/modules/encryption/enc_sha1.cpp b/modules/encryption/enc_sha1.cpp index 38f32b2cb..79d657493 100644 --- a/modules/encryption/enc_sha1.cpp +++ b/modules/encryption/enc_sha1.cpp @@ -120,7 +120,7 @@ class SHA1Context : public Encryption::Context memset(this->digest, 0, sizeof(this->digest)); } - void Update(const unsigned char *data, size_t len) anope_override + void Update(const unsigned char *data, size_t len) override { uint32_t i, j; @@ -141,7 +141,7 @@ class SHA1Context : public Encryption::Context memcpy(&this->buffer[j], &data[i], len - i); } - void Finalize() anope_override + void Finalize() override { uint32_t i; unsigned char finalcount[8]; @@ -164,7 +164,7 @@ class SHA1Context : public Encryption::Context this->Transform(this->buffer); } - Encryption::Hash GetFinalizedHash() anope_override + Encryption::Hash GetFinalizedHash() override { Encryption::Hash hash; hash.first = this->digest; @@ -178,12 +178,12 @@ class SHA1Provider : public Encryption::Provider public: SHA1Provider(Module *creator) : Encryption::Provider(creator, "sha1") { } - Encryption::Context *CreateContext(Encryption::IV *iv) anope_override + Encryption::Context *CreateContext(Encryption::IV *iv) override { return new SHA1Context(iv); } - Encryption::IV GetDefaultIV() anope_override + Encryption::IV GetDefaultIV() override { Encryption::IV iv; iv.first = sha1_iv; @@ -203,7 +203,7 @@ class ESHA1 : public Module } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { SHA1Context context; @@ -219,7 +219,7 @@ class ESHA1 : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) diff --git a/modules/encryption/enc_sha256.cpp b/modules/encryption/enc_sha256.cpp index cccbceea1..8be792346 100644 --- a/modules/encryption/enc_sha256.cpp +++ b/modules/encryption/enc_sha256.cpp @@ -173,7 +173,7 @@ class SHA256Context : public Encryption::Context memset(this->digest, 0, sizeof(this->digest)); } - void Update(const unsigned char *message, size_t mlen) anope_override + void Update(const unsigned char *message, size_t mlen) override { unsigned tmp_len = SHA256_BLOCK_SIZE - this->len, rem_len = mlen < tmp_len ? mlen : tmp_len; @@ -195,7 +195,7 @@ class SHA256Context : public Encryption::Context this->tot_len += (block_nb + 1) << 6; } - void Finalize() anope_override + void Finalize() override { unsigned block_nb = 1 + ((SHA256_BLOCK_SIZE - 9) < (this->len % SHA256_BLOCK_SIZE)); unsigned len_b = (this->tot_len + this->len) << 3; @@ -208,7 +208,7 @@ class SHA256Context : public Encryption::Context UNPACK32(this->h[i], &this->digest[i << 2]); } - Encryption::Hash GetFinalizedHash() anope_override + Encryption::Hash GetFinalizedHash() override { Encryption::Hash hash; hash.first = this->digest; @@ -222,12 +222,12 @@ class SHA256Provider : public Encryption::Provider public: SHA256Provider(Module *creator) : Encryption::Provider(creator, "sha256") { } - Encryption::Context *CreateContext(Encryption::IV *iv) anope_override + Encryption::Context *CreateContext(Encryption::IV *iv) override { return new SHA256Context(iv); } - Encryption::IV GetDefaultIV() anope_override + Encryption::IV GetDefaultIV() override { Encryption::IV iv; iv.first = sha256_h0; @@ -281,7 +281,7 @@ class ESHA256 : public Module use_iv = false; } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { if (!use_iv) NewRandomIV(); @@ -302,7 +302,7 @@ class ESHA256 : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 7dc6bc038..eb5589032 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -131,7 +131,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return this->Bind(i, this->admin_binddn, this->admin_pass); } - LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) anope_override + LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) override { berval cred; cred.bv_val = strdup(pass.c_str()); @@ -162,7 +162,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) anope_override + LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) override { if (i == NULL) throw LDAPException("No interface"); @@ -188,7 +188,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) anope_override + LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) override { LDAPMod **mods = this->BuildMods(attributes); LDAPQuery msgid; @@ -217,7 +217,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) anope_override + LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) override { LDAPQuery msgid; int ret = ldap_delete_ext(this->con, dn.c_str(), NULL, NULL, &msgid); @@ -244,7 +244,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) anope_override + LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) override { LDAPMod **mods = this->BuildMods(attributes); LDAPQuery msgid; @@ -300,7 +300,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition } public: - void Run() anope_override + void Run() override { while (!this->GetExitState()) { @@ -466,7 +466,7 @@ class ModuleLDAP : public Module, public Pipe LDAPServices.clear(); } - void OnReload(Configuration::Conf *config) anope_override + void OnReload(Configuration::Conf *config) override { Configuration::Block *conf = config->GetModule(this); @@ -522,7 +522,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnModuleUnload(User *, Module *m) anope_override + void OnModuleUnload(User *, Module *m) override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { @@ -555,7 +555,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnNotify() anope_override + void OnNotify() override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 7c9593dff..1a4feb232 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -43,7 +43,7 @@ class IdentifyInterface : public LDAPInterface this->requests[id] = ii; } - void OnResult(const LDAPResult &r) anope_override + void OnResult(const LDAPResult &r) override { std::map<LDAPQuery, IdentifyInfo *>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -124,7 +124,7 @@ class IdentifyInterface : public LDAPInterface delete ii; } - void OnError(const LDAPResult &r) anope_override + void OnError(const LDAPResult &r) override { std::map<LDAPQuery, IdentifyInfo *>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -147,7 +147,7 @@ class OnIdentifyInterface : public LDAPInterface this->requests[id] = nick; } - void OnResult(const LDAPResult &r) anope_override + void OnResult(const LDAPResult &r) override { std::map<LDAPQuery, Anope::string>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -178,7 +178,7 @@ class OnIdentifyInterface : public LDAPInterface } } - void OnError(const LDAPResult &r) anope_override + void OnError(const LDAPResult &r) override { this->requests.erase(r.id); Log(this->owner) << r.error; @@ -190,12 +190,12 @@ class OnRegisterInterface : public LDAPInterface public: OnRegisterInterface(Module *m) : LDAPInterface(m) { } - void OnResult(const LDAPResult &r) anope_override + void OnResult(const LDAPResult &r) override { Log(this->owner) << "Successfully added newly created account to LDAP"; } - void OnError(const LDAPResult &r) anope_override + void OnError(const LDAPResult &r) override { Log(this->owner) << "Error adding newly created account to LDAP: " << r.getError(); } @@ -224,7 +224,7 @@ class NSIdentifyLDAP : public Module ModuleManager::SetPriority(this, PRIORITY_FIRST); } - void OnReload(Configuration::Conf *config) anope_override + void OnReload(Configuration::Conf *config) override { Configuration::Block *conf = Config->GetModule(this); @@ -242,7 +242,7 @@ class NSIdentifyLDAP : public Module config->GetModule("nickserv")->Set("forceemail", "false"); } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (!this->disable_register_reason.empty()) { @@ -262,7 +262,7 @@ class NSIdentifyLDAP : public Module return EVENT_CONTINUE; } - void OnCheckAuthentication(User *u, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *u, IdentifyRequest *req) override { if (!this->ldap) return; @@ -280,7 +280,7 @@ class NSIdentifyLDAP : public Module } } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { if (email_attribute.empty() || !this->ldap) return; @@ -300,7 +300,7 @@ class NSIdentifyLDAP : public Module } } - void OnNickRegister(User *, NickAlias *na) anope_override + void OnNickRegister(User *, NickAlias *na) override { if (!this->disable_register_reason.empty() || !this->ldap) return; diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index 3e16d75e6..e265bfd9d 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -18,7 +18,7 @@ class IdentifyInterface : public LDAPInterface this->requests[id] = nick; } - void OnResult(const LDAPResult &r) anope_override + void OnResult(const LDAPResult &r) override { std::map<LDAPQuery, Anope::string>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -69,7 +69,7 @@ class IdentifyInterface : public LDAPInterface } } - void OnError(const LDAPResult &r) anope_override + void OnError(const LDAPResult &r) override { this->requests.erase(r.id); } @@ -91,7 +91,7 @@ class LDAPOper : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = Config->GetModule(this); @@ -106,7 +106,7 @@ class LDAPOper : public Module my_opers.clear(); } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { try { @@ -126,7 +126,7 @@ class LDAPOper : public Module } } - void OnDelCore(NickCore *nc) anope_override + void OnDelCore(NickCore *nc) override { if (nc->o != NULL && my_opers.count(nc->o) > 0) { diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index ceb7af0ef..808cdd264 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -122,15 +122,15 @@ class MySQLService : public Provider ~MySQLService(); - void Run(Interface *i, const Query &query) anope_override; + void Run(Interface *i, const Query &query) override; - Result RunQuery(const Query &query) anope_override; + Result RunQuery(const Query &query) override; - std::vector<Query> CreateTable(const Anope::string &table, const Data &data) anope_override; + std::vector<Query> CreateTable(const Anope::string &table, const Data &data) override; - Query BuildInsert(const Anope::string &table, unsigned int id, Data &data) anope_override; + Query BuildInsert(const Anope::string &table, unsigned int id, Data &data) override; - Query GetTables(const Anope::string &prefix) anope_override; + Query GetTables(const Anope::string &prefix) override; void Connect(); @@ -148,7 +148,7 @@ class DispatcherThread : public Thread, public Condition public: DispatcherThread() : Thread() { } - void Run() anope_override; + void Run() override; }; class ModuleSQL; @@ -186,7 +186,7 @@ class ModuleSQL : public Module, public Pipe delete DThread; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); @@ -239,7 +239,7 @@ class ModuleSQL : public Module, public Pipe } } - void OnModuleUnload(User *, Module *m) anope_override + void OnModuleUnload(User *, Module *m) override { this->DThread->Lock(); @@ -264,7 +264,7 @@ class ModuleSQL : public Module, public Pipe this->OnNotify(); } - void OnNotify() anope_override + void OnNotify() override { this->DThread->Lock(); std::deque<QueryResult> finishedRequests = this->FinishedRequests; diff --git a/modules/extra/m_regex_pcre.cpp b/modules/extra/m_regex_pcre.cpp index b6bf88af1..a7c9d4ba8 100644 --- a/modules/extra/m_regex_pcre.cpp +++ b/modules/extra/m_regex_pcre.cpp @@ -33,7 +33,7 @@ class PCRERegexProvider : public RegexProvider public: PCRERegexProvider(Module *creator) : RegexProvider(creator, "regex/pcre") { } - Regex *Compile(const Anope::string &expression) anope_override + Regex *Compile(const Anope::string &expression) override { return new PCRERegex(expression); } diff --git a/modules/extra/m_regex_posix.cpp b/modules/extra/m_regex_posix.cpp index 551d978b8..933ee59af 100644 --- a/modules/extra/m_regex_posix.cpp +++ b/modules/extra/m_regex_posix.cpp @@ -35,7 +35,7 @@ class POSIXRegexProvider : public RegexProvider public: POSIXRegexProvider(Module *creator) : RegexProvider(creator, "regex/posix") { } - Regex *Compile(const Anope::string &expression) anope_override + Regex *Compile(const Anope::string &expression) override { return new POSIXRegex(expression); } diff --git a/modules/extra/m_regex_tre.cpp b/modules/extra/m_regex_tre.cpp index 760097b08..0f5c0eaf7 100644 --- a/modules/extra/m_regex_tre.cpp +++ b/modules/extra/m_regex_tre.cpp @@ -36,7 +36,7 @@ class TRERegexProvider : public RegexProvider public: TRERegexProvider(Module *creator) : RegexProvider(creator, "regex/tre") { } - Regex *Compile(const Anope::string &expression) anope_override + Regex *Compile(const Anope::string &expression) override { return new TRERegex(expression); } diff --git a/modules/extra/m_sasl_dh-aes.cpp b/modules/extra/m_sasl_dh-aes.cpp index a4fc5ea44..0a73f7788 100644 --- a/modules/extra/m_sasl_dh-aes.cpp +++ b/modules/extra/m_sasl_dh-aes.cpp @@ -48,7 +48,7 @@ class DHAES : public Mechanism DH* dh_params; const size_t keysize; - SASL::Session* CreateSession(const Anope::string &uid) anope_override + SASL::Session* CreateSession(const Anope::string &uid) override { return new DHAESSession(this, uid, dh_params); } @@ -70,7 +70,7 @@ class DHAES : public Mechanism DH_free(dh_params); } - void ProcessMessage(SASL::Session *session, const SASL::Message &m) anope_override + void ProcessMessage(SASL::Session *session, const SASL::Message &m) override { DHAESSession *sess = anope_dynamic_static_cast<DHAESSession *>(session); diff --git a/modules/extra/m_sasl_dh-blowfish.cpp b/modules/extra/m_sasl_dh-blowfish.cpp index 1bfd50173..b310c1089 100644 --- a/modules/extra/m_sasl_dh-blowfish.cpp +++ b/modules/extra/m_sasl_dh-blowfish.cpp @@ -48,7 +48,7 @@ class DHBS : public Mechanism DH* dh_params; const size_t keysize; - SASL::Session* CreateSession(const Anope::string &uid) anope_override + SASL::Session* CreateSession(const Anope::string &uid) override { return new DHBSSession(this, uid, dh_params); } @@ -70,7 +70,7 @@ class DHBS : public Mechanism DH_free(dh_params); } - void ProcessMessage(SASL::Session *session, const SASL::Message &m) anope_override + void ProcessMessage(SASL::Session *session, const SASL::Message &m) override { DHBSSession *sess = anope_dynamic_static_cast<DHBSSession *>(session); diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 2342ef89d..b3c0fd6b7 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -19,7 +19,7 @@ class SQLAuthenticationResult : public SQL::Interface req->Release(me); } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { if (r.Rows() == 0) { @@ -58,7 +58,7 @@ class SQLAuthenticationResult : public SQL::Interface delete this; } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { Log(this->owner) << "m_sql_authentication: Error executing query " << r.GetQuery().query << ": " << r.GetError(); delete this; @@ -80,7 +80,7 @@ class ModuleSQLAuthentication : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); this->engine = config->Get<const Anope::string>("engine"); @@ -91,7 +91,7 @@ class ModuleSQLAuthentication : public Module this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (!this->disable_reason.empty() && (command->name == "nickserv/register" || command->name == "nickserv/group")) { @@ -108,7 +108,7 @@ class ModuleSQLAuthentication : public Module return EVENT_CONTINUE; } - void OnCheckAuthentication(User *u, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *u, IdentifyRequest *req) override { if (!this->SQL) { diff --git a/modules/extra/m_sql_log.cpp b/modules/extra/m_sql_log.cpp index 42b5b8924..475ff1253 100644 --- a/modules/extra/m_sql_log.cpp +++ b/modules/extra/m_sql_log.cpp @@ -20,13 +20,13 @@ class SQLLog : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); this->table = config->Get<const Anope::string>("table", "logs"); } - void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) anope_override + void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) override { Anope::string ref_name; ServiceReference<SQL::Provider> SQL; diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index 68a6d9084..01d1fa174 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -20,7 +20,7 @@ class SQLOperResult : public SQL::Interface public: SQLOperResult(Module *m, User *u) : SQL::Interface(m), user(u) { } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { SQLOperResultDeleter d(this); @@ -82,7 +82,7 @@ class SQLOperResult : public SQL::Interface } } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { SQLOperResultDeleter d(this); Log(this->owner) << "m_sql_oper: Error executing query " << r.GetQuery().query << ": " << r.GetError(); @@ -115,7 +115,7 @@ class ModuleSQLOper : public Module } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); @@ -125,7 +125,7 @@ class ModuleSQLOper : public Module this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { if (!this->SQL) { diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index b306ccfcf..1e9fdad7b 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -44,11 +44,11 @@ class SQLiteService : public Provider ~SQLiteService(); - void Run(Interface *i, const Query &query) anope_override; + void Run(Interface *i, const Query &query) override; Result RunQuery(const Query &query); - std::vector<Query> CreateTable(const Anope::string &table, const Data &data) anope_override; + std::vector<Query> CreateTable(const Anope::string &table, const Data &data) override; Query BuildInsert(const Anope::string &table, unsigned int id, Data &data); @@ -75,7 +75,7 @@ class ModuleSQLite : public Module SQLiteServices.clear(); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); diff --git a/modules/extra/m_ssl_gnutls.cpp b/modules/extra/m_ssl_gnutls.cpp index 011530280..8ad6ee684 100644 --- a/modules/extra/m_ssl_gnutls.cpp +++ b/modules/extra/m_ssl_gnutls.cpp @@ -28,7 +28,7 @@ class MySSLService : public SSLService /** Initialize a socket to use SSL * @param s The socket */ - void Init(Socket *s) anope_override; + void Init(Socket *s) override; }; class SSLSocketIO : public SocketIO @@ -47,43 +47,43 @@ class SSLSocketIO : public SocketIO * @param sz How much to read * @return Number of bytes received */ - int Recv(Socket *s, char *buf, size_t sz) anope_override; + int Recv(Socket *s, char *buf, size_t sz) override; /** Write something to the socket * @param s The socket * @param buf The data to write * @param size The length of the data */ - int Send(Socket *s, const char *buf, size_t sz) anope_override; + int Send(Socket *s, const char *buf, size_t sz) override; /** Accept a connection from a socket * @param s The socket * @return The new socket */ - ClientSocket *Accept(ListenSocket *s) anope_override; + ClientSocket *Accept(ListenSocket *s) override; /** Finished accepting a connection from a socket * @param s The socket * @return SF_ACCEPTED if accepted, SF_ACCEPTING if still in process, SF_DEAD on error */ - SocketFlag FinishAccept(ClientSocket *cs) anope_override; + SocketFlag FinishAccept(ClientSocket *cs) override; /** Connect the socket * @param s THe socket * @param target IP to connect to * @param port to connect to */ - void Connect(ConnectionSocket *s, const Anope::string &target, int port) anope_override; + void Connect(ConnectionSocket *s, const Anope::string &target, int port) override; /** Called to potentially finish a pending connection * @param s The socket * @return SF_CONNECTED on success, SF_CONNECTING if still pending, and SF_DEAD on error. */ - SocketFlag FinishConnect(ConnectionSocket *s) anope_override; + SocketFlag FinishConnect(ConnectionSocket *s) override; /** Called when the socket is destructing */ - void Destroy() anope_override; + void Destroy() override; }; namespace GnuTLS @@ -330,7 +330,7 @@ class GnuTLSModule : public Module } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); @@ -366,7 +366,7 @@ class GnuTLSModule : public Module Log(LOG_DEBUG) << "m_ssl_gnutls: Successfully loaded certificate " << certfile << " and private key " << keyfile; } - void OnPreServerConnect() anope_override + void OnPreServerConnect() override { Configuration::Block *config = Config->GetBlock("uplink", Anope::CurrentUplink); diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp index a274dc78d..4e35c0dbf 100644 --- a/modules/extra/m_ssl_openssl.cpp +++ b/modules/extra/m_ssl_openssl.cpp @@ -20,7 +20,7 @@ class MySSLService : public SSLService /** Initialize a socket to use SSL * @param s The socket */ - void Init(Socket *s) anope_override; + void Init(Socket *s) override; }; class SSLSocketIO : public SocketIO @@ -39,43 +39,43 @@ class SSLSocketIO : public SocketIO * @param sz How much to read * @return Number of bytes received */ - int Recv(Socket *s, char *buf, size_t sz) anope_override; + int Recv(Socket *s, char *buf, size_t sz) override; /** Write something to the socket * @param s The socket * @param buf The data to write * @param size The length of the data */ - int Send(Socket *s, const char *buf, size_t sz) anope_override; + int Send(Socket *s, const char *buf, size_t sz) override; /** Accept a connection from a socket * @param s The socket * @return The new socket */ - ClientSocket *Accept(ListenSocket *s) anope_override; + ClientSocket *Accept(ListenSocket *s) override; /** Finished accepting a connection from a socket * @param s The socket * @return SF_ACCEPTED if accepted, SF_ACCEPTING if still in process, SF_DEAD on error */ - SocketFlag FinishAccept(ClientSocket *cs) anope_override; + SocketFlag FinishAccept(ClientSocket *cs) override; /** Connect the socket * @param s THe socket * @param target IP to connect to * @param port to connect to */ - void Connect(ConnectionSocket *s, const Anope::string &target, int port) anope_override; + void Connect(ConnectionSocket *s, const Anope::string &target, int port) override; /** Called to potentially finish a pending connection * @param s The socket * @return SF_CONNECTED on success, SF_CONNECTING if still pending, and SF_DEAD on error. */ - SocketFlag FinishConnect(ConnectionSocket *s) anope_override; + SocketFlag FinishConnect(ConnectionSocket *s) override; /** Called when the socket is destructing */ - void Destroy() anope_override; + void Destroy() override; }; class SSLModule; @@ -125,7 +125,7 @@ class SSLModule : public Module SSL_CTX_free(server_ctx); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); @@ -159,7 +159,7 @@ class SSLModule : public Module } - void OnPreServerConnect() anope_override + void OnPreServerConnect() override { Configuration::Block *config = Config->GetBlock("uplink", Anope::CurrentUplink); diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp index 91c1d14a4..b400e23ed 100644 --- a/modules/extra/stats/cs_fantasy_stats.cpp +++ b/modules/extra/stats/cs_fantasy_stats.cpp @@ -17,11 +17,11 @@ class MySQLInterface : public SQL::Interface public: MySQLInterface(Module *o) : SQL::Interface(o) { } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); @@ -73,7 +73,7 @@ class CSStats : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine")); diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp index 80db66eb9..7f4092fe2 100644 --- a/modules/extra/stats/cs_fantasy_top.cpp +++ b/modules/extra/stats/cs_fantasy_top.cpp @@ -17,11 +17,11 @@ class MySQLInterface : public SQL::Interface public: MySQLInterface(Module *o) : SQL::Interface(o) { } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); @@ -98,7 +98,7 @@ class CSTop : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine")); diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h index 0c516f5e3..26f907cc3 100644 --- a/modules/extra/stats/irc2sql/irc2sql.h +++ b/modules/extra/stats/irc2sql/irc2sql.h @@ -6,11 +6,11 @@ class MySQLInterface : public SQL::Interface public: MySQLInterface(Module *o) : SQL::Interface(o) { } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) Log(LOG_DEBUG) << "m_irc2sql: Error executing query " << r.finished_query << ": " << r.GetError(); @@ -48,30 +48,30 @@ class IRC2SQL : public Module introduced_myself = false; } - void OnShutdown() anope_override; - void OnReload(Configuration::Conf *config) anope_override; - void OnNewServer(Server *server) anope_override; - void OnServerQuit(Server *server) anope_override; - void OnUserConnect(User *u, bool &exempt) anope_override; - void OnUserQuit(User *u, const Anope::string &msg) anope_override; - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override; - void OnFingerprint(User *u) anope_override; - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override; - void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) anope_override; - void OnUserLogin(User *u) anope_override; - void OnNickLogout(User *u) anope_override; - void OnSetDisplayedHost(User *u) anope_override; + void OnShutdown() override; + void OnReload(Configuration::Conf *config) override; + void OnNewServer(Server *server) override; + void OnServerQuit(Server *server) override; + void OnUserConnect(User *u, bool &exempt) override; + void OnUserQuit(User *u, const Anope::string &msg) override; + void OnUserNickChange(User *u, const Anope::string &oldnick) override; + void OnFingerprint(User *u) override; + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override; + void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override; + void OnUserLogin(User *u) override; + void OnNickLogout(User *u) override; + void OnSetDisplayedHost(User *u) override; - void OnChannelCreate(Channel *c) anope_override; - void OnChannelDelete(Channel *c) anope_override; - void OnLeaveChannel(User *u, Channel *c) anope_override; - void OnJoinChannel(User *u, Channel *c) anope_override; - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override; - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override; + void OnChannelCreate(Channel *c) override; + void OnChannelDelete(Channel *c) override; + void OnLeaveChannel(User *u, Channel *c) override; + void OnJoinChannel(User *u, Channel *c) override; + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; + EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; - void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override; + void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) override; - void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) anope_override; + void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) override; }; diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 4151c4579..a1674bce3 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -10,7 +10,7 @@ class CommandCSSetChanstats : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (!ci) @@ -46,7 +46,7 @@ class CommandCSSetChanstats : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -99,12 +99,12 @@ class CommandNSSetChanstats : public Command this->OnSyntaxError(source, "CHANSTATS"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -122,12 +122,12 @@ class CommandNSSASetChanstats : public CommandNSSetChanstats this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1], true); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -141,11 +141,11 @@ class MySQLInterface : public SQL::Interface public: MySQLInterface(Module *o) : SQL::Interface(o) { } - void OnResult(const SQL::Result &r) anope_override + void OnResult(const SQL::Result &r) override { } - void OnError(const SQL::Result &r) anope_override + void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); @@ -484,7 +484,7 @@ class MChanstats : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); prefix = block->Get<const Anope::string>("prefix", "anope_"); @@ -501,7 +501,7 @@ class MChanstats : public Module Log(this) << "no database connection to " << engine; } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; @@ -509,7 +509,7 @@ class MChanstats : public Module info.AddOption(_("Chanstats")); } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { if (!show_hidden) return; @@ -517,7 +517,7 @@ class MChanstats : public Module info.AddOption(_("Chanstats")); } - void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override + void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) override { User *u = User::Find(user); if (!u || !u->Account() || !c->ci || !cs_stats.HasExt(c->ci)) @@ -528,13 +528,13 @@ class MChanstats : public Module this->RunQuery(query); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *, const Anope::string ¶m) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *, const Anope::string ¶m) override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; @@ -553,7 +553,7 @@ class MChanstats : public Module } public: - void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) anope_override + void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) override { if (!cu->chan->ci || !cs_stats.HasExt(cu->chan->ci)) return; @@ -569,7 +569,7 @@ class MChanstats : public Module this->RunQuery(query); } - void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override + void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override { if (!c->ci || !cs_stats.HasExt(c->ci)) return; @@ -610,14 +610,14 @@ class MChanstats : public Module this->RunQuery(query); } - void OnDelCore(NickCore *nc) anope_override + void OnDelCore(NickCore *nc) override { query = "DELETE FROM `" + prefix + "chanstats` WHERE `nick` = @nick@;"; query.SetValue("nick", nc->display); this->RunQuery(query); } - void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) anope_override + void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) override { query = "CALL " + prefix + "chanstats_proc_chgdisplay(@old_display@, @new_display@);"; query.SetValue("old_display", nc->display); @@ -625,7 +625,7 @@ class MChanstats : public Module this->RunQuery(query); } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { query = "DELETE FROM `" + prefix + "chanstats` WHERE `chan` = @channel@;"; query.SetValue("channel", ci->name); diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 0e24b10c5..1e8bc4e10 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -20,7 +20,7 @@ class CommandBSSetFantasy : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -63,7 +63,7 @@ class CommandBSSetFantasy : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -92,7 +92,7 @@ class Fantasy : public Module { } - void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override + void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override { if (!u || !c || !c->ci || !c->ci->bi || msg.empty() || msg[0] == '\1') return; diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index 8a2ed5fee..eaf9ba428 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -485,16 +485,16 @@ class TCPSocket : public ListenSocket } /* Times out after a few seconds */ - void Tick(time_t) anope_override { } + void Tick(time_t) override { } - void Reply(Packet *p) anope_override + void Reply(Packet *p) override { delete packet; packet = p; SocketEngine::Change(this, true, SF_WRITABLE); } - bool ProcessRead() anope_override + bool ProcessRead() override { Log(LOG_DEBUG_2) << "Resolver: Reading from DNS TCP socket"; @@ -514,7 +514,7 @@ class TCPSocket : public ListenSocket return true; } - bool ProcessWrite() anope_override + bool ProcessWrite() override { Log(LOG_DEBUG_2) << "Resolver: Writing to DNS TCP socket"; @@ -544,7 +544,7 @@ class TCPSocket : public ListenSocket TCPSocket(Manager *m, const Anope::string &ip, int port) : Socket(-1, ip.find(':') != Anope::string::npos), ListenSocket(ip, port, ip.find(':') != Anope::string::npos), manager(m) { } - ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override + ClientSocket *OnAccept(int fd, const sockaddrs &addr) override { return new Client(this->manager, this, fd, addr); } @@ -565,7 +565,7 @@ class UDPSocket : public ReplySocket delete packets[i]; } - void Reply(Packet *p) anope_override + void Reply(Packet *p) override { packets.push_back(p); SocketEngine::Change(this, true, SF_WRITABLE); @@ -573,7 +573,7 @@ class UDPSocket : public ReplySocket std::deque<Packet *>& GetPackets() { return packets; } - bool ProcessRead() anope_override + bool ProcessRead() override { Log(LOG_DEBUG_2) << "Resolver: Reading from DNS UDP socket"; @@ -584,7 +584,7 @@ class UDPSocket : public ReplySocket return this->manager->HandlePacket(this, packet_buffer, length, &from_server); } - bool ProcessWrite() anope_override + bool ProcessWrite() override { Log(LOG_DEBUG_2) << "Resolver: Writing to DNS UDP socket"; @@ -621,7 +621,7 @@ class NotifySocket : public Socket SocketEngine::Change(this, true, SF_WRITABLE); } - bool ProcessWrite() anope_override + bool ProcessWrite() override { if (!packet) return false; @@ -648,7 +648,7 @@ class MyManager : public Manager, public Timer { uint32_t serial; - typedef TR1NS::unordered_map<Question, Query, Question::hash> cache_map; + typedef std::unordered_map<Question, Query, Question::hash> cache_map; cache_map cache; TCPSocket *tcpsock; @@ -732,7 +732,7 @@ class MyManager : public Manager, public Timer } public: - void Process(Request *req) anope_override + void Process(Request *req) override { Log(LOG_DEBUG_2) << "Resolver: Processing request to lookup " << req->name << ", of type " << req->type; @@ -759,12 +759,12 @@ class MyManager : public Manager, public Timer this->udpsock->Reply(p); } - void RemoveRequest(Request *req) anope_override + void RemoveRequest(Request *req) override { this->requests.erase(req->id); } - bool HandlePacket(ReplySocket *s, const unsigned char *const packet_buffer, int length, sockaddrs *from) anope_override + bool HandlePacket(ReplySocket *s, const unsigned char *const packet_buffer, int length, sockaddrs *from) override { if (length < Packet::HEADER_LENGTH) return true; @@ -916,12 +916,12 @@ class MyManager : public Manager, public Timer return true; } - void UpdateSerial() anope_override + void UpdateSerial() override { serial = Anope::CurTime; } - void Notify(const Anope::string &zone) anope_override + void Notify(const Anope::string &zone) override { /* notify slaves of the update */ for (unsigned i = 0; i < notify.size(); ++i) @@ -952,12 +952,12 @@ class MyManager : public Manager, public Timer } } - uint32_t GetSerial() const anope_override + uint32_t GetSerial() const override { return serial; } - void Tick(time_t now) anope_override + void Tick(time_t now) override { Log(LOG_DEBUG_2) << "Resolver: Purging DNS cache"; @@ -1031,7 +1031,7 @@ class ModuleDNS : public Module } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); @@ -1097,7 +1097,7 @@ class ModuleDNS : public Module } } - void OnModuleUnload(User *u, Module *m) anope_override + void OnModuleUnload(User *u, Module *m) override { for (std::map<unsigned short, Request *>::iterator it = this->manager.requests.begin(), it_end = this->manager.requests.end(); it != it_end;) { diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index b19a66ea4..414598441 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -32,7 +32,7 @@ class DNSBLResolver : public Request public: DNSBLResolver(Module *c, User *u, const Blacklist &b, const Anope::string &host, bool add_akill) : Request(dnsmanager, c, host, QUERY_A, true), user(u), blacklist(b), add_to_akill(add_akill) { } - void OnLookupComplete(const Query *record) anope_override + void OnLookupComplete(const Query *record) override { if (!user || user->Quitting()) return; @@ -92,7 +92,7 @@ class ModuleDNSBL : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->check_on_connect = block->Get<bool>("check_on_connect"); @@ -121,7 +121,7 @@ class ModuleDNSBL : public Module } } - void OnUserConnect(User *user, bool &exempt) anope_override + void OnUserConnect(User *user, bool &exempt) override { if (exempt || user->Quitting() || (!this->check_on_connect && !Me->IsSynced()) || !dnsmanager) return; diff --git a/modules/m_helpchan.cpp b/modules/m_helpchan.cpp index d71951a13..1cde06c5a 100644 --- a/modules/m_helpchan.cpp +++ b/modules/m_helpchan.cpp @@ -14,7 +14,7 @@ class HelpChannel : public Module { } - EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string ¶m) override { if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel"))) { diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp index f3d0677a9..88244b03b 100644 --- a/modules/m_httpd.cpp +++ b/modules/m_httpd.cpp @@ -104,17 +104,17 @@ class MyHTTPClient : public HTTPClient } /* Close connection once all data is written */ - bool ProcessWrite() anope_override + bool ProcessWrite() override { return !BinarySocket::ProcessWrite() || this->write_buffer.empty() ? false : true; } - const Anope::string GetIP() anope_override + const Anope::string GetIP() override { return this->ip; } - bool Read(const char *buffer, size_t l) anope_override + bool Read(const char *buffer, size_t l) override { message.content.append(buffer, l); @@ -232,7 +232,7 @@ class MyHTTPClient : public HTTPClient return true; } - void SendError(HTTPError err, const Anope::string &msg) anope_override + void SendError(HTTPError err, const Anope::string &msg) override { HTTPReply h; @@ -243,7 +243,7 @@ class MyHTTPClient : public HTTPClient this->SendReply(&h); } - void SendReply(HTTPReply *msg) anope_override + void SendReply(HTTPReply *msg) override { this->WriteClient("HTTP/1.1 " + GetStatusFromCode(msg->error)); this->WriteClient("Date: " + BuildDate()); @@ -295,7 +295,7 @@ class MyHTTPProvider : public HTTPProvider, public Timer public: MyHTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, const int t, bool s) : Socket(-1, i.find(':') != Anope::string::npos), HTTPProvider(c, n, i, p, s), Timer(c, 10, Anope::CurTime, true), timeout(t) { } - void Tick(time_t) anope_override + void Tick(time_t) override { while (!this->clients.empty()) { @@ -308,19 +308,19 @@ class MyHTTPProvider : public HTTPProvider, public Timer } } - ClientSocket* OnAccept(int fd, const sockaddrs &addr) anope_override + ClientSocket* OnAccept(int fd, const sockaddrs &addr) override { MyHTTPClient *c = new MyHTTPClient(this, fd, addr); this->clients.push_back(c); return c; } - bool RegisterPage(HTTPPage *page) anope_override + bool RegisterPage(HTTPPage *page) override { return this->pages.insert(std::make_pair(page->GetURL(), page)).second; } - void UnregisterPage(HTTPPage *page) anope_override + void UnregisterPage(HTTPPage *page) override { this->pages.erase(page->GetURL()); } @@ -357,7 +357,7 @@ class HTTPD : public Module this->providers.clear(); } - void OnReload(Configuration::Conf *config) anope_override + void OnReload(Configuration::Conf *config) override { Configuration::Block *conf = config->GetModule(this); std::set<Anope::string> existing; @@ -452,7 +452,7 @@ class HTTPD : public Module } } - void OnModuleLoad(User *u, Module *m) anope_override + void OnModuleLoad(User *u, Module *m) override { for (std::map<Anope::string, MyHTTPProvider *>::iterator it = this->providers.begin(), it_end = this->providers.end(); it != it_end; ++it) { diff --git a/modules/m_proxyscan.cpp b/modules/m_proxyscan.cpp index 98178260c..9918c4232 100644 --- a/modules/m_proxyscan.cpp +++ b/modules/m_proxyscan.cpp @@ -29,12 +29,12 @@ class ProxyCallbackListener : public ListenSocket { } - void OnAccept() anope_override + void OnAccept() override { this->Write(ProxyCheckString); } - bool ProcessWrite() anope_override + bool ProcessWrite() override { return !BufferedSocket::ProcessWrite() || this->write_buffer.empty() ? false : true; } @@ -45,7 +45,7 @@ class ProxyCallbackListener : public ListenSocket { } - ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override + ClientSocket *OnAccept(int fd, const sockaddrs &addr) override { return new ProxyCallbackClient(this, fd, addr); } @@ -73,7 +73,7 @@ class ProxyConnect : public ConnectionSocket proxies.erase(this); } - virtual void OnConnect() anope_override = 0; + virtual void OnConnect() override = 0; virtual const Anope::string GetType() const = 0; protected: @@ -113,7 +113,7 @@ class HTTPProxyConnect : public ProxyConnect, public BufferedSocket { } - void OnConnect() anope_override + void OnConnect() override { this->Write("CONNECT %s:%d HTTP/1.0", target_ip.c_str(), target_port); this->Write("Content-length: 0"); @@ -121,12 +121,12 @@ class HTTPProxyConnect : public ProxyConnect, public BufferedSocket this->Write(""); } - const Anope::string GetType() const anope_override + const Anope::string GetType() const override { return "HTTP"; } - bool ProcessRead() anope_override + bool ProcessRead() override { bool b = BufferedSocket::ProcessRead(); if (this->GetLine() == ProxyCheckString) @@ -145,7 +145,7 @@ class SOCKS5ProxyConnect : public ProxyConnect, public BinarySocket { } - void OnConnect() anope_override + void OnConnect() override { sockaddrs target_addr; char buf[4 + sizeof(target_addr.sa4.sin_addr.s_addr) + sizeof(target_addr.sa4.sin_port)]; @@ -172,12 +172,12 @@ class SOCKS5ProxyConnect : public ProxyConnect, public BinarySocket this->Write(buf, ptr); } - const Anope::string GetType() const anope_override + const Anope::string GetType() const override { return "SOCKS5"; } - bool Read(const char *buffer, size_t l) anope_override + bool Read(const char *buffer, size_t l) override { if (l >= ProxyCheckString.length() && !strncmp(buffer, ProxyCheckString.c_str(), ProxyCheckString.length())) { @@ -204,7 +204,7 @@ class ModuleProxyScan : public Module { } - void Tick(time_t) anope_override + void Tick(time_t) override { for (std::set<ProxyConnect *>::iterator it = ProxyConnect::proxies.begin(), it_end = ProxyConnect::proxies.end(); it != it_end; ++it) { @@ -247,7 +247,7 @@ class ModuleProxyScan : public Module delete this->listener; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = Config->GetModule(this); @@ -327,7 +327,7 @@ class ModuleProxyScan : public Module } } - void OnUserConnect(User *user, bool &exempt) anope_override + void OnUserConnect(User *user, bool &exempt) override { if (exempt || user->Quitting() || !Me->IsSynced() || !user->server->IsSynced()) return; diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp index 3c33f5395..2dff7382e 100644 --- a/modules/m_redis.cpp +++ b/modules/m_redis.cpp @@ -27,10 +27,10 @@ class RedisSocket : public BinarySocket, public ConnectionSocket ~RedisSocket(); - void OnConnect() anope_override; - void OnError(const Anope::string &error) anope_override; + void OnConnect() override; + void OnError(const Anope::string &error) override; - bool Read(const char *buffer, size_t l) anope_override; + bool Read(const char *buffer, size_t l) override; }; class Transaction : public Interface @@ -53,7 +53,7 @@ class Transaction : public Interface } } - void OnResult(const Reply &r) anope_override + void OnResult(const Reply &r) override { /* This is a multi bulk reply of the results of the queued commands * in this transaction @@ -185,7 +185,7 @@ class MyRedisService : public Provider this->Send(sock, i, args); } - void SendCommand(Interface *i, const std::vector<Anope::string> &cmds) anope_override + void SendCommand(Interface *i, const std::vector<Anope::string> &cmds) override { std::vector<std::pair<const char *, size_t> > args; for (unsigned j = 0; j < cmds.size(); ++j) @@ -193,7 +193,7 @@ class MyRedisService : public Provider this->Send(i, args); } - void SendCommand(Interface *i, const Anope::string &str) anope_override + void SendCommand(Interface *i, const Anope::string &str) override { std::vector<Anope::string> args; spacesepstream(str).GetTokens(args); @@ -201,7 +201,7 @@ class MyRedisService : public Provider } public: - bool BlockAndProcess() anope_override + bool BlockAndProcess() override { this->sock->ProcessWrite(); this->sock->SetBlocking(true); @@ -210,7 +210,7 @@ class MyRedisService : public Provider return !this->sock->interfaces.empty(); } - void Subscribe(Interface *i, const Anope::string &pattern) anope_override + void Subscribe(Interface *i, const Anope::string &pattern) override { if (sub == NULL) { @@ -226,13 +226,13 @@ class MyRedisService : public Provider sub->subinterfaces[pattern] = i; } - void Unsubscribe(const Anope::string &pattern) anope_override + void Unsubscribe(const Anope::string &pattern) override { if (sub) sub->subinterfaces.erase(pattern); } - void StartTransaction() anope_override + void StartTransaction() override { if (in_transaction) throw CoreException(); @@ -241,7 +241,7 @@ class MyRedisService : public Provider in_transaction = true; } - void CommitTransaction() anope_override + void CommitTransaction() override { /* The result of the transaction comes back to the reply of EXEC as a multi bulk. * The reply to the individual commands that make up the transaction when executed @@ -544,7 +544,7 @@ class ModuleRedis : public Module } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); std::vector<Anope::string> new_services; @@ -573,7 +573,7 @@ class ModuleRedis : public Module } } - void OnModuleUnload(User *, Module *m) anope_override + void OnModuleUnload(User *, Module *m) override { for (std::map<Anope::string, MyRedisService *>::iterator it = services.begin(); it != services.end(); ++it) { diff --git a/modules/m_rewrite.cpp b/modules/m_rewrite.cpp index 51795d825..b12331665 100644 --- a/modules/m_rewrite.cpp +++ b/modules/m_rewrite.cpp @@ -105,7 +105,7 @@ class RewriteCommand : public Command public: RewriteCommand(Module *creator) : Command(creator, "rewrite", 0, 0) { } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { std::vector<Anope::string> full_params = params; full_params.insert(full_params.begin(), source.command); @@ -124,7 +124,7 @@ class RewriteCommand : public Command Log() << "m_rewrite: Unable to rewrite '" << source.command << (!params.empty() ? " " + params[0] : "") << "'"; } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { Rewrite *r = Rewrite::Find(!source.c ? source.service->nick : "", source.command); if (r != NULL && !r->desc.empty()) @@ -134,7 +134,7 @@ class RewriteCommand : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { Rewrite *r = Rewrite::Find(!source.c ? source.service->nick : "", source.command); if (r != NULL && !r->desc.empty()) @@ -157,7 +157,7 @@ class ModuleRewrite : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Rewrite::rewrites.clear(); diff --git a/modules/m_sasl.cpp b/modules/m_sasl.cpp index 969e5b985..b8ecbc3a0 100644 --- a/modules/m_sasl.cpp +++ b/modules/m_sasl.cpp @@ -17,7 +17,7 @@ class Plain : public Mechanism public: Plain(Module *o) : Mechanism(o, "PLAIN") { } - void ProcessMessage(Session *sess, const SASL::Message &m) anope_override + void ProcessMessage(Session *sess, const SASL::Message &m) override { if (m.type == "S") { @@ -68,12 +68,12 @@ class External : public Mechanism throw ModuleException("No CertFP"); } - Session* CreateSession(const Anope::string &uid) anope_override + Session* CreateSession(const Anope::string &uid) override { return new Session(this, uid); } - void ProcessMessage(SASL::Session *sess, const SASL::Message &m) anope_override + void ProcessMessage(SASL::Session *sess, const SASL::Message &m) override { Session *mysess = anope_dynamic_static_cast<Session *>(sess); @@ -120,7 +120,7 @@ class SASLService : public SASL::Service, public Timer delete it->second; } - void ProcessMessage(const SASL::Message &m) anope_override + void ProcessMessage(const SASL::Message &m) override { if (m.target != "*") { @@ -161,7 +161,7 @@ class SASLService : public SASL::Service, public Timer session->mech->ProcessMessage(session, m); } - Anope::string GetAgent() anope_override + Anope::string GetAgent() override { Anope::string agent = Config->GetModule(Service::owner)->Get<Anope::string>("agent", "NickServ"); BotInfo *bi = Config->GetClient(agent); @@ -170,7 +170,7 @@ class SASLService : public SASL::Service, public Timer return agent; } - Session* GetSession(const Anope::string &uid) anope_override + Session* GetSession(const Anope::string &uid) override { std::map<Anope::string, Session *>::iterator it = sessions.find(uid); if (it != sessions.end()) @@ -178,12 +178,12 @@ class SASLService : public SASL::Service, public Timer return NULL; } - void RemoveSession(Session *sess) anope_override + void RemoveSession(Session *sess) override { sessions.erase(sess->uid); } - void DeleteSessions(Mechanism *mech, bool da) anope_override + void DeleteSessions(Mechanism *mech, bool da) override { for (std::map<Anope::string, Session *>::iterator it = sessions.begin(); it != sessions.end();) { @@ -197,7 +197,7 @@ class SASLService : public SASL::Service, public Timer } } - void SendMessage(Session *session, const Anope::string &mtype, const Anope::string &data) anope_override + void SendMessage(Session *session, const Anope::string &mtype, const Anope::string &data) override { SASL::Message msg; msg.source = this->GetAgent(); @@ -208,18 +208,18 @@ class SASLService : public SASL::Service, public Timer IRCD->SendSASLMessage(msg); } - void Succeed(Session *session, NickCore *nc) anope_override + void Succeed(Session *session, NickCore *nc) override { IRCD->SendSVSLogin(session->uid, nc->display); this->SendMessage(session, "D", "S"); } - void Fail(Session *session) anope_override + void Fail(Session *session) override { this->SendMessage(session, "D", "F"); } - void SendMechs(Session *session) anope_override + void SendMechs(Session *session) override { std::vector<Anope::string> mechs = Service::GetServiceKeys("SASL::Mechanism"); Anope::string buf; @@ -229,7 +229,7 @@ class SASLService : public SASL::Service, public Timer this->SendMessage(session, "M", buf.empty() ? "" : buf.substr(1)); } - void Tick(time_t) anope_override + void Tick(time_t) override { for (std::map<Anope::string, Session *>::iterator it = sessions.begin(); it != sessions.end();) { diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp index 36401b800..2d2814143 100644 --- a/modules/m_xmlrpc.cpp +++ b/modules/m_xmlrpc.cpp @@ -45,7 +45,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage this->events.erase(it); } - Anope::string Sanitize(const Anope::string &string) anope_override + Anope::string Sanitize(const Anope::string &string) override { Anope::string ret = string; for (int i = 0; special[i].character.empty() == false; ++i) @@ -104,7 +104,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage } public: - bool OnRequest(HTTPProvider *provider, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply) anope_override + bool OnRequest(HTTPProvider *provider, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply) override { Anope::string content = message.content, tname, data; XMLRPCRequest request(reply); @@ -176,7 +176,7 @@ class ModuleXMLRPC : public Module httpref->UnregisterPage(&xmlrpcinterface); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<const Anope::string>("server", "httpd/main")); } diff --git a/modules/m_xmlrpc_main.cpp b/modules/m_xmlrpc_main.cpp index 17dd8b96f..0f46f09e1 100644 --- a/modules/m_xmlrpc_main.cpp +++ b/modules/m_xmlrpc_main.cpp @@ -14,7 +14,7 @@ class XMLRPCIdentifyRequest : public IdentifyRequest public: XMLRPCIdentifyRequest(Module *m, XMLRPCRequest& req, HTTPClient *c, XMLRPCServiceInterface* iface, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(m, acc, pass), request(req), repl(request.r), client(c), xinterface(iface) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!xinterface || !client) return; @@ -28,7 +28,7 @@ class XMLRPCIdentifyRequest : public IdentifyRequest client->SendReply(&request.r); } - void OnFail() anope_override + void OnFail() override { if (!xinterface || !client) return; @@ -45,7 +45,7 @@ class XMLRPCIdentifyRequest : public IdentifyRequest class MyXMLRPCEvent : public XMLRPCEvent { public: - bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) anope_override + bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) override { if (request.name == "command") this->DoCommand(iface, client, request); @@ -91,7 +91,7 @@ class MyXMLRPCEvent : public XMLRPCEvent XMLRPCommandReply(Anope::string &s) : str(s) { } - void SendMessage(BotInfo *, const Anope::string &msg) anope_override + void SendMessage(BotInfo *, const Anope::string &msg) override { str += msg + "\n"; }; diff --git a/modules/ns_maxemail.cpp b/modules/ns_maxemail.cpp index 275cf0991..fe4746927 100644 --- a/modules/ns_maxemail.cpp +++ b/modules/ns_maxemail.cpp @@ -55,7 +55,7 @@ class NSMaxEmail : public Module { } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (source.IsOper()) return EVENT_CONTINUE; diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index a114db890..439bfd387 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -16,7 +16,7 @@ class ChannelModeFlood : public ChannelModeParam public: ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { try { @@ -45,7 +45,7 @@ class BahamutIRCdProto : public IRCDProto MaxModes = 60; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { if (Servers::Capab.count("TSMODE") > 0) { @@ -55,47 +55,47 @@ class BahamutIRCdProto : public IRCDProto IRCDProto::SendModeInternal(source, dest, buf); } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } /* SVSHOLD - set */ - void SendSVSHold(const Anope::string &nick, time_t time) anope_override + void SendSVSHold(const Anope::string &nick, time_t time) override { UplinkSocket::Message(Me) << "SVSHOLD " << nick << " " << time << " :Being held for registered user"; } /* SVSHOLD - release */ - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message(Me) << "SVSHOLD " << nick << " 0"; } /* SQLINE */ - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message() << "SQLINE " << x->mask << " :" << x->GetReason(); } /* UNSLINE */ - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message() << "UNSGLINE 0 :" << x->mask; } /* UNSZLINE */ - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { /* this will likely fail so its only here for legacy */ UplinkSocket::Message() << "UNSZLINE 0 " << x->GetHost(); @@ -104,7 +104,7 @@ class BahamutIRCdProto : public IRCDProto } /* SZLINE */ - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -117,19 +117,19 @@ class BahamutIRCdProto : public IRCDProto } /* SVSNOOP */ - void SendSVSNOOP(const Server *server, bool set) anope_override + void SendSVSNOOP(const Server *server, bool set) override { UplinkSocket::Message() << "SVSNOOP " << server->GetName() << " " << (set ? "+" : "-"); } /* SGLINE */ - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { UplinkSocket::Message() << "SGLINE " << x->mask.length() << " :" << x->mask << ":" << x->GetReason(); } /* RAKILL */ - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -149,19 +149,19 @@ class BahamutIRCdProto : public IRCDProto } /* TOPIC */ - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic; } /* UNSQLINE */ - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message() << "UNSQLINE " << x->mask; } /* JOIN - SJOIN */ - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(user) << "SJOIN " << c->creation_time << " " << c->name; if (status) @@ -184,7 +184,7 @@ class BahamutIRCdProto : public IRCDProto } } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -230,34 +230,34 @@ class BahamutIRCdProto : public IRCDProto /* Note: if the stamp is null 0, the below usage is correct of Bahamut */ - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf; } - void SendBOB() anope_override + void SendBOB() override { UplinkSocket::Message() << "BURST"; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message() << "BURST 0"; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message() << "NICK " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " " << u->server->GetName() << " 0 0 :" << u->realname; } /* SERVER */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " :TS"; UplinkSocket::Message() << "CAPAB SSJOIN NOQUIT BURST UNCONNECT NICKIP TSMODE TS3"; @@ -274,7 +274,7 @@ class BahamutIRCdProto : public IRCDProto this->SendBOB(); } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { Anope::string modes = c->GetModes(true, true); if (modes.empty()) @@ -282,12 +282,12 @@ class BahamutIRCdProto : public IRCDProto UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } - void SendLogin(User *u, NickAlias *) anope_override + void SendLogin(User *u, NickAlias *) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 1"); } @@ -297,7 +297,7 @@ struct IRCDMessageBurst : IRCDMessage { IRCDMessageBurst(Module *creator) : IRCDMessage(creator, "BURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* If we found a server with the given source, that one just * finished bursting. If there was no source, then our uplink @@ -315,7 +315,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator, const Anope::string &sname) : IRCDMessage(creator, sname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() > 2 && IRCD->IsChannelValid(params[0])) { @@ -362,7 +362,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() == 10) { @@ -390,7 +390,7 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]); @@ -401,7 +401,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string modes; if (params.size() >= 4) @@ -457,7 +457,7 @@ struct IRCDMessageTopic : IRCDMessage { IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 4) { } - void Run(MessageSource &, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &, const std::vector<Anope::string> ¶ms) override { Channel *c = Channel::Find(params[0]); if (c) @@ -550,7 +550,7 @@ class ProtoBahamut : public Module } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); IRCD->SendLogout(u); diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index 0801b58f4..eed63edbf 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -22,7 +22,7 @@ class ChannelModeLargeBan : public ChannelMode public: ChannelModeLargeBan(const Anope::string &mname, char modeChar) : ChannelMode(mname, modeChar) { } - bool CanSet(User *u) const anope_override + bool CanSet(User *u) const override { return u && u->HasMode("OPER"); } @@ -46,29 +46,29 @@ class CharybdisProto : public IRCDProto MaxModes = 4; } - void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) anope_override { ratbox->SendSVSKillInternal(source, targ, reason); } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { ratbox->SendGlobalNotice(bi, dest, msg); } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { ratbox->SendGlobalPrivmsg(bi, dest, msg); } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override { ratbox->SendGlobopsInternal(source, buf); } - void SendSGLine(User *u, const XLine *x) anope_override { ratbox->SendSGLine(u, x); } - void SendSGLineDel(const XLine *x) anope_override { ratbox->SendSGLineDel(x); } - void SendAkill(User *u, XLine *x) anope_override { ratbox->SendAkill(u, x); } - void SendAkillDel(const XLine *x) anope_override { ratbox->SendAkillDel(x); } - void SendSQLineDel(const XLine *x) anope_override { ratbox->SendSQLineDel(x); } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { ratbox->SendJoin(user, c, status); } - void SendServer(const Server *server) anope_override { ratbox->SendServer(server); } - void SendChannel(Channel *c) anope_override { ratbox->SendChannel(c); } - void SendTopic(const MessageSource &source, Channel *c) anope_override { ratbox->SendTopic(source, c); } - bool IsIdentValid(const Anope::string &ident) anope_override { return ratbox->IsIdentValid(ident); } - void SendLogin(User *u, NickAlias *na) anope_override { ratbox->SendLogin(u, na); } - void SendLogout(User *u) anope_override { ratbox->SendLogout(u); } - - void SendSQLine(User *, const XLine *x) anope_override + void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) override { ratbox->SendSVSKillInternal(source, targ, reason); } + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { ratbox->SendGlobalNotice(bi, dest, msg); } + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { ratbox->SendGlobalPrivmsg(bi, dest, msg); } + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { ratbox->SendGlobopsInternal(source, buf); } + void SendSGLine(User *u, const XLine *x) override { ratbox->SendSGLine(u, x); } + void SendSGLineDel(const XLine *x) override { ratbox->SendSGLineDel(x); } + void SendAkill(User *u, XLine *x) override { ratbox->SendAkill(u, x); } + void SendAkillDel(const XLine *x) override { ratbox->SendAkillDel(x); } + void SendSQLineDel(const XLine *x) override { ratbox->SendSQLineDel(x); } + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { ratbox->SendJoin(user, c, status); } + void SendServer(const Server *server) override { ratbox->SendServer(server); } + void SendChannel(Channel *c) override { ratbox->SendChannel(c); } + void SendTopic(const MessageSource &source, Channel *c) override { ratbox->SendTopic(source, c); } + bool IsIdentValid(const Anope::string &ident) override { return ratbox->IsIdentValid(ident); } + void SendLogin(User *u, NickAlias *na) override { ratbox->SendLogin(u, na); } + void SendLogout(User *u) override { ratbox->SendLogout(u); } + + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message(Me) << "RESV * " << x->mask << " :" << x->GetReason(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); /* @@ -109,45 +109,45 @@ class CharybdisProto : public IRCDProto UplinkSocket::Message() << "SVINFO 6 6 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "EUID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " * * :" << u->realname; } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "ENCAP " << u->server->GetName() << " RSFNC " << u->GetUID() << " " << newnick << " " << when << " " << u->timestamp; } - void SendSVSHold(const Anope::string &nick, time_t delay) anope_override + void SendSVSHold(const Anope::string &nick, time_t delay) override { UplinkSocket::Message(Me) << "ENCAP * NICKDELAY " << delay << " " << nick; } - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message(Me) << "ENCAP * NICKDELAY 0 " << nick; } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override { UplinkSocket::Message(Me) << "ENCAP * CHGHOST " << u->GetUID() << " :" << host; } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { this->SendVhost(u, "", u->host); } - void SendSASLMessage(const SASL::Message &message) anope_override + void SendSASLMessage(const SASL::Message &message) override { Server *s = Server::Find(message.target.substr(0, 3)); UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : message.target.substr(0, 3)) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override { Server *s = Server::Find(uid.substr(0, 3)); UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * * * " << acc; @@ -159,7 +159,7 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT);} - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -219,7 +219,7 @@ struct IRCDMessageEUID : IRCDMessage * user is not logged in with services). Hence a NICK or UID command received * from a remote server should not be sent in EUID form to other servers. */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { NickAlias *na = NULL; if (params[9] != "*") @@ -235,7 +235,7 @@ struct IRCDMessageServer : IRCDMessage IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } // SERVER dev.anope.de 1 :charybdis test server - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { // Servers other then our immediate uplink are introduced via SID if (params[1] != "1") @@ -250,7 +250,7 @@ struct IRCDMessagePass : IRCDMessage { IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { // UplinkSID is used in IRCDMessageServer UplinkSID = params[3]; @@ -360,12 +360,12 @@ class ProtoCharybdis : public Module ModuleManager::UnloadModule(m_ratbox, NULL); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock"); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (!c->ci) return; @@ -378,7 +378,7 @@ class ProtoCharybdis : public Module } } - EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -391,7 +391,7 @@ class ProtoCharybdis : public Module return EVENT_CONTINUE; } - EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 0fa4287e6..dc5261403 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -29,7 +29,7 @@ class HybridProto : public IRCDProto return NULL; } - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, user, buf); user->KillInternal(source, buf); @@ -50,42 +50,42 @@ class HybridProto : public IRCDProto MaxModes = 4; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $$" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $$" << dest->GetName() << " :" << msg; } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { UplinkSocket::Message(source) << "GLOBOPS :" << buf; } - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message(FindIntroduced()) << "ENCAP * RESV " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " 0 :" << x->reason; } - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message(Config->GetClient("OperServ")) << "UNXLINE * " << x->mask; } - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { UplinkSocket::Message(Config->GetClient("OperServ")) << "XLINE * " << x->mask << " 0 :" << x->GetReason(); } - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { UplinkSocket::Message(Config->GetClient("OperServ")) << "UNDLINE * " << x->GetHost(); } - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { /* Calculate the time left before this would expire, capping it at 2 days */ time_t timeleft = x->expires - Anope::CurTime; @@ -96,7 +96,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Config->GetClient("OperServ")) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason(); } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -104,12 +104,12 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Config->GetClient("OperServ")) << "UNKLINE * " << x->GetUser() << " " << x->GetHost(); } - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message(Config->GetClient("OperServ")) << "UNRESV * " << x->mask; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { /* * Note that we must send our modes with the SJOIN and @@ -130,7 +130,7 @@ class HybridProto : public IRCDProto } } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -171,7 +171,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Config->GetClient("OperServ")) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason(); } - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { if (server == Me) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription(); @@ -179,7 +179,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() << " " << server->GetSID() << " :" << server->GetDescription(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); @@ -206,7 +206,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message() << "SVINFO 6 5 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); @@ -214,27 +214,27 @@ class HybridProto : public IRCDProto << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " 0 :" << u->realname; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "EOB"; } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 0"); } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { Anope::string modes = c->GetModes(true, true); @@ -244,39 +244,39 @@ class HybridProto : public IRCDProto UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TBURST " << c->creation_time << " " << c->name << " " << c->topic_ts << " " << c->topic_setter << " :" << c->topic; } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "SVSNICK " << u->nick << " " << newnick << " " << when; } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { XLine x(nick, Me->GetName(), Anope::CurTime + t, "Being held for registered user"); this->SendSQLine(NULL, &x); } - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { XLine x(nick); this->SendSQLineDel(&x); } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override { u->SetMode(Config->GetClient("HostServ"), "CLOAK", host); } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { u->RemoveMode(Config->GetClient("HostServ"), "CLOAK", u->host); } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen")) return false; @@ -306,7 +306,7 @@ struct IRCDMessageBMask : IRCDMessage /* 0 1 2 3 */ /* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Channel *c = Channel::Find(params[1]); ChannelMode *mode = ModeManager::FindChannelModeByChar(params[2][0]); @@ -325,7 +325,7 @@ struct IRCDMessageEOB : IRCDMessage { IRCDMessageEOB(Module *craetor) : IRCDMessage(craetor, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetServer()->Sync(true); } @@ -335,7 +335,7 @@ struct IRCDMessageJoin : Message::Join { IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() < 2) return; @@ -353,7 +353,7 @@ struct IRCDMessageNick : IRCDMessage /* 0 1 */ /* :0MCAAAAAB NICK newnick 1350157102 */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->ChangeNick(params[0], convertTo<time_t>(params[1])); } @@ -365,7 +365,7 @@ struct IRCDMessagePass : IRCDMessage /* 0 1 2 3 */ /* PASS password TS 6 0MC */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { UplinkSID = params[3]; } @@ -375,7 +375,7 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetServer()->Sync(false); } @@ -387,7 +387,7 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 */ /* SERVER hades.arpa 1 :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") @@ -405,7 +405,7 @@ struct IRCDMessageSID : IRCDMessage /* 0 1 2 3 */ /* :0MC SID hades.arpa 2 4XY :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]); @@ -418,7 +418,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string modes; if (params.size() >= 3) @@ -468,7 +468,7 @@ struct IRCDMessageSVSMode : IRCDMessage * parv[2] = mode * parv[3] = optional argument (services id) */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (!u) @@ -485,7 +485,7 @@ struct IRCDMessageTBurst : IRCDMessage { IRCDMessageTBurst(Module *creator) : IRCDMessage(creator, "TBURST", 5) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string setter; sepstream(params[3], '!').GetToken(setter, 0); @@ -501,7 +501,7 @@ struct IRCDMessageTMode : IRCDMessage { IRCDMessageTMode(Module *creator) : IRCDMessage(creator, "TMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { time_t ts = 0; @@ -528,7 +528,7 @@ struct IRCDMessageUID : IRCDMessage /* 0 1 2 3 4 5 6 7 8 9 */ /* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string ip = params[6]; @@ -553,7 +553,7 @@ struct IRCDMessageCertFP: IRCDMessage /* 0 */ /* :0MCAAAAAB CERTFP 4C62287BA6776A89CD4F8FF10A62FFB35E79319F51AF6C62C674984974FCCB1D */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -666,7 +666,7 @@ public: this->AddModes(); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); } diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 0cf3e991d..714cc7e4d 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -28,7 +28,7 @@ class ChannelModeFlood : public ChannelModeParam public: ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { try { @@ -45,7 +45,7 @@ class ChannelModeFlood : public ChannelModeParam class InspIRCd12Proto : public IRCDProto { private: - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, user, buf); user->KillInternal(source, buf); @@ -93,17 +93,17 @@ class InspIRCd12Proto : public IRCDProto MaxModes = 20; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { /* InspIRCd may support regex bans */ if (x->IsRegex() && Servers::Capab.count("RLINE")) @@ -132,7 +132,7 @@ class InspIRCd12Proto : public IRCDProto SendDelLine("G", x->GetUser() + "@" + x->GetHost()); } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { if (Servers::Capab.count("SVSTOPIC")) { @@ -149,7 +149,7 @@ class InspIRCd12Proto : public IRCDProto } } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { if (u->HasMode("CLOAK")) this->SendChgHostInternal(u->nick, u->chost); @@ -160,7 +160,7 @@ class InspIRCd12Proto : public IRCDProto this->SendChgIdentInternal(u->nick, u->GetIdent()); } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -214,31 +214,31 @@ class InspIRCd12Proto : public IRCDProto SendAddLine("G", x->GetUser() + "@" + x->GetHost(), timeleft, x->by, x->GetReason()); } - void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) anope_override + void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) override { UplinkSocket::Message() << "PUSH " << dest << " ::" << Me->GetName() << " " << numeric << " " << dest << " " << buf; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { UplinkSocket::Message(source) << "FMODE " << dest->name << " " << dest->creation_time << " " << buf; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "UID " << u->GetUID() << " " << u->timestamp << " " << u->nick << " " << u->host << " " << u->host << " " << u->GetIdent() << " 0.0.0.0 " << u->timestamp << " " << modes << " :" << u->realname; } /* SERVER services-dev.chatspike.net password 0 :Description here */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { /* if rsquit is set then we are waiting on a squit */ if (rsquit_id.empty() && rsquit_server.empty()) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << Config->Uplinks[Anope::CurrentUplink].password << " " << server->GetHops() << " " << server->GetSID() << " :" << server->GetDescription(); } - void SendSquit(Server *s, const Anope::string &message) anope_override + void SendSquit(Server *s, const Anope::string &message) override { if (s != Me) { @@ -251,7 +251,7 @@ class InspIRCd12Proto : public IRCDProto } /* JOIN */ - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(Me) << "FJOIN " << c->name << " " << c->creation_time << " +" << c->GetModes(true, true) << " :," << user->GetUID(); /* Note that we can send this with the FJOIN but choose not to @@ -279,13 +279,13 @@ class InspIRCd12Proto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { SendDelLine("Q", x->mask); } /* SQLINE */ - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -294,7 +294,7 @@ class InspIRCd12Proto : public IRCDProto SendAddLine("Q", x->mask, timeleft, x->by, x->GetReason()); } - void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override + void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override { if (!vIdent.empty()) this->SendChgIdentInternal(u->nick, vIdent); @@ -302,31 +302,31 @@ class InspIRCd12Proto : public IRCDProto this->SendChgHostInternal(u->nick, vhost); } - void SendConnect() anope_override + void SendConnect() override { SendServer(Me); } /* SVSHOLD - set */ - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { UplinkSocket::Message(Config->GetClient("NickServ")) << "SVSHOLD " << nick << " " << t << " :Being held for registered user"; } /* SVSHOLD - release */ - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message(Config->GetClient("NickServ")) << "SVSHOLD " << nick; } /* UNSZLINE */ - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { SendDelLine("Z", x->GetHost()); } /* SZLINE */ - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -335,12 +335,12 @@ class InspIRCd12Proto : public IRCDProto SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason()); } - void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override + void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override { UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param; @@ -348,26 +348,26 @@ class InspIRCd12Proto : public IRCDProto UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan; } - void SendSWhois(const MessageSource &, const Anope::string &who, const Anope::string &mask) anope_override + void SendSWhois(const MessageSource &, const Anope::string &who, const Anope::string &mask) override { User *u = User::Find(who); UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " swhois :" << mask; } - void SendBOB() anope_override + void SendBOB() override { UplinkSocket::Message(Me) << "BURST " << Anope::CurTime; Module *enc = ModuleManager::FindFirstOf(ENCRYPTION); UplinkSocket::Message(Me) << "VERSION :Anope-" << Anope::Version() << " " << Me->GetName() << " :" << IRCD->GetProtocolName() << " - (" << (enc ? enc->name : "none") << ") -- " << Anope::VersionBuildString(); } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "ENDBURST"; } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { if (Servers::Capab.count("GLOBOPS")) UplinkSocket::Message(source) << "SNONOTICE g :" << buf; @@ -375,7 +375,7 @@ class InspIRCd12Proto : public IRCDProto UplinkSocket::Message(source) << "SNONOTICE A :" << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { /* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */ if (na->nc->HasExt("UNCONFIRMED")) @@ -384,26 +384,26 @@ class InspIRCd12Proto : public IRCDProto UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { UplinkSocket::Message(Me) << "FJOIN " << c->name << " " << c->creation_time << " +" << c->GetModes(true, true) << " :"; } - void SendOper(User *u) anope_override + void SendOper(User *u) override { } - void SendSASLMessage(const SASL::Message &message) anope_override + void SendSASLMessage(const SASL::Message &message) override { UplinkSocket::Message(Me) << "ENCAP " << message.target.substr(0, 3) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override { UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << acc; @@ -425,12 +425,12 @@ class InspIRCd12Proto : public IRCDProto saslusers.push_back(su); } - bool IsExtbanValid(const Anope::string &mask) anope_override + bool IsExtbanValid(const Anope::string &mask) override { return mask.length() >= 3 && mask[1] == ':'; } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen")) return false; @@ -457,7 +457,7 @@ class InspIRCdExtBan : public ChannelModeList public: InspIRCdExtBan(const Anope::string &mname, char modeChar) : ChannelModeList(mname, modeChar) { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); @@ -507,7 +507,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params[0].equals_cs("START")) { @@ -846,7 +846,7 @@ struct IRCDMessageChgIdent : IRCDMessage { IRCDMessageChgIdent(Module *creator) : IRCDMessage(creator, "CHGIDENT", 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (u) @@ -858,7 +858,7 @@ struct IRCDMessageChgName : IRCDMessage { IRCDMessageChgName(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->SetRealname(params[0]); } @@ -868,7 +868,7 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::Match(Me->GetSID(), params[0]) == false) return; @@ -891,7 +891,7 @@ struct IRCDMessageEndburst : IRCDMessage { IRCDMessageEndburst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Server *s = source.GetServer(); @@ -905,7 +905,7 @@ struct IRCDMessageFHost : IRCDMessage { IRCDMessageFHost(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->SetDisplayedHost(params[0]); } @@ -915,7 +915,7 @@ struct IRCDMessageFJoin : IRCDMessage { IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string modes; if (params.size() >= 3) @@ -963,7 +963,7 @@ struct IRCDMessageFMode : IRCDMessage { IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* :source FMODE #test 12345678 +nto foo */ @@ -992,7 +992,7 @@ struct IRCDMessageFTopic : IRCDMessage { IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* :source FTOPIC channel topicts setby :topic */ @@ -1006,7 +1006,7 @@ struct IRCDMessageIdle : IRCDMessage { IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { BotInfo *bi = BotInfo::Find(params[0]); if (bi) @@ -1030,7 +1030,7 @@ struct IRCDMessageMetadata : IRCDMessage { IRCDMessageMetadata(Module *creator) : IRCDMessage(creator, "METADATA", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (isdigit(params[0][0])) { @@ -1125,7 +1125,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (IRCD->IsChannelValid(params[0])) { @@ -1160,7 +1160,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->ChangeNick(params[0]); } @@ -1170,7 +1170,7 @@ struct IRCDMessageOperType : IRCDMessage { IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* opertype is equivalent to mode +o because servers dont do this directly */ @@ -1184,7 +1184,7 @@ struct IRCDMessageRSQuit : IRCDMessage { IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Server *s = Server::Find(params[0]); const Anope::string &reason = params.size() > 1 ? params[1] : ""; @@ -1200,7 +1200,7 @@ struct IRCDMessageSetIdent : IRCDMessage { IRCDMessageSetIdent(Module *creator) : IRCDMessage(creator, "SETIDENT", 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->SetIdent(params[0]); } @@ -1218,7 +1218,7 @@ struct IRCDMessageServer : IRCDMessage * 3: numeric * 4: desc */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { unsigned int hops = Anope::string(params[2]).is_pos_number_only() ? convertTo<unsigned>(params[2]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[4], params[3]); @@ -1229,7 +1229,7 @@ struct IRCDMessageSQuit : Message::SQuit { IRCDMessageSQuit(Module *creator) : Message::SQuit(creator) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params[0] == rsquit_id || params[0] == rsquit_server) { @@ -1251,7 +1251,7 @@ struct IRCDMessageTime : IRCDMessage { IRCDMessageTime(Module *creator) : IRCDMessage(creator, "TIME", 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { UplinkSocket::Message(Me) << "TIME " << source.GetSource() << " " << params[1] << " " << Anope::CurTime; } @@ -1274,7 +1274,7 @@ struct IRCDMessageUID : IRCDMessage * 8+: modes and params -- IMPORTANT, some modes (e.g. +s) may have parameters. So don't assume a fixed position of realname! * last: realname */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { time_t ts = convertTo<time_t>(params[1]); @@ -1364,7 +1364,7 @@ class ProtoInspIRCd12 : public Module Servers::Capab.insert("NOQUIT"); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { /* InspIRCd 1.2 doesn't set -r on nick change, remove -r here. Note that if we have to set +r later * this will cancel out this -r, resulting in no mode changes. diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 4e88d01a8..b71744c78 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -34,7 +34,7 @@ class InspIRCd20Proto : public IRCDProto MaxModes = 20; } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "CAPAB START 1202"; UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202"; @@ -42,39 +42,39 @@ class InspIRCd20Proto : public IRCDProto insp12->SendConnect(); } - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override { insp12->SendSVSKillInternal(source, user, buf); } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { insp12->SendGlobalNotice(bi, dest, msg); } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { insp12->SendGlobalPrivmsg(bi, dest, msg); } - void SendAkillDel(const XLine *x) anope_override { insp12->SendAkillDel(x); } - void SendTopic(const MessageSource &whosets, Channel *c) anope_override { insp12->SendTopic(whosets, c); }; - void SendVhostDel(User *u) anope_override { insp12->SendVhostDel(u); } - void SendAkill(User *u, XLine *x) anope_override { insp12->SendAkill(u, x); } - void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) anope_override { insp12->SendNumericInternal(numeric, dest, buf); } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override { insp12->SendModeInternal(source, dest, buf); } - void SendClientIntroduction(User *u) anope_override { insp12->SendClientIntroduction(u); } - void SendServer(const Server *server) anope_override { insp12->SendServer(server); } - void SendSquit(Server *s, const Anope::string &message) anope_override { insp12->SendSquit(s, message); } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { insp12->SendJoin(user, c, status); } - void SendSQLineDel(const XLine *x) anope_override { insp12->SendSQLineDel(x); } - void SendSQLine(User *u, const XLine *x) anope_override { insp12->SendSQLine(u, x); } - void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) anope_override { insp12->SendVhost(u, vident, vhost); } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override { insp12->SendSVSHold(nick, t); } - void SendSVSHoldDel(const Anope::string &nick) anope_override { insp12->SendSVSHoldDel(nick); } - void SendSZLineDel(const XLine *x) anope_override { insp12->SendSZLineDel(x); } - void SendSZLine(User *u, const XLine *x) anope_override { insp12->SendSZLine(u, x); } - void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) anope_override { insp12->SendSVSJoin(source, u, chan, other); } - void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) anope_override { insp12->SendSVSPart(source, u, chan, param); } - void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) anope_override { insp12->SendSWhois(bi, who, mask); } - void SendBOB() anope_override { insp12->SendBOB(); } - void SendEOB() anope_override { insp12->SendEOB(); } + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { insp12->SendSVSKillInternal(source, user, buf); } + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { insp12->SendGlobalNotice(bi, dest, msg); } + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { insp12->SendGlobalPrivmsg(bi, dest, msg); } + void SendAkillDel(const XLine *x) override { insp12->SendAkillDel(x); } + void SendTopic(const MessageSource &whosets, Channel *c) override { insp12->SendTopic(whosets, c); }; + void SendVhostDel(User *u) override { insp12->SendVhostDel(u); } + void SendAkill(User *u, XLine *x) override { insp12->SendAkill(u, x); } + void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) override { insp12->SendNumericInternal(numeric, dest, buf); } + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { insp12->SendModeInternal(source, dest, buf); } + void SendClientIntroduction(User *u) override { insp12->SendClientIntroduction(u); } + void SendServer(const Server *server) override { insp12->SendServer(server); } + void SendSquit(Server *s, const Anope::string &message) override { insp12->SendSquit(s, message); } + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { insp12->SendJoin(user, c, status); } + void SendSQLineDel(const XLine *x) override { insp12->SendSQLineDel(x); } + void SendSQLine(User *u, const XLine *x) override { insp12->SendSQLine(u, x); } + void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) override { insp12->SendVhost(u, vident, vhost); } + void SendSVSHold(const Anope::string &nick, time_t t) override { insp12->SendSVSHold(nick, t); } + void SendSVSHoldDel(const Anope::string &nick) override { insp12->SendSVSHoldDel(nick); } + void SendSZLineDel(const XLine *x) override { insp12->SendSZLineDel(x); } + void SendSZLine(User *u, const XLine *x) override { insp12->SendSZLine(u, x); } + void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) override { insp12->SendSVSJoin(source, u, chan, other); } + void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override { insp12->SendSVSPart(source, u, chan, param); } + void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) override { insp12->SendSWhois(bi, who, mask); } + void SendBOB() override { insp12->SendBOB(); } + void SendEOB() override { insp12->SendEOB(); } void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) { insp12->SendGlobopsInternal(source, buf); } - void SendLogin(User *u, NickAlias *na) anope_override { insp12->SendLogin(u, na); } - void SendLogout(User *u) anope_override { insp12->SendLogout(u); } - void SendChannel(Channel *c) anope_override { insp12->SendChannel(c); } - void SendSASLMessage(const SASL::Message &message) anope_override { insp12->SendSASLMessage(message); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override { insp12->SendSVSLogin(uid, acc); } - bool IsExtbanValid(const Anope::string &mask) anope_override { return insp12->IsExtbanValid(mask); } - bool IsIdentValid(const Anope::string &ident) anope_override { return insp12->IsIdentValid(ident); } + void SendLogin(User *u, NickAlias *na) override { insp12->SendLogin(u, na); } + void SendLogout(User *u) override { insp12->SendLogout(u); } + void SendChannel(Channel *c) override { insp12->SendChannel(c); } + void SendSASLMessage(const SASL::Message &message) override { insp12->SendSASLMessage(message); } + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override { insp12->SendSVSLogin(uid, acc); } + bool IsExtbanValid(const Anope::string &mask) override { return insp12->IsExtbanValid(mask); } + bool IsIdentValid(const Anope::string &ident) override { return insp12->IsIdentValid(ident); } }; class InspIRCdExtBan : public ChannelModeList @@ -82,7 +82,7 @@ class InspIRCdExtBan : public ChannelModeList public: InspIRCdExtBan(const Anope::string &mname, char modeChar) : ChannelModeList(mname, modeChar) { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); @@ -155,7 +155,7 @@ class ColonDelimitedParamMode : public ChannelModeParam public: ColonDelimitedParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { return IsValid(value, false); } @@ -204,7 +204,7 @@ class SimpleNumberParamMode : public ChannelModeParam public: SimpleNumberParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { if (value.empty()) return false; // empty param is never valid @@ -229,7 +229,7 @@ class ChannelModeFlood : public ColonDelimitedParamMode public: ChannelModeFlood(char modeChar) : ColonDelimitedParamMode("FLOOD", modeChar) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { // The parameter of this mode is a bit different, it may begin with a '*', // ignore it if that's the case @@ -242,7 +242,7 @@ class ChannelModeHistory : public ColonDelimitedParamMode public: ChannelModeHistory(char modeChar) : ColonDelimitedParamMode("HISTORY", modeChar) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { return (ColonDelimitedParamMode::IsValid(value, true)); } @@ -253,7 +253,7 @@ class ChannelModeRedirect : public ChannelModeParam public: ChannelModeRedirect(char modeChar) : ChannelModeParam("REDIRECT", modeChar, true) { } - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { // The parameter of this mode is a channel, and channel names start with '#' return ((!value.empty()) && (value[0] == '#')); @@ -266,7 +266,7 @@ struct IRCDMessageCapab : Message::Capab IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params[0].equals_cs("START")) { @@ -616,7 +616,7 @@ struct IRCDMessageEncap : IRCDMessage IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4), insp12_encap("IRCDMessage", "inspircd12/encap") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::Match(Me->GetSID(), params[0]) == false) return; @@ -658,7 +658,7 @@ struct IRCDMessageFIdent : IRCDMessage { IRCDMessageFIdent(Module *creator) : IRCDMessage(creator, "FIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->SetIdent(params[0]); } @@ -747,24 +747,24 @@ class ProtoInspIRCd20 : public Module ModuleManager::UnloadModule(m_insp12, NULL); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { use_server_side_topiclock = conf->GetModule(this)->Get<bool>("use_server_side_topiclock"); use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock"); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (c->ci) this->OnChanRegistered(c->ci); } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty()) @@ -780,7 +780,7 @@ class ProtoInspIRCd20 : public Module } } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (use_server_side_mlock && ci->c) SendChannelMetadata(ci->c, "mlock", ""); @@ -789,7 +789,7 @@ class ProtoInspIRCd20 : public Module SendChannelMetadata(ci->c, "topiclock", ""); } - EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -802,7 +802,7 @@ class ProtoInspIRCd20 : public Module return EVENT_CONTINUE; } - EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -815,7 +815,7 @@ class ProtoInspIRCd20 : public Module return EVENT_CONTINUE; } - EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) anope_override + EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) override { if (cmd->name == "chanserv/topic" && ci->c) { diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index b0b2bb522..998d83921 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -15,7 +15,7 @@ class ngIRCdProto : public IRCDProto { - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, user, buf); user->KillInternal(source, buf); @@ -32,7 +32,7 @@ class ngIRCdProto : public IRCDProto MaxModes = 5; } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -41,24 +41,24 @@ class ngIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "GLINE " << x->mask << " " << timeleft << " :" << x->GetReason() << " (" << x->by << ")"; } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { UplinkSocket::Message(Me) << "GLINE " << x->mask; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { UplinkSocket::Message(Me) << "CHANINFO " << c->name << " +" << c->GetModes(true, true); } // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "NICK " << u->nick << " 1 " << u->GetIdent() << " " << u->host << " 1 " << modes << " :" << u->realname; } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " 0210-IRC+ Anope|" << Anope::VersionShort() << ":CLHMSo P"; /* Make myself known to myself in the serverlist */ @@ -67,27 +67,27 @@ class ngIRCdProto : public IRCDProto this->SendNumeric(376, "*", ":End of MOTD command"); } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "SVSNICK " << u->nick << " " << newnick; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { UplinkSocket::Message(source) << "WALLOPS :" << buf; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(user) << "JOIN " << c->name; if (status) @@ -110,7 +110,7 @@ class ngIRCdProto : public IRCDProto } } - void SendKickInternal(const MessageSource &source, const Channel *chan, User *user, const Anope::string &buf) anope_override + void SendKickInternal(const MessageSource &source, const Channel *chan, User *user, const Anope::string &buf) override { if (!buf.empty()) UplinkSocket::Message(source) << "KICK " << chan->name << " " << user->nick << " :" << buf; @@ -118,22 +118,22 @@ class ngIRCdProto : public IRCDProto UplinkSocket::Message(source) << "KICK " << chan->name << " " << user->nick; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { UplinkSocket::Message(source) << "MODE " << dest->name << " " << buf; } - void SendPartInternal(User *u, const Channel *chan, const Anope::string &buf) anope_override + void SendPartInternal(User *u, const Channel *chan, const Anope::string &buf) override { if (!buf.empty()) UplinkSocket::Message(u) << "PART " << chan->name << " :" << buf; @@ -142,17 +142,17 @@ class ngIRCdProto : public IRCDProto } /* SERVER name hop descript */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription(); } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TOPIC " << c->name << " :" << c->topic; } - void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override + void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override { if (!vIdent.empty()) UplinkSocket::Message(Me) << "METADATA " << u->nick << " user :" << vIdent; @@ -165,7 +165,7 @@ class ngIRCdProto : public IRCDProto } } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { this->SendVhost(u, u->GetIdent(), ""); } @@ -176,7 +176,7 @@ struct IRCDMessage005 : IRCDMessage IRCDMessage005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Please see <http://www.irc.org/tech_docs/005.html> for details. - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { size_t pos; Anope::string parameter, data; @@ -217,7 +217,7 @@ struct IRCDMessage376 : IRCDMessage * */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { } }; @@ -243,7 +243,7 @@ struct IRCDMessageChaninfo : IRCDMessage * a channel has no user limit (the parameter <modes> doesn't list the "l" * channel mode). In this case <limit> should be "0". */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { bool created; Channel *c = Channel::FindOrCreate(params[0], created); @@ -285,7 +285,7 @@ struct IRCDMessageJoin : Message::Join * * if a user joins a new channel, the ircd sends <channelname>\7<umode> */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *user = source.GetUser(); size_t pos = params[0].find('\7'); @@ -335,7 +335,7 @@ struct IRCDMessageMetadata : IRCDMessage * - "user": the user name (ident) of a client (can't be empty) */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (!u) @@ -386,7 +386,7 @@ struct IRCDMessageMode : IRCDMessage * params[n] = parameters */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string modes = params[1]; @@ -433,7 +433,7 @@ struct IRCDMessageNick : IRCDMessage * params[0] = newnick * */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() == 1) { @@ -467,7 +467,7 @@ struct IRCDMessageNJoin : IRCDMessage * * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP,%test,+test2 */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { std::list<Message::Join::SJoinUser> users; @@ -507,7 +507,7 @@ struct IRCDMessagePong : IRCDMessage * when receiving a new server and then finish sync once we * get a pong back from that server. */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (!source.GetServer()->IsSynced()) source.GetServer()->Sync(false); @@ -544,7 +544,7 @@ struct IRCDMessageServer : IRCDMessage * params[3] = server description */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() == 3) { @@ -571,7 +571,7 @@ struct IRCDMessageTopic : IRCDMessage IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Received: :DukeP TOPIC #anope :test - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Channel *c = Channel::Find(params[0]); if (!c) @@ -684,7 +684,7 @@ class ProtongIRCd : public Module } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveMode(Config->GetClient("NickServ"), "REGISTERED"); } diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index c4d39e4a9..a7ff0ae88 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -34,26 +34,26 @@ class PlexusProto : public IRCDProto MaxModes = 4; } - void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) anope_override { hybrid->SendSVSKillInternal(source, targ, reason); } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalNotice(bi, dest, msg); } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalPrivmsg(bi, dest, msg); } - void SendSQLine(User *u, const XLine *x) anope_override { hybrid->SendSQLine(u, x); } - void SendSQLineDel(const XLine *x) anope_override { hybrid->SendSQLineDel(x); } - void SendSGLineDel(const XLine *x) anope_override { hybrid->SendSGLineDel(x); } - void SendSGLine(User *u, const XLine *x) anope_override { hybrid->SendSGLine(u, x); } - void SendAkillDel(const XLine *x) anope_override { hybrid->SendAkillDel(x); } - void SendAkill(User *u, XLine *x) anope_override { hybrid->SendAkill(u, x); } - void SendServer(const Server *server) anope_override { hybrid->SendServer(server); } - void SendChannel(Channel *c) anope_override { hybrid->SendChannel(c); } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override { hybrid->SendSVSHold(nick, t); } - void SendSVSHoldDel(const Anope::string &nick) anope_override { hybrid->SendSVSHoldDel(nick); } - - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) override { hybrid->SendSVSKillInternal(source, targ, reason); } + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { hybrid->SendGlobalNotice(bi, dest, msg); } + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { hybrid->SendGlobalPrivmsg(bi, dest, msg); } + void SendSQLine(User *u, const XLine *x) override { hybrid->SendSQLine(u, x); } + void SendSQLineDel(const XLine *x) override { hybrid->SendSQLineDel(x); } + void SendSGLineDel(const XLine *x) override { hybrid->SendSGLineDel(x); } + void SendSGLine(User *u, const XLine *x) override { hybrid->SendSGLine(u, x); } + void SendAkillDel(const XLine *x) override { hybrid->SendAkillDel(x); } + void SendAkill(User *u, XLine *x) override { hybrid->SendAkill(u, x); } + void SendServer(const Server *server) override { hybrid->SendServer(server); } + void SendChannel(Channel *c) override { hybrid->SendChannel(c); } + void SendSVSHold(const Anope::string &nick, time_t t) override { hybrid->SendSVSHold(nick, t); } + void SendSVSHoldDel(const Anope::string &nick) override { hybrid->SendSVSHoldDel(nick); } + + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { UplinkSocket::Message(source) << "OPERWALL :" << buf; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" << user->GetUID(); if (status) @@ -76,12 +76,12 @@ class PlexusProto : public IRCDProto } } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "ENCAP " << u->server->GetName() << " SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when; } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override { if (!ident.empty()) UplinkSocket::Message(Me) << "ENCAP * CHGIDENT " << u->GetUID() << " " << ident; @@ -89,12 +89,12 @@ class PlexusProto : public IRCDProto u->SetMode(Config->GetClient("HostServ"), "CLOAK"); } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { u->RemoveMode(Config->GetClient("HostServ"), "CLOAK"); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); /* CAPAB @@ -131,38 +131,38 @@ class PlexusProto : public IRCDProto UplinkSocket::Message() << "SVINFO 6 5 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 255.255.255.255 " << u->GetUID() << " 0 " << u->host << " :" << u->realname; } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "ENCAP * SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID() << " " << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID(); } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "ENCAP * TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic; } - void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override { UplinkSocket::Message(source) << "ENCAP " << user->server->GetName() << " SVSJOIN " << user->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override { UplinkSocket::Message(source) << "ENCAP " << user->server->GetName() << " SVSPART " << user->GetUID() << " " << chan; } @@ -172,7 +172,7 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* * Received: :dev.anope.de ENCAP * SU DukePyrolator DukePyrolator @@ -215,7 +215,7 @@ struct IRCDMessagePass : IRCDMessage { IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { UplinkSID = params[3]; } @@ -227,7 +227,7 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 */ /* SERVER hades.arpa 1 :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") @@ -255,7 +255,7 @@ struct IRCDMessageUID : IRCDMessage params[10] = info */ // :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB 0 192.168.0.5 :Adam - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* An IP of 0 means the user is spoofed */ Anope::string ip = params[6]; diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 72cdc9573..ef09b9553 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -28,27 +28,27 @@ class RatboxProto : public IRCDProto MaxModes = 4; } - void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) anope_override { hybrid->SendSVSKillInternal(source, targ, reason); } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalNotice(bi, dest, msg); } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalPrivmsg(bi, dest, msg); } - void SendSQLine(User *u, const XLine *x) anope_override { hybrid->SendSQLine(u, x); } - void SendSGLine(User *u, const XLine *x) anope_override { hybrid->SendSGLine(u, x); } - void SendSGLineDel(const XLine *x) anope_override { hybrid->SendSGLineDel(x); } - void SendAkill(User *u, XLine *x) anope_override { hybrid->SendAkill(u, x); } - void SendAkillDel(const XLine *x) anope_override { hybrid->SendAkillDel(x); } - void SendSQLineDel(const XLine *x) anope_override { hybrid->SendSQLineDel(x); } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { hybrid->SendJoin(user, c, status); } - void SendServer(const Server *server) anope_override { hybrid->SendServer(server); } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override { hybrid->SendModeInternal(source, u, buf); } - void SendChannel(Channel *c) anope_override { hybrid->SendChannel(c); } - bool IsIdentValid(const Anope::string &ident) anope_override { return hybrid->IsIdentValid(ident); } - - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) override { hybrid->SendSVSKillInternal(source, targ, reason); } + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { hybrid->SendGlobalNotice(bi, dest, msg); } + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { hybrid->SendGlobalPrivmsg(bi, dest, msg); } + void SendSQLine(User *u, const XLine *x) override { hybrid->SendSQLine(u, x); } + void SendSGLine(User *u, const XLine *x) override { hybrid->SendSGLine(u, x); } + void SendSGLineDel(const XLine *x) override { hybrid->SendSGLineDel(x); } + void SendAkill(User *u, XLine *x) override { hybrid->SendAkill(u, x); } + void SendAkillDel(const XLine *x) override { hybrid->SendAkillDel(x); } + void SendSQLineDel(const XLine *x) override { hybrid->SendSQLineDel(x); } + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { hybrid->SendJoin(user, c, status); } + void SendServer(const Server *server) override { hybrid->SendServer(server); } + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { hybrid->SendModeInternal(source, u, buf); } + void SendChannel(Channel *c) override { hybrid->SendChannel(c); } + bool IsIdentValid(const Anope::string &ident) override { return hybrid->IsIdentValid(ident); } + + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { UplinkSocket::Message(source) << "OPERWALL :" << buf; } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); /* @@ -75,13 +75,13 @@ class RatboxProto : public IRCDProto UplinkSocket::Message() << "SVINFO 6 3 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " :" << u->realname; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { if (na->nc->HasExt("UNCONFIRMED")) return; @@ -89,12 +89,12 @@ class RatboxProto : public IRCDProto UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID() << " " << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID(); } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { BotInfo *bi = source.GetBot(); bool needjoin = c->FindUser(bi) == NULL; @@ -119,7 +119,7 @@ struct IRCDMessageEncap : IRCDMessage IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 3) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } // Debug: Received: :00BAAAAAB ENCAP * LOGIN Adam - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params[1] == "LOGIN" || params[1] == "SU") { @@ -143,7 +143,7 @@ struct IRCDMessagePass : IRCDMessage { IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { UplinkSID = params[3]; } @@ -154,7 +154,7 @@ struct IRCDMessageServer : IRCDMessage IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } // SERVER hades.arpa 1 :ircd-ratbox test server - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { // Servers other then our immediate uplink are introduced via SID if (params[1] != "1") @@ -174,7 +174,7 @@ struct IRCDMessageTBurst : IRCDMessage * params[2] = topic OR who set the topic * params[3] = topic if params[2] isnt the topic */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { time_t topic_time = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime; Channel *c = Channel::Find(params[0]); @@ -194,7 +194,7 @@ struct IRCDMessageUID : IRCDMessage IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 9) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } // :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB :Adam - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { /* Source is always the server */ User::OnIntroduce(params[0], params[4], params[5], "", params[6], source.GetServer(), params[8], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3], params[7], NULL); diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index d7bc8fa14..395b4dfcc 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -33,12 +33,12 @@ class UnrealIRCdProto : public IRCDProto private: /* SVSNOOP */ - void SendSVSNOOP(const Server *server, bool set) anope_override + void SendSVSNOOP(const Server *server, bool set) override { UplinkSocket::Message() << "SVSNOOP " << server->GetName() << " " << (set ? "+" : "-"); } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -57,22 +57,22 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message() << "TKL - G " << x->GetUser() << " " << x->GetHost() << " " << x->by; } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { BotInfo *HostServ = Config->GetClient("HostServ"); u->RemoveMode(HostServ, "CLOAK"); @@ -81,7 +81,7 @@ class UnrealIRCdProto : public IRCDProto u->SetMode(HostServ, "CLOAK"); } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -125,18 +125,18 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message() << "TKL + G " << x->GetUser() << " " << x->GetHost() << " " << x->by << " " << Anope::CurTime + timeleft << " " << x->created << " :" << x->GetReason(); } - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf; user->KillInternal(source, buf); } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVS2MODE " << u->nick <<" " << buf; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message() << "NICK " << u->nick << " 1 " << u->timestamp << " " << u->GetIdent() << " " << u->host << " " << u->server->GetName() << " 0 " << modes << " " << u->host << " * :" << u->realname; @@ -144,7 +144,7 @@ class UnrealIRCdProto : public IRCDProto /* SERVER name hop descript */ /* Unreal 3.2 actually sends some info about itself in the descript area */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { if (!server->GetSID().empty() && server == Me) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :U0-*-" << server->GetSID() << " " << server->GetDescription(); @@ -153,7 +153,7 @@ class UnrealIRCdProto : public IRCDProto } /* JOIN */ - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " :" << user->nick; if (status) @@ -178,7 +178,7 @@ class UnrealIRCdProto : public IRCDProto /* unsqline */ - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message() << "UNSQLINE " << x->mask; } @@ -188,7 +188,7 @@ class UnrealIRCdProto : public IRCDProto ** - Unreal will translate this to TKL for us ** */ - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message() << "SQLINE " << x->mask << " :" << x->GetReason(); } @@ -199,14 +199,14 @@ class UnrealIRCdProto : public IRCDProto ** parv[1] = nick ** parv[2] = options */ - void SendSVSO(BotInfo *source, const Anope::string &nick, const Anope::string &flag) anope_override + void SendSVSO(BotInfo *source, const Anope::string &nick, const Anope::string &flag) override { UplinkSocket::Message(source) << "SVSO " << nick << " " << flag; } /* Functions that use serval cmd functions */ - void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override + void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override { if (!vIdent.empty()) UplinkSocket::Message(Me) << "CHGIDENT " << u->nick << " " << vIdent; @@ -214,7 +214,7 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "CHGHOST " << u->nick << " " << vhost; } - void SendConnect() anope_override + void SendConnect() override { /* NICKv2 = Nick Version 2 @@ -240,13 +240,13 @@ class UnrealIRCdProto : public IRCDProto } /* SVSHOLD - set */ - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { UplinkSocket::Message() << "TKL + Q H " << nick << " " << Me->GetName() << " " << Anope::CurTime + t << " " << Anope::CurTime << " :Being held for registered user"; } /* SVSHOLD - release */ - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message() << "TKL - Q * " << nick << " " << Me->GetName(); } @@ -255,19 +255,19 @@ class UnrealIRCdProto : public IRCDProto /* * SVSNLINE - :realname mask */ - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message() << "SVSNLINE - :" << x->mask; } /* UNSZLINE */ - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { UplinkSocket::Message() << "TKL - Z * " << x->GetHost() << " " << x->by; } /* SZLINE */ - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -280,7 +280,7 @@ class UnrealIRCdProto : public IRCDProto /* * SVSNLINE + reason_where_is_space :realname mask with spaces */ - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { Anope::string edited_reason = x->GetReason(); edited_reason = edited_reason.replace_all_cs(" ", "_"); @@ -296,7 +296,7 @@ class UnrealIRCdProto : public IRCDProto /* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken when coming from a none TOKEN'd server */ - void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSJOIN " << user->GetUID() << " " << chan << " :" << param; @@ -304,7 +304,7 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(source) << "SVSJOIN " << user->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSPART " << user->GetUID() << " " << chan << " :" << param; @@ -312,17 +312,17 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(source) << "SVSPART " << user->GetUID() << " " << chan; } - void SendSWhois(const MessageSource &source, const Anope::string &who, const Anope::string &mask) anope_override + void SendSWhois(const MessageSource &source, const Anope::string &who, const Anope::string &mask) override { UplinkSocket::Message(source) << "SWHOIS " << who << " :" << mask; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "EOS"; } - bool IsNickValid(const Anope::string &nick) anope_override + bool IsNickValid(const Anope::string &nick) override { if (nick.equals_ci("ircd") || nick.equals_ci("irc")) return false; @@ -330,7 +330,7 @@ class UnrealIRCdProto : public IRCDProto return IRCDProto::IsNickValid(nick); } - bool IsChannelValid(const Anope::string &chan) anope_override + bool IsChannelValid(const Anope::string &chan) override { if (chan.find(':') != Anope::string::npos) return false; @@ -338,12 +338,12 @@ class UnrealIRCdProto : public IRCDProto return IRCDProto::IsChannelValid(chan); } - bool IsExtbanValid(const Anope::string &mask) anope_override + bool IsExtbanValid(const Anope::string &mask) override { return mask.length() >= 4 && mask[0] == '~' && mask[2] == ':'; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { if (Servers::Capab.count("ESVID") > 0) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); @@ -351,12 +351,12 @@ class UnrealIRCdProto : public IRCDProto IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 0"); } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { /* Unreal does not support updating a channels TS without actually joining a user, * so we will join and part us now @@ -376,7 +376,7 @@ class UnrealIRCdProto : public IRCDProto } } - void SendSASLMessage(const SASL::Message &message) anope_override + void SendSASLMessage(const SASL::Message &message) override { size_t p = message.target.find('!'); if (p == Anope::string::npos) @@ -385,7 +385,7 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override { size_t p = uid.find('!'); if (p == Anope::string::npos) @@ -393,7 +393,7 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "SVSLOGIN " << uid.substr(0, p) << " " << uid << " " << acc; } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen")) return false; @@ -420,7 +420,7 @@ class UnrealExtBan : public ChannelModeList public: UnrealExtBan(const Anope::string &mname, char modeChar) : ChannelModeList(mname, modeChar) { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); @@ -485,7 +485,7 @@ class ChannelModeFlood : public ChannelModeParam ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { } /* Borrowed part of this check from UnrealIRCd */ - bool IsValid(const Anope::string &value) const anope_override + bool IsValid(const Anope::string &value) const override { if (value.empty()) return false; @@ -537,7 +537,7 @@ class ChannelModeUnrealSSL : public ChannelMode { } - bool CanSet(User *u) const anope_override + bool CanSet(User *u) const override { return false; } @@ -547,7 +547,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "PROTOCTL") { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { for (unsigned i = 0; i < params.size(); ++i) { @@ -702,7 +702,7 @@ struct IRCDMessageChgHost : IRCDMessage { IRCDMessageChgHost(Module *creator) : IRCDMessage(creator, "CHGHOST", 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (u) @@ -714,7 +714,7 @@ struct IRCDMessageChgIdent : IRCDMessage { IRCDMessageChgIdent(Module *creator) : IRCDMessage(creator, "CHGIDENT", 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (u) @@ -726,7 +726,7 @@ struct IRCDMessageChgName : IRCDMessage { IRCDMessageChgName(Module *creator) : IRCDMessage(creator, "CHGNAME", 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = User::Find(params[0]); if (u) @@ -738,7 +738,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator, const Anope::string &mname) : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { bool server_source = source.GetServer() != NULL; Anope::string modes = params[1]; @@ -783,7 +783,7 @@ struct IRCDMessageNetInfo : IRCDMessage { IRCDMessageNetInfo(Module *creator) : IRCDMessage(creator, "NETINFO", 8) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { UplinkSocket::Message() << "NETINFO " << MaxUserCount << " " << Anope::CurTime << " " << convertTo<int>(params[2]) << " " << params[3] << " 0 0 0 :" << params[7]; } @@ -813,7 +813,7 @@ struct IRCDMessageNick : IRCDMessage ** parv[0] = new nickname ** parv[1] = hopcount */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (params.size() == 11) { @@ -875,7 +875,7 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { if (!source.GetServer()->IsSynced()) source.GetServer()->Sync(false); @@ -886,7 +886,7 @@ struct IRCDMessageSASL : IRCDMessage { IRCDMessageSASL(Module *creator) : IRCDMessage(creator, "SASL", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { size_t p = params[1].find('!'); if (!SASL::sasl || p == Anope::string::npos) @@ -907,7 +907,7 @@ struct IRCDMessageSDesc : IRCDMessage { IRCDMessageSDesc(Module *creator) : IRCDMessage(creator, "SDESC", 1) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetServer()->SetDescription(params[0]); } @@ -917,7 +917,7 @@ struct IRCDMessageSetHost : IRCDMessage { IRCDMessageSetHost(Module *creator) : IRCDMessage(creator, "SETHOST", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -933,7 +933,7 @@ struct IRCDMessageSetIdent : IRCDMessage { IRCDMessageSetIdent(Module *creator) : IRCDMessage(creator, "SETIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); u->SetVIdent(params[0]); @@ -944,7 +944,7 @@ struct IRCDMessageSetName : IRCDMessage { IRCDMessageSetName(Module *creator) : IRCDMessage(creator, "SETNAME", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); u->SetRealname(params[0]); @@ -955,7 +955,7 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; @@ -977,7 +977,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string modes; if (params.size() >= 4) @@ -1071,7 +1071,7 @@ struct IRCDMessageTopic : IRCDMessage ** parv[2] = topic time ** parv[3] = topic text */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { Channel *c = Channel::Find(params[0]); if (c) @@ -1084,7 +1084,7 @@ struct IRCDMessageUmode2 : IRCDMessage { IRCDMessageUmode2(Module *creator) : IRCDMessage(creator, "UMODE2", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override { source.GetUser()->SetModesInternal(source, "%s", params[0].c_str()); } @@ -1191,19 +1191,19 @@ class ProtoUnreal : public Module ModuleManager::SetPriority(this, PRIORITY_FIRST); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock"); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); if (Servers::Capab.count("ESVID") == 0) IRCD->SendLogout(u); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (!c->ci) return; @@ -1216,7 +1216,7 @@ class ProtoUnreal : public Module } } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); if (!ci->c || !use_server_side_mlock || !modelocks || !Servers::Capab.count("MLOCK")) @@ -1225,14 +1225,14 @@ class ProtoUnreal : public Module UplinkSocket::Message(Me) << "MLOCK " << static_cast<long>(ci->c->creation_time) << " " << ci->name << " " << modes; } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (!ci->c || !use_server_side_mlock || !Servers::Capab.count("MLOCK")) return; UplinkSocket::Message(Me) << "MLOCK " << static_cast<long>(ci->c->creation_time) << " " << ci->name << " :"; } - EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -1245,7 +1245,7 @@ class ProtoUnreal : public Module return EVENT_CONTINUE; } - EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 144433631..cd09ed227 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -22,13 +22,13 @@ class BotServCore : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client"); BotServ = BotInfo::Find(bsnick, true); } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { /* Do not allow removing bot modes on our service bots */ if (chan->ci && chan->ci->bi == user) @@ -39,7 +39,7 @@ class BotServCore : public Module } } - void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) anope_override + void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) override { if (ci->c && ci->c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers")) { @@ -48,7 +48,7 @@ class BotServCore : public Module } } - void OnJoinChannel(User *user, Channel *c) anope_override + void OnJoinChannel(User *user, Channel *c) override { if (!Config || !IRCD) return; @@ -103,7 +103,7 @@ class BotServCore : public Module } } - void OnLeaveChannel(User *u, Channel *c) anope_override + void OnLeaveChannel(User *u, Channel *c) override { /* Channel is persistent, it shouldn't be deleted and the service bot should stay */ if (c->ci && persist && persist->HasExt(c->ci)) @@ -124,7 +124,7 @@ class BotServCore : public Module c->ci->bi->Part(c->ci->c); } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty()) return EVENT_CONTINUE; @@ -159,7 +159,7 @@ class BotServCore : public Module return EVENT_CONTINUE; } - void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *BotServ) return; @@ -174,7 +174,7 @@ class BotServCore : public Module "one of the following characters: %s"), fantasycharacters.c_str()); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { if (source.GetUser() && !source.GetBot() && Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) { @@ -188,7 +188,7 @@ class BotServCore : public Module return EVENT_CONTINUE; } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { /* Set default bot flags */ spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")); @@ -196,7 +196,7 @@ class BotServCore : public Module ci->Extend<bool>("BS_" + token.upper()); } - void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) anope_override + void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) override { BotInfo *bi = BotInfo::Find(target->nick); if (bi) @@ -204,7 +204,7 @@ class BotServCore : public Module bi->Join(channel, &status); } - void OnCreateBot(BotInfo *bi) anope_override + void OnCreateBot(BotInfo *bi) override { if (bi->botmodes.empty()) bi->botmodes = Config->GetModule(this)->Get<const Anope::string>("botumodes"); diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 250296f55..1d6e1090c 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -26,7 +26,7 @@ class ChanServCore : public Module, public ChanServService { } - void Hold(Channel *c) anope_override + void Hold(Channel *c) override { /** A timer used to keep the BotServ bot/ChanServ in the channel * after kicking the last user in a channel @@ -61,7 +61,7 @@ class ChanServCore : public Module, public ChanServService /** Called when the delay is up * @param The current time */ - void Tick(time_t) anope_override + void Tick(time_t) override { if (!c) return; @@ -89,7 +89,7 @@ class ChanServCore : public Module, public ChanServService new ChanServTimer(ChanServ, inhabit, this->owner, c); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -116,13 +116,13 @@ class ChanServCore : public Module, public ChanServService always_lower = conf->GetModule(this)->Get<bool>("always_lower_ts"); } - void OnBotDelete(BotInfo *bi) anope_override + void OnBotDelete(BotInfo *bi) override { if (bi == ChanServ) ChanServ = NULL; } - EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) override { if (bi == ChanServ && Config->GetModule(this)->Get<bool>("opersonly") && !u->HasMode("OPER")) { @@ -133,7 +133,7 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } - void OnDelCore(NickCore *nc) anope_override + void OnDelCore(NickCore *nc) override { std::deque<ChannelInfo *> chans; nc->GetChannelReferences(chans); @@ -207,7 +207,7 @@ class ChanServCore : public Module, public ChanServService } } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { /* remove access entries that are this channel */ @@ -242,7 +242,7 @@ class ChanServCore : public Module, public ChanServService } } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *ChanServ) return EVENT_CONTINUE; @@ -257,7 +257,7 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } - void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *ChanServ) return; @@ -274,7 +274,7 @@ class ChanServCore : public Module, public ChanServService "lists and settings for any channel.")); } - void OnCheckModes(Reference<Channel> &c) anope_override + void OnCheckModes(Reference<Channel> &c) override { if (!c) return; @@ -294,14 +294,14 @@ class ChanServCore : public Module, public ChanServService } } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { /* Set default chan flags */ for (unsigned i = 0; i < defaults.size(); ++i) ci->Extend<bool>(defaults[i].upper()); } - EventReturn OnCanSet(User *u, const ChannelMode *cm) anope_override + EventReturn OnCanSet(User *u, const ChannelMode *cm) override { if (Config->GetModule(this)->Get<const Anope::string>("nomlock").find(cm->mchar) != Anope::string::npos || Config->GetModule(this)->Get<const Anope::string>("require").find(cm->mchar) != Anope::string::npos) @@ -309,7 +309,7 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { bool perm = c->HasMode("PERM") || (c->ci && persist && persist->HasExt(c->ci)); if (!perm && !c->botchannel && (c->users.empty() || (c->users.size() == 1 && c->users.begin()->second->user->server == Me))) @@ -318,13 +318,13 @@ class ChanServCore : public Module, public ChanServService } } - void OnLog(Log *l) anope_override + void OnLog(Log *l) override { if (l->type == LOG_CHANNEL) l->bi = ChanServ; } - void OnExpireTick() anope_override + void OnExpireTick() override { time_t chanserv_expire = Config->GetModule(this)->Get<time_t>("expire", "14d"); @@ -362,7 +362,7 @@ class ChanServCore : public Module, public ChanServService } } - EventReturn OnCheckDelete(Channel *c) anope_override + EventReturn OnCheckDelete(Channel *c) override { /* Do not delete this channel if ChanServ/a BotServ bot is inhabiting it */ if (inhabit.HasExt(c)) @@ -375,7 +375,7 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } - void OnPreUplinkSync(Server *serv) anope_override + void OnPreUplinkSync(Server *serv) override { if (!persist) return; @@ -409,7 +409,7 @@ class ChanServCore : public Module, public ChanServService } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { if (!persist || !ci->c) return; @@ -421,7 +421,7 @@ class ChanServCore : public Module, public ChanServService ci->c->SetMode(NULL, "PERM"); } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (always_lower && c->ci && c->creation_time > c->ci->time_registered) { @@ -432,7 +432,7 @@ class ChanServCore : public Module, public ChanServService } } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (!always_lower && Anope::CurTime == c->creation_time && c->ci && setter.GetUser() && !setter.GetUser()->server->IsULined()) { @@ -451,7 +451,7 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; @@ -461,7 +461,7 @@ class ChanServCore : public Module, public ChanServService info[_("Expires")] = Anope::strftime(ci->last_used + chanserv_expire, source.GetAccount()); } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { if (always_lower) // Since we always lower the TS, the other side will remove the modes if the channel ts lowers, so we don't diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index db4644ebe..fe15a3ef9 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -29,7 +29,7 @@ class GlobalCore : public Module, public GlobalService { } - void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) anope_override + void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) override { if (Me->GetLinks().empty()) return; @@ -48,7 +48,7 @@ class GlobalCore : public Module, public GlobalService this->ServerGlobal(sender, Servers::GetUplink(), rmessage); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -62,28 +62,28 @@ class GlobalCore : public Module, public GlobalService Global = bi; } - void OnRestart() anope_override + void OnRestart() override { const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); if (!gl.empty()) this->SendGlobal(Global, "", gl); } - void OnShutdown() anope_override + void OnShutdown() override { const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); if (!gl.empty()) this->SendGlobal(Global, "", gl); } - void OnNewServer(Server *s) anope_override + void OnNewServer(Server *s) override { const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycleup"); if (!gl.empty() && !Me->IsSynced()) s->Notice(Global, gl); } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *Global) return EVENT_CONTINUE; diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp index e51fb428c..9d9130fa6 100644 --- a/modules/pseudoclients/hostserv.cpp +++ b/modules/pseudoclients/hostserv.cpp @@ -21,7 +21,7 @@ class HostServCore : public Module throw ModuleException("Your IRCd does not support vhosts"); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -35,7 +35,7 @@ class HostServCore : public Module HostServ = bi; } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { if (!IRCD->CanSetVHost) return; @@ -66,12 +66,12 @@ class HostServCore : public Module } } - void OnNickUpdate(User *u) anope_override + void OnNickUpdate(User *u) override { this->OnUserLogin(u); } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *HostServ) return EVENT_CONTINUE; @@ -79,7 +79,7 @@ class HostServCore : public Module return EVENT_CONTINUE; } - void OnSetVhost(NickAlias *na) anope_override + void OnSetVhost(NickAlias *na) override { if (Config->GetModule(this)->Get<bool>("activate_on_set")) { @@ -106,7 +106,7 @@ class HostServCore : public Module } } - void OnDeleteVhost(NickAlias *na) anope_override + void OnDeleteVhost(NickAlias *na) override { if (Config->GetModule(this)->Get<bool>("activate_on_set")) { diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index f4ba325fb..71f5e64d0 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -41,7 +41,7 @@ class MemoServCore : public Module, public MemoServService { } - MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force) anope_override + MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force) override { bool ischan; MemoInfo *mi = MemoInfo::GetMemoInfo(target, ischan); @@ -138,7 +138,7 @@ class MemoServCore : public Module, public MemoServService } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -152,28 +152,28 @@ class MemoServCore : public Module, public MemoServService MemoServ = bi; } - void OnNickCoreCreate(NickCore *nc) anope_override + void OnNickCoreCreate(NickCore *nc) override { nc->memos.memomax = Config->GetModule(this)->Get<int>("maxmemos"); } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { ci->memos.memomax = Config->GetModule(this)->Get<int>("maxmemos"); } - void OnBotDelete(BotInfo *bi) anope_override + void OnBotDelete(BotInfo *bi) override { if (bi == MemoServ) MemoServ = NULL; } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { this->Check(u); } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (c->ci && !c->ci->memos.memos->empty() && c->ci->AccessFor(u).HasPriv("MEMO")) { @@ -184,18 +184,18 @@ class MemoServCore : public Module, public MemoServService } } - void OnUserAway(User *u, const Anope::string &message) anope_override + void OnUserAway(User *u, const Anope::string &message) override { if (message.empty()) this->Check(u); } - void OnNickUpdate(User *u) anope_override + void OnNickUpdate(User *u) override { this->Check(u); } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *MemoServ) return EVENT_CONTINUE; @@ -208,7 +208,7 @@ class MemoServCore : public Module, public MemoServService return EVENT_CONTINUE; } - void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *MemoServ) return; diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 0c314e500..d8b55a9d5 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -25,7 +25,7 @@ class NickServCollide : public Timer { } - void Tick(time_t t) anope_override + void Tick(time_t t) override { if (!u || !na) return; @@ -88,7 +88,7 @@ class NickServRelease : public User, public Timer NickServReleases.erase(this->nick); } - void Tick(time_t t) anope_override { } + void Tick(time_t t) override { } }; class NickServCore : public Module, public NickServService @@ -123,7 +123,7 @@ class NickServCore : public Module, public NickServService OnShutdown(); } - void OnShutdown() anope_override + void OnShutdown() override { /* On shutdown, restart, or mod unload, remove all of our holds for nicks (svshold or qlines) * because some IRCds do not allow us to have these automatically expire @@ -132,12 +132,12 @@ class NickServCore : public Module, public NickServService this->Release(it->second); } - void OnRestart() anope_override + void OnRestart() override { OnShutdown(); } - void Validate(User *u) anope_override + void Validate(User *u) override { NickAlias *na = NickAlias::Find(u->nick); if (!na) @@ -196,7 +196,7 @@ class NickServCore : public Module, public NickServService } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { NickAlias *na = NickAlias::Find(u->nick); if (na && *na->nc == u->Account() && !Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !na->nc->HasExt("UNCONFIRMED")) @@ -207,7 +207,7 @@ class NickServCore : public Module, public NickServService u->SetModes(NickServ, "%s", modesonid.c_str()); } - void Collide(User *u, NickAlias *na) anope_override + void Collide(User *u, NickAlias *na) override { if (na) collided.Set(na); @@ -241,7 +241,7 @@ class NickServCore : public Module, public NickServService u->Kill(NickServ ? NickServ->nick : "", "Services nickname-enforcer kill"); } - void Release(NickAlias *na) anope_override + void Release(NickAlias *na) override { if (held.HasExt(na)) { @@ -260,7 +260,7 @@ class NickServCore : public Module, public NickServService } } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -284,7 +284,7 @@ class NickServCore : public Module, public NickServService defaults.clear(); } - void OnDelNick(NickAlias *na) anope_override + void OnDelNick(NickAlias *na) override { User *u = User::Find(na->nick); if (u && u->Account() == na->nc) @@ -295,7 +295,7 @@ class NickServCore : public Module, public NickServService } } - void OnDelCore(NickCore *nc) anope_override + void OnDelCore(NickCore *nc) override { Log(NickServ, "nick") << "Deleting nickname group " << nc->display; @@ -311,12 +311,12 @@ class NickServCore : public Module, public NickServService nc->users.clear(); } - void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) anope_override + void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) override { Log(LOG_NORMAL, "nick", NickServ) << "Changing " << nc->display << " nickname group display to " << newdisplay; } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { Configuration::Block *block = Config->GetModule(this); @@ -345,13 +345,13 @@ class NickServCore : public Module, public NickServService } } - void OnNickGroup(User *u, NickAlias *target) anope_override + void OnNickGroup(User *u, NickAlias *target) override { if (!target->nc->HasExt("UNCONFIRMED")) u->SetMode(NickServ, "REGISTERED"); } - void OnNickUpdate(User *u) anope_override + void OnNickUpdate(User *u) override { for (User::ChanUserList::iterator it = u->chans.begin(), it_end = u->chans.end(); it != it_end; ++it) { @@ -362,7 +362,7 @@ class NickServCore : public Module, public NickServService } } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (u->Quitting() || !u->server->IsSynced() || u->server->IsULined()) return; @@ -376,14 +376,14 @@ class NickServCore : public Module, public NickServService this->Validate(u); } - void OnPostUserLogoff(User *u) anope_override + void OnPostUserLogoff(User *u) override { NickAlias *na = NickAlias::Find(u->nick); if (na) OnCancel(u, na); } - void OnServerSync(Server *s) anope_override + void OnServerSync(Server *s) override { for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) { @@ -399,7 +399,7 @@ class NickServCore : public Module, public NickServService } } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { NickAlias *old_na = NickAlias::Find(oldnick), *na = NickAlias::Find(u->nick); /* If the new nick isn't registered or it's registered and not yours */ @@ -423,13 +423,13 @@ class NickServCore : public Module, public NickServService OnCancel(u, old_na); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (u->server->IsSynced() && mname == "REGISTERED" && !u->IsIdentified(true)) u->RemoveMode(NickServ, mname); } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *NickServ) return EVENT_CONTINUE; @@ -449,7 +449,7 @@ class NickServCore : public Module, public NickServService return EVENT_CONTINUE; } - void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *NickServ) return; @@ -494,7 +494,7 @@ class NickServCore : public Module, public NickServService } } - void OnExpireTick() anope_override + void OnExpireTick() override { if (Anope::NoExpire || Anope::ReadOnly) return; @@ -526,7 +526,7 @@ class NickServCore : public Module, public NickServService } } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { if (!na->nc->HasExt("UNCONFIRMED")) { diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index 1a07bb009..885cfcc85 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -16,27 +16,27 @@ class SGLineManager : public XLineManager public: SGLineManager(Module *creator) : XLineManager(creator, "xlinemanager/sgline", 'G') { } - void OnMatch(User *u, XLine *x) anope_override + void OnMatch(User *u, XLine *x) override { this->Send(u, x); } - void OnExpire(const XLine *x) anope_override + void OnExpire(const XLine *x) override { Log(Config->GetClient("OperServ"), "expire/akill") << "AKILL on \002" << x->mask << "\002 has expired"; } - void Send(User *u, XLine *x) anope_override + void Send(User *u, XLine *x) override { IRCD->SendAkill(u, x); } - void SendDel(XLine *x) anope_override + void SendDel(XLine *x) override { IRCD->SendAkillDel(x); } - bool Check(User *u, const XLine *x) anope_override + bool Check(User *u, const XLine *x) override { if (x->regex) { @@ -73,17 +73,17 @@ class SQLineManager : public XLineManager public: SQLineManager(Module *creator) : XLineManager(creator, "xlinemanager/sqline", 'Q'), nickserv("NickServService", "NickServ") { } - void OnMatch(User *u, XLine *x) anope_override + void OnMatch(User *u, XLine *x) override { this->Send(u, x); } - void OnExpire(const XLine *x) anope_override + void OnExpire(const XLine *x) override { Log(Config->GetClient("OperServ"), "expire/sqline") << "SQLINE on \002" << x->mask << "\002 has expired"; } - void Send(User *u, XLine *x) anope_override + void Send(User *u, XLine *x) override { if (!IRCD->CanSQLine) { @@ -100,7 +100,7 @@ class SQLineManager : public XLineManager IRCD->SendSQLine(u, x); } - void SendDel(XLine *x) anope_override + void SendDel(XLine *x) override { if (!IRCD->CanSQLine || x->IsRegex()) ; @@ -108,7 +108,7 @@ class SQLineManager : public XLineManager IRCD->SendSQLineDel(x); } - bool Check(User *u, const XLine *x) anope_override + bool Check(User *u, const XLine *x) override { if (x->regex) return x->regex->Matches(u->nick); @@ -137,17 +137,17 @@ class SNLineManager : public XLineManager public: SNLineManager(Module *creator) : XLineManager(creator, "xlinemanager/snline", 'N') { } - void OnMatch(User *u, XLine *x) anope_override + void OnMatch(User *u, XLine *x) override { this->Send(u, x); } - void OnExpire(const XLine *x) anope_override + void OnExpire(const XLine *x) override { Log(Config->GetClient("OperServ"), "expire/snline") << "SNLINE on \002" << x->mask << "\002 has expired"; } - void Send(User *u, XLine *x) anope_override + void Send(User *u, XLine *x) override { if (IRCD->CanSNLine && !x->IsRegex()) IRCD->SendSGLine(u, x); @@ -156,13 +156,13 @@ class SNLineManager : public XLineManager u->Kill(Config->GetClient("OperServ"), "SNLined: " + x->reason); } - void SendDel(XLine *x) anope_override + void SendDel(XLine *x) override { if (IRCD->CanSNLine && !x->IsRegex()) IRCD->SendSGLineDel(x); } - bool Check(User *u, const XLine *x) anope_override + bool Check(User *u, const XLine *x) override { if (x->regex) return x->regex->Matches(u->realname); @@ -199,7 +199,7 @@ class OperServCore : public Module XLineManager::UnregisterXLineManager(&snlines); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string>("client"); @@ -213,7 +213,7 @@ class OperServCore : public Module OperServ = bi; } - EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) override { if (bi == OperServ && !u->HasMode("OPER") && Config->GetModule(this)->Get<bool>("opersonly")) { @@ -225,37 +225,37 @@ class OperServCore : public Module return EVENT_CONTINUE; } - void OnServerQuit(Server *server) anope_override + void OnServerQuit(Server *server) override { if (server->IsJuped()) Log(server, "squit", OperServ) << "Received SQUIT for juped server " << server->GetName(); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (mname == "OPER") Log(u, "oper", OperServ) << "is now an IRC operator."; } - void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override { if (mname == "OPER") Log(u, "oper", OperServ) << "is no longer an IRC operator"; } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting() && !exempt) XLineManager::CheckAll(u); } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { if (!u->HasMode("OPER")) this->sqlines.CheckAllXLines(u); } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { XLine *x = this->sqlines.CheckChannel(c); if (x) @@ -268,7 +268,7 @@ class OperServCore : public Module return EVENT_CONTINUE; } - EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!params.empty() || source.c || source.service != *OperServ) return EVENT_CONTINUE; @@ -276,7 +276,7 @@ class OperServCore : public Module return EVENT_CONTINUE; } - void OnLog(Log *l) anope_override + void OnLog(Log *l) override { if (l->type == LOG_SERVER) l->bi = OperServ; diff --git a/modules/third/language/CMakeLists.txt b/modules/third/language/CMakeLists.txt index 85278f5be..c46544836 100644 --- a/modules/third/language/CMakeLists.txt +++ b/modules/third/language/CMakeLists.txt @@ -2,7 +2,7 @@ if(GETTEXT_FOUND) # Get all of the .po files file(GLOB LANG_SRCS_PO RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.*.po") - sort_list(LANG_SRCS_PO) + list(SORT LANG_SRCS_PO) foreach(LANG_PO ${LANG_SRCS_PO}) # Get the domain for this language file diff --git a/modules/webcpanel/pages/chanserv/access.h b/modules/webcpanel/pages/chanserv/access.h index 7f81f2d39..9ff77c486 100644 --- a/modules/webcpanel/pages/chanserv/access.h +++ b/modules/webcpanel/pages/chanserv/access.h @@ -16,9 +16,9 @@ class Access : public WebPanelProtectedPage public: Access(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; - std::set<Anope::string> GetData() anope_override; + std::set<Anope::string> GetData() override; }; } diff --git a/modules/webcpanel/pages/chanserv/akick.h b/modules/webcpanel/pages/chanserv/akick.h index bd5b18132..938dbde04 100644 --- a/modules/webcpanel/pages/chanserv/akick.h +++ b/modules/webcpanel/pages/chanserv/akick.h @@ -16,9 +16,9 @@ class Akick : public WebPanelProtectedPage public: Akick(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; - std::set<Anope::string> GetData() anope_override; + std::set<Anope::string> GetData() override; }; } diff --git a/modules/webcpanel/pages/chanserv/drop.h b/modules/webcpanel/pages/chanserv/drop.h index d418ade8f..684562453 100644 --- a/modules/webcpanel/pages/chanserv/drop.h +++ b/modules/webcpanel/pages/chanserv/drop.h @@ -16,7 +16,7 @@ namespace WebCPanel public: Drop(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; diff --git a/modules/webcpanel/pages/chanserv/info.h b/modules/webcpanel/pages/chanserv/info.h index 4302264d6..8f70f13b2 100644 --- a/modules/webcpanel/pages/chanserv/info.h +++ b/modules/webcpanel/pages/chanserv/info.h @@ -16,7 +16,7 @@ class Info : public WebPanelProtectedPage public: Info(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/chanserv/modes.h b/modules/webcpanel/pages/chanserv/modes.h index 36f5a1d27..5fd69e07f 100644 --- a/modules/webcpanel/pages/chanserv/modes.h +++ b/modules/webcpanel/pages/chanserv/modes.h @@ -16,9 +16,9 @@ class Modes : public WebPanelProtectedPage public: Modes(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; - std::set<Anope::string> GetData() anope_override; + std::set<Anope::string> GetData() override; }; } diff --git a/modules/webcpanel/pages/chanserv/set.h b/modules/webcpanel/pages/chanserv/set.h index dcd483419..12c94dcf0 100644 --- a/modules/webcpanel/pages/chanserv/set.h +++ b/modules/webcpanel/pages/chanserv/set.h @@ -16,9 +16,9 @@ class Set : public WebPanelProtectedPage public: Set(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; - std::set<Anope::string> GetData() anope_override; + std::set<Anope::string> GetData() override; }; } diff --git a/modules/webcpanel/pages/confirm.h b/modules/webcpanel/pages/confirm.h index eceeedee1..fb5b9d54e 100644 --- a/modules/webcpanel/pages/confirm.h +++ b/modules/webcpanel/pages/confirm.h @@ -15,7 +15,7 @@ class Confirm : public WebPanelPage public: Confirm(const Anope::string &u) : WebPanelPage(u) { } - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) override; }; } diff --git a/modules/webcpanel/pages/hostserv/request.h b/modules/webcpanel/pages/hostserv/request.h index 59d790937..53e72c1bc 100644 --- a/modules/webcpanel/pages/hostserv/request.h +++ b/modules/webcpanel/pages/hostserv/request.h @@ -16,7 +16,7 @@ class Request : public WebPanelProtectedPage public: Request(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/index.cpp b/modules/webcpanel/pages/index.cpp index 1b136c7fb..debedd551 100644 --- a/modules/webcpanel/pages/index.cpp +++ b/modules/webcpanel/pages/index.cpp @@ -19,7 +19,7 @@ class WebpanelRequest : public IdentifyRequest public: WebpanelRequest(Module *o, HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(o, user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!client || !server) return; @@ -63,7 +63,7 @@ class WebpanelRequest : public IdentifyRequest client->SendReply(&reply); } - void OnFail() anope_override + void OnFail() override { if (!client || !server) return; diff --git a/modules/webcpanel/pages/index.h b/modules/webcpanel/pages/index.h index b3c638d05..d6039feae 100644 --- a/modules/webcpanel/pages/index.h +++ b/modules/webcpanel/pages/index.h @@ -15,7 +15,7 @@ class Index : public WebPanelPage public: Index(const Anope::string &u) : WebPanelPage(u) { } - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) override; }; } diff --git a/modules/webcpanel/pages/logout.h b/modules/webcpanel/pages/logout.h index ab324bdf9..f44f3aad5 100644 --- a/modules/webcpanel/pages/logout.h +++ b/modules/webcpanel/pages/logout.h @@ -13,7 +13,7 @@ class Logout : public WebPanelProtectedPage public: Logout(const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/memoserv/memos.h b/modules/webcpanel/pages/memoserv/memos.h index e55104823..afe9067b8 100644 --- a/modules/webcpanel/pages/memoserv/memos.h +++ b/modules/webcpanel/pages/memoserv/memos.h @@ -16,7 +16,7 @@ class Memos : public WebPanelProtectedPage public: Memos(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/nickserv/access.h b/modules/webcpanel/pages/nickserv/access.h index 8c7337236..0752fc1b0 100644 --- a/modules/webcpanel/pages/nickserv/access.h +++ b/modules/webcpanel/pages/nickserv/access.h @@ -16,7 +16,7 @@ class Access : public WebPanelProtectedPage public: Access(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/nickserv/alist.h b/modules/webcpanel/pages/nickserv/alist.h index 357699f4e..ba2ca1a7a 100644 --- a/modules/webcpanel/pages/nickserv/alist.h +++ b/modules/webcpanel/pages/nickserv/alist.h @@ -16,7 +16,7 @@ class Alist : public WebPanelProtectedPage public: Alist(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/nickserv/cert.h b/modules/webcpanel/pages/nickserv/cert.h index 7fa86e6eb..32c5d1aa9 100644 --- a/modules/webcpanel/pages/nickserv/cert.h +++ b/modules/webcpanel/pages/nickserv/cert.h @@ -16,7 +16,7 @@ class Cert : public WebPanelProtectedPage public: Cert(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/nickserv/info.h b/modules/webcpanel/pages/nickserv/info.h index 46e588f8b..1b70a3827 100644 --- a/modules/webcpanel/pages/nickserv/info.h +++ b/modules/webcpanel/pages/nickserv/info.h @@ -16,7 +16,7 @@ class Info : public WebPanelProtectedPage public: Info(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/operserv/akill.h b/modules/webcpanel/pages/operserv/akill.h index 9fd47d79a..1cabaf205 100644 --- a/modules/webcpanel/pages/operserv/akill.h +++ b/modules/webcpanel/pages/operserv/akill.h @@ -16,7 +16,7 @@ class Akill : public WebPanelProtectedPage public: Akill(const Anope::string &cat, const Anope::string &u); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) override; }; } diff --git a/modules/webcpanel/pages/register.h b/modules/webcpanel/pages/register.h index 38646c98c..e38e7f5ce 100644 --- a/modules/webcpanel/pages/register.h +++ b/modules/webcpanel/pages/register.h @@ -15,7 +15,7 @@ class Register : public WebPanelPage public: Register(const Anope::string &u) : WebPanelPage(u) { } - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) override; }; } diff --git a/modules/webcpanel/static_fileserver.h b/modules/webcpanel/static_fileserver.h index 184c8661d..0707cad97 100644 --- a/modules/webcpanel/static_fileserver.h +++ b/modules/webcpanel/static_fileserver.h @@ -14,6 +14,6 @@ class StaticFileServer : public HTTPPage public: StaticFileServer(const Anope::string &f_n, const Anope::string &u, const Anope::string &c_t); - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) anope_override; + bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) override; }; diff --git a/modules/webcpanel/webcpanel.cpp b/modules/webcpanel/webcpanel.cpp index bf0a31540..d5acfbf67 100644 --- a/modules/webcpanel/webcpanel.cpp +++ b/modules/webcpanel/webcpanel.cpp @@ -258,7 +258,7 @@ namespace WebPanel MyComandReply(TemplateFileServer::Replacements &_r, const Anope::string &_k) : re(_r), k(_k) { } - void SendMessage(BotInfo *source, const Anope::string &msg) anope_override + void SendMessage(BotInfo *source, const Anope::string &msg) override { re[k] = msg; } diff --git a/modules/webcpanel/webcpanel.h b/modules/webcpanel/webcpanel.h index 7e4b5a556..e03e45ed1 100644 --- a/modules/webcpanel/webcpanel.h +++ b/modules/webcpanel/webcpanel.h @@ -80,7 +80,7 @@ class WebPanelProtectedPage : public WebPanelPage { } - bool OnRequest(HTTPProvider *provider, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply) anope_override anope_final + bool OnRequest(HTTPProvider *provider, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply) override final { ServiceReference<Panel> panel("Panel", "webcpanel"); NickAlias *na; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be3f1010f..fd834fc16 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,71 +2,41 @@ file(GLOB SRC_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") if(WIN32) - append_to_list(SRC_SRCS win32/dir/dir.cpp) - append_to_list(SRC_SRCS win32/socket.cpp) - append_to_list(SRC_SRCS win32/windows.cpp) - append_to_list(SRC_SRCS win32/dl/dl.cpp) - append_to_list(SRC_SRCS win32/pipe/pipe.cpp) - append_to_list(SRC_SRCS win32/pthread/pthread.cpp) - append_to_list(SRC_SRCS win32/sigaction/sigaction.cpp) + list(APPEND SRC_SRCS win32/dir/dir.cpp) + list(APPEND SRC_SRCS win32/socket.cpp) + list(APPEND SRC_SRCS win32/windows.cpp) + list(APPEND SRC_SRCS win32/dl/dl.cpp) + list(APPEND SRC_SRCS win32/pipe/pipe.cpp) + list(APPEND SRC_SRCS win32/pthread/pthread.cpp) + list(APPEND SRC_SRCS win32/sigaction/sigaction.cpp) endif(WIN32) if(HAVE_EPOLL) - append_to_list(SRC_SRCS socketengines/socketengine_epoll.cpp) + list(APPEND SRC_SRCS socketengines/socketengine_epoll.cpp) else(HAVE_EPOLL) if(HAVE_KQUEUE) - append_to_list(SRC_SRCS socketengines/socketengine_kqueue.cpp) + list(APPEND SRC_SRCS socketengines/socketengine_kqueue.cpp) else(HAVE_KQUEUE) if(HAVE_POLL) - append_to_list(SRC_SRCS socketengines/socketengine_poll.cpp) + list(APPEND SRC_SRCS socketengines/socketengine_poll.cpp) else(HAVE_POLL) - append_to_list(SRC_SRCS socketengines/socketengine_select.cpp) + list(APPEND SRC_SRCS socketengines/socketengine_select.cpp) endif(HAVE_POLL) endif(HAVE_KQUEUE) endif(HAVE_EPOLL) -sort_list(SRC_SRCS) +list(SORT SRC_SRCS) # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") -# Create an empty list to store extra include directories -set(EXTRA_INCLUDES) -# Iterate through all the source files -foreach(SRC ${SRC_SRCS}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) -endforeach(SRC) -# If there were extra include directories, remove the duplicates and add the directories to the include path -if(EXTRA_INCLUDES) - remove_list_duplicates(EXTRA_INCLUDES) - include_directories(${EXTRA_INCLUDES}) -endif(EXTRA_INCLUDES) - # Under Windows, we also include a resource file to the build if(WIN32) # Make sure that the resource file is seen as an RC file to be compiled with a resource compiler, not a C++ compiler set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC) # Add the resource file to the list of sources - append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc) - # For MinGW, we have to change the compile flags - if(MINGW) - set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include") - # If any sort of debugging is being enabled, add a _DEBUG define to the flags for the resource compiler - if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") - set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG") - endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "${RC_CFLAGS}") - # For anything else, assumingly Visual Studio at this point, use a different set of compile flags - else(MINGW) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"") - endif(MINGW) + list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"") endif(WIN32) # If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators diff --git a/src/main.cpp b/src/main.cpp index 99054688c..86d135ca8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,7 +47,7 @@ class UpdateTimer : public Timer public: UpdateTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Anope::SaveDatabases(); } @@ -58,7 +58,7 @@ class ExpireTimer : public Timer public: ExpireTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { } - void Tick(time_t) anope_override + void Tick(time_t) override { FOREACH_MOD(OnExpireTick, ()); } diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 200aa2bf3..394d2fc51 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,6 +1,6 @@ # Find all the *.cpp files within the current source directory, and sort the list file(GLOB TOOLS_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -sort_list(TOOLS_SRCS) +list(SORT TOOLS_SRCS) # Set all the files to use C++ as well as set their compile flags set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") @@ -9,30 +9,25 @@ set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS foreach(SRC ${TOOLS_SRCS}) # Convert the source file extension to have no extension string(REGEX REPLACE "\\.cpp$" "" EXE ${SRC}) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC}) - # Only continue if this file isn't skipped - if(NOT SKIP) - # Generate the executable and set its linker flags, also set it to depend on the main Anope executable to be built beforehand - add_executable(${EXE} ${SRC}) - set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") - add_dependencies(${EXE} ${PROGRAM_NAME}) - # Only for Windows, set anopesmtp to require the wsock32 library - if(WIN32 AND ${EXE} STREQUAL anopesmtp) - target_link_libraries(${EXE} wsock32) - endif(WIN32 AND ${EXE} STREQUAL anopesmtp) - if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) - target_link_libraries(${EXE} socket nsl) - endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) - # Set the executable to be installed to the bin directory under the main directory - install(TARGETS ${EXE} - DESTINATION ${BIN_DIR} - ) - # Add the executable to the list of files for CPack to ignore - get_target_property(EXE_BINARY ${EXE} LOCATION) - get_filename_component(EXE_BINARY ${EXE_BINARY} NAME) - add_to_cpack_ignored_files("${EXE_BINARY}$" TRUE) - endif(NOT SKIP) + # Generate the executable and set its linker flags, also set it to depend on the main Anope executable to be built beforehand + add_executable(${EXE} ${SRC}) + set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") + add_dependencies(${EXE} ${PROGRAM_NAME}) + # Only for Windows, set anopesmtp to require the wsock32 library + if(WIN32 AND ${EXE} STREQUAL anopesmtp) + target_link_libraries(${EXE} wsock32) + endif(WIN32 AND ${EXE} STREQUAL anopesmtp) + if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) + target_link_libraries(${EXE} socket nsl) + endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) + # Set the executable to be installed to the bin directory under the main directory + install(TARGETS ${EXE} + DESTINATION ${BIN_DIR} + ) + # Add the executable to the list of files for CPack to ignore + get_target_property(EXE_BINARY ${EXE} LOCATION) + get_filename_component(EXE_BINARY ${EXE_BINARY} NAME) + add_to_cpack_ignored_files("${EXE_BINARY}$" TRUE) endforeach(SRC) # If not on Windows, generate anoperc and install it along with mydbgen diff --git a/src/win32/Config.cs b/src/win32/Config.cs index 03308fde1..8fbf31a65 100644 --- a/src/win32/Config.cs +++ b/src/win32/Config.cs @@ -27,14 +27,12 @@ namespace Config {
class Config
{
- static string ExecutablePath, InstallDirectory, VSVersion, VSShortVer, ExtraIncludeDirs, ExtraLibDirs, ExtraArguments;
+ static string ExecutablePath, InstallDirectory, ExtraIncludeDirs, ExtraLibDirs, ExtraArguments;
static bool UseNMake = true, BuildDebug = false;
static bool CheckResponse(string InstallerResponse)
{
- if (string.Compare(InstallerResponse, "yes", true) == 0 || string.Compare(InstallerResponse, "y", true) == 0)
- return true;
- return false;
+ return string.Compare(InstallerResponse, "yes", true) == 0 || string.Compare(InstallerResponse, "y", true) == 0;
}
static bool LoadCache()
@@ -62,10 +60,6 @@ namespace Config ExtraLibDirs = value;
else if (name == "EXTRAARGS")
ExtraArguments = value;
- else if (name == "VSVERSION")
- VSVersion = value;
- else if (name == "VSSHORTVER")
- VSShortVer = value;
}
return true;
@@ -87,8 +81,6 @@ namespace Config tw.WriteLine("EXTRAINCLUDE={0}", ExtraIncludeDirs);
tw.WriteLine("EXTRALIBS={0}", ExtraLibDirs);
tw.WriteLine("EXTRAARGS={0}", ExtraArguments);
- tw.WriteLine("VSVERSION={0}", VSVersion);
- tw.WriteLine("VSSHORTVER={0}", VSShortVer);
}
}
@@ -103,18 +95,15 @@ namespace Config Console.Write("[{0}] ", UseNMake ? "yes" : "no");
return UseNMake ? "yes" : "no";
case 2:
- Console.Write("[{0}] ", VSShortVer);
- return VSShortVer;
- case 3:
Console.Write("[{0}] ", BuildDebug ? "yes" : "no");
return BuildDebug ? "yes" : "no";
- case 4:
+ case 3:
Console.Write("[{0}] ", ExtraIncludeDirs);
return ExtraIncludeDirs;
- case 5:
+ case 4:
Console.Write("[{0}] ", ExtraLibDirs);
return ExtraLibDirs;
- case 6:
+ case 5:
Console.Write("[{0}] ", ExtraArguments);
return ExtraArguments;
default:
@@ -247,15 +236,14 @@ namespace Config if (!DoQuick)
{
List<string> InstallerQuestions = new List<string>()
- {
- "Where do you want Anope to be installed?",
- "Would you like to build using NMake instead of using Visual Studio?\r\nNOTE: If you decide to use NMake, you must be in an environment where\r\nNMake can function, such as the Visual Studio command line. If you say\r\nyes to this while not in an environment that can run NMake, it can\r\ncause the CMake configuration to enter an endless loop. [y/n]",
- "Are you using Visual Studio 2008, 2010, or 2012? You can leave this blank\nand have CMake try and auto detect it, but this usually doesn't\nwork correctly. [2008/2010/2012]",
- "Would you like to build a debug version of Anope? [y/n]",
- "Are there any extra include directories you wish to use?\nYou may only need to do this if CMake is unable to locate missing dependencies without hints.\nSeparate directories with semicolons and use slashes (aka /) instead of backslashes (aka \\).\nIf you need no extra include directories, enter NONE in all caps.",
- "Are there any extra library directories you wish to use?\nYou may only need to do this if CMake is unable to locate missing dependencies without hints.\nSeparate directories with semicolons and use slashes (aka /) instead of backslashes (aka \\).\nIf you need no extra library directories, enter NONE in all caps.",
- "Are there any extra arguments you wish to pass to CMake?\nIf you need no extra arguments to CMake, enter NONE in all caps."
- };
+ {
+ "Where do you want Anope to be installed?",
+ "Would you like to build using NMake instead of using Visual Studio? [y/n]",
+ "Would you like to build a debug version of Anope? [y/n]",
+ "Are there any extra include directories you wish to use?\nYou may only need to do this if CMake is unable to locate missing dependencies without hints.\nSeparate directories with semicolons and use slashes (aka /) instead of backslashes (aka \\).\nIf you need no extra include directories, enter NONE in all caps.",
+ "Are there any extra library directories you wish to use?\nYou may only need to do this if CMake is unable to locate missing dependencies without hints.\nSeparate directories with semicolons and use slashes (aka /) instead of backslashes (aka \\).\nIf you need no extra library directories, enter NONE in all caps.",
+ "Are there any extra arguments you wish to pass to CMake?\nIf you need no extra arguments to CMake, enter NONE in all caps."
+ };
for (int i = 0; i < InstallerQuestions.Count; ++i)
{
@@ -269,8 +257,8 @@ namespace Config if (!string.IsNullOrWhiteSpace(CacheResponse) && string.IsNullOrWhiteSpace(InstallerResponse))
InstallerResponse = CacheResponse;
- // Question 5-7 are optional
- if (i < 4 && string.IsNullOrWhiteSpace(InstallerResponse))
+ // Question 4-6 are optional
+ if (i < 3 && string.IsNullOrWhiteSpace(InstallerResponse))
{
Console.WriteLine("Invalid option");
--i;
@@ -305,42 +293,23 @@ namespace Config break;
case 1:
UseNMake = CheckResponse(InstallerResponse);
- if (UseNMake)
- ++i;
break;
case 2:
- if (InstallerResponse == "2012")
- {
- VSVersion = "-G\"Visual Studio 11\" ";
- VSShortVer = "2012";
- }
- else if (InstallerResponse == "2010")
- {
- VSVersion = "-G\"Visual Studio 10\" ";
- VSShortVer = "2010";
- }
- else if (InstallerResponse == "2008")
- {
- VSVersion = "-G\"Visual Studio 9 2008\" ";
- VSShortVer = "2008";
- }
- break;
- case 3:
BuildDebug = CheckResponse(InstallerResponse);
break;
- case 4:
+ case 3:
if (InstallerResponse == "NONE")
ExtraIncludeDirs = null;
else
ExtraIncludeDirs = InstallerResponse;
break;
- case 5:
+ case 4:
if (InstallerResponse == "NONE")
ExtraLibDirs = null;
else
ExtraLibDirs = InstallerResponse;
break;
- case 6:
+ case 5:
if (InstallerResponse == "NONE")
ExtraArguments = null;
else
@@ -354,11 +323,7 @@ namespace Config Console.WriteLine("Anope will be compiled with the following options:");
Console.WriteLine("Install directory: {0}", InstallDirectory);
- Console.WriteLine("Use NMake: {0}", UseNMake ? "Yes" : "No");
- if (!string.IsNullOrWhiteSpace(VSShortVer))
- Console.WriteLine("Using Visual Studio: {0}", VSShortVer);
- else
- Console.WriteLine("Using Visual Studio: No");
+ Console.WriteLine("Generator: {0}", UseNMake ? "nmake" : "Visual Studio");
Console.WriteLine("Build debug: {0}", BuildDebug ? "Yes" : "No");
Console.WriteLine("Anope Version: {0}", AnopeVersion);
Console.WriteLine("Extra Include Directories: {0}", ExtraIncludeDirs);
@@ -383,9 +348,9 @@ namespace Config ExtraArguments = "";
InstallDirectory = "-DINSTDIR:STRING=\"" + InstallDirectory.Replace('\\', '/') + "\" ";
- string NMake = UseNMake ? "-G\"NMake Makefiles\" " : "";
- string Debug = BuildDebug ? "-DCMAKE_BUILD_TYPE:STRING=DEBUG " : "-DCMAKE_BUILD_TYPE:STRING=RELEASE ";
- string cMake = InstallDirectory + NMake + Debug + VSVersion + ExtraIncludeDirs + ExtraLibDirs + ExtraArguments + "\"" + ExecutablePath.Replace('\\', '/') + "\"";
+ string Generator = UseNMake ? "-G\"NMake Makefiles\" " : "-G \"Visual Studio 11\" ";
+ string Debug = "-DCMAKE_BUILD_TYPE:STRING=" + (BuildDebug ? "DEBUG" : "RELEASE") + " ";
+ string cMake = InstallDirectory + Generator + Debug + ExtraIncludeDirs + ExtraLibDirs + ExtraArguments + "\"" + ExecutablePath.Replace('\\', '/') + "\"";
RunCMake(cMake);
return 0;
diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h index ad561f9b3..d08969ceb 100644 --- a/src/win32/anope_windows.h +++ b/src/win32/anope_windows.h @@ -42,6 +42,13 @@ /* VS2008 hates having this define before its own */ #define vsnprintf _vsnprintf +#define popen _popen +#define pclose _pclose + +#define PATH_MAX MAX_PATH + +#define sleep(x) Sleep(x * 1000) + #define anope_close windows_close #define stat _stat |
