Commits

Fuzhou Chen committed c81206f

[Fix] Build break on MSVC.

Seems clang didn't strictly follow C coding rule. Fix them as expected.

Comments (0)

Files changed (2)

src/utest/esch_t_pair.c

     esch_gc* gc = NULL;
     esch_vector* root = NULL;
     const size_t len = 10; 
-    esch_pair* pairs[len];
+    esch_pair* pairs[10];
     size_t i = 0, count = 0;
     esch_value value1, value2, data;
     esch_iterator iter;

src/utest/esch_t_vector.c

     esch_byte bval = '\0';
     esch_unicode uval = 0;
     esch_value value2;
+    esch_iterator iter;
 
     ret = esch_vector_new(config, &vec);
     ESCH_TEST_CHECK(ret == ESCH_OK, "Failed to create vector", ret);
                     "Bad value: element 4", ESCH_ERROR_INVALID_STATE);
 
     esch_log_info(g_testLog, "Case 3: Enumerate via iterator");
-    esch_iterator iter;
     ret = esch_object_get_iterator(ESCH_CAST_TO_OBJECT(vec), &iter);
     ESCH_TEST_CHECK(ret == ESCH_OK, "Can't get iterator", ret);
     for (i = 0; i < 5; ++i) {