Format the code via clang-format

This commit is contained in:
Maschell 2022-07-20 18:55:26 +02:00
parent 5325909776
commit 30038aa526
5 changed files with 117 additions and 27 deletions

67
.clang-format Normal file
View File

@ -0,0 +1,67 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never

View File

@ -6,8 +6,16 @@ on:
- main - main
jobs: jobs:
clang-format:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
build-binary: build-binary:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: build binary - name: build binary

View File

@ -3,8 +3,16 @@ name: CI-PR
on: [pull_request] on: [pull_request]
jobs: jobs:
clang-format:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
build-binary: build-binary:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: build binary - name: build binary

View File

@ -1,3 +1,5 @@
[![CI-Release](https://github.com/wiiu-env/LaunchInstaller/actions/workflows/ci.yml/badge.svg)](https://github.com/wiiu-env/LaunchInstaller/actions/workflows/ci.yml)
# LaunchInstaller # LaunchInstaller
## Usage ## Usage
@ -24,5 +26,9 @@ docker run -it --rm -v ${PWD}:/project launchinstaller-builder make
docker run -it --rm -v ${PWD}:/project launchinstaller-builder make clean docker run -it --rm -v ${PWD}:/project launchinstaller-builder make clean
``` ```
## Format the code via docker
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source -i`
## Credits ## Credits
Maschell Maschell

View File

@ -1,13 +1,13 @@
#include <string>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <coreinit/title.h>
#include <sysapp/title.h>
#include <sysapp/launch.h>
#include <coreinit/ios.h>
#include <coreinit/cache.h> #include <coreinit/cache.h>
#include <coreinit/debug.h> #include <coreinit/debug.h>
#include <coreinit/ios.h>
#include <coreinit/title.h>
#include <dirent.h>
#include <string.h>
#include <string>
#include <sys/types.h>
#include <sysapp/launch.h>
#include <sysapp/title.h>
#include <romfs_dev.h> #include <romfs_dev.h>
@ -66,7 +66,8 @@ int main(int argc, char **argv) {
std::string completePath = std::string("/vol/external01/") + bundle_path; std::string completePath = std::string("/vol/external01/") + bundle_path;
if (fopen(completePath.c_str(), "r") == NULL) { if (fopen(completePath.c_str(), "r") == NULL) {
OSFatal("\"sd:/wiiu/apps/PayloadLoaderInstaller.wuhb\" is missing on the sd card");; OSFatal("\"sd:/wiiu/apps/PayloadLoaderInstaller.wuhb\" is missing on the sd card");
;
} }
LOAD_REQUEST request; LOAD_REQUEST request;
@ -87,7 +88,7 @@ int main(int argc, char **argv) {
request.fileoffset = ((uint32_t *) &info.offset)[1]; request.fileoffset = ((uint32_t *) &info.offset)[1];
} }
strncat(request.path, bundle_path.c_str() , sizeof(request.path) - 1); strncat(request.path, bundle_path.c_str(), sizeof(request.path) - 1);
DCFlushRange(&request, sizeof(LOAD_REQUEST)); DCFlushRange(&request, sizeof(LOAD_REQUEST));
int mcpFd = IOS_Open("/dev/mcp", (IOSOpenMode) 0); int mcpFd = IOS_Open("/dev/mcp", (IOSOpenMode) 0);
@ -98,7 +99,7 @@ int main(int argc, char **argv) {
} }
uint64_t titleID = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_HEALTH_AND_SAFETY); uint64_t titleID = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_HEALTH_AND_SAFETY);
if( OSGetTitleID() == titleID){ if (OSGetTitleID() == titleID) {
OSRestartGame(); OSRestartGame();
} else { } else {
_SYSLaunchTitleWithStdArgsInNoSplash(titleID, 0); _SYSLaunchTitleWithStdArgsInNoSplash(titleID, 0);