From: nishi Date: Wed, 26 Jun 2024 02:44:03 +0000 (+0000) Subject: format X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ca5e6ea13a317764c06deeee6d6cbbe181309a12;p=dataworks.git format git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@439 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Library/exec.c b/Library/exec.c index d328100..5a8ef5f 100644 --- a/Library/exec.c +++ b/Library/exec.c @@ -200,30 +200,27 @@ struct Node* parser_process(struct dataworks_db* db, struct Node* node, bool dol for(i = 0; node->nodes[i] != NULL; i++) { struct Node* r = parser_process(db, node->nodes[i], false); char t = __dw_get_node_type(r); - if(!( - (typ[i] == 'F' || typ[i] == 'I') && t == 'N' - || typ[i] == t - )){ + if(!((typ[i] == 'F' || typ[i] == 'I') && t == 'N' || typ[i] == t)) { newnode->errnum = DW_ERR_EXEC_TYPE_MISMATCH; } arr[i] = r; } arr[i] = NULL; - if(newnode->errnum == DW_ERR_SUCCESS){ + if(newnode->errnum == DW_ERR_SUCCESS) { void** fields = malloc(sizeof(*fields) * (i + 1)); fields[i] = NULL; int k; - for(k = 0; k < i; k++){ - if(typ[k] == DW_RECORD_STRING){ + for(k = 0; k < i; k++) { + if(typ[k] == DW_RECORD_STRING) { fields[k] = __dw_strdup(arr[k]->string); - }else if(typ[k] == DW_RECORD_LOGICAL){ + } else if(typ[k] == DW_RECORD_LOGICAL) { fields[k] = malloc(1); *(char*)fields[k] = arr[k]->logical; - }else if(typ[k] == DW_RECORD_FLOATING){ + } else if(typ[k] == DW_RECORD_FLOATING) { fields[k] = malloc(sizeof(double)); *(double*)fields[k] = arr[k]->number; - }else if(typ[k] == DW_RECORD_INTEGER){ + } else if(typ[k] == DW_RECORD_INTEGER) { fields[k] = malloc(8); *(uint64_t*)fields[k] = arr[k]->number; } diff --git a/Library/parser.c b/Library/parser.c index 3444f19..ed32429 100644 --- a/Library/parser.c +++ b/Library/parser.c @@ -102,10 +102,10 @@ void __dw_free_node2(struct Node* node, bool top) { if(!top) free(node); } -char __dw_get_node_type(struct Node* node){ - if(node->type == 'N' || node->type == 'L'){ +char __dw_get_node_type(struct Node* node) { + if(node->type == 'N' || node->type == 'L') { return node->type; - }else if(node->string != NULL){ + } else if(node->string != NULL) { return 'S'; } return 0; diff --git a/Makefiles/common.mk b/Makefiles/common.mk index 0bfe492..c616e4a 100644 --- a/Makefiles/common.mk +++ b/Makefiles/common.mk @@ -51,7 +51,7 @@ replace: done format: - clang-format -i $(FILES) + clang-format --verbose -i $(FILES) clean: $(MAKE) -C ./Grammar clean $(COMPILE_FLAGS)