summaryrefslogtreecommitdiff
path: root/dtc.h
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-10-12 17:19:43 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-10-13 15:56:53 +1100
commite1147b159e9209e1c3102f350445ba9927048b4d (patch)
tree7a0a4d903b1e3fdfca097f46890b66d2ebc3d4ea /dtc.h
parent04cf1fdc0fcf471c2e77376101bda65f727b3812 (diff)
downloaddevice-tree-compiler-e1147b159e9209e1c3102f350445ba9927048b4d.tar.gz
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 'dtc.h')
-rw-r--r--dtc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/dtc.h b/dtc.h
index a08f415..d3e82fb 100644
--- a/dtc.h
+++ b/dtc.h
@@ -105,13 +105,13 @@ extern const char *markername(enum markertype markertype);
struct marker {
enum markertype type;
- int offset;
+ unsigned int offset;
char *ref;
struct marker *next;
};
struct data {
- int len;
+ unsigned int len;
char *val;
struct marker *markers;
};
@@ -129,7 +129,7 @@ size_t type_marker_length(struct marker *m);
void data_free(struct data d);
-struct data data_grow_for(struct data d, int xlen);
+struct data data_grow_for(struct data d, unsigned int xlen);
struct data data_copy_mem(const char *mem, int len);
struct data data_copy_escape_string(const char *s, int len);
@@ -253,7 +253,7 @@ void append_to_property(struct node *node,
const char *get_unitname(struct node *node);
struct property *get_property(struct node *node, const char *propname);
cell_t propval_cell(struct property *prop);
-cell_t propval_cell_n(struct property *prop, int n);
+cell_t propval_cell_n(struct property *prop, unsigned int n);
struct property *get_property_by_label(struct node *tree, const char *label,
struct node **node);
struct marker *get_marker_label(struct node *tree, const char *label,