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>
This commit is contained in:
Andre Przywara 2020-10-12 17:19:43 +01:00 committed by David Gibson
parent 04cf1fdc0f
commit e1147b159e
5 changed files with 14 additions and 14 deletions

View file

@ -29,11 +29,11 @@ char *yaml_error_name[] = {
(emitter)->problem, __func__, __LINE__); \
})
static void yaml_propval_int(yaml_emitter_t *emitter, struct marker *markers, char *data, int len, int width)
static void yaml_propval_int(yaml_emitter_t *emitter, struct marker *markers, char *data, unsigned int len, int width)
{
yaml_event_t event;
void *tag;
int off, start_offset = markers->offset;
unsigned int off, start_offset = markers->offset;
switch(width) {
case 1: tag = "!u8"; break;
@ -112,7 +112,7 @@ static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len)
static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
{
yaml_event_t event;
int len = prop->val.len;
unsigned int len = prop->val.len;
struct marker *m = prop->val.markers;
/* Emit the property name */