Skip to content

Commit 937c4e4

Browse files
committed
ext/hash: Make return type zend_result for serialize function typedef
1 parent c26e77c commit 937c4e4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/hash/hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static void one_to_buffer(size_t sz, unsigned char *buf, uint64_t val) {
229229
significant bits first. This allows 32-bit and 64-bit architectures to
230230
interchange serialized HashContexts. */
231231

232-
PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *hash, zval *zv, const char *spec) /* {{{ */
232+
PHP_HASH_API zend_result php_hash_serialize_spec(const php_hashcontext_object *hash, zval *zv, const char *spec) /* {{{ */
233233
{
234234
size_t pos = 0, max_alignment = 1;
235235
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
331331
}
332332
/* }}} */
333333

334-
PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv) /* {{{ */
334+
PHP_HASH_API zend_result php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv) /* {{{ */
335335
{
336336
if (hash->ops->serialize_spec) {
337337
*magic = PHP_HASH_SERIALIZE_MAGIC_SPEC;

ext/hash/hash_sha3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const php_hash_ops php_hash_sha3_##bits##_ops = { \
292292
#endif
293293
#define PHP_KECCAK_SPEC "b200IiIIB"
294294

295-
static int php_keccak_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
295+
static zend_result php_keccak_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
296296
{
297297
*magic = PHP_HASH_SERIALIZE_MAGIC_KECCAK;
298298
return php_hash_serialize_spec(hash, zv, PHP_KECCAK_SPEC);

ext/hash/php_hash.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ typedef void (*php_hash_init_func_t)(void *context, HashTable *args);
3535
typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count);
3636
typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context);
3737
typedef zend_result (*php_hash_copy_func_t)(const void *ops, const void *orig_context, void *dest_context);
38-
typedef int (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv);
38+
typedef zend_result (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv);
3939
typedef int (*php_hash_unserialize_func_t)(php_hashcontext_object *hash, zend_long magic, const zval *zv);
4040

4141
typedef struct _php_hash_ops {
@@ -148,9 +148,9 @@ extern PHP_HASH_API zend_class_entry *php_hashcontext_ce;
148148
PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(zend_string *algo);
149149
PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops);
150150
PHP_HASH_API zend_result php_hash_copy(const void *ops, const void *orig_context, void *dest_context);
151-
PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv);
151+
PHP_HASH_API zend_result php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv);
152152
PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *context, zend_long magic, const zval *zv);
153-
PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec);
153+
PHP_HASH_API zend_result php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec);
154154
PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const zval *zv, const char *spec);
155155

156156
static inline void *php_hash_alloc_context(const php_hash_ops *ops) {

0 commit comments

Comments
 (0)