aboutsummaryrefslogtreecommitdiffstats
path: root/treesource.c
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2017-03-10 03:28:43 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2017-03-10 03:28:43 +0000
commitf059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f (patch)
tree74d52c3db99ba80520d6142e9bc77e2802093021 /treesource.c
parentb903311b940763cafe4fb3d8ab3da9c135c17b0c (diff)
downloadsrc-f059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f.tar.gz
src-f059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f.zip
Import dtc 1.4.3vendor/dtc/1.4.3
Notes
Notes: svn path=/vendor/dtc/dist/; revision=314985 svn path=/vendor/dtc/1.4.3/; revision=314986; tag=vendor/dtc/1.4.3
Diffstat (limited to 'treesource.c')
-rw-r--r--treesource.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/treesource.c b/treesource.c
index bf7a626e18ab..c9d8967969f9 100644
--- a/treesource.c
+++ b/treesource.c
@@ -25,12 +25,12 @@ extern FILE *yyin;
extern int yyparse(void);
extern YYLTYPE yylloc;
-struct boot_info *the_boot_info;
+struct dt_info *parser_output;
bool treesource_error;
-struct boot_info *dt_from_source(const char *fname)
+struct dt_info *dt_from_source(const char *fname)
{
- the_boot_info = NULL;
+ parser_output = NULL;
treesource_error = false;
srcfile_push(fname);
@@ -43,7 +43,7 @@ struct boot_info *dt_from_source(const char *fname)
if (treesource_error)
die("Syntax error parsing input tree\n");
- return the_boot_info;
+ return parser_output;
}
static void write_prefix(FILE *f, int level)
@@ -109,7 +109,7 @@ static void write_propval_string(FILE *f, struct data val)
break;
case '\0':
fprintf(f, "\", ");
- while (m && (m->offset < i)) {
+ while (m && (m->offset <= (i + 1))) {
if (m->type == LABEL) {
assert(m->offset == (i+1));
fprintf(f, "%s: ", m->ref);
@@ -178,7 +178,7 @@ static void write_propval_bytes(FILE *f, struct data val)
m = m->next;
}
- fprintf(f, "%02hhx", *bp++);
+ fprintf(f, "%02hhx", (unsigned char)(*bp++));
if ((const void *)bp >= propend)
break;
fprintf(f, " ");
@@ -263,13 +263,13 @@ static void write_tree_source_node(FILE *f, struct node *tree, int level)
}
-void dt_to_source(FILE *f, struct boot_info *bi)
+void dt_to_source(FILE *f, struct dt_info *dti)
{
struct reserve_info *re;
fprintf(f, "/dts-v1/;\n\n");
- for (re = bi->reservelist; re; re = re->next) {
+ for (re = dti->reservelist; re; re = re->next) {
struct label *l;
for_each_label(re->labels, l)
@@ -279,6 +279,6 @@ void dt_to_source(FILE *f, struct boot_info *bi)
(unsigned long long)re->re.size);
}
- write_tree_source_node(f, bi->dt, 0);
+ write_tree_source_node(f, dti->dt, 0);
}