comparison libpurple/tests/test_cipher.c @ 28789:c76eb1c6f6ac

Fix annoying, but generally useless warning.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 13 Dec 2009 02:36:08 +0000
parents fc5508709e74
children
comparison
equal deleted inserted replaced
28788:5152c6cea318 28789:c76eb1c6f6ac
140 #define SHA1_TEST(data, digest) { \ 140 #define SHA1_TEST(data, digest) { \
141 PurpleCipher *cipher = NULL; \ 141 PurpleCipher *cipher = NULL; \
142 PurpleCipherContext *context = NULL; \ 142 PurpleCipherContext *context = NULL; \
143 gchar cdigest[41]; \ 143 gchar cdigest[41]; \
144 gboolean ret = FALSE; \ 144 gboolean ret = FALSE; \
145 gchar *input = data; \
145 \ 146 \
146 cipher = purple_ciphers_find_cipher("sha1"); \ 147 cipher = purple_ciphers_find_cipher("sha1"); \
147 context = purple_cipher_context_new(cipher, NULL); \ 148 context = purple_cipher_context_new(cipher, NULL); \
148 \ 149 \
149 if((data)) { \ 150 if (input) { \
150 purple_cipher_context_append(context, (guchar *)(data), strlen((data))); \ 151 purple_cipher_context_append(context, (guchar *)input, strlen(input)); \
151 } else { \ 152 } else { \
152 gint j; \ 153 gint j; \
153 guchar buff[1000]; \ 154 guchar buff[1000]; \
154 \ 155 \
155 memset(buff, 'a', 1000); \ 156 memset(buff, 'a', 1000); \
200 #define SHA256_TEST(data, digest) { \ 201 #define SHA256_TEST(data, digest) { \
201 PurpleCipher *cipher = NULL; \ 202 PurpleCipher *cipher = NULL; \
202 PurpleCipherContext *context = NULL; \ 203 PurpleCipherContext *context = NULL; \
203 gchar cdigest[65]; \ 204 gchar cdigest[65]; \
204 gboolean ret = FALSE; \ 205 gboolean ret = FALSE; \
206 gchar *input = data; \
205 \ 207 \
206 cipher = purple_ciphers_find_cipher("sha256"); \ 208 cipher = purple_ciphers_find_cipher("sha256"); \
207 context = purple_cipher_context_new(cipher, NULL); \ 209 context = purple_cipher_context_new(cipher, NULL); \
208 \ 210 \
209 if((data)) { \ 211 if (input) { \
210 purple_cipher_context_append(context, (guchar *)(data), strlen((data))); \ 212 purple_cipher_context_append(context, (guchar *)input, strlen(input)); \
211 } else { \ 213 } else { \
212 gint j; \ 214 gint j; \
213 guchar buff[1000]; \ 215 guchar buff[1000]; \
214 \ 216 \
215 memset(buff, 'a', 1000); \ 217 memset(buff, 'a', 1000); \