Update .clang-format to change assingment, comment and macro formatting

This commit is contained in:
Maschell 2022-02-03 14:08:08 +01:00
parent 114f5b08f0
commit 7eb5d075f3
16 changed files with 107 additions and 106 deletions

View File

@ -2,7 +2,8 @@
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
@ -56,7 +57,7 @@ SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false

View File

@ -243,7 +243,7 @@ bool ElfUtils::elfLinkOne(char type, size_t offset, int32_t addend, uint32_t des
return false;
}
freeSlot->trampolin[0] = 0x3D600000 | ((((uint32_t) value) >> 16) & 0x0000FFFF);// lis r11, real_addr@h
freeSlot->trampolin[0] = 0x3D600000 | ((((uint32_t) value) >> 16) & 0x0000FFFF); // lis r11, real_addr@h
freeSlot->trampolin[1] = 0x616B0000 | (((uint32_t) value) & 0x0000ffff); // ori r11, r11, real_addr@l
freeSlot->trampolin[2] = 0x7D6903A6; // mtctr r11
freeSlot->trampolin[3] = 0x4E800420; // bctr

View File

@ -35,16 +35,16 @@ int32_t CFile::open(const std::string &filepath, eOpenTypes mode) {
switch (mode) {
default:
case ReadOnly:// file must exist
case ReadOnly: // file must exist
openMode = O_RDONLY;
break;
case WriteOnly:// file will be created / zerod
case WriteOnly: // file will be created / zerod
openMode = O_TRUNC | O_CREAT | O_WRONLY;
break;
case ReadWrite:// file must exist
case ReadWrite: // file must exist
openMode = O_RDWR;
break;
case Append:// append to file, file will be created if missing. write only
case Append: // append to file, file will be created if missing. write only
openMode = O_CREAT | O_APPEND | O_WRONLY;
break;
}

View File

@ -110,7 +110,7 @@ int main(int argc, char **argv) {
auto handle = IOS_Open("/dev/mcp", IOS_OPEN_READ);
if (handle >= 0) {
int in = 0xF9;// IPC_CUSTOM_COPY_ENVIRONMENT_PATH
int in = 0xF9; // IPC_CUSTOM_COPY_ENVIRONMENT_PATH
if (IOS_Ioctl(handle, 100, &in, sizeof(in), environmentPath, sizeof(environmentPath)) == IOS_ERROR_OK) {
DEBUG_FUNCTION_LINE("Boot into %s", environmentPath);
}

View File

@ -248,7 +248,7 @@ char *StringTools::str_replace(char *orig, char *rep, char *with) {
char *tmp; // varies
int len_rep; // length of rep (the string to remove)
int len_with; // length of with (the string to replace rep with)
int len_front;// distance between rep and end of last rep
int len_front; // distance between rep and end of last rep
int count; // number of replacements
// sanity checks and initialization
@ -256,7 +256,7 @@ char *StringTools::str_replace(char *orig, char *rep, char *with) {
return NULL;
len_rep = strlen(rep);
if (len_rep == 0)
return NULL;// empty rep causes infinite loop during count
return NULL; // empty rep causes infinite loop during count
if (!with)
with = (char *) "";
len_with = strlen(with);
@ -282,7 +282,7 @@ char *StringTools::str_replace(char *orig, char *rep, char *with) {
len_front = ins - orig;
tmp = strncpy(tmp, orig, len_front) + len_front;
tmp = strcpy(tmp, with) + len_with;
orig += len_front + len_rep;// move to next "end of rep"
orig += len_front + len_rep; // move to next "end of rep"
}
strcpy(tmp, orig);
return result;

View File

@ -7,7 +7,7 @@
uint32_t moduleLogInit = false;
uint32_t cafeLogInit = false;
uint32_t udpLogInit = false;
#endif// DEBUG
#endif // DEBUG
void initLogging() {
#ifdef DEBUG
@ -15,7 +15,7 @@ void initLogging() {
cafeLogInit = WHBLogCafeInit();
udpLogInit = WHBLogUdpInit();
}
#endif// DEBUG
#endif // DEBUG
}
void deinitLogging() {
@ -32,5 +32,5 @@ void deinitLogging() {
WHBLogUdpDeinit();
udpLogInit = false;
}
#endif// DEBUG
#endif // DEBUG
}