Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit b023468

Browse files
committed
Merge pull request #874
2 parents 5e05419 + c0abd52 commit b023468

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gridfs/gridfs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ PHP_METHOD(MongoGridFS, find)
223223
}
224224
/* }}} */
225225

226-
static int get_chunk_size(zval *array TSRMLS_DC)
226+
static long get_chunk_size(zval *array TSRMLS_DC)
227227
{
228228
zval **zchunk_size = 0;
229229

@@ -408,8 +408,8 @@ static void cleanup_stale_chunks(INTERNAL_FUNCTION_PARAMETERS, zval *cleanup_ids
408408
PHP_METHOD(MongoGridFS, storeBytes)
409409
{
410410
char *bytes = 0;
411-
int bytes_len = 0, chunk_num = 0, chunk_size = 0, global_chunk_size = 0,
412-
pos = 0;
411+
int bytes_len = 0, chunk_num = 0;
412+
long global_chunk_size = 0, pos = 0;
413413
int revert = 0;
414414

415415
zval temp;
@@ -466,7 +466,7 @@ PHP_METHOD(MongoGridFS, storeBytes)
466466

467467
/* insert chunks */
468468
while (pos < bytes_len) {
469-
chunk_size = bytes_len - pos >= global_chunk_size ? global_chunk_size : bytes_len - pos;
469+
size_t chunk_size = bytes_len - pos >= global_chunk_size ? global_chunk_size : bytes_len - pos;
470470

471471
if (!(chunk_id = insert_chunk(chunks, zid, chunk_num, bytes + pos, chunk_size, options TSRMLS_CC))) {
472472
revert = 1;
@@ -641,8 +641,8 @@ PHP_METHOD(MongoGridFS, storeFile)
641641
{
642642
zval *fh, *extra = 0, *options = 0;
643643
char *filename = 0;
644-
int chunk_num = 0, global_chunk_size = 0, fd = -1;
645-
long size = 0, pos = 0;
644+
int chunk_num = 0, fd = -1;
645+
long global_chunk_size = 0, size = 0, pos = 0;
646646
int revert = 0;
647647
FILE *fp = 0;
648648

php_mongo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mongo)
500500
char *default_host;
501501
long default_port;
502502
long request_id;
503-
int chunk_size;
503+
long chunk_size;
504504

505505
/* $ alternative */
506506
char *cmd_char;

0 commit comments

Comments
 (0)