summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2013-10-28 21:06:53 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2013-10-28 21:06:53 +1100
commit17625371eeea2fa7257361163c52d336a1a98ebc (patch)
tree9d6ebe9b93acaa2b962d2a6993b4e3b00ce0c708 /data.c
parent79eebb23dbf1f6eeff1789cd0d6f1c1fe620a487 (diff)
downloaddevice-tree-compiler-17625371eeea2fa7257361163c52d336a1a98ebc.tar.gz
Use stdbool more widely
We already use the C99 bool type from stdbool.h in a few places. However there are many other places we represent boolean values as plain ints. This patch changes that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'data.c')
-rw-r--r--data.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/data.c b/data.c
index 4a40c5b..4c50b12 100644
--- a/data.c
+++ b/data.c
@@ -250,20 +250,20 @@ struct data data_add_marker(struct data d, enum markertype type, char *ref)
return data_append_markers(d, m);
}
-int data_is_one_string(struct data d)
+bool data_is_one_string(struct data d)
{
int i;
int len = d.len;
if (len == 0)
- return 0;
+ return false;
for (i = 0; i < len-1; i++)
if (d.val[i] == '\0')
- return 0;
+ return false;
if (d.val[len-1] != '\0')
- return 0;
+ return false;
- return 1;
+ return true;
}