Skip to content

Commit e31e90f

Browse files
committed
hash: murmur: Remove folds
Signed-off-by: Anatol Belski <ab@php.net>
1 parent 1c50a40 commit e31e90f

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

ext/hash/hash_murmur.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "murmur/PMurHash128.h"
2222

2323

24-
const php_hash_ops php_hash_murmur3a_ops = {/*{{{*/
24+
const php_hash_ops php_hash_murmur3a_ops = {
2525
"murmur3a",
2626
(php_hash_init_func_t) PHP_MURMUR3AInit,
2727
(php_hash_update_func_t) PHP_MURMUR3AUpdate,
@@ -34,40 +34,40 @@ const php_hash_ops php_hash_murmur3a_ops = {/*{{{*/
3434
4,
3535
sizeof(PHP_MURMUR3A_CTX),
3636
0
37-
};/*}}}*/
37+
};
3838

3939
PHP_HASH_API void PHP_MURMUR3AInit(PHP_MURMUR3A_CTX *ctx)
40-
{/*{{{*/
40+
{
4141
ctx->h = 0;
4242
ctx->carry = 0;
4343
ctx->len = 0;
44-
}/*}}}*/
44+
}
4545

4646
PHP_HASH_API void PHP_MURMUR3AUpdate(PHP_MURMUR3A_CTX *ctx, const unsigned char *in, size_t len)
47-
{/*{{{*/
47+
{
4848
ctx->len += len;
4949
PMurHash32_Process(&ctx->h, &ctx->carry, in, len);
50-
}/*}}}*/
50+
}
5151

5252
PHP_HASH_API void PHP_MURMUR3AFinal(unsigned char digest[4], PHP_MURMUR3A_CTX *ctx)
53-
{/*{{{*/
53+
{
5454
ctx->h = PMurHash32_Result(ctx->h, ctx->carry, ctx->len);
5555

5656
digest[0] = (unsigned char)((ctx->h >> 24) & 0xff);
5757
digest[1] = (unsigned char)((ctx->h >> 16) & 0xff);
5858
digest[2] = (unsigned char)((ctx->h >> 8) & 0xff);
5959
digest[3] = (unsigned char)(ctx->h & 0xff);
60-
}/*}}}*/
60+
}
6161

6262
PHP_HASH_API int PHP_MURMUR3ACopy(const php_hash_ops *ops, PHP_MURMUR3A_CTX *orig_context, PHP_MURMUR3A_CTX *copy_context)
63-
{/*{{{*/
63+
{
6464
copy_context->h = orig_context->h;
6565
copy_context->carry = orig_context->carry;
6666
copy_context->len = orig_context->len;
6767
return SUCCESS;
68-
}/*}}}*/
68+
}
6969

70-
const php_hash_ops php_hash_murmur3c_ops = {/*{{{*/
70+
const php_hash_ops php_hash_murmur3c_ops = {
7171
"murmur3c",
7272
(php_hash_init_func_t) PHP_MURMUR3CInit,
7373
(php_hash_update_func_t) PHP_MURMUR3CUpdate,
@@ -80,23 +80,23 @@ const php_hash_ops php_hash_murmur3c_ops = {/*{{{*/
8080
4,
8181
sizeof(PHP_MURMUR3C_CTX),
8282
0
83-
};/*}}}*/
83+
};
8484

8585
PHP_HASH_API void PHP_MURMUR3CInit(PHP_MURMUR3C_CTX *ctx)
86-
{/*{{{*/
86+
{
8787
memset(&ctx->h, 0, sizeof ctx->h);
8888
memset(&ctx->carry, 0, sizeof ctx->carry);
8989
ctx->len = 0;
90-
}/*}}}*/
90+
}
9191

9292
PHP_HASH_API void PHP_MURMUR3CUpdate(PHP_MURMUR3C_CTX *ctx, const unsigned char *in, size_t len)
93-
{/*{{{*/
93+
{
9494
ctx->len += len;
9595
PMurHash128x86_Process(ctx->h, ctx->carry, in, len);
96-
}/*}}}*/
96+
}
9797

9898
PHP_HASH_API void PHP_MURMUR3CFinal(unsigned char digest[4], PHP_MURMUR3C_CTX *ctx)
99-
{/*{{{*/
99+
{
100100
uint32_t h[4] = {0};
101101
PMurHash128x86_Result(ctx->h, ctx->carry, ctx->len, h);
102102

@@ -116,17 +116,17 @@ PHP_HASH_API void PHP_MURMUR3CFinal(unsigned char digest[4], PHP_MURMUR3C_CTX *c
116116
digest[13] = (unsigned char)((h[3] >> 16) & 0xff);
117117
digest[14] = (unsigned char)((h[3] >> 8) & 0xff);
118118
digest[15] = (unsigned char)(h[3] & 0xff);
119-
}/*}}}*/
119+
}
120120

121121
PHP_HASH_API int PHP_MURMUR3CCopy(const php_hash_ops *ops, PHP_MURMUR3C_CTX *orig_context, PHP_MURMUR3C_CTX *copy_context)
122-
{/*{{{*/
122+
{
123123
memcpy(&copy_context->h, &orig_context->h, sizeof orig_context->h);
124124
memcpy(&copy_context->carry, &orig_context->carry, sizeof orig_context->carry);
125125
copy_context->len = orig_context->len;
126126
return SUCCESS;
127-
}/*}}}*/
127+
}
128128

129-
const php_hash_ops php_hash_murmur3f_ops = {/*{{{*/
129+
const php_hash_ops php_hash_murmur3f_ops = {
130130
"murmur3f",
131131
(php_hash_init_func_t) PHP_MURMUR3FInit,
132132
(php_hash_update_func_t) PHP_MURMUR3FUpdate,
@@ -139,23 +139,23 @@ const php_hash_ops php_hash_murmur3f_ops = {/*{{{*/
139139
8,
140140
sizeof(PHP_MURMUR3F_CTX),
141141
0
142-
};/*}}}*/
142+
};
143143

144144
PHP_HASH_API void PHP_MURMUR3FInit(PHP_MURMUR3F_CTX *ctx)
145-
{/*{{{*/
145+
{
146146
memset(&ctx->h, 0, sizeof ctx->h);
147147
memset(&ctx->carry, 0, sizeof ctx->carry);
148148
ctx->len = 0;
149-
}/*}}}*/
149+
}
150150

151151
PHP_HASH_API void PHP_MURMUR3FUpdate(PHP_MURMUR3F_CTX *ctx, const unsigned char *in, size_t len)
152-
{/*{{{*/
152+
{
153153
ctx->len += len;
154154
PMurHash128x64_Process(ctx->h, ctx->carry, in, len);
155-
}/*}}}*/
155+
}
156156

157157
PHP_HASH_API void PHP_MURMUR3FFinal(unsigned char digest[4], PHP_MURMUR3F_CTX *ctx)
158-
{/*{{{*/
158+
{
159159
uint64_t h[2] = {0};
160160
PMurHash128x64_Result(ctx->h, ctx->carry, ctx->len, h);
161161

@@ -175,12 +175,12 @@ PHP_HASH_API void PHP_MURMUR3FFinal(unsigned char digest[4], PHP_MURMUR3F_CTX *c
175175
digest[13] = (unsigned char)((h[1] >> 16) & 0xff);
176176
digest[14] = (unsigned char)((h[1] >> 8) & 0xff);
177177
digest[15] = (unsigned char)(h[1] & 0xff);
178-
}/*}}}*/
178+
}
179179

180180
PHP_HASH_API int PHP_MURMUR3FCopy(const php_hash_ops *ops, PHP_MURMUR3F_CTX *orig_context, PHP_MURMUR3F_CTX *copy_context)
181-
{/*{{{*/
181+
{
182182
memcpy(&copy_context->h, &orig_context->h, sizeof orig_context->h);
183183
memcpy(&copy_context->carry, &orig_context->carry, sizeof orig_context->carry);
184184
copy_context->len = orig_context->len;
185185
return SUCCESS;
186-
}/*}}}*/
186+
}

0 commit comments

Comments
 (0)