/ Check-in [452ccaa9]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Take out the incomplete initializer on the constant "dummy" in sqlite3VdbeGetOp(). Add a comment that the MSVC warning there should be ignored.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mistake
Files: files | file ages | folders
SHA1: 452ccaa9080e42657b5f0908bf40dbd834cd39f6
User & Date: drh 2010-07-02 18:44:37
Context
2010-07-02
18:58
Do not run the tests in notify3.test unless the unlock-notify API is available. check-in: 0d7fd6fe user: dan tags: mistake
18:44
Take out the incomplete initializer on the constant "dummy" in sqlite3VdbeGetOp(). Add a comment that the MSVC warning there should be ignored. check-in: 452ccaa9 user: drh tags: mistake
18:15
Fix a couple more compiler warnings under MSVC. check-in: 26bc27e3 user: shaneh tags: mistake
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

826
827
828
829
830
831
832


833
834
835
836
837
838
839
840
** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as
** a new VDBE is created.  So we are free to set addr to p->nOp-1 without
** having to double-check to make sure that the result is non-negative. But
** if SQLITE_OMIT_TRACE is defined, the OP_Trace is omitted and we do need to
** check the value of p->nOp-1 before continuing.
*/
VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){


  static const VdbeOp dummy = { 0 };
  assert( p->magic==VDBE_MAGIC_INIT );
  if( addr<0 ){
#ifdef SQLITE_OMIT_TRACE
    if( p->nOp==0 ) return (VdbeOp*)&dummy;
#endif
    addr = p->nOp - 1;
  }







>
>
|







826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as
** a new VDBE is created.  So we are free to set addr to p->nOp-1 without
** having to double-check to make sure that the result is non-negative. But
** if SQLITE_OMIT_TRACE is defined, the OP_Trace is omitted and we do need to
** check the value of p->nOp-1 before continuing.
*/
VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
  /* C89 specifies that the constant "dummy" will be initialized to all
  ** zeros, which is correct.  MSVC generates a warning, nevertheless. */
  static const VdbeOp dummy;  /* Ignore the MSVC warning about no initializer */
  assert( p->magic==VDBE_MAGIC_INIT );
  if( addr<0 ){
#ifdef SQLITE_OMIT_TRACE
    if( p->nOp==0 ) return (VdbeOp*)&dummy;
#endif
    addr = p->nOp - 1;
  }