scottmac Sat Jul 5 00:28:16 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/hash hash.c
Log:
Fix break caused by previous commit, warning and remove zend_get_parameters()
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash.c?r1=1.18.2.5.2.7.2.9&r2=1.18.2.5.2.7.2.10&diff_format=u
Index: php-src/ext/hash/hash.c
diff -u php-src/ext/hash/hash.c:1.18.2.5.2.7.2.9
php-src/ext/hash/hash.c:1.18.2.5.2.7.2.10
--- php-src/ext/hash/hash.c:1.18.2.5.2.7.2.9 Fri Jul 4 21:00:16 2008
+++ php-src/ext/hash/hash.c Sat Jul 5 00:28:16 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hash.c,v 1.18.2.5.2.7.2.9 2008/07/04 21:00:16 pajoye Exp $ */
+/* $Id: hash.c,v 1.18.2.5.2.7.2.10 2008/07/05 00:28:16 scottmac Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -620,30 +620,26 @@
}
len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name,
strlen(algorithm.mhash_name));
- {
- char name[128];
- memcpy(name, buf, len+1);
- REGISTER_LONG_CONSTANT(name, algorithm.value, CONST_CS
| CONST_PERSISTENT);
- }
+ zend_register_long_constant(buf, len + 1, algorithm.value,
CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
}
}
PHP_FUNCTION(mhash)
{
- zval **z_algorithm;
+ zval *z_algorithm;
int algorithm;
- if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_ex(1, &z_algorithm) ==
FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(1 TSRMLS_CC, "z", &z_algorithm) == FAILURE) {
+ return;
}
- algorithm = Z_LVAL_PP(z_algorithm);
+ algorithm = Z_LVAL_P(z_algorithm);
/* need to conver the first parameter from int to string */
if (algorithm >= 0 && algorithm < MHASH_NUM_ALGOS) {
struct mhash_bc_entry algorithm_lookup =
mhash_to_hash[algorithm];
if (algorithm_lookup.hash_name) {
- ZVAL_STRING(*z_algorithm, algorithm_lookup.hash_name,
1);
+ ZVAL_STRING(z_algorithm, algorithm_lookup.hash_name, 1);
}
}
@@ -754,8 +750,8 @@
ops->hash_update(context,
&null, 1);
}
ops->hash_update(context, (unsigned
char *)padded_salt, salt_len);
- ops->hash_update(context, password,
password_len);
- ops->hash_final(digest, context);
+ ops->hash_update(context, (unsigned
char *)password, password_len);
+ ops->hash_final((unsigned char
*)digest, context);
memcpy( &key[i*block_size], digest,
block_size);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php