@@ -223,7 +223,7 @@ PHP_METHOD(MongoGridFS, find)
223
223
}
224
224
/* }}} */
225
225
226
- static int get_chunk_size (zval * array TSRMLS_DC )
226
+ static long get_chunk_size (zval * array TSRMLS_DC )
227
227
{
228
228
zval * * zchunk_size = 0 ;
229
229
@@ -408,8 +408,8 @@ static void cleanup_stale_chunks(INTERNAL_FUNCTION_PARAMETERS, zval *cleanup_ids
408
408
PHP_METHOD (MongoGridFS , storeBytes )
409
409
{
410
410
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 ;
413
413
int revert = 0 ;
414
414
415
415
zval temp ;
@@ -466,7 +466,7 @@ PHP_METHOD(MongoGridFS, storeBytes)
466
466
467
467
/* insert chunks */
468
468
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 ;
470
470
471
471
if (!(chunk_id = insert_chunk (chunks , zid , chunk_num , bytes + pos , chunk_size , options TSRMLS_CC ))) {
472
472
revert = 1 ;
@@ -641,8 +641,8 @@ PHP_METHOD(MongoGridFS, storeFile)
641
641
{
642
642
zval * fh , * extra = 0 , * options = 0 ;
643
643
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 ;
646
646
int revert = 0 ;
647
647
FILE * fp = 0 ;
648
648
0 commit comments