Merge pull request #702 from evelikov/all-the-warnings

All the warnings
pull/703/head
jackun 2 years ago committed by GitHub
commit ed95ab6140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,7 +41,7 @@ jobs:
- name: Build release package
run: |
./build-source.sh
./build.sh build package release
./build.sh build -Dwerror=true package release
- name: Upload release
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
env:
@ -63,4 +63,4 @@ jobs:
with:
name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}}
path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz
retention-days: 30
retention-days: 30

@ -1,36 +0,0 @@
pkgname=('mangohud' 'lib32-mangohud')
pkgver=r24.b67a2aa
pkgrel=1
pkgdesc="Vulkan overlay layer to display information about the application"
arch=('x86_64')
makedepends=('gcc' 'meson' 'python-mako' 'libx11' 'lib32-libx11' 'git')
depends=('glslang' 'libglvnd' 'lib32-libglvnd' 'vulkan-headers')
replaces=('vulkan-mesa-layer-mango' 'lib32-vulkan-mesa-layer-mango')
url="https://github.com/flightlessmango/MangoHud"
pkgver() {
cd $startdir
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
git submodule update --init --depth 50
}
build() {
cd $startdir
# ./build.sh clean
./build.sh build
}
package_mangohud() {
provides=("mangohud=${pkgver}")
cd $startdir
install -Dm664 "build/release/usr/lib64/libMangoHud.so" "${pkgdir}/usr/lib/libMangoHud.so"
install -Dm664 "build/release/usr/share/vulkan/implicit_layer.d/mangohud.json" "${pkgdir}/usr/share/vulkan/implicit_layer.d/mangohud.json"
}
package_lib32-mangohud() {
provides=("lib32-mangohud=${pkgver}")
cd $startdir
install -Dm664 "build/release/usr/lib32/libMangoHud.so" "${pkgdir}/usr/lib32/libMangoHud.so"
}

@ -143,6 +143,7 @@ dependencies() {
configure() {
dependencies
git submodule update --init --depth 50
CONFIGURE_OPTS="-Dwerror=true"
if [[ ! -f "build/meson64/build.ninja" ]]; then
meson build/meson64 --libdir lib/mangohud/lib64 --prefix /usr -Dappend_libdir_mangohud=false -Dld_libdir_prefix=true -Dld_libdir_abs=true $@ ${CONFIGURE_OPTS}
fi

@ -3,7 +3,7 @@ project('MangoHud',
version : 'v0.6.6',
license : 'MIT',
meson_version: '>=0.54.0',
default_options : ['buildtype=release', 'c_std=c99', 'cpp_std=c++14']
default_options : ['buildtype=release', 'c_std=c99', 'cpp_std=c++14', 'warning_level=2']
)
cc = meson.get_compiler('c')
@ -123,8 +123,8 @@ c_args = []
foreach a : ['-Werror=implicit-function-declaration',
'-Werror=missing-prototypes', '-Werror=return-type',
'-Werror=incompatible-pointer-types',
'-fno-math-errno',
'-fno-trapping-math', '-Qunused-arguments']
'-Wno-unused-parameter', '-Qunused-arguments',
'-fno-math-errno', '-fno-trapping-math']
if cc.has_argument(a)
c_args += a
endif
@ -139,8 +139,8 @@ endforeach
# Check for generic C++ arguments
cpp_args = []
foreach a : ['-Werror=return-type',
'-fno-math-errno', '-fno-trapping-math',
'-Qunused-arguments']
'-Wno-unused-parameter', '-Qunused-arguments',
'-fno-math-errno', '-fno-trapping-math']
if cpp.has_argument(a)
cpp_args += a
endif

File diff suppressed because it is too large Load Diff

@ -34,7 +34,7 @@ void amdgpu_get_metrics()
gpu_info.MemClock = amdgpu_metrics.current_uclk;
gpu_info.apu_cpu_power = amdgpu_metrics.average_cpu_power / 1000.f;
int cpu_temp = 0;
for (int i = 0; i < cpuStats.GetCPUData().size() / 2; i++)
for (unsigned i = 0; i < cpuStats.GetCPUData().size() / 2; i++)
if (amdgpu_metrics.temperature_core[i] > cpu_temp)
cpu_temp = amdgpu_metrics.temperature_core[i];

@ -91,7 +91,7 @@ static void enumerate_config_files(std::vector<std::string>& paths) {
}
}
bool parseConfigFile(overlay_params& params) {
void parseConfigFile(overlay_params& params) {
HUDElements.options.clear();
params.options.clear();
std::vector<std::string> paths;
@ -120,8 +120,6 @@ bool parseConfigFile(overlay_params& params) {
parseConfigLine(line, params.options);
}
params.config_file_path = *p;
return true;
return;
}
return false;
}

