From 768297b430a00b7757fce44c75903f6c434355b3 Mon Sep 17 00:00:00 2001 From: jackun Date: Sun, 10 May 2020 15:11:56 +0300 Subject: [PATCH] [editorconfig] Apply whitespace rules --- build.sh | 4 ++-- src/config.h | 2 +- src/cpu.cpp | 2 +- src/cpu.h | 2 +- src/dbus.cpp | 2 +- src/font_default.h | 2 +- src/font_unispace.c | 2 +- src/gpu.cpp | 2 +- src/gpu.h | 2 +- src/keybinds.h | 2 +- src/loaders/loader_nvctrl.cpp | 2 +- src/memory.cpp | 4 ++-- src/memory.h | 2 +- src/meson.build | 8 ++++---- src/nvctrl.h | 2 +- src/nvml.cpp | 6 +++--- src/overlay.cpp | 18 +++++++++--------- src/overlay.h | 2 +- src/overlay_params.cpp | 4 ++-- src/pci_ids.cpp | 4 ++-- src/pci_ids.h | 2 +- 21 files changed, 38 insertions(+), 38 deletions(-) diff --git a/build.sh b/build.sh index 41045428..c4796452 100755 --- a/build.sh +++ b/build.sh @@ -51,7 +51,7 @@ dependencies() { set -e } echo "# Checking Dependencies" - + case $DISTRO in "Arch Linux"|"Manjaro Linux") MANAGER_QUERY="pacman -Q" @@ -74,7 +74,7 @@ dependencies() { MANAGER_INSTALL="apt install" DEPS="{gcc,g++,gcc-multilib,g++-multilib,ninja-build,python3-pip,python3-setuptools,python3-wheel,pkg-config,mesa-common-dev,libx11-dev,libxnvctrl-dev,libdbus-1-dev}" install - + if [[ $($SU_CMD pip3 show meson; echo $?) == 1 || $($SU_CMD pip3 show mako; echo $?) == 1 ]]; then $SU_CMD pip3 install 'meson>=0.54' mako fi diff --git a/src/config.h b/src/config.h index 53de83a4..be03dbac 100644 --- a/src/config.h +++ b/src/config.h @@ -1,2 +1,2 @@ #include "overlay_params.h" -void parseConfigFile(overlay_params& p); \ No newline at end of file +void parseConfigFile(overlay_params& p); diff --git a/src/cpu.cpp b/src/cpu.cpp index 558c1e75..118b2a4e 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -266,4 +266,4 @@ bool CPUStats::GetCpuFile() { return true; } -CPUStats cpuStats; \ No newline at end of file +CPUStats cpuStats; diff --git a/src/cpu.h b/src/cpu.h index 7209c4e3..1fdf20c4 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -67,4 +67,4 @@ private: FILE *m_cpuTempFile = nullptr; }; -extern CPUStats cpuStats; \ No newline at end of file +extern CPUStats cpuStats; diff --git a/src/dbus.cpp b/src/dbus.cpp index b6eb585d..da23fbb1 100644 --- a/src/dbus.cpp +++ b/src/dbus.cpp @@ -752,4 +752,4 @@ void dbus_manager::dbus_thread(dbus_manager *pmgr) } dbus_manager dbus_mgr; -} \ No newline at end of file +} diff --git a/src/font_default.h b/src/font_default.h index b5ce4507..cee83dcb 100644 --- a/src/font_default.h +++ b/src/font_default.h @@ -11,4 +11,4 @@ const char* GetDefaultCompressedFontDataTTFBase85(void); } #endif -#endif \ No newline at end of file +#endif diff --git a/src/font_unispace.c b/src/font_unispace.c index 8fa94400..ce84cc7d 100644 --- a/src/font_unispace.c +++ b/src/font_unispace.c @@ -296,4 +296,4 @@ static const char ttf_compressed_data_base85[178490+1] = const char* GetDefaultCompressedFontDataTTFBase85(void) { return ttf_compressed_data_base85; -} \ No newline at end of file +} diff --git a/src/gpu.cpp b/src/gpu.cpp index d758fbc7..c8bde708 100644 --- a/src/gpu.cpp +++ b/src/gpu.cpp @@ -83,4 +83,4 @@ void getAmdGpuUsage(){ amdgpu.MemClock = value / 1000000; gpu_info.MemClock = amdgpu.MemClock; } -} \ No newline at end of file +} diff --git a/src/gpu.h b/src/gpu.h index d8863335..e12d9f3c 100644 --- a/src/gpu.h +++ b/src/gpu.h @@ -30,4 +30,4 @@ extern struct amdGpu amdgpu; extern struct gpuInfo gpu_info; void getNvidiaGpuInfo(void); -void getAmdGpuUsage(void); \ No newline at end of file +void getAmdGpuUsage(void); diff --git a/src/keybinds.h b/src/keybinds.h index c8945f27..1195bb1c 100644 --- a/src/keybinds.h +++ b/src/keybinds.h @@ -21,4 +21,4 @@ bool key_is_pressed(KeySym ks) { bool isPressed = !!(keys_return[kc2 >> 3] & (1 << (kc2 & 7))); return isPressed; } -#endif \ No newline at end of file +#endif diff --git a/src/loaders/loader_nvctrl.cpp b/src/loaders/loader_nvctrl.cpp index fb9ceb18..0d00d11c 100644 --- a/src/loaders/loader_nvctrl.cpp +++ b/src/loaders/loader_nvctrl.cpp @@ -60,7 +60,7 @@ bool libnvctrl_loader::Load(const std::string& library_name) { CleanUp(true); return false; } - + XNVCTRLQueryTargetAttribute64 = reinterpret_castXNVCTRLQueryTargetAttribute64)>( dlsym(library_, "XNVCTRLQueryTargetAttribute64")); diff --git a/src/memory.cpp b/src/memory.cpp index 323e419d..d4b73b48 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -91,9 +91,9 @@ void update_meminfo(void) { mem_info.mem = curmem; mem_info.bufmem = curbufmem; mem_info.memeasyfree = cureasyfree; - + memused = (float(mem_info.memmax) - float(mem_info.memeasyfree)) / (1024 * 1024); memmax = float(mem_info.memmax) / (1024 * 1024); fclose(meminfo_fp); -} \ No newline at end of file +} diff --git a/src/memory.h b/src/memory.h index 7b022a88..e3ac5b77 100644 --- a/src/memory.h +++ b/src/memory.h @@ -12,4 +12,4 @@ struct memory_information { }; void update_meminfo(void); -FILE *open_file(const char *file, int *reported); \ No newline at end of file +FILE *open_file(const char *file, int *reported); diff --git a/src/meson.build b/src/meson.build index 9bb5f046..4685b08f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -98,18 +98,18 @@ vklayer_mesa_overlay = shared_library( overlay_spv, c_args : [ pre_args, - c_vis_args, - no_override_init_args, + c_vis_args, + no_override_init_args, vulkan_wsi_args ], cpp_args : [ pre_args, - cpp_vis_args, + cpp_vis_args, cpp_nvml_args, vulkan_wsi_args ], dependencies : [ - vulkan_wsi_deps, + vulkan_wsi_deps, libimgui_core_dep, dbus_dep, dep_dl, diff --git a/src/nvctrl.h b/src/nvctrl.h index 3de9052f..55a77bfa 100644 --- a/src/nvctrl.h +++ b/src/nvctrl.h @@ -11,4 +11,4 @@ extern struct nvctrlInfo nvctrl_info; extern bool nvctrlSuccess; bool checkXNVCtrl(void); void getNvctrlInfo(void); -char *get_attr_target_string(int attr, int target_type, int target_id); \ No newline at end of file +char *get_attr_target_string(int attr, int target_type, int target_id); diff --git a/src/nvml.cpp b/src/nvml.cpp index d2a4fb55..e79b4e28 100644 --- a/src/nvml.cpp +++ b/src/nvml.cpp @@ -38,7 +38,7 @@ bool checkNVML(const char* pciBusId){ std::cerr << "MANGOHUD: Failed to load NVML\n"; } return false; -} +} bool getNVMLInfo(){ nvmlReturn_t response; @@ -49,8 +49,8 @@ bool getNVMLInfo(){ nvml.nvmlDeviceGetClockInfo(nvidiaDevice, NVML_CLOCK_MEM, &nvidiaMemClock); nvml.nvmlDeviceGetPciInfo_v3(nvidiaDevice, &nvidiaPciInfo); deviceID = nvidiaPciInfo.pciDeviceId >> 16; - + if (response == NVML_ERROR_NOT_SUPPORTED) nvmlSuccess = false; return nvmlSuccess; -} \ No newline at end of file +} diff --git a/src/overlay.cpp b/src/overlay.cpp index 6c15be89..f0c49ad4 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -880,7 +880,7 @@ void check_keybinds(struct overlay_params& params){ elapsedF2 = (double)(now - last_f2_press); elapsedF12 = (double)(now - last_f12_press); elapsedReloadCfg = (double)(now - reload_cfg_press); - + if (elapsedF2 >= 500000 && !params.output_file.empty()){ #ifdef HAVE_X11 pressed = key_is_pressed(params.toggle_logging); @@ -961,7 +961,7 @@ void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& pa std::thread(update_meminfo).detach(); if (params.enabled[OVERLAY_PARAM_ENABLED_io_read] || params.enabled[OVERLAY_PARAM_ENABLED_io_write]) std::thread(getIoStats, &sw_stats.io).detach(); - + gpuLoadLog = gpu_info.load; cpuLoadLog = sw_stats.total_cpu; sw_stats.fps = fps; @@ -1149,7 +1149,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2& window_size = ImVec2(params.width, params.height); unsigned width = ImGui::GetIO().DisplaySize.x; unsigned height = ImGui::GetIO().DisplaySize.y; - + if (!params.no_display){ ImGui::Begin("Main", &open, ImGuiWindowFlags_NoDecoration); if (params.enabled[OVERLAY_PARAM_ENABLED_version]){ @@ -1193,7 +1193,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2& ImGui::Text("%%"); // ImGui::SameLine(150); // ImGui::Text("%s", "%"); - + if (params.enabled[OVERLAY_PARAM_ENABLED_cpu_temp]){ ImGui::TableNextCell(); right_aligned_text(char_width * 4, "%i", cpuStats.GetCPUDataTotal().temp); @@ -1201,7 +1201,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2& ImGui::Text("°C"); } } - + if (params.enabled[OVERLAY_PARAM_ENABLED_core_load]){ int i = 0; for (const CPUData &cpuData : cpuStats.GetCPUData()) @@ -1234,7 +1234,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2& ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.io_color), "IO RW"); if (params.enabled[OVERLAY_PARAM_ENABLED_io_read] && params.enabled[OVERLAY_PARAM_ENABLED_io_write]) ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.io_color), "IO RD/RW"); - + if (params.enabled[OVERLAY_PARAM_ENABLED_io_read]){ ImGui::TableNextCell(); float val = data.io.diff.read * 1000000 / sampling; @@ -2361,7 +2361,7 @@ static VkResult overlay_CreateSwapchainKHR( // ss << ")"; std::string deviceName = prop.deviceName; get_device_name(prop.vendorID, prop.deviceID, swapchain_data->sw_stats); - if(driverProps.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY){ + if(driverProps.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY){ ss << "NVIDIA"; ss << " (" << ((prop.driverVersion >> 22) & 0x3ff); ss << "." << ((prop.driverVersion >> 14) & 0x0ff); @@ -2459,7 +2459,7 @@ static VkResult overlay_QueuePresentKHR( FpsLimiter(fps_limit_stats); fps_limit_stats.frameEnd = os_time_get_nano(); } - + return result; } @@ -2675,7 +2675,7 @@ static VkResult overlay_CreateInstance( { VkLayerInstanceCreateInfo *chain_info = get_instance_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); - + std::string engineName, engineVersion; if (!is_blacklisted()) { diff --git a/src/overlay.h b/src/overlay.h index df65cd89..65732d15 100644 --- a/src/overlay.h +++ b/src/overlay.h @@ -60,4 +60,4 @@ void check_keybinds(struct overlay_params& params); void init_system_info(void); void FpsLimiter(struct fps_limit& stats); void imgui_custom_style(struct overlay_params& params); -void get_device_name(int32_t vendorID, int32_t deviceID, struct swapchain_stats& sw_stats); \ No newline at end of file +void get_device_name(int32_t vendorID, int32_t deviceID, struct swapchain_stats& sw_stats); diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index e7148cac..f5dd6ad2 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -422,7 +422,7 @@ parse_overlay_config(struct overlay_params *params, } params->tableCols = 3; - + if (!params->font_size) { params->font_size = 24; } else { @@ -437,7 +437,7 @@ parse_overlay_config(struct overlay_params *params, params->tableCols = 4; params->width = 20 * params->font_size; } - + // set frametime limit if (params->fps_limit >= 0) fps_limit_stats.targetFrameTime = int64_t(1000000000.0 / params->fps_limit); diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp index 8171bda2..7e6260e2 100644 --- a/src/pci_ids.cpp +++ b/src/pci_ids.cpp @@ -35,7 +35,7 @@ void parse_pciids() ss.str(""); ss.clear(); ss << line; - + switch(tabs) { case 0: @@ -67,4 +67,4 @@ void parse_pciids() break; } } -} \ No newline at end of file +} diff --git a/src/pci_ids.h b/src/pci_ids.h index 1426fa23..82f5d3d0 100644 --- a/src/pci_ids.h +++ b/src/pci_ids.h @@ -16,4 +16,4 @@ struct device extern std::map>> pci_ids; -void parse_pciids(void); \ No newline at end of file +void parse_pciids(void);