RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   29-Dec-2010 17:33:54
  Branch: HEAD                             Handle: 2010122916335201

  Modified files:
    rpm                     CHANGES
    rpm/lib                 rpmrc.c
    rpm/rpmio               librpmio.vers lookup3.c

  Log:
    - revert lookup3.c+valgrind because gcc version dependent.

  Summary:
    Revision    Changes     Path
    1.3528      +1  -0      rpm/CHANGES
    2.291       +0  -4      rpm/lib/rpmrc.c
    2.201       +0  -1      rpm/rpmio/librpmio.vers
    1.8         +62 -72     rpm/rpmio/lookup3.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3527 -r1.3528 CHANGES
  --- rpm/CHANGES       29 Dec 2010 16:07:59 -0000      1.3527
  +++ rpm/CHANGES       29 Dec 2010 16:33:52 -0000      1.3528
  @@ -1,4 +1,5 @@
   5.4.0 -> 5.4.1:
  +    - jbj: revert lookup3.c+valgrind because gcc version dependent.
   
   5.3.7 -> 5.4.0:
       - jbj: remove markReplacedFiles.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  ============================================================================
  $ cvs diff -u -r2.290 -r2.291 rpmrc.c
  --- rpm/lib/rpmrc.c   25 Dec 2010 20:39:05 -0000      2.290
  +++ rpm/lib/rpmrc.c   29 Dec 2010 16:33:53 -0000      2.291
  @@ -1070,10 +1070,6 @@
   {
       int rc = 0;
   
  -#ifdef WITH_VALGRIND
  -    _running_on_valgrind = RUNNING_ON_VALGRIND;
  -#endif
  -
       if (!defaultsInitialized) {
        setDefaults();
        defaultsInitialized = 1;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/librpmio.vers
  ============================================================================
  $ cvs diff -u -r2.200 -r2.201 librpmio.vers
  --- rpm/rpmio/librpmio.vers   25 Dec 2010 20:39:04 -0000      2.200
  +++ rpm/rpmio/librpmio.vers   29 Dec 2010 16:33:53 -0000      2.201
  @@ -881,7 +881,6 @@
       mongo_simple_int_command;
       mongo_simple_str_command;
       mongo_update;
  -    _running_on_valgrind;
     local:
       *;
   };
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/lookup3.c
  ============================================================================
  $ cvs diff -u -r1.7 -r1.8 lookup3.c
  --- rpm/rpmio/lookup3.c       25 Dec 2010 20:39:04 -0000      1.7
  +++ rpm/rpmio/lookup3.c       29 Dec 2010 16:33:53 -0000      1.8
  @@ -255,7 +255,7 @@
       u.ptr = key;
       if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
        const rpmuint32_t *k = (const rpmuint32_t *)key;        /* read 32-bit 
chunks */
  -#ifdef       WITH_VALGRIND
  +#ifdef       VALGRIND
        const rpmuint8_t  *k8;
   #endif
   
  @@ -279,29 +279,8 @@
         * still catch it and complain.  The masking trick does make the hash
         * noticably faster for short strings (like English words).
         */
  -#ifdef WITH_VALGRIND
  -     if(UNLIKELY(_running_on_valgrind)) {
  -     /* make valgrind happy */
  +#ifndef VALGRIND
   
  -     k8 = (const rpmuint8_t *)k;
  -     switch (size) {
  -     case 12:        c += k[2]; b+=k[1]; a+=k[0];    break;
  -     case 11:        c += ((rpmuint32_t)k8[10])<<16; /*...@fallthrough@*/
  -     case 10:        c += ((rpmuint32_t)k8[9])<<8;   /*...@fallthrough@*/
  -     case  9:        c += k8[8];                     /*...@fallthrough@*/
  -     case  8:        b += k[1]; a+=k[0];             break;
  -     case  7:        b += ((rpmuint32_t)k8[6])<<16;  /*...@fallthrough@*/
  -     case  6:        b += ((rpmuint32_t)k8[5])<<8;   /*...@fallthrough@*/
  -     case  5:        b += k8[4];                     /*...@fallthrough@*/
  -     case  4:        a += k[0];                      break;
  -     case  3:        a += ((rpmuint32_t)k8[2])<<16;  /*...@fallthrough@*/
  -     case  2:        a += ((rpmuint32_t)k8[1])<<8;   /*...@fallthrough@*/
  -     case  1:        a += k8[0];                     break;
  -     case  0:        goto exit;
  -     }
  -
  -     } else {
  -#endif
        switch (size) {
        case 12:        c += k[2]; b+=k[1]; a+=k[0]; break;
        case 11:        c += k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
  @@ -317,8 +296,26 @@
        case  1:        a += k[0]&0xff; break;
        case  0:        goto exit;
        }
  -#ifdef WITH_VALGRIND
  +
  +#else /* make valgrind happy */
  +
  +     k8 = (const rpmuint8_t *)k;
  +     switch (size) {
  +     case 12:        c += k[2]; b+=k[1]; a+=k[0]     break;
  +     case 11:        c += ((rpmuint32_t)k8[10])<<16; /*...@fallthrough@*/
  +     case 10:        c += ((rpmuint32_t)k8[9])<<8;   /*...@fallthrough@*/
  +     case  9:        c += k8[8];                     /*...@fallthrough@*/
  +     case  8:        b += k[1]; a+=k[0];             break;
  +     case  7:        b += ((rpmuint32_t)k8[6])<<16;  /*...@fallthrough@*/
  +     case  6:        b += ((rpmuint32_t)k8[5])<<8;   /*...@fallthrough@*/
  +     case  5:        b += k8[4];                     /*...@fallthrough@*/
  +     case  4:        a += k[0];                      break;
  +     case  3:        a += ((rpmuint32_t)k8[2])<<16;  /*...@fallthrough@*/
  +     case  2:        a += ((rpmuint32_t)k8[1])<<8;   /*...@fallthrough@*/
  +     case  1:        a += k8[0];                     break;
  +     case  0:        goto exit;
        }
  +
   #endif /* !valgrind */
   
       } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
  @@ -468,7 +465,7 @@
       u.ptr = key;
       if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
        const rpmuint32_t *k = (const rpmuint32_t *)key;        /* read 32-bit 
chunks */
  -#ifdef       WITH_VALGRIND
  +#ifdef       VALGRIND
        const rpmuint8_t  *k8;
   #endif
   
  @@ -491,9 +488,25 @@
         * still catch it and complain.  The masking trick does make the hash
         * noticably faster for short strings (like English words).
         */
  -#ifdef WITH_VALGRIND
  -     if(UNLIKELY(_running_on_valgrind)) {
  -     /* make valgrind happy */
  +#ifndef VALGRIND
  +
  +     switch (size) {
  +     case 12:        c += k[2]; b+=k[1]; a+=k[0]; break;
  +     case 11:        c += k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
  +     case 10:        c += k[2]&0xffff; b+=k[1]; a+=k[0]; break;
  +     case  9:        c += k[2]&0xff; b+=k[1]; a+=k[0]; break;
  +     case  8:        b += k[1]; a+=k[0]; break;
  +     case  7:        b += k[1]&0xffffff; a+=k[0]; break;
  +     case  6:        b += k[1]&0xffff; a+=k[0]; break;
  +     case  5:        b += k[1]&0xff; a+=k[0]; break;
  +     case  4:        a += k[0]; break;
  +     case  3:        a += k[0]&0xffffff; break;
  +     case  2:        a += k[0]&0xffff; break;
  +     case  1:        a += k[0]&0xff; break;
  +     case  0:        goto exit;
  +     }
  +
  +#else /* make valgrind happy */
   
        k8 = (const rpmuint8_t *)k;
        switch (size) {
  @@ -512,26 +525,6 @@
        case  0:        goto exit;
        }
   
  -     } else {
  -#endif
  -     switch (size) {
  -     case 12:        c += k[2]; b+=k[1]; a+=k[0]; break;
  -     case 11:        c += k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
  -     case 10:        c += k[2]&0xffff; b+=k[1]; a+=k[0]; break;
  -     case  9:        c += k[2]&0xff; b+=k[1]; a+=k[0]; break;
  -     case  8:        b += k[1]; a+=k[0]; break;
  -     case  7:        b += k[1]&0xffffff; a+=k[0]; break;
  -     case  6:        b += k[1]&0xffff; a+=k[0]; break;
  -     case  5:        b += k[1]&0xff; a+=k[0]; break;
  -     case  4:        a += k[0]; break;
  -     case  3:        a += k[0]&0xffffff; break;
  -     case  2:        a += k[0]&0xffff; break;
  -     case  1:        a += k[0]&0xff; break;
  -     case  0:        goto exit;
  -     }
  -
  -#ifdef WITH_VALGRIND
  -     }       
   #endif /* !valgrind */
   
       } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
  @@ -675,7 +668,7 @@
       u.ptr = key;
       if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
        const rpmuint32_t *k = (const rpmuint32_t *)key;        /* read 32-bit 
chunks */
  -#ifdef       WITH_VALGRIND
  +#ifdef       VALGRIND
        const rpmuint8_t  *k8;
   #endif
   
  @@ -699,9 +692,25 @@
         * still catch it and complain.  The masking trick does make the hash
         * noticably faster for short strings (like English words).
         */
  -#ifdef WITH_VALGRIND
  -     if(UNLIKELY(_running_on_valgrind)) {
  -     /* make valgrind happy */
  +#ifndef VALGRIND
  +
  +     switch (size) {
  +     case 12:        c += k[2]; b+=k[1]; a+=k[0]; break;
  +     case 11:        c += k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
  +     case 10:        c += k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
  +     case  9:        c += k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
  +     case  8:        b += k[1]; a+=k[0]; break;
  +     case  7:        b += k[1]&0xffffff00; a+=k[0]; break;
  +     case  6:        b += k[1]&0xffff0000; a+=k[0]; break;
  +     case  5:        b += k[1]&0xff000000; a+=k[0]; break;
  +     case  4:        a += k[0]; break;
  +     case  3:        a += k[0]&0xffffff00; break;
  +     case  2:        a += k[0]&0xffff0000; break;
  +     case  1:        a += k[0]&0xff000000; break;
  +     case  0:        goto exit;
  +    }
  +
  +#else  /* make valgrind happy */
   
        k8 = (const rpmuint8_t *)k;
        switch (size) { /* all the case statements fall through */
  @@ -718,27 +727,8 @@
        case  2:        a += ((rpmuint32_t)k8[1])<<16;  /*...@fallthrough@*/
        case  1:        a += ((rpmuint32_t)k8[0])<<24;  break;
        case  0:        goto exit;
  -        }
  +    }
   
  -     } else {
  -#endif
  -     switch (size) {
  -     case 12:        c += k[2]; b+=k[1]; a+=k[0]; break;
  -     case 11:        c += k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
  -     case 10:        c += k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
  -     case  9:        c += k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
  -     case  8:        b += k[1]; a+=k[0]; break;
  -     case  7:        b += k[1]&0xffffff00; a+=k[0]; break;
  -     case  6:        b += k[1]&0xffff0000; a+=k[0]; break;
  -     case  5:        b += k[1]&0xff000000; a+=k[0]; break;
  -     case  4:        a += k[0]; break;
  -     case  3:        a += k[0]&0xffffff00; break;
  -     case  2:        a += k[0]&0xffff0000; break;
  -     case  1:        a += k[0]&0xff000000; break;
  -     case  0:        goto exit;
  -     }
  -#ifdef WITH_VALGRIND
  -     }
   #endif /* !VALGRIND */
   
       } else {                        /* need to read the key one byte at a 
time */
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to