Index: extsrc/cson_amalgamation.c ================================================================== --- extsrc/cson_amalgamation.c +++ extsrc/cson_amalgamation.c @@ -5389,11 +5389,11 @@ cson_string * colName = NULL; int i = 0; int rc = 0; cson_value * currentValue = NULL; int const colCount = sqlite3_column_count(st); - if( !colCount || (colCount>cson_array_length_get(colNames)) ) { + if( !colCount || (colCount>(int)cson_array_length_get(colNames)) ) { return NULL; } rootV = cson_value_new_object(); if(!rootV) return NULL; root = cson_value_get_object(rootV); Index: src/backoffice.c ================================================================== --- src/backoffice.c +++ src/backoffice.c @@ -541,11 +541,11 @@ backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID()); db_end_transaction(0); break; } }else{ - if( lastWarning+warningDelay < tmNow ){ + if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ fossil_warning( "backoffice process %lld still running after %d seconds", x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); lastWarning = tmNow; warningDelay *= 2; Index: src/bag.c ================================================================== --- src/bag.c +++ src/bag.c @@ -101,11 +101,11 @@ int e = old.a[i]; if( e>0 ){ unsigned h = bag_hash(e)%newSize; while( p->a[h] ){ h++; - if( h==newSize ) h = 0; + if( (int)h==newSize ) h = 0; } p->a[h] = e; nLive++; }else if( e<0 ){ nDel++; @@ -131,11 +131,11 @@ bag_resize(p, n + 20 ); } h = bag_hash(e)%p->sz; while( p->a[h]>0 && p->a[h]!=e ){ h++; - if( h>=p->sz ) h = 0; + if( (int)h>=p->sz ) h = 0; } if( p->a[h]<=0 ){ if( p->a[h]==0 ) p->used++; p->a[h] = e; p->cnt++; @@ -154,11 +154,11 @@ return 0; } h = bag_hash(e)%p->sz; while( p->a[h] && p->a[h]!=e ){ h++; - if( h>=p->sz ) h = 0; + if( (int)h>=p->sz ) h = 0; } return p->a[h]==e; } /* @@ -170,11 +170,11 @@ assert( e>0 ); if( p->sz==0 ) return; h = bag_hash(e)%p->sz; while( p->a[h] && p->a[h]!=e ){ h++; - if( h>=p->sz ) h = 0; + if( (int)h>=p->sz ) h = 0; } if( p->a[h] ){ int nx = h+1; if( nx>=p->sz ) nx = 0; if( p->a[nx]==0 ){ @@ -217,21 +217,21 @@ assert( p->sz>0 ); assert( e>0 ); h = bag_hash(e)%p->sz; while( p->a[h] && p->a[h]!=e ){ h++; - if( h>=p->sz ) h = 0; + if( (int)h>=p->sz ) h = 0; } assert( p->a[h] ); h++; - while( hsz && p->a[h]<=0 ){ + while( (int)hsz && p->a[h]<=0 ){ h++; } - return hsz ? p->a[h] : 0; + return (int)hsz ? p->a[h] : 0; } /* ** Return the number of elements in the bag. */ int bag_count(Bag *p){ return p->cnt; } Index: src/blob.c ================================================================== --- src/blob.c +++ src/blob.c @@ -678,11 +678,11 @@ /* ** Truncate a blob back to zero length */ void blob_truncate(Blob *p, int sz){ - if( sz>=0 && sznUsed ) p->nUsed = sz; + if( sz>=0 && sz<(int)(p->nUsed) ) p->nUsed = sz; } /* ** Seek the cursor in a blob to the indicated offset. */ @@ -1163,11 +1163,11 @@ return 0; } blob_is_init(pBlob); nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out); fclose(out); - if( nWrote!=blob_size(pBlob) ){ + if( nWrote!=(int)blob_size(pBlob) ){ fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote, blob_size(pBlob), zFilename); } } return nWrote; @@ -1361,11 +1361,11 @@ int i, n; for(i=n=0; i=p->nAlloc ){ + if( j>=(int)(p->nAlloc) ){ blob_resize(p, j); z = p->aData; } p->nUsed = j; z[j] = 0; @@ -1416,11 +1416,11 @@ } n++; } } j += n; - if( j>=p->nAlloc ){ + if( j>=(int)(p->nAlloc) ){ blob_resize(p, j); z = (unsigned char *)p->aData; } p->nUsed = j; z[j] = 0; Index: src/browse.c ================================================================== --- src/browse.c +++ src/browse.c @@ -894,19 +894,19 @@ relinkTree(&sTree, p); } for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ const char *zLastClass = p->pSibling==0 ? " last" : ""; if( p->pChild ){ - const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : ""; + const char *zSubdirClass = (int)(p->nFullName)==nD-1 ? " subdir" : ""; @
  • @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName) if( p->mtime>0.0 ){ char *zAge = human_readable_age(rNow - p->mtime); @
    %s(zAge)
    } @
    - if( startExpanded || p->nFullName<=nD ){ + if( startExpanded || (int)(p->nFullName)<=nD ){ @
      }else{ @ \n"); x->text = list; g.ftntsIssues[2]++; } @@ -2762,11 +2764,11 @@ } } blob_reset( allNotes ); rndr.notes.all = filtered; rndr.notes.nLbled = n; - assert( COUNT_FOOTNOTES(allNotes) == rndr.notes.nLbled ); + assert( (int)(COUNT_FOOTNOTES(allNotes)) == rndr.notes.nLbled ); } } fn = CAST_AS_FOOTNOTES( allNotes ); for(i=0; ibRndred ? x->nUsed : 0; if( !x->iMark ) break; assert( x->nUsed ); rndr.make.footnote_item(all_items, &x->text, x->iMark, @@ -2845,11 +2847,11 @@ if( rndr.notes.misref.nUsed ){ rndr.make.footnote_item(all_items, 0, -1, rndr.notes.misref.nUsed, rndr.make.opaque); g.ftntsIssues[0] += rndr.notes.misref.nUsed; } - while( ++j < COUNT_FOOTNOTES(notes) ){ + while( ++j < (int)(COUNT_FOOTNOTES(notes)) ){ const struct footnote* x = CAST_AS_FOOTNOTES(notes) + j; assert( !x->iMark ); assert( !x->nUsed ); assert( !x->bRndred ); rndr.make.footnote_item(all_items,&x->text,0,0,rndr.make.opaque); @@ -2865,23 +2867,23 @@ /* clean-up */ assert( rndr.iDepth==0 ); blob_reset(&text); lr = (struct link_ref *)blob_buffer(&rndr.refs); end = blob_size(&rndr.refs)/sizeof(struct link_ref); - for(i=0; i0 ){ count += nspace; - while( nspace>=etSPACESIZE ){ + while( nspace>=(int)etSPACESIZE ){ blob_append(pBlob,spaces,etSPACESIZE); nspace -= etSPACESIZE; } if( nspace>0 ) blob_append(pBlob,spaces,nspace); } @@ -880,11 +880,11 @@ if( flag_leftjustify ){ register int nspace; nspace = width-length; if( nspace>0 ){ count += nspace; - while( nspace>=etSPACESIZE ){ + while( nspace>=(int)etSPACESIZE ){ blob_append(pBlob,spaces,etSPACESIZE); nspace -= etSPACESIZE; } if( nspace>0 ) blob_append(pBlob,spaces,nspace); } Index: src/rebuild.c ================================================================== --- src/rebuild.c +++ src/rebuild.c @@ -256,11 +256,11 @@ int nChild, i, cid; while( rid>0 ){ /* Fix up the "blob.size" field if needed. */ - if( size!=blob_size(pBase) ){ + if( size!=(int)blob_size(pBase) ){ db_multi_exec( "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid ); } Index: src/tar.c ================================================================== --- src/tar.c +++ src/tar.c @@ -246,11 +246,11 @@ blen++; } /* build the string */ blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); /* this _must_ be right */ - if(blob_size(&tball.pax) != blen){ + if((int)blob_size(&tball.pax) != blen){ fossil_panic("internal error: PAX tar header has bad length"); } } Index: src/th.c ================================================================== --- src/th.c +++ src/th.c @@ -853,11 +853,11 @@ thBufferAddChar(interp, &strbuf, 0); thBufferWrite(interp, &lenbuf, &nWord, sizeof(int)); nCount++; } } - assert((lenbuf.nBuf/sizeof(int))==nCount); + assert((int)(lenbuf.nBuf/sizeof(int))==nCount); assert((pazElem && panElem) || (!pazElem && !panElem)); if( pazElem && rc==TH_OK ){ int i; char *zElem; Index: src/th_main.c ================================================================== --- src/th_main.c +++ src/th_main.c @@ -1849,11 +1849,11 @@ if( argc==2 ){ if( Th_ToInt(interp, argv[1], argl[1], &n) ){ return TH_ERROR; } if( n<1 ) n = 1; - if( n>sizeof(aRand) ) n = sizeof(aRand); + if( n>(int)sizeof(aRand) ) n = sizeof(aRand); }else{ n = 10; } sqlite3_randomness(n, aRand); encode16(aRand, zOut, n); Index: src/timeline.c ================================================================== --- src/timeline.c +++ src/timeline.c @@ -547,11 +547,11 @@ if( z[jj]=='\n' ) break; } } z[ii] = 0; cgi_printf("%W",z); - }else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ + }else if( mxWikiLen>0 && (int)blob_size(&comment)>mxWikiLen ){ Blob truncated; blob_zero(&truncated); blob_append(&truncated, blob_buffer(&comment), mxWikiLen); blob_append(&truncated, "...", 3); @ %W(blob_str(&truncated)) @@ -3432,11 +3432,11 @@ zStartOfProject = db_text(0, "SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;" ); timeline_temp_table(); db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); - for(i=0; i0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0) || memcmp(zValue, aField[i].zValue, nValue)!=0 - || strlen(aField[i].zValue)!=nValue + ||(int)strlen(aField[i].zValue)!=nValue ){ if( memcmp(aField[i].zName, "private_", 8)==0 ){ zValue = db_conceal(zValue, nValue); blob_appendf(&tktchng, "J %s %s\n", aField[i].zName, zValue); aUsed[i] = JCARD_PRIVATE; Index: src/user.c ================================================================== --- src/user.c +++ src/user.c @@ -157,11 +157,11 @@ int nB = 0; int i; memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1); memcpy(zA, zOrig, nA+1); assert( nA==(int)strlen((char*)zA) ); - for(i=0; i0 ){ int x = randint(nA); zB[nB++] = zA[x]; zA[x] = zA[--nA]; Index: src/util.c ================================================================== --- src/util.c +++ src/util.c @@ -680,18 +680,18 @@ }else{ zDir = fossil_getenv("LOCALAPPDATA"); if( zDir==0 ) zDir = "."; } #else - for(i=0; i=sizeof(azTmp)/sizeof(azTmp[0]) ) zDir = "."; + if( i>=(int)(sizeof(azTmp)/sizeof(azTmp[0])) ) zDir = "."; cDirSep = '/'; #endif nDir = strlen(zDir); zSep[1] = 0; zSep[0] = (nDir && zDir[nDir-1]==cDirSep) ? 0 : cDirSep; Index: src/wikiformat.c ================================================================== --- src/wikiformat.c +++ src/wikiformat.c @@ -790,11 +790,11 @@ p->endTag = 0; i = 1; } j = 0; while( fossil_isalnum(z[i]) ){ - if( jiCode = findTag(zTag); p->iType = aMarkup[p->iCode].iType; @@ -813,11 +813,11 @@ while( fossil_isspace(z[i]) ){ i++; } while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){ int attrOk; /* True to preserve attribute. False to ignore it */ j = 0; while( fossil_isalnum(z[i]) ){ - if( jaAttr[p->nAttr].iACode = iACode = findAttr(zTag); attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; @@ -1105,11 +1105,11 @@ db_static_prepare(&q, "SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2" ); db_bind_text(&q, ":u", zUuid); n = (int)strlen(zUuid); - if( n>=sizeof(zU2) ) n = sizeof(zU2)-1; + if( n>=(int)sizeof(zU2) ) n = sizeof(zU2)-1; memcpy(zU2, zUuid, n); zU2[n-1]++; zU2[n] = 0; db_bind_text(&q, ":u2", zU2); rc = db_step(&q); @@ -1358,11 +1358,11 @@ }else{ blob_appendf(pOut, "[%h]", zTarget); zTerm = ""; } if( zExtra ) fossil_free(zExtra); - assert( strlen(zTerm)=blob_size(pContent)-50 ){ + if( size>=(int)blob_size(pContent)-50 ){ size = 0; }else if( uuid_is_shunned(zUuid) ){ size = 0; }else{ if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); @@ -577,11 +577,11 @@ if( uuid_is_shunned(blob_str(pUuid)) ){ blob_reset(&uuid); return; } if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || - pXfer->mxSend<=blob_size(pXfer->pOut) ){ + pXfer->mxSend<=(int)blob_size(pXfer->pOut) ){ const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; blob_appendf(pXfer->pOut, zFormat /*works-like:"%b"*/, pUuid); pXfer->nIGotSent++; blob_reset(&uuid); return; @@ -701,11 +701,11 @@ const char *zName, /* Name of unversioned file to be sent */ int noContent /* True to omit the content */ ){ Stmt q1; - if( blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; + if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; if( noContent ){ db_prepare(&q1, "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q", zName ); @@ -722,11 +722,11 @@ if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){ xfer_cannot_send_sha3_error(pXfer); db_reset(&q1); return; } - if( blob_size(pXfer->pOut)>=pXfer->mxSend ){ + if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ){ /* If we have already reached the send size limit, send a (short) ** uvigot card rather than a uvfile card. This only happens on the ** server side. The uvigot card will provoke the client to resend ** another uvgimme on the next cycle. */ blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", @@ -1029,11 +1029,11 @@ ); } while( db_step(&q)==SQLITE_ROW ){ blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0)); cnt++; - if( pXfer->resync && pXfer->mxSendpOut) ){ + if( pXfer->resync && pXfer->mxSend<(int)blob_size(pXfer->pOut) ){ pXfer->resync = db_column_int(&q, 1)-1; } } db_finalize(&q); if( cnt==0 ) pXfer->resync = 0; @@ -1457,11 +1457,11 @@ if( iVers>=3 ){ cgi_set_content_type("application/x-fossil-uncompressed"); } blob_is_int(&xfer.aToken[2], &seqno); max = db_int(0, "SELECT max(rid) FROM blob"); - while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){ + while( xfer.mxSend>(int)blob_size(xfer.pOut) && seqno<=max){ if( time(NULL) >= xfer.maxTime ) break; if( iVers>=3 ){ send_compressed_file(&xfer, seqno); }else{ send_file(&xfer, seqno, 0, 1); @@ -2228,11 +2228,11 @@ nArtifactSent++; db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); if( syncFlags & SYNC_VERBOSE ){ fossil_print("\rUnversioned-file sent: %s\n", zName); } - if( blob_size(xfer.pOut)>xfer.mxSend ) break; + if( (int)blob_size(xfer.pOut)>xfer.mxSend ) break; } db_finalize(&uvq); if( rc==SQLITE_DONE ) uvDoPush = 0; } } Index: src/zip.c ================================================================== --- src/zip.c +++ src/zip.c @@ -66,11 +66,11 @@ /* ** Ensure that blob pBlob is at least nMin bytes in size. */ static void zip_blob_minsize(Blob *pBlob, int nMin){ - if( blob_size(pBlob)pInsert, 4, -1); sqlite3_bind_text(p->pInsert, 5, blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC ); }else{ - int nIn = blob_size(pFile); + unsigned int nIn = blob_size(pFile); unsigned long int nOut = nIn; sqlite3_bind_int(p->pInsert, 2, mPerm==PERM_EXE ? 0100755 : 0100644); sqlite3_bind_int(p->pInsert, 4, nIn); zip_blob_minsize(&p->tmp, nIn); compress( (unsigned char*) blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn ); - if( nOut>=nIn ){ + if( nOut>=(unsigned long)nIn ){ sqlite3_bind_blob(p->pInsert, 5, blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC ); }else{ sqlite3_bind_blob(p->pInsert, 5,