Mailing List Archive

svn commit: r1916299 - /httpd/httpd/trunk/modules/filters/mod_crypto.c
Author: ylavic
Date: Thu Mar 14 14:54:59 2024
New Revision: 1916299

URL: http://svn.apache.org/viewvc?rev=1916299&view=rev
Log:
mod_crypto: Fix warnings about signed bit fields.

The non-zero value for one bit field is -1:

mod_crypto.c|565 col 18| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
|| ctx->encrypt = 1;
|| ^ ~
mod_crypto.c|746 col 22| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
|| ctx->clength = 1;
|| ^ ~
mod_crypto.c|903 col 35| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
|| ctx->seen_eos = 1;
|| ^ ~
mod_crypto.c|960 col 22| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
|| ctx->clength = 1;
|| ^ ~

Use unsigned bit fields for struct crypto_ctx's members seen_eos, encrypt and clength.


Modified:
httpd/httpd/trunk/modules/filters/mod_crypto.c

Modified: httpd/httpd/trunk/modules/filters/mod_crypto.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_crypto.c?rev=1916299&r1=1916298&r2=1916299&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_crypto.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_crypto.c Thu Mar 14 14:54:59 2024
@@ -108,9 +108,9 @@ typedef struct crypto_ctx
apr_off_t remaining;
apr_off_t written;
apr_size_t osize;
- int seen_eos:1;
- int encrypt:1;
- int clength:1;
+ unsigned int seen_eos :1,
+ encrypt :1,
+ clength :1;
} crypto_ctx;

static const char *parse_pass_conf_binary(cmd_parms *cmd,