/ Check-in [8001aa52]
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:Implement sqlite3Strlen30() using strlen() from the C library.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8001aa52bd12f900092387fe3571463e89efd977
User & Date: drh 2015-06-30 03:18:33
Context
2015-06-30
03:34
Put all variable declarations for sqlite3PagerWrite() at the beginning of the block. Syntax only - no logic changes. check-in: a0fa6b3b user: drh tags: trunk
03:18
Implement sqlite3Strlen30() using strlen() from the C library. check-in: 8001aa52 user: drh tags: trunk
03:13
Change sqlite3ApiExit() so that its first argument is never NULL. check-in: 791b706e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
** lower 30 bits of a 32-bit signed integer.
**
** The value returned will never be negative.  Nor will it ever be greater
** than the actual length of the string.  For very long strings (greater
** than 1GiB) the value returned might be less than the true string length.
*/
int sqlite3Strlen30(const char *z){
  const char *z2 = z;
  if( z==0 ) return 0;
  while( *z2 ){ z2++; }
  return 0x3fffffff & (int)(z2 - z);
}

/*
** Set the current error code to err_code and clear any prior error message.
*/
void sqlite3Error(sqlite3 *db, int err_code){
  assert( db!=0 );







<

<
|







101
102
103
104
105
106
107

108

109
110
111
112
113
114
115
116
** lower 30 bits of a 32-bit signed integer.
**
** The value returned will never be negative.  Nor will it ever be greater
** than the actual length of the string.  For very long strings (greater
** than 1GiB) the value returned might be less than the true string length.
*/
int sqlite3Strlen30(const char *z){

  if( z==0 ) return 0;

  return 0x3fffffff & (int)strlen(z);
}

/*
** Set the current error code to err_code and clear any prior error message.
*/
void sqlite3Error(sqlite3 *db, int err_code){
  assert( db!=0 );