From: Rich Salz Date: Wed, 10 Aug 2016 13:45:36 +0000 (-0400) Subject: GH1383: Add casts to ERR_PACK X-Git-Tag: OpenSSL_1_1_0~234 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=446dffa7f6abf5400adac9c7814440b5af3b7edd;p=oweals%2Fopenssl.git GH1383: Add casts to ERR_PACK Reviewed-by: Emilia Käsper (Merged from https://github.com/openssl/openssl/pull/1385 --- 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