mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
apply clang format to generator
This commit is contained in:
parent
863602305a
commit
c7693f77d4
@ -1,13 +1,12 @@
|
|||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "json.hpp"
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include "json.hpp"
|
||||||
|
|
||||||
struct NidFuncTable {
|
struct NidFuncTable {
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
@ -26,11 +25,9 @@ void GenerateCodeFiles(
|
|||||||
std::string headerName(lowModName + ".h");
|
std::string headerName(lowModName + ".h");
|
||||||
std::string headerCode("#pragma once\n\n#include \"library_common.h\" \n\n");
|
std::string headerCode("#pragma once\n\n#include \"library_common.h\" \n\n");
|
||||||
std::string trimmedName = moduleName;
|
std::string trimmedName = moduleName;
|
||||||
if (moduleName.find("libSce") != std::string::npos)
|
if (moduleName.find("libSce") != std::string::npos) {
|
||||||
{
|
trimmedName = moduleName.substr(6, moduleName.size() - 1);
|
||||||
trimmedName = moduleName.substr(6, moduleName.size()-1);
|
} else if (moduleName.find("lib") != std::string::npos) {
|
||||||
}
|
|
||||||
else if (moduleName.find("lib") != std::string::npos) {
|
|
||||||
trimmedName = moduleName.substr(3, moduleName.size() - 1);
|
trimmedName = moduleName.substr(3, moduleName.size() - 1);
|
||||||
trimmedName[0] = toupper(trimmedName[0]);
|
trimmedName[0] = toupper(trimmedName[0]);
|
||||||
}
|
}
|
||||||
@ -64,11 +61,11 @@ void GenerateCodeFiles(
|
|||||||
for (const auto& lib : libName2FuncTableMap) {
|
for (const auto& lib : libName2FuncTableMap) {
|
||||||
for (const auto& func : lib.second) {
|
for (const auto& func : lib.second) {
|
||||||
if (funcImplementation.find(func.m_funcName) == funcImplementation.end()) {
|
if (funcImplementation.find(func.m_funcName) == funcImplementation.end()) {
|
||||||
const std::string funcDeclare(
|
const std::string funcDeclare("int PS4_SYSV_ABI " + func.m_funcName + "()\n" +
|
||||||
"int PS4_SYSV_ABI " + func.m_funcName + "()\n" + "{\n" +
|
"{\n" +
|
||||||
" PRINT_UNIMPLEMENTED_FUNCTION_NAME();\n"
|
" PRINT_UNIMPLEMENTED_FUNCTION_NAME();\n"
|
||||||
" return ORBIS_OK;\n" +
|
" return ORBIS_OK;\n" +
|
||||||
"}\n\n");
|
"}\n\n");
|
||||||
sourceCode += funcDeclare;
|
sourceCode += funcDeclare;
|
||||||
funcImplementation.insert(func.m_funcName);
|
funcImplementation.insert(func.m_funcName);
|
||||||
}
|
}
|
||||||
@ -77,9 +74,10 @@ void GenerateCodeFiles(
|
|||||||
sourceCode += "void Register" + moduleName + "(Loader::SymbolsResolver * sym) {\n";
|
sourceCode += "void Register" + moduleName + "(Loader::SymbolsResolver * sym) {\n";
|
||||||
for (const auto& lib : libName2FuncTableMap) {
|
for (const auto& lib : libName2FuncTableMap) {
|
||||||
for (const auto& func : lib.second) {
|
for (const auto& func : lib.second) {
|
||||||
sourceCode += " LIB_FUNCTION(\"" + func.m_id + ", " + lib.first + " , " + std::to_string(func.m_libversion) + " , " + moduleName +
|
sourceCode += " LIB_FUNCTION(\"" + func.m_id + ", " + lib.first + " , " +
|
||||||
", " + std::to_string(func.m_version_major) + ", " +
|
std::to_string(func.m_libversion) + " , " + moduleName + ", " +
|
||||||
std::to_string(func.m_version_minor) + " , " + func.m_funcName + " ),\n";
|
std::to_string(func.m_version_major) + ", " +
|
||||||
|
std::to_string(func.m_version_minor) + " , " + func.m_funcName + " ),\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user