diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b5c1c9..e716217d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,7 +98,7 @@ set(PROJECT_LINK_LIBS if(ENABLE_I3) find_program(I3_EXECUTABLE "i3") if(NOT I3_EXECUTABLE) - message(WARNING "${ANSI}[41;30mDisabling \"i3 module\" support (prerequisites failed)${ANSI}[0m") + message(WARNING "${ANSI}[41;1mDisabling \"i3 module\" support (prerequisites failed)${ANSI}[0m") set(ENABLE_I3 OFF) endif() endif() @@ -109,7 +109,7 @@ if(ENABLE_ALSA) set(PROJECT_INCL_DIRS ${PROJECT_INCL_DIRS} ${ALSA_INCLUDE_DIR}) set(PROJECT_LINK_LIBS ${PROJECT_LINK_LIBS} ${ALSA_LIBRARY}) else(ALSA_FOUND) - message(WARNING "${ANSI}[41;30mDisabling \"volume module\" support (prerequisites failed)${ANSI}[0m") + message(WARNING "${ANSI}[41;1mDisabling \"volume module\" support (prerequisites failed)${ANSI}[0m") set(ENABLE_ALSA OFF) endif() endif() @@ -120,7 +120,7 @@ if(ENABLE_MPD) set(PROJECT_INCL_DIRS ${PROJECT_INCL_DIRS} ${LIBMPDCLIENT_INCLUDE_DIR}) set(PROJECT_LINK_LIBS ${PROJECT_LINK_LIBS} ${LIBMPDCLIENT_LIBRARY}) else(LIBMPDCLIENT_FOUND) - message(WARNING "${ANSI}[41;30mDisabling \"mpd module\" support (prerequisites failed)${ANSI}[0m") + message(WARNING "${ANSI}[41;1mDisabling \"mpd module\" support (prerequisites failed)${ANSI}[0m") set(ENABLE_MPD OFF) endif() endif() @@ -131,7 +131,7 @@ if(ENABLE_NETWORK) set(PROJECT_INCL_DIRS ${PROJECT_INCL_DIRS} ${LIBIW_INCLUDE_DIR}) set(PROJECT_LINK_LIBS ${PROJECT_LINK_LIBS} ${LIBIW_LIBRARY}) else(LIBIW_FOUND) - message(WARNING "${ANSI}[41;30mDisabling \"network module\" support (prerequisites failed)${ANSI}[0m") + message(WARNING "${ANSI}[41;1mDisabling \"network module\" support (prerequisites failed)${ANSI}[0m") set(ENABLE_NETWORK OFF) endif() endif() diff --git a/include/bar.hpp b/include/bar.hpp index 72b667c6..96f92608 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -1,5 +1,4 @@ -#ifndef _BAR_HPP_ -#define _BAR_HPP_ +#pragma once #include #include @@ -12,7 +11,7 @@ DefineBaseException(ConfigurationError); struct CompiledWithoutModuleSupport : public ConfigurationError { - CompiledWithoutModuleSupport(std::string module_name) + explicit CompiledWithoutModuleSupport(std::string module_name) : ConfigurationError(std::string(APP_NAME) + " was not compiled with support for module \""+ module_name +"\"") {} }; @@ -96,5 +95,3 @@ class Bar std::shared_ptr &get_bar(); const Options& bar_opts(); - -#endif diff --git a/include/config.hpp.cmake b/include/config.hpp.cmake index ffdc9caa..412c6064 100644 --- a/include/config.hpp.cmake +++ b/include/config.hpp.cmake @@ -1,5 +1,4 @@ -#ifndef _CONFIG_HPP_ -#define _CONFIG_HPP_ +#pragma once #define APP_NAME "@PROJECT_NAME@" @@ -22,5 +21,3 @@ #define BSPWM_STATUS_PREFIX "@SETTING_BSPWM_STATUS_PREFIX@" #define PATH_CPU_INFO "@SETTING_PATH_CPU_INFO@" #define PATH_MEMORY_INFO "@SETTING_PATH_MEMORY_INFO@" - -#endif // _CONFIG_HPP_ diff --git a/include/drawtypes/animation.hpp b/include/drawtypes/animation.hpp index 9346cc6f..1ddffff2 100644 --- a/include/drawtypes/animation.hpp +++ b/include/drawtypes/animation.hpp @@ -1,5 +1,4 @@ -#ifndef _DRAWTYPES_ANIMATION_HPP_ -#define _DRAWTYPES_ANIMATION_HPP_ +#pragma once #include #include @@ -21,7 +20,7 @@ namespace drawtypes public: Animation(std::vector> &&frames, int framerate_ms = 1); - Animation(int framerate_ms) + explicit Animation(int framerate_ms) : framerate_ms(framerate_ms){} void add(std::unique_ptr &&frame); @@ -37,5 +36,3 @@ namespace drawtypes std::unique_ptr get_config_animation(const std::string& config_path, const std::string& animation_name = "animation", bool required = true); } - -#endif diff --git a/include/drawtypes/bar.hpp b/include/drawtypes/bar.hpp index d39ccd34..1a9379aa 100644 --- a/include/drawtypes/bar.hpp +++ b/include/drawtypes/bar.hpp @@ -1,5 +1,4 @@ -#ifndef _DRAWTYPES_BAR_HPP_ -#define _DRAWTYPES_BAR_HPP_ +#pragma once #include #include @@ -16,7 +15,7 @@ namespace drawtypes protected: std::unique_ptr builder; std::vector colors; - bool gradient; + bool gradient = false; unsigned int width; std::string format; @@ -25,7 +24,7 @@ namespace drawtypes std::unique_ptr indicator; public: - Bar(int width, const std::string& format, bool lazy_builder_closing = true); + Bar(int width, const std::string& fmt, bool lazy_builder_closing = true); Bar(int width, bool lazy_builder_closing = true) : Bar(width, "", lazy_builder_closing){} @@ -41,5 +40,3 @@ namespace drawtypes std::unique_ptr get_config_bar(const std::string& config_path, const std::string& bar_name = "bar", bool lazy_builder_closing = true); } - -#endif diff --git a/include/drawtypes/icon.hpp b/include/drawtypes/icon.hpp index 8cd8a287..85304cbc 100644 --- a/include/drawtypes/icon.hpp +++ b/include/drawtypes/icon.hpp @@ -1,5 +1,4 @@ -#ifndef _DRAWTYPES_ICON_HPP_ -#define _DRAWTYPES_ICON_HPP_ +#pragma once #include #include @@ -37,5 +36,3 @@ namespace drawtypes std::unique_ptr get_config_icon(const std::string& module_name, const std::string& icon_name = "icon", bool required = true, const std::string& def = ""); std::unique_ptr get_optional_config_icon(const std::string& module_name, const std::string& icon_name = "icon", const std::string& def = ""); } - -#endif diff --git a/include/drawtypes/label.hpp b/include/drawtypes/label.hpp index 129b3d31..52cd8b7c 100644 --- a/include/drawtypes/label.hpp +++ b/include/drawtypes/label.hpp @@ -1,5 +1,4 @@ -#ifndef _DRAWTYPES_LABEL_HPP_ -#define _DRAWTYPES_LABEL_HPP_ +#pragma once #include #include @@ -29,5 +28,3 @@ namespace drawtypes std::unique_ptr