]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc: Align a few integer types
authorVolker Lendecke <vl@samba.org>
Thu, 31 Dec 2020 09:16:21 +0000 (10:16 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Jan 2021 00:10:30 +0000 (00:10 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/rpc/binding.c

index 0a78be5bf16d93718711ff3e92c975c64e9c5142..29be6ae16b293281863c38fcb589f41ced9e3a00 100644 (file)
@@ -213,7 +213,7 @@ _PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_bi
 {
        char *s = talloc_strdup(mem_ctx, "");
        char *o = s;
-       int i;
+       size_t i;
        const char *t_name = NULL;
        bool option_section = false;
        const char *target_hostname = NULL;
@@ -1208,7 +1208,7 @@ static NTSTATUS dcerpc_floor_set_rhs_data(TALLOC_CTX *mem_ctx,
 
 enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
 {
-       int i;
+       size_t i;
 
        /* Find a transport that has 'prot' as 4th protocol */
        for (i=0;i<ARRAY_SIZE(transports);i++) {
@@ -1224,7 +1224,7 @@ enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
 
 _PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower)
 {
-       int i;
+       size_t i;
 
        /* Find a transport that matches this tower */
        for (i=0;i<ARRAY_SIZE(transports);i++) {
@@ -1250,7 +1250,7 @@ _PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_towe
 
 _PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t)
 {
-       int i;
+       size_t i;
 
        for (i=0; i<ARRAY_SIZE(transports); i++) {
                if (t == transports[i].transport) {
@@ -1458,7 +1458,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
                                             struct epm_tower *tower)
 {
        const enum epm_protocol *protseq = NULL;
-       int num_protocols = -1, i;
+       size_t i, num_protocols;
        struct ndr_syntax_id abstract_syntax;
        NTSTATUS status;
 
@@ -1471,7 +1471,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
                }
        }
 
-       if (num_protocols == -1) {
+       if (i == ARRAY_SIZE(transports)) {
                DEBUG(0, ("Unable to find transport with id '%d'\n", binding->transport));
                return NT_STATUS_UNSUCCESSFUL;
        }