[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesdk/kbabel/kbabeldict/modules/dbsearchengine
From:       Marcus Meissner <marcus () jet ! franken ! de>
Date:       2003-10-24 15:23:24
[Download RAW message or body]

CVS commit by mm: 

Fixed breakage on 64bit platforms.

We were sometimes using loc-1 with loc being 0.
Since loc is uint32_t , loc-1 is 0xffffffff. This works on 32 bit, since
it is the same as 0, but breaks utterly on 64bit systems.

The code in here is a mess in general.


  M +4 -2      database.cpp   1.44


--- kdesdk/kbabel/kbabeldict/modules/dbsearchengine/database.cpp  #1.43:1.44
@@ -1065,5 +1065,5 @@ d+=2; //1 uint32!  
 
 while( (!end) && ( (forward=(d[loc])<location) 
-                         ||(d[loc-1]>location)) )
+                         ||((loc > 0) && (d[loc-1]>location))) )
 {
 
@@ -1079,8 +1079,10 @@ while( (!end) && ( (forward=(d[loc])<loc
 
     kdDebug(KBABEL_SEARCH) << "Insert:" << location << " We are at: "<< loc << " \
i.e. " <<  d[loc] << "  Step:" << step<< endl;      +    if (loc > 0) {
     if (forward)
 kdDebug(KBABEL_SEARCH) << "Go " << "forward" << " prev is " << d[loc-1] << endl;
     else
     kdDebug(KBABEL_SEARCH) << "Go " << "backward" << " prev is " << d[loc-1] << \
endl; +    }
 
 if(forward)
@@ -1123,5 +1125,5 @@ if(loc==num) kdDebug(KBABEL_SEARCH) << "
 if(loc==0) kdDebug(KBABEL_SEARCH) << "BEGIN" << endl;
 
-kdDebug(KBABEL_SEARCH) << location << " inserted between " << d[loc-1] << " and " << \
d[loc] <<endl;  +if (loc > 0) kdDebug(KBABEL_SEARCH) << location << " inserted \
between " << d[loc-1] << " and " << d[loc] <<endl;   
 if((loc<num && location==d[loc]) || (loc>0 && location==d[loc-1]))  //What about \
word repetition


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic