@@ -228,16 +228,16 @@ static HashTableX s_abbrTable;
228
228
static bool s_abbrInitialized = false ;
229
229
230
230
/*
231
- static bool initTable ( HashTableX *table, char *words[], long size ) {
231
+ static bool initTable ( HashTableX *table, char *words[], int32_t size ) {
232
232
// set up the hash table
233
233
if ( ! table->set ( 8 , 4 , size * 2,NULL,0,false,MAX_NICENESS,
234
234
"abbrtbl") )
235
235
return log("build: Could not init abbreviation table.");
236
236
// now add in all the stop words
237
- long n = (long )size/ sizeof(char *);
238
- for ( long i = 0 ; i < n ; i++ ) {
237
+ int32_t n = (int32_t )size/ sizeof(char *);
238
+ for ( int32_t i = 0 ; i < n ; i++ ) {
239
239
char *sw = words[i];
240
- //long swlen = gbstrlen ( sw );
240
+ //int32_t swlen = gbstrlen ( sw );
241
241
int64_t swh = hash64Lower_utf8 ( sw );
242
242
if ( ! table->addTerm (&swh,i+1) ) return false;
243
243
}
@@ -247,28 +247,28 @@ static bool initTable ( HashTableX *table, char *words[], long size ) {
247
247
248
248
bool isAbbr ( int64_t h , bool *hasWordAfter ) {
249
249
if ( ! s_abbrInitialized ) {
250
- // shortcut
250
+ // int16_tcut
251
251
HashTableX *t = &s_abbrTable;
252
252
// set up the hash table
253
- long n = ((long )sizeof (s_abbrs99))/ ((long )sizeof (Abbr));
253
+ int32_t n = ((int32_t )sizeof (s_abbrs99))/ ((int32_t )sizeof (Abbr));
254
254
if ( ! t->set ( 8 ,4 ,n*4 , NULL ,0 ,false ,MAX_NICENESS," abbrtbl" ))
255
255
return log (" build: Could not init abbrev table." );
256
256
// now add in all the stop words
257
- for ( long i = 0 ; i < n ; i++ ) {
257
+ for ( int32_t i = 0 ; i < n ; i++ ) {
258
258
char *sw = s_abbrs99[i].m_str ;
259
259
int64_t swh = hash64Lower_utf8 ( sw );
260
- long val = i + 1 ;
260
+ int32_t val = i + 1 ;
261
261
if ( ! t->addKey (&swh,&val) ) return false ;
262
262
}
263
263
s_abbrInitialized = true ;
264
264
// test it
265
265
int64_t h = hash64Lower_utf8 (" St" );
266
266
if ( ! t->isInTable (&h) ) { char *xx=NULL ;*xx=0 ; }
267
- long sc = s_abbrTable.getScore ( &h );
267
+ int32_t sc = s_abbrTable.getScore ( &h );
268
268
if ( sc >= n ) { char *xx=NULL ;*xx=0 ; }
269
269
}
270
270
// get from table
271
- long sc = s_abbrTable.getScore ( &h );
271
+ int32_t sc = s_abbrTable.getScore ( &h );
272
272
if ( sc <= 0 ) return false ;
273
273
if ( hasWordAfter ) *hasWordAfter = s_abbrs99[sc-1 ].m_hasWordAfter ;
274
274
return true ;
0 commit comments