From 211748e65a2eab15c0c79d9ef3cf0b5527b772bd Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Tue, 26 Apr 2016 13:01:22 +0000 Subject: [PATCH] Replace bit mask hex values with shifts --- src/common.h | 8 ++++---- strophe.h | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common.h b/src/common.h index 1817164..6cade0f 100644 --- a/src/common.h +++ b/src/common.h @@ -133,10 +133,10 @@ struct _xmpp_handlist_t { #define MAX_DOMAIN_LEN 256 -#define SASL_MASK_PLAIN 0x01 -#define SASL_MASK_DIGESTMD5 0x02 -#define SASL_MASK_ANONYMOUS 0x04 -#define SASL_MASK_SCRAMSHA1 0x08 +#define SASL_MASK_PLAIN (1 << 0) +#define SASL_MASK_DIGESTMD5 (1 << 1) +#define SASL_MASK_ANONYMOUS (1 << 2) +#define SASL_MASK_SCRAMSHA1 (1 << 3) enum { XMPP_PORT_CLIENT = 5222, diff --git a/strophe.h b/strophe.h index 737b0a2..b47da68 100644 --- a/strophe.h +++ b/strophe.h @@ -158,6 +158,11 @@ xmpp_log_t *xmpp_get_default_logger(xmpp_log_level_t level); typedef struct _xmpp_conn_t xmpp_conn_t; typedef struct _xmpp_stanza_t xmpp_stanza_t; +/* connection flags */ +#define XMPP_CONN_FLAG_DISABLE_TLS (1UL << 0) +#define XMPP_CONN_FLAG_MANDATORY_TLS (1UL << 1) +#define XMPP_CONN_FLAG_LEGACY_SSL (1UL << 2) + /* connect callback */ typedef enum { XMPP_CONN_CONNECT, @@ -192,10 +197,6 @@ typedef enum { XMPP_SE_XML_NOT_WELL_FORMED } xmpp_error_type_t; -#define XMPP_CONN_FLAG_DISABLE_TLS 0x0001 -#define XMPP_CONN_FLAG_MANDATORY_TLS 0x0002 -#define XMPP_CONN_FLAG_LEGACY_SSL 0x0004 - typedef struct { xmpp_error_type_t type; char *text;