SQLite

Check-in [54d285464a]
Login

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

Overview
Comment:Fix C99-style variable declaration issue seen with older versions of MSVC.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 54d285464a222c59327eb6c917c1cc0125a55a27
User & Date: mistachkin 2017-02-01 22:59:29.767
Context
2017-02-01
23:03
Backout the change in [02f6293f27] as it causes MSVC to complain. (check-in: aaae74d06f user: mistachkin tags: trunk)
22:59
Fix C99-style variable declaration issue seen with older versions of MSVC. (check-in: 54d285464a user: mistachkin tags: trunk)
22:32
Add an option to the MSVC makefile to enable treating warnings as errors. (check-in: 6a378c29b4 user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/rtree/rtree.c.
446
447
448
449
450
451
452
453
454
455

456
457
458
459

460
461
462
463

464
465
466

467
468
469
470
471
472
473
    (((u32)p[1]) << 16) + 
    (((u32)p[2]) <<  8) + 
    (((u32)p[3]) <<  0)
  );
#endif
}
static i64 readInt64(u8 *p){
  testcase( ((((char*)p) - (char*)0)&7)!=0 );  /* not always 8-byte aligned */
#if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
  u64 x;

  memcpy(&x, p, 8);
  return (i64)_byteswap_uint64(x);
#elif SQLITE_BYTEORDER==1234 && (GCC_VERSION>=4003000 || CLANG_VERSION>=3000000)
  u64 x;

  memcpy(&x, p, 8);
  return (i64)__builtin_bswap64(x);
#elif SQLITE_BYTEORDER==4321
  i64 x;

  memcpy(&x, p, 8);
  return x;
#else

  return (
    (((i64)p[0]) << 56) + 
    (((i64)p[1]) << 48) + 
    (((i64)p[2]) << 40) + 
    (((i64)p[3]) << 32) + 
    (((i64)p[4]) << 24) + 
    (((i64)p[5]) << 16) + 







<


>




>




>



>







446
447
448
449
450
451
452

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
    (((u32)p[1]) << 16) + 
    (((u32)p[2]) <<  8) + 
    (((u32)p[3]) <<  0)
  );
#endif
}
static i64 readInt64(u8 *p){

#if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
  u64 x;
  testcase( ((((char*)p) - (char*)0)&7)!=0 );  /* not always 8-byte aligned */
  memcpy(&x, p, 8);
  return (i64)_byteswap_uint64(x);
#elif SQLITE_BYTEORDER==1234 && (GCC_VERSION>=4003000 || CLANG_VERSION>=3000000)
  u64 x;
  testcase( ((((char*)p) - (char*)0)&7)!=0 );  /* not always 8-byte aligned */
  memcpy(&x, p, 8);
  return (i64)__builtin_bswap64(x);
#elif SQLITE_BYTEORDER==4321
  i64 x;
  testcase( ((((char*)p) - (char*)0)&7)!=0 );  /* not always 8-byte aligned */
  memcpy(&x, p, 8);
  return x;
#else
  testcase( ((((char*)p) - (char*)0)&7)!=0 );  /* not always 8-byte aligned */
  return (
    (((i64)p[0]) << 56) + 
    (((i64)p[1]) << 48) + 
    (((i64)p[2]) << 40) + 
    (((i64)p[3]) << 32) + 
    (((i64)p[4]) << 24) + 
    (((i64)p[5]) << 16) +