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

Commit c0abd52

Browse files
committed
Use consistent types for chunk_size and pos in storeBytes() and storeFile()
This makes storeBytes() consistent with storeFile(), which was recently changed for PHP-1505.
1 parent b59c43d commit c0abd52

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gridfs/gridfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +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;
412-
long global_chunk_size = 0;
413-
pos = 0;
411+
int bytes_len = 0, chunk_num = 0;
412+
long global_chunk_size = 0, pos = 0;
414413
int revert = 0;
415414

416415
zval temp;
@@ -467,7 +466,7 @@ PHP_METHOD(MongoGridFS, storeBytes)
467466

468467
/* insert chunks */
469468
while (pos < bytes_len) {
470-
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;
471470

472471
if (!(chunk_id = insert_chunk(chunks, zid, chunk_num, bytes + pos, chunk_size, options TSRMLS_CC))) {
473472
revert = 1;

0 commit comments

Comments
 (0)