>From fecf12cdfbad86e82ad188e70d50e384d9d70441 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 2 May 2014 09:34:28 +0200 Subject: [PATCH 1/8] squash_me to sss_dbus: implement API --- src/lib/dbus/sss_dbus_parser.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/dbus/sss_dbus_parser.c b/src/lib/dbus/sss_dbus_parser.c index 6ebccb6fc96372b6dcb9139c6c7a8a9069b6f237..c7e041b4aff8f54c5da3d60a4abf28e5e34c7819 100644 --- a/src/lib/dbus/sss_dbus_parser.c +++ b/src/lib/dbus/sss_dbus_parser.c @@ -54,7 +54,7 @@ do { \ data_type, field, done) \ do { \ dbus_type val; \ - int i; \ + unsigned int i; \ \ attr->type = attr_type; \ if (attr->num_values == 0) { \ @@ -73,7 +73,7 @@ do { \ dbus_message_iter_get_basic(iter, &val); \ attr->data.field[i] = val; \ \ - if (!dbus_message_iter_next(iter) && i < attr->num_values - 1) { \ + if (!dbus_message_iter_next(iter) && i + 1 < attr->num_values) { \ ret = SSS_DBUS_INTERNAL_ERROR; \ goto done; \ } \ @@ -86,7 +86,7 @@ static unsigned int sss_dbus_get_array_length(DBusMessageIter *iter) { DBusMessageIter array_iter; - size_t size; + unsigned int size; dbus_message_iter_recurse(iter, &array_iter); @@ -177,7 +177,7 @@ sss_dbus_parse_array(sss_dbus_ctx *ctx, sss_dbus_attr *attr) { DBusMessageIter array_iter; - sss_dbus_error ret; + sss_dbus_error ret = 0; attr->num_values = sss_dbus_get_array_length(iter); dbus_message_iter_recurse(iter, &array_iter); @@ -214,7 +214,7 @@ sss_dbus_parse_array(sss_dbus_ctx *ctx, case DBUS_TYPE_STRING: case DBUS_TYPE_OBJECT_PATH: ; const char *val; - int i; + unsigned int i; attr->type = SSS_DBUS_ATTR_TYPE_STRING; if (attr->num_values == 0) { @@ -240,7 +240,7 @@ sss_dbus_parse_array(sss_dbus_ctx *ctx, } if (!dbus_message_iter_next(&array_iter) - && i < attr->num_values - 1) { + && i + 1 < attr->num_values) { ret = SSS_DBUS_INTERNAL_ERROR; goto done; } @@ -395,7 +395,7 @@ sss_dbus_parse_attr_list(sss_dbus_ctx *ctx, const char *name = NULL; unsigned int num_values; sss_dbus_error ret; - int i; + unsigned int i; dbus_message_iter_init(msg, &iter); -- 1.9.0