mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-06-06 01:13:45 -04:00
[*] basic in-house cpp linting
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
a8047d3b12
commit
c7afb87a0c
19 changed files with 60 additions and 64 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef DATA_MANAGER_H
|
#pragma once
|
||||||
#define DATA_MANAGER_H
|
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -21,5 +20,3 @@ std::string ReadableBytesSize(u64 size) noexcept;
|
||||||
u64 DataDirSize(DataDir dir);
|
u64 DataDirSize(DataDir dir);
|
||||||
|
|
||||||
}; // namespace FrontendCommon::DataManager
|
}; // namespace FrontendCommon::DataManager
|
||||||
|
|
||||||
#endif // DATA_MANAGER_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef FIRMWARE_MANAGER_H
|
#pragma once
|
||||||
#define FIRMWARE_MANAGER_H
|
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
|
|
@ -107,5 +106,3 @@ inline std::pair<Service::Set::FirmwareVersionFormat, Result> GetFirmwareVersion
|
||||||
|
|
||||||
// TODO(crueter): GET AS STRING
|
// TODO(crueter): GET AS STRING
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <vector>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
|
||||||
namespace FrontendCommon {
|
namespace FrontendCommon {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef FRONTEND_H
|
#pragma once
|
||||||
#define FRONTEND_H
|
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include "qt_common/qt_common.h"
|
#include "qt_common/qt_common.h"
|
||||||
|
|
@ -114,4 +113,3 @@ const QString GetTextInput(const QString& title = QString(), const QString& capt
|
||||||
const QString& defaultText = QString());
|
const QString& defaultText = QString());
|
||||||
|
|
||||||
} // namespace QtCommon::Frontend
|
} // namespace QtCommon::Frontend
|
||||||
#endif // FRONTEND_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_COMMON_H
|
#pragma once
|
||||||
#define QT_COMMON_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
|
@ -62,4 +61,3 @@ const QString tr(const std::string& str);
|
||||||
|
|
||||||
std::filesystem::path GetEdenCommand();
|
std::filesystem::path GetEdenCommand();
|
||||||
} // namespace QtCommon
|
} // namespace QtCommon
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_APPLET_UTIL_H
|
#pragma once
|
||||||
#define QT_APPLET_UTIL_H
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
namespace QtCommon::Applets {}
|
namespace QtCommon::Applets {}
|
||||||
#endif // QT_APPLET_UTIL_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_CONTENT_UTIL_H
|
#pragma once
|
||||||
#define QT_CONTENT_UTIL_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
|
@ -63,4 +62,3 @@ void configureFilesystemProvider(const std::string& filepath);
|
||||||
// Profiles //
|
// Profiles //
|
||||||
void FixProfiles();
|
void FixProfiles();
|
||||||
} // namespace QtCommon::Content
|
} // namespace QtCommon::Content
|
||||||
#endif // QT_CONTENT_UTIL_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace QtCommon::FS {
|
namespace QtCommon::FS {
|
||||||
|
|
||||||
void LinkRyujinx(std::filesystem::path& from, std::filesystem::path& to);
|
void LinkRyujinx(std::filesystem::path& from, std::filesystem::path& to);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_GAME_UTIL_H
|
#pragma once
|
||||||
#define QT_GAME_UTIL_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
@ -78,5 +77,3 @@ void CreateHomeMenuShortcut(ShortcutTarget target);
|
||||||
[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);
|
[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);
|
||||||
|
|
||||||
} // namespace QtCommon::Game
|
} // namespace QtCommon::Game
|
||||||
|
|
||||||
#endif // QT_GAME_UTIL_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_META_H
|
#pragma once
|
||||||
#define QT_META_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
@ -12,4 +11,3 @@ namespace QtCommon::Meta {
|
||||||
void RegisterMetaTypes();
|
void RegisterMetaTypes();
|
||||||
|
|
||||||
} // namespace QtCommon::Meta
|
} // namespace QtCommon::Meta
|
||||||
#endif // QT_META_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_PATH_UTIL_H
|
#pragma once
|
||||||
#define QT_PATH_UTIL_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
|
@ -10,5 +9,3 @@
|
||||||
namespace QtCommon::Path {
|
namespace QtCommon::Path {
|
||||||
bool OpenShaderCache(u64 program_id, QObject* parent);
|
bool OpenShaderCache(u64 program_id, QObject* parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_PATH_UTIL_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef QT_ROM_UTIL_H
|
#pragma once
|
||||||
#define QT_ROM_UTIL_H
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include "qt_common/qt_common.h"
|
#include "qt_common/qt_common.h"
|
||||||
|
|
||||||
namespace QtCommon::ROM {
|
namespace QtCommon::ROM {
|
||||||
|
bool RomFSRawCopy(size_t total_size, size_t& read_size, QtProgressCallback callback, const FileSys::VirtualDir& src, const FileSys::VirtualDir& dest, bool full);
|
||||||
bool RomFSRawCopy(size_t total_size, size_t& read_size, QtProgressCallback callback,
|
|
||||||
const FileSys::VirtualDir& src, const FileSys::VirtualDir& dest, bool full);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // QT_ROM_UTIL_H
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
// SPDX-FileCopyrightText: 2013 Diego Gutierrez (diegog@unizar.es)
|
// SPDX-FileCopyrightText: 2013 Diego Gutierrez (diegog@unizar.es)
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef AREATEX_H
|
#pragma once
|
||||||
#define AREATEX_H
|
|
||||||
|
|
||||||
#define AREATEX_WIDTH 160
|
#define AREATEX_WIDTH 160
|
||||||
#define AREATEX_HEIGHT 560
|
#define AREATEX_HEIGHT 560
|
||||||
|
|
@ -11219,5 +11218,3 @@ static const unsigned char areaTexBytes[] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
// SPDX-FileCopyrightText: 2013 Diego Gutierrez (diegog@unizar.es)
|
// SPDX-FileCopyrightText: 2013 Diego Gutierrez (diegog@unizar.es)
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef SEARCHTEX_H
|
#pragma once
|
||||||
#define SEARCHTEX_H
|
|
||||||
|
|
||||||
#define SEARCHTEX_WIDTH 64
|
#define SEARCHTEX_WIDTH 64
|
||||||
#define SEARCHTEX_HEIGHT 16
|
#define SEARCHTEX_HEIGHT 16
|
||||||
|
|
@ -84,5 +83,3 @@ static const unsigned char searchTexBytes[] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef DATA_DIALOG_H
|
#pragma once
|
||||||
#define DATA_DIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "frontend_common/data_manager.h"
|
#include "frontend_common/data_manager.h"
|
||||||
|
|
@ -47,5 +46,3 @@ private:
|
||||||
|
|
||||||
std::optional<std::string> selectProfile();
|
std::optional<std::string> selectProfile();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATA_DIALOG_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef MIGRATION_DIALOG_H
|
#pragma once
|
||||||
#define MIGRATION_DIALOG_H
|
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
@ -29,5 +28,3 @@ private:
|
||||||
|
|
||||||
QAbstractButton* m_clickedButton;
|
QAbstractButton* m_clickedButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MIGRATION_DIALOG_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef MIGRATION_WORKER_H
|
#pragma once
|
||||||
#define MIGRATION_WORKER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "common/fs/path_util.h"
|
#include "common/fs/path_util.h"
|
||||||
|
|
@ -73,5 +72,3 @@ private:
|
||||||
MigrationStrategy strategy;
|
MigrationStrategy strategy;
|
||||||
QString success_text = tr("Data was migrated successfully.");
|
QString success_text = tr("Data was migrated successfully.");
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MIGRATION_WORKER_H
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#ifndef RYUJINX_DIALOG_H
|
#pragma once
|
||||||
#define RYUJINX_DIALOG_H
|
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
@ -28,5 +27,3 @@ private:
|
||||||
std::filesystem::path m_eden;
|
std::filesystem::path m_eden;
|
||||||
std::filesystem::path m_ryu;
|
std::filesystem::path m_ryu;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RYUJINX_DIALOG_H
|
|
||||||
|
|
|
||||||
40
tools/cpp-lint.sh
Executable file
40
tools/cpp-lint.sh
Executable file
|
|
@ -0,0 +1,40 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
# tools/../
|
||||||
|
ROOTDIR=$(CDPATH='' cd -- "$(dirname -- "$0")/../" && pwd)
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "-- $*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $0 [command]
|
||||||
|
|
||||||
|
Dumb script that serves as a ad-hoc cpp-linter
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
once Check for #pragma once prescence in header files
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
case "$1" in
|
||||||
|
once)
|
||||||
|
find "$ROOTDIR/src" -type f -name "*.h" -exec grep -L "#pragma once" {} +
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
osdef)
|
||||||
|
find "$ROOTDIR/src" -type f -name "*.h" -exec grep -nw "ANDROID" {} +
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*) usage ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift
|
||||||
|
done
|
||||||
Loading…
Add table
Reference in a new issue