Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
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: true
AfterStruct: true
AfterFunction: true
AfterNamespace: false
AfterUnion: true
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: 3
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
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ name: C/C++ CI
on: [push, pull_request]

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 ./include ./samples ./libraries -e *.txt

build:
name: ubuntu-18.04
runs-on: ubuntu-18.04
runs-on: ubuntu-18.04
needs: clang-format
container: devkitpro/devkitppc:latest

steps:
- uses: actions/checkout@v1
with:
submodules: true


- name: install cmake
run: |
apt-get install -y cmake
Expand Down
12 changes: 5 additions & 7 deletions include/arpa/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ ntohs(uint16_t netshort);
in_addr_t
inet_addr(const char *cp);

int
inet_aton(const char *cp,
struct in_addr *inp);
int inet_aton(const char *cp,
struct in_addr *inp);

char *
inet_ntoa(struct in_addr in);
Expand All @@ -38,10 +37,9 @@ inet_ntop(int af,
char *dst,
socklen_t size);

int
inet_pton(int af,
const char *src,
void *dst);
int inet_pton(int af,
const char *src,
void *dst);

#ifdef __cplusplus
}
Expand Down
9 changes: 4 additions & 5 deletions include/avm/drc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ extern "C" {

typedef enum AVMDrcScanMode
{
AVM_DRC_SCAN_MODE_UNKNOWN_0 = 0,
AVM_DRC_SCAN_MODE_UNKNOWN_1 = 1,
AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3,
AVM_DRC_SCAN_MODE_UNKNOWN_0 = 0,
AVM_DRC_SCAN_MODE_UNKNOWN_1 = 1,
AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3,
AVM_DRC_SCAN_MODE_UNKNOWN_255 = 255,
} AVMDrcScanMode;

BOOL
AVMGetDRCScanMode(AVMDrcScanMode *outScanMode);
BOOL AVMGetDRCScanMode(AVMDrcScanMode *outScanMode);

#ifdef __cplusplus
}
Expand Down
53 changes: 21 additions & 32 deletions include/coreinit/alarm.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include "thread.h"
#include "threadqueue.h"
#include "time.h"
#include <wut.h>

/**
* \defgroup coreinit_alarms Alarms
Expand Down Expand Up @@ -123,32 +123,28 @@ WUT_CHECK_SIZE(OSAlarm, 0x58);
/**
* Cancel an alarm.
*/
BOOL
OSCancelAlarm(OSAlarm *alarm);
BOOL OSCancelAlarm(OSAlarm *alarm);


/**
* Cancel all alarms which have a matching tag set by OSSetAlarmTag.
*
* \param group The alarm tag to cancel.
*/
void
OSCancelAlarms(uint32_t group);
void OSCancelAlarms(uint32_t group);


/**
* Initialise an alarm structure.
*/
void
OSCreateAlarm(OSAlarm *alarm);
void OSCreateAlarm(OSAlarm *alarm);


/**
* Initialise an alarm structure with a name.
*/
void
OSCreateAlarmEx(OSAlarm *alarm,
const char *name);
void OSCreateAlarmEx(OSAlarm *alarm,
const char *name);


/**
Expand All @@ -161,16 +157,14 @@ OSGetAlarmUserData(OSAlarm *alarm);
/**
* Initialise an alarm queue structure.
*/
void
OSInitAlarmQueue(OSAlarmQueue *queue);
void OSInitAlarmQueue(OSAlarmQueue *queue);


/**
* Initialise an alarm queue structure with a name.
*/
void
OSInitAlarmQueueEx(OSAlarmQueue *queue,
const char *name);
void OSInitAlarmQueueEx(OSAlarmQueue *queue,
const char *name);


/**
Expand All @@ -180,10 +174,9 @@ OSInitAlarmQueueEx(OSAlarmQueue *queue,
* \param time The duration until the alarm should be triggered.
* \param callback The alarm callback to call when the alarm is triggered.
*/
BOOL
OSSetAlarm(OSAlarm *alarm,
OSTime time,
OSAlarmCallback callback);
BOOL OSSetAlarm(OSAlarm *alarm,
OSTime time,
OSAlarmCallback callback);


