diff options
author | Volker Lendecke <vl@samba.org> | 2019-01-24 10:37:21 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-02-03 13:52:29 +0100 |
commit | 64e05bc8c138e1155a27a992233015ebc0d91dbb (patch) | |
tree | ee66f064af26c095bccd17700b58466233fb0518 /librpc | |
parent | 9df23fe4e51227b3d5bcb074fe34d10f9e019a66 (diff) | |
download | samba-64e05bc8c138e1155a27a992233015ebc0d91dbb.tar.gz |
librpc: Solaris cc does not like unnamed struct members
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/ndr/ndr_compression.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/librpc/ndr/ndr_compression.c b/librpc/ndr/ndr_compression.c index f06a076a71f..c4a13a2f3ba 100644 --- a/librpc/ndr/ndr_compression.c +++ b/librpc/ndr/ndr_compression.c @@ -34,7 +34,7 @@ struct ndr_compression_state { uint8_t *dict; size_t dict_size; } mszip; - }; + } alg; }; static voidpf ndr_zlib_alloc(voidpf opaque, uInt items, uInt size) @@ -59,7 +59,7 @@ static enum ndr_err_code ndr_pull_compression_mszip_cab_chunk(struct ndr_pull *n DATA_BLOB plain_chunk; uint32_t plain_chunk_offset; uint32_t plain_chunk_size; - z_stream *z = state->mszip.z; + z_stream *z = state->alg.mszip.z; int z_ret; plain_chunk_size = decompressed_len; @@ -125,8 +125,8 @@ static enum ndr_err_code ndr_pull_compression_mszip_cab_chunk(struct ndr_pull *n * uncompressed output as dictionnary. */ - if (state->mszip.dict_size) { - z_ret = inflateSetDictionary(z, state->mszip.dict, state->mszip.dict_size); + if (state->alg.mszip.dict_size) { + z_ret = inflateSetDictionary(z, state->alg.mszip.dict, state->alg.mszip.dict_size); if (z_ret != Z_OK) { return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "zlib inflateSetDictionary error %s (%d) %s (PULL)", @@ -164,8 +164,8 @@ static enum ndr_err_code ndr_pull_compression_mszip_cab_chunk(struct ndr_pull *n * we can just store that instead of copying the memory over * the dict temp buffer. */ - state->mszip.dict = plain_chunk.data; - state->mszip.dict_size = plain_chunk.length; + state->alg.mszip.dict = plain_chunk.data; + state->alg.mszip.dict_size = plain_chunk.length; z_ret = inflateReset(z); if (z_ret != Z_OK) { @@ -217,7 +217,7 @@ static enum ndr_err_code ndr_push_compression_mszip_cab_chunk(struct ndr_push *n comp_chunk.data[0] = 'C'; comp_chunk.data[1] = 'K'; - z = state->mszip.z; + z = state->alg.mszip.z; z->next_in = plain_chunk.data; z->avail_in = plain_chunk.length; z->total_in = 0; @@ -234,8 +234,8 @@ static enum ndr_err_code ndr_push_compression_mszip_cab_chunk(struct ndr_push *n * same CFFOLDER as a dictionnary for the compression. */ - if (state->mszip.dict_size) { - z_ret = deflateSetDictionary(z, state->mszip.dict, state->mszip.dict_size); + if (state->alg.mszip.dict_size) { + z_ret = deflateSetDictionary(z, state->alg.mszip.dict, state->alg.mszip.dict_size); if (z_ret != Z_OK) { return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "zlib deflateSetDictionary error %s (%d) %s (PUSH)", @@ -274,7 +274,7 @@ static enum ndr_err_code ndr_push_compression_mszip_cab_chunk(struct ndr_push *n zError(z_ret), z_ret, z->msg); } - if (plain_chunk.length > talloc_array_length(state->mszip.dict)) { + if (plain_chunk.length > talloc_array_length(state->alg.mszip.dict)) { return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "zlib dict buffer is too big (PUSH)"); } @@ -289,8 +289,8 @@ static enum ndr_err_code ndr_push_compression_mszip_cab_chunk(struct ndr_push *n * still going to been valid for the lifetime of the * compressions state object. */ - memcpy(state->mszip.dict, plain_chunk.data, plain_chunk.length); - state->mszip.dict_size = plain_chunk.length; + memcpy(state->alg.mszip.dict, plain_chunk.data, plain_chunk.length); + state->alg.mszip.dict_size = plain_chunk.length; DEBUG(9,("MSZIP comp plain_chunk_size: %08X (%u) comp_chunk_size: %08X (%u)\n", (unsigned int)plain_chunk.length, @@ -805,11 +805,11 @@ static enum ndr_err_code generic_mszip_init(TALLOC_CTX *mem_ctx, z->zfree = ndr_zlib_free; z->opaque = mem_ctx; - state->mszip.z = z; - state->mszip.dict_size = 0; + state->alg.mszip.z = z; + state->alg.mszip.dict_size = 0; /* pre-alloc dictionnary */ - state->mszip.dict = talloc_array(mem_ctx, uint8_t, 0x8000); - NDR_ERR_HAVE_NO_MEMORY(state->mszip.dict); + state->alg.mszip.dict = talloc_array(mem_ctx, uint8_t, 0x8000); + NDR_ERR_HAVE_NO_MEMORY(state->alg.mszip.dict); return NDR_ERR_SUCCESS; } @@ -820,8 +820,8 @@ static void generic_mszip_free(struct ndr_compression_state *state) return; } - TALLOC_FREE(state->mszip.z); - TALLOC_FREE(state->mszip.dict); + TALLOC_FREE(state->alg.mszip.z); + TALLOC_FREE(state->alg.mszip.dict); } @@ -842,11 +842,11 @@ enum ndr_err_code ndr_pull_compression_state_init(struct ndr_pull *ndr, break; case NDR_COMPRESSION_MSZIP_CAB: NDR_CHECK(generic_mszip_init(ndr, s)); - z_ret = inflateInit2(s->mszip.z, -MAX_WBITS); + z_ret = inflateInit2(s->alg.mszip.z, -MAX_WBITS); if (z_ret != Z_OK) { return ndr_pull_error(ndr, NDR_ERR_COMPRESSION, "zlib inflateinit2 error %s (%d) %s (PULL)", - zError(z_ret), z_ret, s->mszip.z->msg); + zError(z_ret), z_ret, s->alg.mszip.z->msg); } break; default: @@ -897,7 +897,7 @@ enum ndr_err_code ndr_push_compression_state_init(struct ndr_push *ndr, break; case NDR_COMPRESSION_MSZIP_CAB: NDR_CHECK(generic_mszip_init(ndr, s)); - z_ret = deflateInit2(s->mszip.z, + z_ret = deflateInit2(s->alg.mszip.z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, @@ -906,7 +906,7 @@ enum ndr_err_code ndr_push_compression_state_init(struct ndr_push *ndr, if (z_ret != Z_OK) { return ndr_push_error(ndr, NDR_ERR_COMPRESSION, "zlib inflateinit2 error %s (%d) %s (PUSH)", - zError(z_ret), z_ret, s->mszip.z->msg); + zError(z_ret), z_ret, s->alg.mszip.z->msg); } break; default: |