]> andersk Git - libyaml.git/blobdiff - tests/run-dumper.c
New upstream version 0.2.2
[libyaml.git] / tests / run-dumper.c
index 6236ee1eaa7f95ebce60a56a2f858de0da10a8b0..04c5beeafa5798aeb22cc4163c2763ef6a5fdccf 100644 (file)
@@ -79,10 +79,12 @@ error:
 int compare_nodes(yaml_document_t *document1, int index1,
         yaml_document_t *document2, int index2, int level)
 {
-    if (level++ > 1000) return 0;
-    yaml_node_t *node1 = yaml_document_get_node(document1, index1);
-    yaml_node_t *node2 = yaml_document_get_node(document2, index2);
     int k;
+    yaml_node_t *node1;
+    yaml_node_t *node2;
+    if (level++ > 1000) return 0;
+    node1 = yaml_document_get_node(document1, index1);
+    node2 = yaml_document_get_node(document2, index2);
 
     assert(node1);
     assert(node2);
@@ -180,8 +182,8 @@ int print_output(char *name, unsigned char *buffer, size_t size, int count)
         if (feof(file)) break;
     }
     fclose(file);
-    printf("#### (length: %zd)\n", total_size);
-    printf("OUTPUT:\n%s#### (length: %zd)\n", buffer, size);
+    printf("#### (length: %ld)\n", (long)total_size);
+    printf("OUTPUT:\n%s#### (length: %ld)\n", buffer, (long)size);
     return 0;
 }
 
@@ -304,7 +306,7 @@ main(int argc, char *argv[])
             yaml_document_delete(documents+k);
         }
 
-        printf("PASSED (length: %zd)\n", written);
+        printf("PASSED (length: %ld)\n", (long)written);
         print_output(argv[number], buffer, written, -1);
     }
 
This page took 0.027538 seconds and 4 git commands to generate.