summaryrefslogtreecommitdiff
path: root/src/test_onefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test_onefile.c')
-rw-r--r--src/test_onefile.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test_onefile.c b/src/test_onefile.c
index cd7db00..6986744 100644
--- a/src/test_onefile.c
+++ b/src/test_onefile.c
@@ -288,7 +288,7 @@ static int tmpWrite(
){
tmp_file *pTmp = (tmp_file *)pFile;
if( (iAmt+iOfst)>pTmp->nAlloc ){
- int nNew = 2*(iAmt+iOfst+pTmp->nAlloc);
+ int nNew = (int)(2*(iAmt+iOfst+pTmp->nAlloc));
char *zNew = sqlite3_realloc(pTmp->zAlloc, nNew);
if( !zNew ){
return SQLITE_NOMEM;
@@ -297,7 +297,7 @@ static int tmpWrite(
pTmp->nAlloc = nNew;
}
memcpy(&pTmp->zAlloc[iOfst], zBuf, iAmt);
- pTmp->nSize = MAX(pTmp->nSize, iOfst+iAmt);
+ pTmp->nSize = (int)MAX(pTmp->nSize, iOfst+iAmt);
return SQLITE_OK;
}
@@ -306,7 +306,7 @@ static int tmpWrite(
*/
static int tmpTruncate(sqlite3_file *pFile, sqlite_int64 size){
tmp_file *pTmp = (tmp_file *)pFile;
- pTmp->nSize = MIN(pTmp->nSize, size);
+ pTmp->nSize = (int)MIN(pTmp->nSize, size);
return SQLITE_OK;
}
@@ -418,7 +418,7 @@ static int fsRead(
/* Journal file. */
int iRem = iAmt;
int iBuf = 0;
- int ii = iOfst;
+ int ii = (int)iOfst;
while( iRem>0 && rc==SQLITE_OK ){
int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
@@ -453,14 +453,14 @@ static int fsWrite(
}else{
rc = pF->pMethods->xWrite(pF, zBuf, iAmt, iOfst+BLOCKSIZE);
if( rc==SQLITE_OK ){
- pReal->nDatabase = MAX(pReal->nDatabase, iAmt+iOfst);
+ pReal->nDatabase = (int)MAX(pReal->nDatabase, iAmt+iOfst);
}
}
}else{
/* Journal file. */
int iRem = iAmt;
int iBuf = 0;
- int ii = iOfst;
+ int ii = (int)iOfst;
while( iRem>0 && rc==SQLITE_OK ){
int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
@@ -475,7 +475,7 @@ static int fsWrite(
}
}
if( rc==SQLITE_OK ){
- pReal->nJournal = MAX(pReal->nJournal, iAmt+iOfst);
+ pReal->nJournal = (int)MAX(pReal->nJournal, iAmt+iOfst);
}
}
@@ -489,9 +489,9 @@ static int fsTruncate(sqlite3_file *pFile, sqlite_int64 size){
fs_file *p = (fs_file *)pFile;
fs_real_file *pReal = p->pReal;
if( p->eType==DATABASE_FILE ){
- pReal->nDatabase = MIN(pReal->nDatabase, size);
+ pReal->nDatabase = (int)MIN(pReal->nDatabase, size);
}else{
- pReal->nJournal = MIN(pReal->nJournal, size);
+ pReal->nJournal = (int)MIN(pReal->nJournal, size);
}
return SQLITE_OK;
}
@@ -606,7 +606,7 @@ static int fsOpen(
p->eType = eType;
assert(strlen("-journal")==8);
- nName = strlen(zName)-((eType==JOURNAL_FILE)?8:0);
+ nName = (int)strlen(zName)-((eType==JOURNAL_FILE)?8:0);
pReal=pFsVfs->pFileList;
for(; pReal && strncmp(pReal->zName, zName, nName); pReal=pReal->pNext);
@@ -641,7 +641,7 @@ static int fsOpen(
pReal->nBlob = BLOBSIZE;
}else{
unsigned char zS[4];
- pReal->nBlob = size;
+ pReal->nBlob = (int)size;
rc = pRealFile->pMethods->xRead(pRealFile, zS, 4, 0);
pReal->nDatabase = (zS[0]<<24)+(zS[1]<<16)+(zS[2]<<8)+zS[3];
if( rc==SQLITE_OK ){
@@ -687,7 +687,7 @@ static int fsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs;
fs_real_file *pReal;
sqlite3_file *pF;
- int nName = strlen(zPath) - 8;
+ int nName = (int)strlen(zPath) - 8;
assert(strlen("-journal")==8);
assert(strcmp("-journal", &zPath[nName])==0);
@@ -717,7 +717,7 @@ static int fsAccess(
fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs;
fs_real_file *pReal;
int isJournal = 0;
- int nName = strlen(zPath);
+ int nName = (int)strlen(zPath);
if( flags!=SQLITE_ACCESS_EXISTS ){
sqlite3_vfs *pParent = ((fs_vfs_t *)pVfs)->pParent;