Modifications to avoid signed/unsigned warnings in vdbe.c. (CVS 5912)

FossilOrigin-Name: 9939dd839ac13708f9b5b877c48729b1781eedf3
This commit is contained in:
danielk1977
2008-11-17 15:31:47 +00:00
parent 89d4004f03
commit 64202cfec6
5 changed files with 24 additions and 25 deletions
+4 -4
View File
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.792 2008/11/13 18:00:15 danielk1977 Exp $
** @(#) $Id: sqliteInt.h,v 1.793 2008/11/17 15:31:48 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -685,7 +685,7 @@ struct sqlite3 {
CollSeq *pDfltColl; /* The default collating sequence (BINARY) */
i64 lastRowid; /* ROWID of most recent insert (see above) */
i64 priorNewRowid; /* Last randomly generated ROWID */
int magic; /* Magic number for detect library misuse */
u32 magic; /* Magic number for detect library misuse */
int nChange; /* Value returned by sqlite3_changes() */
int nTotalChange; /* Value returned by sqlite3_total_changes() */
sqlite3_mutex *mutex; /* Connection mutex */
@@ -2335,8 +2335,8 @@ int sqlite3VarintLen(u64 v);
** x = putVarint32( A, B );
**
*/
#define getVarint32(A,B) ((*(A)<(unsigned char)0x80) ? ((B) = (u32)*(A)),1 : sqlite3GetVarint32((A), &(B)))
#define putVarint32(A,B) (((B)<(u32)0x80) ? (*(A) = (unsigned char)(B)),1 : sqlite3PutVarint32((A), (B)))
#define getVarint32(A,B) ((*(A)<(unsigned char)0x80) ? ((B) = (u32)*(A)),1 : sqlite3GetVarint32((A), (u32 *)&(B)))
#define putVarint32(A,B) (((u32)(B)<(u32)0x80) ? (*(A) = (unsigned char)(B)),1 : sqlite3PutVarint32((A), (B)))
#define getVarint sqlite3GetVarint
#define putVarint sqlite3PutVarint
+9 -10
View File
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.787 2008/11/13 18:29:51 shane Exp $
** $Id: vdbe.c,v 1.788 2008/11/17 15:31:48 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -177,7 +177,7 @@ static const unsigned char opcodeProperty[] = OPFLG_INITIALIZER;
** specified by mask.
*/
int sqlite3VdbeOpcodeHasProperty(int opcode, int mask){
assert( opcode>0 && opcode<sizeof(opcodeProperty) );
assert( opcode>0 && opcode<(int)sizeof(opcodeProperty) );
return (opcodeProperty[opcode]&mask)!=0;
}
@@ -552,7 +552,6 @@ int sqlite3VdbeExec(
#endif
UnpackedRecord aTempRec[16]; /* Space to hold a transient UnpackedRecord */
assert( p->magic==VDBE_MAGIC_RUN ); /* sqlite3_step() verifies this */
assert( db->magic==SQLITE_MAGIC_BUSY );
sqlite3BtreeMutexArrayEnter(&p->aMutex);
@@ -1964,7 +1963,7 @@ case OP_SetNumColumns: {
** the result.
*/
case OP_Column: {
u32 payloadSize; /* Number of bytes in the record */
int payloadSize; /* Number of bytes in the record */
int p1 = pOp->p1; /* P1 value of the opcode */
int p2 = pOp->p2; /* column number to retrieve */
VdbeCursor *pC = 0;/* The VDBE cursor */
@@ -1972,7 +1971,7 @@ case OP_Column: {
BtCursor *pCrsr; /* The BTree cursor */
u32 *aType; /* aType[i] holds the numeric type of the i-th column */
u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
u32 nField; /* number of fields in the record */
int nField; /* number of fields in the record */
int len; /* The length of the serialized data for the column */
int i; /* Loop counter */
char *zData; /* Part of the record being decoded */
@@ -2020,7 +2019,7 @@ case OP_Column: {
sqlite3BtreeKeySize(pCrsr, &payloadSize64);
payloadSize = payloadSize64;
}else{
sqlite3BtreeDataSize(pCrsr, &payloadSize);
sqlite3BtreeDataSize(pCrsr, (u32 *)&payloadSize);
}
nField = pC->nField;
}else{
@@ -2054,7 +2053,7 @@ case OP_Column: {
}else{
u8 *zIdx; /* Index into header */
u8 *zEndHdr; /* Pointer to first byte after the header */
u32 offset; /* Offset into the data */
int offset; /* Offset into the data */
int szHdrSz; /* Size of the header size field at start of record */
int avail; /* Number of bytes of available data */
@@ -2255,7 +2254,7 @@ case OP_MakeRecord: {
Mem *pRec; /* The new record */
u64 nData = 0; /* Number of bytes of data space */
int nHdr = 0; /* Number of bytes of header space */
u64 nByte = 0; /* Data space required for this record */
i64 nByte = 0; /* Data space required for this record */
int nZero = 0; /* Number of zero bytes at the end of the record */
int nVarint; /* Number of bytes in a varint */
u32 serial_type; /* Type field */
@@ -3328,7 +3327,7 @@ case OP_NewRowid: { /* out2-prerelease */
** Others complain about 0x7ffffffffffffffffLL. The following macro seems
** to provide the constant while making all compilers happy.
*/
# define MAX_ROWID ( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
# define MAX_ROWID (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
#endif
if( !pC->useRandomRowid ){
@@ -3634,7 +3633,7 @@ case OP_RowData: {
n = n64;
}else{
sqlite3BtreeDataSize(pCrsr, &n);
if( n>db->aLimit[SQLITE_LIMIT_LENGTH] ){
if( (int)n>db->aLimit[SQLITE_LIMIT_LENGTH] ){
goto too_big;
}
}
+2 -2
View File
@@ -15,7 +15,7 @@
** 6000 lines long) it was split up into several smaller files and
** this header information was factored out.
**
** $Id: vdbeInt.h,v 1.157 2008/11/05 16:37:35 drh Exp $
** $Id: vdbeInt.h,v 1.158 2008/11/17 15:31:48 danielk1977 Exp $
*/
#ifndef _VDBEINT_H_
#define _VDBEINT_H_
@@ -296,7 +296,7 @@ struct Vdbe {
Mem *aVar; /* Values for the OP_Variable opcode. */
char **azVar; /* Name of variables */
int okVar; /* True if azVar[] has been initialized */
int magic; /* Magic number for sanity checking */
u32 magic; /* Magic number for sanity checking */
int nMem; /* Number of memory locations currently allocated */
Mem *aMem; /* The memory locations */
int nCallback; /* Number of callbacks invoked so far */