summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-12-20 11:00:53 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2020-01-03 11:34:37 +0100
commit20eceef4c7a1310321cf85e7a96ef167ab477862 (patch)
tree7c839ecb817130b1efbb6841ecca0f2034686f3d
parent0fa5dc501dc018105ecae5cbadf7bc87af0987f8 (diff)
downloadgnutls-20eceef4c7a1310321cf85e7a96ef167ab477862.tar.gz
Fix "left shift cannot be represented in type 'int'" in hello_ext.[ch]
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--lib/hello_ext.c2
-rw-r--r--lib/hello_ext.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/hello_ext.c b/lib/hello_ext.c
index 33eaa27b10..0c6c0dca01 100644
--- a/lib/hello_ext.c
+++ b/lib/hello_ext.c
@@ -520,7 +520,7 @@ int _gnutls_hello_ext_pack(gnutls_session_t session, gnutls_buffer_st *packed)
BUFFER_APPEND_NUM(packed, 0);
for (i = 0; i <= GNUTLS_EXTENSION_MAX_VALUE; i++) {
- if (session->internals.used_exts & (1<<i)) {
+ if (session->internals.used_exts & (1U << i)) {
ext = gid_to_ext_entry(session, i);
if (ext == NULL)
diff --git a/lib/hello_ext.h b/lib/hello_ext.h
index f2dfd7ff6a..38b28ae069 100644
--- a/lib/hello_ext.h
+++ b/lib/hello_ext.h
@@ -160,7 +160,7 @@ typedef struct hello_ext_entry_st {
inline static unsigned
_gnutls_hello_ext_is_present(gnutls_session_t session, extensions_t id)
{
- if ((1 << id) & session->internals.used_exts)
+ if (session->internals.used_exts & (1U << id))
return 1;
return 0;
@@ -184,7 +184,7 @@ unsigned _gnutls_hello_ext_save(gnutls_session_t session,
return 0;
}
- session->internals.used_exts |= (1 << id);
+ session->internals.used_exts |= (1U << id);
return 1;
}