Skip to content

Commit 5be5365

Browse files
authored
Merge pull request #65 from remicollet/issue-pointers
Fix incompatible pointer types (32-bit)
2 parents c805574 + 9e136bf commit 5be5365

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

zstd.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_zstd_uncompress_dict, 0, 0, 2)
8282
ZEND_ARG_INFO(0, dictBuffer)
8383
ZEND_END_ARG_INFO()
8484

85-
static size_t zstd_check_compress_level(long level)
85+
static size_t zstd_check_compress_level(zend_long level)
8686
{
8787
uint16_t maxLevel = (uint16_t) ZSTD_maxCLevel();
8888

8989
#if ZSTD_VERSION_NUMBER >= 10304
9090
if (level > maxLevel) {
91-
ZSTD_WARNING("compression level (%ld)"
91+
ZSTD_WARNING("compression level (" ZEND_LONG_FMT ")"
9292
" must be within 1..%d or smaller then 0", level, maxLevel);
9393
return 0;
9494
}
@@ -121,7 +121,7 @@ ZEND_FUNCTION(zstd_compress)
121121
{
122122
zend_string *output;
123123
size_t size, result;
124-
long level = DEFAULT_COMPRESS_LEVEL;
124+
zend_long level = DEFAULT_COMPRESS_LEVEL;
125125

126126
char *input;
127127
size_t input_len;
@@ -154,7 +154,7 @@ ZEND_FUNCTION(zstd_compress)
154154
output = zend_string_alloc(size, 0);
155155

156156
result = ZSTD_compress(ZSTR_VAL(output), size, input, input_len,
157-
level);
157+
(int)level);
158158

159159
if (ZSTD_IS_ERROR(result)) {
160160
zend_string_efree(output);
@@ -274,7 +274,7 @@ ZEND_FUNCTION(zstd_uncompress)
274274

275275
ZEND_FUNCTION(zstd_compress_dict)
276276
{
277-
long level = DEFAULT_COMPRESS_LEVEL;
277+
zend_long level = DEFAULT_COMPRESS_LEVEL;
278278

279279
zend_string *output;
280280
char *input, *dict;
@@ -298,7 +298,7 @@ ZEND_FUNCTION(zstd_compress_dict)
298298
}
299299
ZSTD_CDict* const cdict = ZSTD_createCDict(dict,
300300
dict_len,
301-
level);
301+
(int)level);
302302
if (!cdict) {
303303
ZSTD_freeCStream(cctx);
304304
ZSTD_WARNING("ZSTD_createCDict() error");
@@ -906,8 +906,8 @@ static int APC_UNSERIALIZER_NAME(zstd)(APC_UNSERIALIZER_ARGS)
906906
if (!result) {
907907
php_error_docref(NULL, E_NOTICE,
908908
"Error at offset %ld of %ld bytes",
909-
(zend_long) (tmp - (unsigned char*) var),
910-
(zend_long) var_len);
909+
(long) (tmp - (unsigned char*) var),
910+
(long) var_len);
911911
ZVAL_NULL(value);
912912
result = 0;
913913
} else {

0 commit comments

Comments
 (0)