run clang-format
This commit is contained in:
parent
71385a1fd5
commit
80d2ed5180
4 changed files with 28 additions and 19 deletions
|
|
@ -1,2 +1,12 @@
|
||||||
---
|
---
|
||||||
BasedOnStyle: WebKit
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 4
|
||||||
|
ColumnLimit: 88
|
||||||
|
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||||
|
|
||||||
|
BinPackParameters: OnePerLine
|
||||||
|
|
||||||
|
AlignConsecutiveMacros: Consecutive
|
||||||
|
AlignEscapedNewlines: LeftWithLastLine
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
find . -regex '.*\.\(c\|h\)' -exec clang-format -i --sort-includes {} \;
|
find . -regex '.*\.\(c\|h\)' -not -path "./CMakeFiles/*" -exec clang-format -i --sort-includes {} \;
|
||||||
|
|
|
||||||
17
main.c
17
main.c
|
|
@ -28,11 +28,10 @@
|
||||||
|
|
||||||
Config *config = NULL;
|
Config *config = NULL;
|
||||||
|
|
||||||
int parseArguments(int, char**);
|
int parseArguments(int, char **);
|
||||||
void printHelp(void);
|
void printHelp(void);
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char **argv) {
|
||||||
{
|
|
||||||
if (parseArguments(argc, argv) != 0) {
|
if (parseArguments(argc, argv) != 0) {
|
||||||
printHelp();
|
printHelp();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -41,14 +40,13 @@ int main(int argc, char** argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int parseArguments(int argc, char** argv)
|
int parseArguments(int argc, char **argv) {
|
||||||
{
|
|
||||||
char configPath[1024];
|
char configPath[1024];
|
||||||
size_t configPathLength = 0;
|
size_t configPathLength = 0;
|
||||||
bool expectConfigPath = false;
|
bool expectConfigPath = false;
|
||||||
|
|
||||||
for (int argIndex = 1; argIndex < argc; argIndex++) {
|
for (int argIndex = 1; argIndex < argc; argIndex++) {
|
||||||
const char* arg = argv[argIndex];
|
const char *arg = argv[argIndex];
|
||||||
|
|
||||||
if (expectConfigPath) {
|
if (expectConfigPath) {
|
||||||
size_t length = strlen(arg);
|
size_t length = strlen(arg);
|
||||||
|
|
@ -65,7 +63,9 @@ int parseArguments(int argc, char** argv)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!expectConfigPath && (strncmp(arg, ARG_L_CONFIG_PATH, ARG_LEN_L_CONFIG_PATH) || strncmp(arg, ARG_S_CONFIG_PATH, ARG_LEN_S_CONFIG_PATH))) {
|
if (!expectConfigPath &&
|
||||||
|
(strncmp(arg, ARG_L_CONFIG_PATH, ARG_LEN_L_CONFIG_PATH) ||
|
||||||
|
strncmp(arg, ARG_S_CONFIG_PATH, ARG_LEN_S_CONFIG_PATH))) {
|
||||||
printf("Encountered config path argument.\n");
|
printf("Encountered config path argument.\n");
|
||||||
expectConfigPath = true;
|
expectConfigPath = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -80,7 +80,6 @@ int parseArguments(int argc, char** argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void printHelp(void)
|
void printHelp(void) {
|
||||||
{
|
|
||||||
/* TODO */
|
/* TODO */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
yaml.h
14
yaml.h
|
|
@ -4,13 +4,13 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
YAML_TYPE_STRING, /**< A value that represents a string. */
|
YAML_TYPE_STRING, /**< A value that represents a string. */
|
||||||
YAML_TYPE_NUMBER, /**< A value that represents a number. */
|
YAML_TYPE_NUMBER, /**< A value that represents a number. */
|
||||||
YAML_TYPE_OBJECT, /**< A value that represents an object. */
|
YAML_TYPE_OBJECT, /**< A value that represents an object. */
|
||||||
YAML_TYPE_ARRAY, /**< A value that represents an array. */
|
YAML_TYPE_ARRAY, /**< A value that represents an array. */
|
||||||
YAML_TYPE_TRUE, /**< A value that represents true. */
|
YAML_TYPE_TRUE, /**< A value that represents true. */
|
||||||
YAML_TYPE_FALSE, /**< A value that represents false. */
|
YAML_TYPE_FALSE, /**< A value that represents false. */
|
||||||
YAML_TYPE_NULL, /**< A value that represents null. */
|
YAML_TYPE_NULL, /**< A value that represents null. */
|
||||||
} yaml_type_t;
|
} yaml_type_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue