summaryrefslogtreecommitdiff
path: root/flattree.c
diff options
context:
space:
mode:
author Andre Przywara <andre.przywara@arm.com> 2020-10-12 17:19:43 +0100
committer David Gibson <david@gibson.dropbear.id.au> 2020-10-13 15:56:53 +1100
commite1147b159e9209e1c3102f350445ba9927048b4d (patch)
tree7a0a4d903b1e3fdfca097f46890b66d2ebc3d4ea /flattree.c
parent04cf1fdc0fcf471c2e77376101bda65f727b3812 (diff)
dtc: Fix signedness comparisons warnings: change types
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in various parts of dtc. Many variables are using signed types unnecessarily, as we never use negative value in them. Change their types to be unsigned, to prevent issues with comparisons. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201012161948.23994-7-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'flattree.c')
-rw-r--r--flattree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/flattree.c b/flattree.c
index 07f10d2..4659afb 100644
--- a/flattree.c
+++ b/flattree.c
@@ -149,7 +149,7 @@ static void asm_emit_align(void *e, int a)
static void asm_emit_data(void *e, struct data d)
{
FILE *f = e;
- int off = 0;
+ unsigned int off = 0;
struct marker *m = d.markers;
for_each_marker_of_type(m, LABEL)
@@ -219,7 +219,7 @@ static struct emitter asm_emitter = {
static int stringtable_insert(struct data *d, const char *str)
{
- int i;
+ unsigned int i;
/* FIXME: do this more efficiently? */
@@ -345,7 +345,7 @@ static void make_fdt_header(struct fdt_header *fdt,
void dt_to_blob(FILE *f, struct dt_info *dti, int version)
{
struct version_info *vi = NULL;
- int i;
+ unsigned int i;
struct data blob = empty_data;
struct data reservebuf = empty_data;
struct data dtbuf = empty_data;
@@ -446,7 +446,7 @@ static void dump_stringtable_asm(FILE *f, struct data strbuf)
void dt_to_asm(FILE *f, struct dt_info *dti, int version)
{
struct version_info *vi = NULL;
- int i;
+ unsigned int i;
struct data strbuf = empty_data;
struct reserve_info *re;
const char *symprefix = "dt";