add BLOBMSG_TYPE_BOOL as an alias for BLOBMSG_TYPE_INT8

This commit is contained in:
Felix Fietkau 2011-07-29 12:56:18 +02:00
parent ed9b5c986b
commit abbc140e8d
2 changed files with 3 additions and 2 deletions

View file

@ -31,7 +31,8 @@ enum blobmsg_type {
BLOBMSG_TYPE_INT16,
BLOBMSG_TYPE_INT8,
__BLOBMSG_TYPE_LAST,
BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1
BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1,
BLOBMSG_TYPE_BOOL = BLOBMSG_TYPE_INT8,
};
struct blobmsg_hdr {

View file

@ -228,7 +228,7 @@ static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, boo
data_str = buf;
switch(blob_id(attr)) {
case BLOBMSG_TYPE_INT8:
case BLOBMSG_TYPE_BOOL:
sprintf(buf, "%s", *(uint8_t *)data ? "true" : "false");
break;
case BLOBMSG_TYPE_INT32: