mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
Wconversion: workarounds for CentOS7
This commit is contained in:
parent
bf9c517b39
commit
d5618f6059
11 changed files with 39 additions and 16 deletions
|
@ -29,6 +29,9 @@
|
||||||
"linux-gentoo/x86_64-amd/gcc": {
|
"linux-gentoo/x86_64-amd/gcc": {
|
||||||
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G ZIP\";cmake .. ${cmake} && make -j4 && make -j DESTDIR=../destdir install && ctest -j4 --output-on-failure ${cpack}"
|
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G ZIP\";cmake .. ${cmake} && make -j4 && make -j DESTDIR=../destdir install && ctest -j4 --output-on-failure ${cpack}"
|
||||||
},
|
},
|
||||||
|
"linux-centos-7/x86_64-amd/gcc": {
|
||||||
|
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && make -j DESTDIR=../destdir install && ctest -j4 --output-on-failure ${cpack}"
|
||||||
|
},
|
||||||
"linux-centos-8/x86_64-amd/gcc": {
|
"linux-centos-8/x86_64-amd/gcc": {
|
||||||
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && make -j DESTDIR=../destdir install && ctest -j4 --output-on-failure ${cpack}"
|
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && make -j DESTDIR=../destdir install && ctest -j4 --output-on-failure ${cpack}"
|
||||||
},
|
},
|
||||||
|
@ -172,7 +175,7 @@
|
||||||
"mbedtls": {
|
"mbedtls": {
|
||||||
"cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITH_HTTP2=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_JOSE=1 -DCMAKE_BUILD_TYPE=DEBUG",
|
"cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITH_HTTP2=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_JOSE=1 -DCMAKE_BUILD_TYPE=DEBUG",
|
||||||
# no distro -devel package for mbedtls
|
# no distro -devel package for mbedtls
|
||||||
"platforms": "not linux-centos-8/x86_64-amd/gcc"
|
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc"
|
||||||
},
|
},
|
||||||
"noserver": {
|
"noserver": {
|
||||||
"cmake": "-DLWS_WITHOUT_SERVER=ON -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS=1"
|
"cmake": "-DLWS_WITHOUT_SERVER=ON -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS=1"
|
||||||
|
|
|
@ -366,7 +366,7 @@ retry_as_first:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*in == '\"') {
|
if (*in == '\"') {
|
||||||
s->inside_quote ^= 1;
|
s->inside_quote = !!((s->inside_quote ^ 1) & 1);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1323,7 +1323,7 @@ bail1:
|
||||||
case LMSPR_NEED_MORE:
|
case LMSPR_NEED_MORE:
|
||||||
break;
|
break;
|
||||||
case LMSPR_COMPLETED:
|
case LMSPR_COMPLETED:
|
||||||
par->consumed = (uint32_t)((unsigned int)par->consumed + (unsigned int)par->vbit.consumed);
|
par->consumed = (uint32_t)((unsigned int)par->consumed + (unsigned int)(unsigned char)par->vbit.consumed);
|
||||||
if (par->vbit.value >
|
if (par->vbit.value >
|
||||||
LWS_ARRAY_SIZE(property_valid)) {
|
LWS_ARRAY_SIZE(property_valid)) {
|
||||||
lwsl_notice("%s: undef prop id 0x%x\n",
|
lwsl_notice("%s: undef prop id 0x%x\n",
|
||||||
|
|
|
@ -36,6 +36,10 @@
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
|
|
||||||
|
/* work around CentOS 7 -Wconversion problem */
|
||||||
|
#undef RTA_ALIGNTO
|
||||||
|
#define RTA_ALIGNTO 4U
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lws_netlink_coldplug_done_cb(lws_sorted_usec_list_t *sul)
|
lws_netlink_coldplug_done_cb(lws_sorted_usec_list_t *sul)
|
||||||
{
|
{
|
||||||
|
|
|
@ -384,7 +384,7 @@ lws_ss_deserialize_parse(struct lws_ss_serialization_parser *par,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RPAR_LEN_LSB:
|
case RPAR_LEN_LSB:
|
||||||
par->rem |= (uint16_t)*cp++;
|
par->rem = (uint16_t)(par->rem | *cp++);
|
||||||
switch (par->type) {
|
switch (par->type) {
|
||||||
|
|
||||||
/* event loop side */
|
/* event loop side */
|
||||||
|
|
|
@ -532,7 +532,7 @@ lws_smd_msg_distribute(struct lws_context *ctx)
|
||||||
lws_smd_peer_t *pr = lws_container_of(p, lws_smd_peer_t, list);
|
lws_smd_peer_t *pr = lws_container_of(p, lws_smd_peer_t, list);
|
||||||
|
|
||||||
/* may destroy pr if zombie, hence _safe iterator */
|
/* may destroy pr if zombie, hence _safe iterator */
|
||||||
more |= (char)!!_lws_smd_msg_deliver_peer(ctx, pr);
|
more = (char)(more | !!_lws_smd_msg_deliver_peer(ctx, pr));
|
||||||
|
|
||||||
} lws_end_foreach_dll_safe(p, p1);
|
} lws_end_foreach_dll_safe(p, p1);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
|
||||||
|
|
||||||
/* Add leading zeroes if necessary */
|
/* Add leading zeroes if necessary */
|
||||||
if (tolen > i) {
|
if (tolen > i) {
|
||||||
memset(to, 0, tolen - i);
|
memset(to, 0, (size_t)(tolen - i));
|
||||||
to += tolen - i;
|
to += tolen - i;
|
||||||
}
|
}
|
||||||
while (i--) {
|
while (i--) {
|
||||||
|
|
|
@ -762,7 +762,11 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
||||||
#if defined(LWS_WITH_BORINGSSL)
|
#if defined(LWS_WITH_BORINGSSL)
|
||||||
(uint32_t)
|
(uint32_t)
|
||||||
#else
|
#else
|
||||||
|
#if (OPENSSL_VERSION_NUMBER >= 0x10003000l) /* not documented by openssl */
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
|
#else
|
||||||
|
(long)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
info->ssl_client_options_set);
|
info->ssl_client_options_set);
|
||||||
|
@ -774,7 +778,11 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
||||||
#if defined(LWS_WITH_BORINGSSL)
|
#if defined(LWS_WITH_BORINGSSL)
|
||||||
(uint32_t)
|
(uint32_t)
|
||||||
#else
|
#else
|
||||||
(unsigned long)
|
#if (OPENSSL_VERSION_NUMBER >= 0x10003000l) /* not documented by openssl */
|
||||||
|
(unsigned long)
|
||||||
|
#else
|
||||||
|
(long)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
info->ssl_client_options_clear);
|
info->ssl_client_options_clear);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -581,7 +581,11 @@ lws_tls_server_vhost_backend_init(const struct lws_context_creation_info *info,
|
||||||
#if defined(LWS_WITH_BORINGSSL)
|
#if defined(LWS_WITH_BORINGSSL)
|
||||||
(uint32_t)
|
(uint32_t)
|
||||||
#else
|
#else
|
||||||
(unsigned long)
|
#if (OPENSSL_VERSION_NUMBER >= 0x10003000l) /* not documented by openssl */
|
||||||
|
(unsigned long)
|
||||||
|
#else
|
||||||
|
(long)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
info->ssl_options_set);
|
info->ssl_options_set);
|
||||||
|
@ -593,7 +597,11 @@ lws_tls_server_vhost_backend_init(const struct lws_context_creation_info *info,
|
||||||
#if defined(LWS_WITH_BORINGSSL)
|
#if defined(LWS_WITH_BORINGSSL)
|
||||||
(uint32_t)
|
(uint32_t)
|
||||||
#else
|
#else
|
||||||
(unsigned long)
|
#if (OPENSSL_VERSION_NUMBER >= 0x10003000l) /* not documented by openssl */
|
||||||
|
(unsigned long)
|
||||||
|
#else
|
||||||
|
(long)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
info->ssl_options_clear);
|
info->ssl_options_clear);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -158,8 +158,8 @@ lws_context_init_ssl_library(const struct lws_context_creation_info *info)
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
openssl_mutexes = (pthread_mutex_t *)
|
openssl_mutexes = (pthread_mutex_t *)
|
||||||
OPENSSL_malloc(CRYPTO_num_locks() *
|
OPENSSL_malloc((size_t)((unsigned long)CRYPTO_num_locks() *
|
||||||
sizeof(openssl_mutexes[0]));
|
(unsigned long)sizeof(openssl_mutexes[0])));
|
||||||
|
|
||||||
for (n = 0; n < CRYPTO_num_locks(); n++)
|
for (n = 0; n < CRYPTO_num_locks(); n++)
|
||||||
pthread_mutex_init(&openssl_mutexes[n], NULL);
|
pthread_mutex_init(&openssl_mutexes[n], NULL);
|
||||||
|
|
|
@ -98,7 +98,7 @@ struct acme_connection {
|
||||||
|
|
||||||
size_t len_privkey_pem;
|
size_t len_privkey_pem;
|
||||||
|
|
||||||
unsigned int yes:2;
|
unsigned int yes;
|
||||||
unsigned int use:1;
|
unsigned int use:1;
|
||||||
unsigned int is_sni_02:1;
|
unsigned int is_sni_02:1;
|
||||||
};
|
};
|
||||||
|
@ -496,7 +496,7 @@ cb_authz(struct lejp_ctx *ctx, char reason)
|
||||||
if (s->use) {
|
if (s->use) {
|
||||||
lws_strncpy(s->challenge_uri, ctx->buf,
|
lws_strncpy(s->challenge_uri, ctx->buf,
|
||||||
sizeof(s->challenge_uri));
|
sizeof(s->challenge_uri));
|
||||||
s->yes |= 2;
|
s->yes = s->yes | 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case JAAZ_CHALLENGES_TOKEN:
|
case JAAZ_CHALLENGES_TOKEN:
|
||||||
|
@ -504,7 +504,7 @@ cb_authz(struct lejp_ctx *ctx, char reason)
|
||||||
if (s->use) {
|
if (s->use) {
|
||||||
lws_strncpy(s->chall_token, ctx->buf,
|
lws_strncpy(s->chall_token, ctx->buf,
|
||||||
sizeof(s->chall_token));
|
sizeof(s->chall_token));
|
||||||
s->yes |= 1;
|
s->yes = s->yes | 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -552,11 +552,11 @@ cb_chac(struct lejp_ctx *ctx, char reason)
|
||||||
lws_strncpy(s->status, ctx->buf, sizeof(s->status));
|
lws_strncpy(s->status, ctx->buf, sizeof(s->status));
|
||||||
break;
|
break;
|
||||||
case JCAC_URI:
|
case JCAC_URI:
|
||||||
s->yes |= 2;
|
s->yes = s->yes | 2;
|
||||||
break;
|
break;
|
||||||
case JCAC_TOKEN:
|
case JCAC_TOKEN:
|
||||||
lws_strncpy(s->chall_token, ctx->buf, sizeof(s->chall_token));
|
lws_strncpy(s->chall_token, ctx->buf, sizeof(s->chall_token));
|
||||||
s->yes |= 1;
|
s->yes = s->yes | 1;
|
||||||
break;
|
break;
|
||||||
case JCAC_DETAIL:
|
case JCAC_DETAIL:
|
||||||
lws_snprintf(s->detail, sizeof(s->detail), "%s", ctx->buf);
|
lws_snprintf(s->detail, sizeof(s->detail), "%s", ctx->buf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue