From fb559c6ffd6ca9f09b0e4609efd3c38e6b51661d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 5 May 2009 09:08:33 +0000 Subject: Fix the macros. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@741 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/base64.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libssh/base64.c b/libssh/base64.c index 51563ef2..4c6f92d8 100644 --- a/libssh/base64.c +++ b/libssh/base64.c @@ -32,15 +32,15 @@ static char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/" ; -/* transformations */ -#define SET_A(n,i) do { n |= (i&63) <<18; } while (0) -#define SET_B(n,i) do { n |= (i&63) <<12; } while (0) -#define SET_C(n,i) do { n |= (i&63) << 6; } while (0) -#define SET_D(n,i) do { n |= (i&63); } while (0) - -#define GET_A(n) ((n & 0xff0000) >> 16) -#define GET_B(n) ((n & 0xff00) >> 8) -#define GET_C(n) (n & 0xff) +/* Transformations */ +#define SET_A(n, i) do { (n) |= ((i) & 63) <<18; } while (0) +#define SET_B(n, i) do { (n) |= ((i) & 63) <<12; } while (0) +#define SET_C(n, i) do { (n) |= ((i) & 63) << 6; } while (0) +#define SET_D(n, i) do { (n) |= ((i) & 63); } while (0) + +#define GET_A(n) (((n) & 0xff0000) >> 16) +#define GET_B(n) (((n) & 0xff00) >> 8) +#define GET_C(n) ((n) & 0xff) static int _base64_to_bin(unsigned char dest[3], const char *source, int num); static int get_equals(char *string); -- cgit v1.2.3