/**
Expand All @@ -194,34 +187,30 @@ OSSetAlarm(OSAlarm *alarm,
* \param interval The interval between triggers after the first trigger.
* \param callback The alarm callback to call when the alarm is triggered.
*/
BOOL
OSSetPeriodicAlarm(OSAlarm *alarm,
OSTime start,
OSTime interval,
OSAlarmCallback callback);
BOOL OSSetPeriodicAlarm(OSAlarm *alarm,
OSTime start,
OSTime interval,
OSAlarmCallback callback);


/**
* Set an alarm tag which is used in OSCancelAlarms for bulk cancellation.
*/
void
OSSetAlarmTag(OSAlarm *alarm,
uint32_t group);
void OSSetAlarmTag(OSAlarm *alarm,
uint32_t group);


/**
* Set alarm user data which is returned by OSGetAlarmUserData.
*/
void
OSSetAlarmUserData(OSAlarm *alarm,
void *data);
void OSSetAlarmUserData(OSAlarm *alarm,
void *data);


/**
* Sleep the current thread until the alarm has been triggered or cancelled.
*/
BOOL
OSWaitAlarm(OSAlarm *alarm);
BOOL OSWaitAlarm(OSAlarm *alarm);

#ifdef __cplusplus
}
Expand Down
26 changes: 11 additions & 15 deletions include/coreinit/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
extern "C" {
#endif

BOOL
OSCompareAndSwapAtomic(volatile uint32_t *ptr,
uint32_t compare,
uint32_t value);
BOOL OSCompareAndSwapAtomic(volatile uint32_t *ptr,
uint32_t compare,
uint32_t value);

BOOL
OSCompareAndSwapAtomicEx(volatile uint32_t *ptr,
uint32_t compare,
uint32_t value,
uint32_t *old);
BOOL OSCompareAndSwapAtomicEx(volatile uint32_t *ptr,
uint32_t compare,
uint32_t value,
uint32_t *old);

uint32_t
OSSwapAtomic(volatile uint32_t *ptr,
Expand All @@ -44,13 +42,11 @@ uint32_t
OSXorAtomic(volatile uint32_t *ptr,
uint32_t value);

BOOL
OSTestAndClearAtomic(volatile uint32_t *ptr,
uint32_t bit);
BOOL OSTestAndClearAtomic(volatile uint32_t *ptr,
uint32_t bit);

BOOL
OSTestAndSetAtomic(volatile uint32_t *ptr,
uint32_t bit);
BOOL OSTestAndSetAtomic(volatile uint32_t *ptr,
uint32_t bit);

#ifdef __cplusplus
}
Expand Down
26 changes: 11 additions & 15 deletions include/coreinit/atomic64.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ uint64_t
OSSetAtomic64(volatile uint64_t *ptr,
uint64_t value);

BOOL
OSCompareAndSwapAtomic64(volatile uint64_t *ptr,
uint64_t compare,
uint64_t value);
BOOL OSCompareAndSwapAtomic64(volatile uint64_t *ptr,
uint64_t compare,
uint64_t value);

BOOL
OSCompareAndSwapAtomicEx64(volatile uint64_t *ptr,
uint64_t compare,
uint64_t value,
uint64_t *old);
BOOL OSCompareAndSwapAtomicEx64(volatile uint64_t *ptr,
uint64_t compare,
uint64_t value,
uint64_t *old);

uint64_t
OSSwapAtomic64(volatile uint64_t *ptr,
Expand All @@ -51,13 +49,11 @@ uint64_t
OSXorAtomic64(volatile uint64_t *ptr,
uint64_t value);

BOOL
OSTestAndClearAtomic64(volatile uint64_t *ptr,
uint32_t bit);
BOOL OSTestAndClearAtomic64(volatile uint64_t *ptr,
uint32_t bit);

BOOL
OSTestAndSetAtomic64(volatile uint64_t *ptr,
uint32_t bit);
BOOL OSTestAndSetAtomic64(volatile uint64_t *ptr,
uint32_t bit);

#ifdef __cplusplus
}
Expand Down
Loading