mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/hash: Make return type zend_result for serialize function typedef
This commit is contained in:
committed by
Gina Peter Banyard
parent
c26e77c4c5
commit
937c4e4ac6
@@ -229,7 +229,7 @@ static void one_to_buffer(size_t sz, unsigned char *buf, uint64_t val) {
|
||||
significant bits first. This allows 32-bit and 64-bit architectures to
|
||||
interchange serialized HashContexts. */
|
||||
|
||||
PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *hash, zval *zv, const char *spec) /* {{{ */
|
||||
PHP_HASH_API zend_result php_hash_serialize_spec(const php_hashcontext_object *hash, zval *zv, const char *spec) /* {{{ */
|
||||
{
|
||||
size_t pos = 0, max_alignment = 1;
|
||||
unsigned char *buf = (unsigned char *) hash->context;
|
||||
@@ -331,7 +331,7 @@ PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const z
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv) /* {{{ */
|
||||
PHP_HASH_API zend_result php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv) /* {{{ */
|
||||
{
|
||||
if (hash->ops->serialize_spec) {
|
||||
*magic = PHP_HASH_SERIALIZE_MAGIC_SPEC;
|
||||
|
||||
@@ -292,7 +292,7 @@ const php_hash_ops php_hash_sha3_##bits##_ops = { \
|
||||
#endif
|
||||
#define PHP_KECCAK_SPEC "b200IiIIB"
|
||||
|
||||
static int php_keccak_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
|
||||
static zend_result php_keccak_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
|
||||
{
|
||||
*magic = PHP_HASH_SERIALIZE_MAGIC_KECCAK;
|
||||
return php_hash_serialize_spec(hash, zv, PHP_KECCAK_SPEC);
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef void (*php_hash_init_func_t)(void *context, HashTable *args);
|
||||
typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count);
|
||||
typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context);
|
||||
typedef zend_result (*php_hash_copy_func_t)(const void *ops, const void *orig_context, void *dest_context);
|
||||
typedef int (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv);
|
||||
typedef zend_result (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv);
|
||||
typedef int (*php_hash_unserialize_func_t)(php_hashcontext_object *hash, zend_long magic, const zval *zv);
|
||||
|
||||
typedef struct _php_hash_ops {
|
||||
@@ -148,9 +148,9 @@ extern PHP_HASH_API zend_class_entry *php_hashcontext_ce;
|
||||
PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(zend_string *algo);
|
||||
PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops);
|
||||
PHP_HASH_API zend_result php_hash_copy(const void *ops, const void *orig_context, void *dest_context);
|
||||
PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv);
|
||||
PHP_HASH_API zend_result php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv);
|
||||
PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *context, zend_long magic, const zval *zv);
|
||||
PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec);
|
||||
PHP_HASH_API zend_result php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec);
|
||||
PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const zval *zv, const char *spec);
|
||||
|
||||
static inline void *php_hash_alloc_context(const php_hash_ops *ops) {
|
||||
|
||||
Reference in New Issue
Block a user