diff --git a/checks.c b/checks.c index a6037ed..322f085 100644 --- a/checks.c +++ b/checks.c @@ -2,6 +2,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2007. */ +#include #include "dtc.h" #include "srcpos.h" diff --git a/data.c b/data.c index 5b25aa0..7621491 100644 --- a/data.c +++ b/data.c @@ -2,8 +2,10 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. */ +#include #include "dtc.h" +#include "util.h" void data_free(struct data d) { diff --git a/dtc-lexer.l b/dtc-lexer.l index 1b129b1..b8c66cf 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -19,6 +19,8 @@ COMMENT "/*"([^*]|\*+[^*/])*\*+"/" LINECOMMENT "//".*\n %{ +#include + #include "dtc.h" #include "srcpos.h" #include "dtc-parser.tab.h" diff --git a/dtc-parser.y b/dtc-parser.y index e47f80d..45a699a 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -5,6 +5,7 @@ %locations %{ +#include #include #include diff --git a/dtc.c b/dtc.c index e506837..c66750e 100644 --- a/dtc.c +++ b/dtc.c @@ -3,6 +3,7 @@ * (C) Copyright David Gibson , IBM Corporation. 2005. */ +#include #include #include "dtc.h" diff --git a/dtc.h b/dtc.h index 473552e..791f815 100644 --- a/dtc.h +++ b/dtc.h @@ -13,16 +13,12 @@ #include #include #include -#include -#include #include #include #include #include -#include "util.h" - #ifdef DEBUG #define debug(...) printf(__VA_ARGS__) #else diff --git a/fdtdump.c b/fdtdump.c index f90b281..2f21967 100644 --- a/fdtdump.c +++ b/fdtdump.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/flattree.c b/flattree.c index 7d50b3d..14546f9 100644 --- a/flattree.c +++ b/flattree.c @@ -2,6 +2,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. */ +#include #include "dtc.h" #include "srcpos.h" diff --git a/fstree.c b/fstree.c index 0f9a534..41327a7 100644 --- a/fstree.c +++ b/fstree.c @@ -3,11 +3,13 @@ * (C) Copyright David Gibson , IBM Corporation. 2005. */ -#include "dtc.h" - #include +#include #include +#include "dtc.h" +#include "util.h" + static struct node *read_fstree(const char *dirname) { DIR *d; diff --git a/srcpos.c b/srcpos.c index c42eba8..7d4c7e3 100644 --- a/srcpos.c +++ b/srcpos.c @@ -7,6 +7,7 @@ #define _GNU_SOURCE #endif +#include #include #include "dtc.h" diff --git a/tests/add_subnode_with_nops.c b/tests/add_subnode_with_nops.c index 29bd34b..d723d41 100644 --- a/tests/add_subnode_with_nops.c +++ b/tests/add_subnode_with_nops.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/appendprop1.c b/tests/appendprop1.c index a7b502a..4350905 100644 --- a/tests/appendprop1.c +++ b/tests/appendprop1.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/appendprop2.c b/tests/appendprop2.c index a96c88a..9502b9e 100644 --- a/tests/appendprop2.c +++ b/tests/appendprop2.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/appendprop_addrrange.c b/tests/appendprop_addrrange.c index 543a799..f3f0fcf 100644 --- a/tests/appendprop_addrrange.c +++ b/tests/appendprop_addrrange.c @@ -13,6 +13,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" int main(int argc, char *argv[]) { diff --git a/tests/check_full.c b/tests/check_full.c index b6d5fc3..931f016 100644 --- a/tests/check_full.c +++ b/tests/check_full.c @@ -14,6 +14,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" static int expect_bad; /* = 0 */ diff --git a/tests/check_header.c b/tests/check_header.c index ca26ec1..bd2a51b 100644 --- a/tests/check_header.c +++ b/tests/check_header.c @@ -10,6 +10,7 @@ #include #include "tests.h" +#include "util.h" static void *dtdup(void *dt) { diff --git a/tests/check_path.c b/tests/check_path.c index c3ae15d..9fa0b6b 100644 --- a/tests/check_path.c +++ b/tests/check_path.c @@ -10,6 +10,7 @@ #include #include "tests.h" +#include "util.h" #define CHECK(code) \ { \ diff --git a/tests/dtb_reverse.c b/tests/dtb_reverse.c index 95b6c1c..7552362 100644 --- a/tests/dtb_reverse.c +++ b/tests/dtb_reverse.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define CHECK(code) \ { \ diff --git a/tests/get_path.c b/tests/get_path.c index da8b26a..7612c2d 100644 --- a/tests/get_path.c +++ b/tests/get_path.c @@ -13,6 +13,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define POISON ('\xff') diff --git a/tests/incbin.c b/tests/incbin.c index 36ff669..d8c6ed4 100644 --- a/tests/incbin.c +++ b/tests/incbin.c @@ -14,6 +14,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define CHUNKSIZE 1024 diff --git a/tests/move_and_save.c b/tests/move_and_save.c index a89f8de..2133958 100644 --- a/tests/move_and_save.c +++ b/tests/move_and_save.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" int main(int argc, char *argv[]) { diff --git a/tests/nopulate.c b/tests/nopulate.c index 06f8369..32624a7 100644 --- a/tests/nopulate.c +++ b/tests/nopulate.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" static int nopulate_struct(char *buf, const char *fdt) { diff --git a/tests/open_pack.c b/tests/open_pack.c index 6ed4df7..6f18705 100644 --- a/tests/open_pack.c +++ b/tests/open_pack.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" int main(int argc, char *argv[]) { diff --git a/tests/overlay.c b/tests/overlay.c index 2d27918..fb05712 100644 --- a/tests/overlay.c +++ b/tests/overlay.c @@ -11,6 +11,7 @@ #include #include "tests.h" +#include "util.h" #define CHECK(code) \ { \ diff --git a/tests/overlay_bad_fixup.c b/tests/overlay_bad_fixup.c index 029bc79..13eee82 100644 --- a/tests/overlay_bad_fixup.c +++ b/tests/overlay_bad_fixup.c @@ -11,6 +11,7 @@ #include #include "tests.h" +#include "util.h" #define CHECK(code, expected) \ { \ diff --git a/tests/rw_oom.c b/tests/rw_oom.c index 39fc312..9407589 100644 --- a/tests/rw_oom.c +++ b/tests/rw_oom.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" /* This is not derived programmatically. May require adjustment to changes. */ #define SPACE 285 diff --git a/tests/rw_tree1.c b/tests/rw_tree1.c index 1fe2351..ca2e132 100644 --- a/tests/rw_tree1.c +++ b/tests/rw_tree1.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/setprop.c b/tests/setprop.c index c2d1365..a005abe 100644 --- a/tests/setprop.c +++ b/tests/setprop.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 #define NEW_STRING "here is quite a long test string, blah blah blah" @@ -78,6 +79,6 @@ int main(int argc, char *argv[]) FAIL("Failed to set \"prop-u64\" to 0x%016llx: %s", TEST_VALUE64_1, fdt_strerror(err)); check_getprop_64(fdt, 0, "prop-u64", TEST_VALUE64_1); - + PASS(); } diff --git a/tests/setprop_inplace.c b/tests/setprop_inplace.c index 4818216..f8d97dd 100644 --- a/tests/setprop_inplace.c +++ b/tests/setprop_inplace.c @@ -16,6 +16,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" int main(int argc, char *argv[]) { diff --git a/tests/sw_states.c b/tests/sw_states.c index 42d57ae..b4d0113 100644 --- a/tests/sw_states.c +++ b/tests/sw_states.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/sw_tree1.c b/tests/sw_tree1.c index 7aa808c..112a58c 100644 --- a/tests/sw_tree1.c +++ b/tests/sw_tree1.c @@ -15,6 +15,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 @@ -48,7 +49,7 @@ static void realloc_fdt(void **fdt, size_t *size, bool created) fdt_strerror(err)); } else { FAIL("Ran out of space"); - } + } return; case REALLOC: @@ -128,7 +129,7 @@ int main(int argc, char *argv[]) size = strtoul(argv[1], &endp, 0); if (*endp == '\0') alloc_mode = FIXED; - else + else CONFIG("Bad allocation mode \"%s\" specified", argv[1]); } diff --git a/tests/tests.h b/tests/tests.h index 578d8c1..a666942 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -116,6 +116,4 @@ void *load_blob_arg(int argc, char *argv[]); void save_blob(const char *filename, void *blob); void *open_blob_rw(const void *blob); -#include "util.h" - #endif /* TESTS_H */ diff --git a/tests/testutils.c b/tests/testutils.c index 6d69e87..d8760f9 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -19,6 +19,8 @@ #include #include +#include "util.h" + #ifdef NO_VALGRIND static inline void VALGRIND_MAKE_MEM_UNDEFINED(void *p, size_t len) { diff --git a/tests/treegen.c b/tests/treegen.c index 1f576b0..3e7a6f2 100644 --- a/tests/treegen.c +++ b/tests/treegen.c @@ -17,8 +17,8 @@ #include #include -#include "tests.h" #include "testdata.h" +#include "util.h" /* * Buffer with write cursor. Emit helpers write at the cursor, advance it, and diff --git a/tests/truncated_memrsv.c b/tests/truncated_memrsv.c index e9b18cc..84be238 100644 --- a/tests/truncated_memrsv.c +++ b/tests/truncated_memrsv.c @@ -14,6 +14,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 diff --git a/tests/unterminated_memrsv.c b/tests/unterminated_memrsv.c index a19dc2d..c2f7140 100644 --- a/tests/unterminated_memrsv.c +++ b/tests/unterminated_memrsv.c @@ -17,6 +17,7 @@ #include "tests.h" #include "testdata.h" +#include "util.h" #define SPACE 65536 @@ -57,7 +58,7 @@ int main(int argc, char *argv[]) if (err != -FDT_ERR_TRUNCATED) FAIL("fdt_del_mem_rsv() returned %d instead of -FDT_ERR_TRUNCATED", err); - + buf = xmalloc(SPACE); err = fdt_open_into(fdt, buf, SPACE); if (err != -FDT_ERR_TRUNCATED) diff --git a/treesource.c b/treesource.c index bf648bf..33036c2 100644 --- a/treesource.c +++ b/treesource.c @@ -2,6 +2,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. */ +#include #include "dtc.h" #include "srcpos.h" diff --git a/yamltree.c b/yamltree.c index 25fd25e..4df7948 100644 --- a/yamltree.c +++ b/yamltree.c @@ -5,10 +5,11 @@ * (C) Copyright David Gibson , IBM Corporation. 2005. */ -#include +#include #include + #include "dtc.h" -#include "srcpos.h" +#include "util.h" const char *yaml_error_name[] = { [YAML_NO_ERROR] = "no error",