/ Check-in [0c903461]
Login

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

Overview
Comment:Fix for ticket #47: Use a cast to avoid a warning about discarding a "const" inside of hash.c. (CVS 577)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0c903461533fabca7815e8cccbd3b712bcd22ddc
User & Date: drh 2002-05-21 23:44:30
Context
2002-05-22
21:27
Fix for ticket #46: Report an error if a CREATE TABLE contains two or more columns with the same name. (CVS 578) check-in: ba1953ab user: drh tags: trunk
2002-05-21
23:44
Fix for ticket #47: Use a cast to avoid a warning about discarding a "const" inside of hash.c. (CVS 577) check-in: 0c903461 user: drh tags: trunk
13:43
Double-quoted strings resolve to column names if possible. Single-quoted strings continue to be interpreted as string literals. (CVS 576) check-in: 55e7d654 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/hash.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This is the implementation of generic hash-tables
    13     13   ** used in SQLite.
    14     14   **
    15         -** $Id: hash.c,v 1.7 2002/02/23 23:45:45 drh Exp $
           15  +** $Id: hash.c,v 1.8 2002/05/21 23:44:30 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <assert.h>
    19     19   
    20     20   /* Turn bulk memory into a hash table object by initializing the
    21     21   ** fields of the Hash structure.
    22     22   **
................................................................................
   316    316       new_elem->pKey = sqliteMalloc( nKey );
   317    317       if( new_elem->pKey==0 ){
   318    318         sqliteFree(new_elem);
   319    319         return data;
   320    320       }
   321    321       memcpy((void*)new_elem->pKey, pKey, nKey);
   322    322     }else{
   323         -    new_elem->pKey = (const void*)pKey;
          323  +    new_elem->pKey = (void*)pKey;
   324    324     }
   325    325     new_elem->nKey = nKey;
   326    326     pH->count++;
   327    327     if( pH->htsize==0 ) rehash(pH,8);
   328    328     if( pH->htsize==0 ){
   329    329       pH->count = 0;
   330    330       sqliteFree(new_elem);