]> Nishi Git Mirror - dataworks.git/commitdiff
format
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 26 Jun 2024 02:44:03 +0000 (02:44 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 26 Jun 2024 02:44:03 +0000 (02:44 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@439 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Library/exec.c
Library/parser.c
Makefiles/common.mk

index d3281008370b269e3b67adc917be34ecec7af739..5a8ef5fb71069c5cf6aef5debc68c57f11d58a42 100644 (file)
@@ -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;
                                                }
index 3444f199249e3cdc42bba6896c097012f9bd715b..ed3242988a30c338896df1af209169916d0ad9e5 100644 (file)
@@ -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;
index 0bfe492464c85032e180965d3ae435eb3a2fa47f..c616e4a0136318e7113dbfe4a387757b639bdcc5 100644 (file)
@@ -51,7 +51,7 @@ replace:
         done
 
 format:
-       clang-format -i $(FILES)
+       clang-format --verbose -i $(FILES)
 
 clean:
        $(MAKE) -C ./Grammar clean $(COMPILE_FLAGS)