diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..beacb20 --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +--- +Language: Cpp +UseTab: Always +TabWidth: 8 +AlignConsecutiveAssignments: + Enabled: true +AlignConsecutiveDeclarations: + Enabled: true +IndentWidth: 8 +PointerAlignment: Left +ColumnLimit: 0 +AllowShortIfStatementsOnASingleLine: Always +AllowShortBlocksOnASingleLine: Never +AllowShortFunctionsOnASingleLine: Empty +AllowShortLoopsOnASingleLine: true +SpaceBeforeParens: Never +AlignEscapedNewlines: DontAlign +SortIncludes: false +AllowShortEnumsOnASingleLine: false +#IndentPPDirectives: AfterHash diff --git a/client/main.c b/client/main.c index 1f3fc8a..1ebae01 100644 --- a/client/main.c +++ b/client/main.c @@ -2,38 +2,38 @@ MwWidget root, window, opengl; -static void resize(MwWidget handle, void* user, void* client){ +static void resize(MwWidget handle, void* user, void* client) { int ww = MwGetInteger(window, MwNwidth); int wh = MwGetInteger(window, MwNheight); MwVaApply(opengl, - MwNwidth, ww, - MwNheight, wh, - NULL); + MwNwidth, ww, + MwNheight, wh, + NULL); glViewport(0, 0, ww, wh); } -static void tick(MwWidget handle, void* user, void* client){ +static void tick(MwWidget handle, void* user, void* client) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); MwOpenGLSwapBuffer(opengl); } -static void* gl_load(const char* name){ +static void* gl_load(const char* name) { return MwOpenGLGetProcAddress(opengl, name); } -int main(){ +int main() { MwLibraryInit(); root = MwVaCreateWidget(NULL, "root", NULL, 0, 0, 0, 0, - MwNwaitMS, 15, - NULL); + MwNwaitMS, 15, + NULL); window = MwVaCreateWidget(MwWindowClass, "main", root, MwDEFAULT, MwDEFAULT, 800, 600, - MwNtitle, "AssaultFish", - NULL); + MwNtitle, "AssaultFish", + NULL); opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 0, 0, 800, 600); diff --git a/external/milsko b/external/milsko index 012650f..7574969 160000 --- a/external/milsko +++ b/external/milsko @@ -1 +1 @@ -Subproject commit 012650f06f489d1219ba492118d2f35d25e93ce2 +Subproject commit 75749697ba25330127fdca110fda9098d65719e3 diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..65d311b --- /dev/null +++ b/format.sh @@ -0,0 +1,2 @@ +#!/bin/sh +clang-format --verbose -i `find include server client -name "*.c" -or -name "*.h"` diff --git a/include/af_common.h b/include/af_common.h index 59cf4bc..0c52f46 100644 --- a/include/af_common.h +++ b/include/af_common.h @@ -20,7 +20,7 @@ /* should be broadcasted! otherwise other user wouldn't know */ typedef struct af_pkt_join { unsigned char length; - char* name; + char* name; } af_pkt_join_t; #endif diff --git a/server/main.c b/server/main.c index 21b281d..6107ece 100644 --- a/server/main.c +++ b/server/main.c @@ -1,4 +1,4 @@ #include -int main(int argc, char** argv){ +int main(int argc, char** argv) { }