Skip to content

Commit

Permalink
Format code and add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Apr 27, 2022
1 parent 9e5e7dd commit 11e89b0
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/FileInfos.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once
#include "utils/logger.h"
#include "utils/utils.h"
#include <coreinit/mcp.h>
#include <mutex>
#include <string>
#include <wuhb_utils/utils.h>
#include "utils/utils.h"

class FileInfos {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/fs/FileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FileReader {

virtual bool isReady();

virtual uint32_t getHandle(){
virtual uint32_t getHandle() {
return reinterpret_cast<uint32_t>(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fs/FileReaderWUHB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <coreinit/cache.h>
#include <wuhb_utils/utils.h>

FileReaderWUHB::FileReaderWUHB(const std::shared_ptr<FileInfos>& info, const std::string &relativeFilepath, bool autoUnmount) {
FileReaderWUHB::FileReaderWUHB(const std::shared_ptr<FileInfos> &info, const std::string &relativeFilepath, bool autoUnmount) {
if (!info) {
DEBUG_FUNCTION_LINE_ERR("Info was NULL");
return;
Expand Down
2 changes: 1 addition & 1 deletion src/fs/FileReaderWUHB.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FileReaderWUHB : public FileReader {
bool autoUnmount = false;

public:
explicit FileReaderWUHB(const std::shared_ptr<FileInfos>& info, const std::string &relativeFilepath, bool autoUnmount);
explicit FileReaderWUHB(const std::shared_ptr<FileInfos> &info, const std::string &relativeFilepath, bool autoUnmount);
~FileReaderWUHB() override;
int64_t read(uint8_t *buffer, uint32_t size) override;
bool isReady() override;
Expand Down
6 changes: 1 addition & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ACPMetaXml gLaunchXML __attribute__((section(".data")));
MCPTitleListType current_launched_title_info __attribute__((section(".data")));
BOOL gHomebrewLaunched __attribute__((section(".data")));


std::mutex fileInfosMutex;
std::forward_list<std::shared_ptr<FileInfos>> fileInfos;

Expand Down Expand Up @@ -238,12 +237,9 @@ void readCustomTitlesFromSD() {
}





auto repl = "fs:/vol/external01/";
auto input = dirList.GetFilepath(i);
const char * relativeFilepath;
const char *relativeFilepath;

if (std::string_view(input).starts_with(repl)) {
relativeFilepath = &input[strlen(repl)];
Expand Down
8 changes: 4 additions & 4 deletions src/utils/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
extern "C" {
#endif

#define LOG_APP_TYPE "P"
#define LOG_APP_NAME "homebrew_on_menu"
#define LOG_APP_TYPE "P"
#define LOG_APP_NAME "homebrew_on_menu"

#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)

#define LOG(LOG_FUNC, FMT, ARGS...) LOG_EX(LOG_FUNC, "", "", FMT, ##ARGS)

Expand Down
3 changes: 2 additions & 1 deletion src/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <cstdint>
#include <forward_list>
#include <malloc.h>
#include <memory>
#include <mutex>

uint32_t hash_string(const char *);

Expand All @@ -29,4 +31,3 @@ bool remove_locked_first_if(std::mutex &mutex, std::forward_list<T, Allocator> &
}
return false;
}

0 comments on commit 11e89b0

Please sign in to comment.