]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
mdssvc: Simplify sl_unpack_loop
authorVolker Lendecke <vl@samba.org>
Fri, 3 Aug 2018 10:38:47 +0000 (12:38 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Sep 2018 05:49:14 +0000 (07:49 +0200)
Move a variable declaration closer to its use, avoid a redundant
?true:false;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/rpc_server/mdssvc/marshalling.c

index 976702c49d4464cb588cd459e87cda999d98a87e..76db6ffa39e58f78e9e65e4041b36223eda9416f 100644 (file)
@@ -1058,7 +1058,6 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
        int i, toc_index, subcount;
        uint64_t result;
        sl_nil_t nil;
-       sl_bool_t b;
        struct sl_tag tag, cpx_tag;
 
        while (count > 0) {
@@ -1119,8 +1118,9 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
                        count -= subcount;
                        break;
 
-               case SQ_TYPE_BOOL:
-                       b = tag.count != 0 ? true : false;
+               case SQ_TYPE_BOOL: {
+                       sl_bool_t b = (tag.count != 0);
+
                        result = dalloc_add_copy(query, &b, sl_bool_t);
                        if (result != 0) {
                                return -1;
@@ -1128,6 +1128,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
                        offset += tag.size;
                        count--;
                        break;
+               }
 
                case SQ_TYPE_INT64:
                        subcount = sl_unpack_ints(query, buf, offset, bufsize, encoding);