From 446dffa7f6abf5400adac9c7814440b5af3b7edd Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Wed, 10 Aug 2016 09:45:36 -0400 Subject: [PATCH] GH1383: Add casts to ERR_PACK MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Emilia Käsper (Merged from https://github.com/openssl/openssl/pull/1385 --- include/openssl/err.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/openssl/err.h b/include/openssl/err.h index fdffd66db0..f9390919ab 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -133,11 +133,13 @@ typedef struct err_state_st { # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ERR_PACK(l,f,r) \ - ( ((unsigned int)((l) & 0x0FF) << 24L) | (((f) & 0xFFF) << 12L) | ((r) & 0xFFF) ) -# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) -# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) -# define ERR_GET_REASON(l) (int)((l)&0xfffL) +# define ERR_PACK(l,f,r) ( \ + (((unsigned int)(l) & 0x0FF) << 24L) | \ + (((unsigned int)(f) & 0xFFF) << 12L) | \ + (((unsigned int)(r) & 0xFFF) ) ) +# define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) +# define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) +# define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) /* OS functions */ # define SYS_F_FOPEN 1 -- 2.25.1