apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr-util/dbm apr_dbm_sdbm.c
Date Thu, 19 Feb 2004 16:50:37 GMT
jorton      2004/02/19 08:50:37

  Modified:    test     Tag: APU_0_9_BRANCH testdbm.c
               dbm      Tag: APU_0_9_BRANCH apr_dbm_sdbm.c
  Log:
  Backport from HEAD:
  
  * dbm/apr_dbm_sdbm.c (vt_sdbm_exists): Fix (size_t *) -> (int *) casts
  missed in earlier fix for PR 14861. (broken only on bigendian LP64
  platforms)
  
  * test/testdb.c (doit): Add regression test.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.20.2.2  +5 -1      apr-util/test/testdbm.c
  
  Index: testdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/test/testdbm.c,v
  retrieving revision 1.20.2.1
  retrieving revision 1.20.2.2
  diff -w -d -u -r1.20.2.1 -r1.20.2.2
  --- testdbm.c	13 Feb 2004 09:52:44 -0000	1.20.2.1
  +++ testdbm.c	19 Feb 2004 16:50:36 -0000	1.20.2.2
  @@ -307,7 +307,7 @@
                   }
               }
               fputs("OK\n", stderr);
  -            fputs("Testing retrieval: ", stderr);
  +            fputs("Testing existence/retrieval: ", stderr);
               for (i = 0; i < 10; i++) {
                   int j;
                   char c, keydata[10];
  @@ -316,6 +316,10 @@
                   }
                   key.dptr = keydata;
                   key.dsize = 10;
  +                if (!apr_dbm_exists(db, key)) {
  +                    prdatum(stderr, key);
  +                    oops(db, 0, "exists: %s", "failed");
  +                }
                   rv = apr_dbm_fetch(db, key, &val);
                   if (rv != APR_SUCCESS || val.dsize != 10 ||
                       (strncmp(val.dptr, valdata, 10) != 0) ) { 
  
  
  
  No                   revision
  No                   revision
  1.10.2.2  +4 -2      apr-util/dbm/apr_dbm_sdbm.c
  
  Index: apr_dbm_sdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/apr_dbm_sdbm.c,v
  retrieving revision 1.10.2.1
  retrieving revision 1.10.2.2
  diff -w -d -u -r1.10.2.1 -r1.10.2.2
  --- apr_dbm_sdbm.c	13 Feb 2004 09:52:42 -0000	1.10.2.1
  +++ apr_dbm_sdbm.c	19 Feb 2004 16:50:37 -0000	1.10.2.2
  @@ -179,11 +179,13 @@
   static int vt_sdbm_exists(apr_dbm_t *dbm, apr_datum_t key)
   {
       int exists;
  -    apr_sdbm_datum_t *ckey = (apr_sdbm_datum_t *)&key;
  +    apr_sdbm_datum_t ckey;
  +
  +    CONVERT_DATUM(ckey, &key);
   
       {
           apr_sdbm_datum_t value;
  -        if (apr_sdbm_fetch(dbm->file, &value, *ckey) != APR_SUCCESS) {
  +        if (apr_sdbm_fetch(dbm->file, &value, ckey) != APR_SUCCESS) {
               exists = 0;
           }
           else
  
  
  

Mime
View raw message