@ -5,7 +5,7 @@
#include "overlay_params.h"
#include <string>
bool parseConfigFile(overlay_params& p);
void parseConfigFile(overlay_params& p);
std::string get_program_name();
#endif //MANGOHUD_CONFIG_H

@ -24,7 +24,6 @@ static void parse_command(struct instance_data *instance_data,
#endif
}
if (!strncmp(cmd, "logging", cmdlen)) {
auto now = Clock::now(); /* us */
if (logger->is_active())
logger->stop_logging();
else
@ -213,4 +212,4 @@ void process_control_socket(struct instance_data *instance_data)
break;
}
}
}
}

@ -227,13 +227,14 @@ bool CPUStats::UpdateCPUData()
bool CPUStats::UpdateCoreMhz() {
m_coreMhz.clear();
FILE *fp;
char str[10];
for (size_t i = 0; i < m_cpuData.size(); i++)
{
std::string path = "/sys/devices/system/cpu/cpu" + std::to_string(i) + "/cpufreq/scaling_cur_freq";
if ((fp = fopen(path.c_str(), "r"))){
fscanf(fp, "%s", str);
m_cpuData[i].mhz = atoi(str) / 1000;
int64_t temp;
if (fscanf(fp, "%" PRId64, &temp) != 1)
temp = 0;
m_cpuData[i].mhz = temp / 1000;
fclose(fp);
}
}

@ -150,9 +150,9 @@ void logging(){
}
Logger::Logger(overlay_params* in_params)
: m_logging_on(false),
m_values_valid(false),
m_params(in_params)
: m_params(in_params),
m_logging_on(false),
m_values_valid(false)
{
m_log_end = Clock::now() - 15s;
SPDLOG_DEBUG("Logger constructed!");
@ -188,7 +188,7 @@ void Logger::stop_logging() {
writefile.join();
writesummary.join();
} else {
#ifdef MANGOAPP
#ifdef MANGOAPP
string path = std::getenv("HOME");
std::string logName = path + "/mangoapp_" + get_log_suffix();
writeSummary(logName);
@ -284,7 +284,7 @@ void Logger::calculate_benchmark_data(){
label = "0.1%";
if (percent == 0.01f)
label = "1%";
if (label.length() > max_label_size)
max_label_size = label.length();

@ -28,7 +28,7 @@
/**
* @file
* OS independent time-manipulation functions.
*
*
* @author Jose Fonseca <jfonseca@vmware.com>
*/
@ -187,7 +187,7 @@ os_wait_until_zero_abs_timeout(volatile int *var, int64_t timeout)
if (!p_atomic_read(var))
return true;
if (timeout == OS_TIMEOUT_INFINITE)
if (timeout == (int64_t)OS_TIMEOUT_INFINITE)
return os_wait_until_zero(var, OS_TIMEOUT_INFINITE);
while (p_atomic_read(var)) {

@ -595,29 +595,29 @@ void init_gpu_stats(uint32_t& vendorID, uint32_t reported_deviceID, overlay_para
SPDLOG_DEBUG("amdgpu path check: {}/device/vendor", path);
FILE *fp;
char str[10];
string device = path + "/device/device";
if ((fp = fopen(device.c_str(), "r"))){
fscanf(fp, "%s", str);
uint32_t temp = strtol(str, NULL, 16);
uint32_t temp = 0;
if (fscanf(fp, "%x", &temp) == 1) {
// if (temp != reported_deviceID && deviceID != 0){
// fclose(fp);
// SPDLOG_DEBUG("DeviceID does not match vulkan report {}", reported_deviceID);
// continue;
// }
deviceID = temp;
deviceID = temp;
}
fclose(fp);
}
string vendor = path + "/device/vendor";
if ((fp = fopen(vendor.c_str(), "r"))){
fscanf(fp, "%s", str);
uint32_t temp = strtol(str, NULL, 16);
if (temp != vendorID)
uint32_t temp = 0;
if (fscanf(fp, "%x", &temp) != 1 || temp != vendorID) {
fclose(fp);
continue;
}
fclose(fp);
}
string line = str;
trim(line);
if (line != "0x1002" || !file_exists(path + "/device/gpu_busy_percent"))
if (deviceID != 0x1002 || !file_exists(path + "/device/gpu_busy_percent"))
continue;
if (pci_bus_parsed && pci_dev) {

@ -660,7 +660,7 @@ parse_overlay_config(struct overlay_params *params,
if (!env || read_cfg) {
// Get config options
bool has_config_file = parseConfigFile(*params);
parseConfigFile(*params);
if (params->options.find("full") != params->options.end() && params->options.find("full")->second != "0") {
#define OVERLAY_PARAM_BOOL(name) \
params->enabled[OVERLAY_PARAM_ENABLED_##name] = 1;

Loading…
Cancel
Save