Ignore:
Timestamp:
2012-02-28T13:59:00+13:00 (12 years ago)
Author:
kjdon
Message:

merged 64_bit_Greenstone branch into trunk, rev 25139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_weights_build.c

    r16583 r25147  
    3838#include "words.h"
    3939
    40 #define MAXBITS (sizeof(unsigned long) * 8)
     40#define MAXBITS (sizeof(mg_u_long) * 8)
    4141
    4242/*
     
    8181static char *file_name = "";
    8282static char *text_file_name = "";
    83 static unsigned long NumPara = 0;
    84 static unsigned long StaticNumOfDocs = 0;
    85 
    86 unsigned long get_NumPara (void);
    87 unsigned long get_StaticNumOfDocs (void);
     83static mg_u_long NumPara = 0;
     84static mg_u_long StaticNumOfDocs = 0;
     85
     86mg_u_long get_NumPara (void);
     87mg_u_long get_StaticNumOfDocs (void);
    8888void GenerateWeights (void);
    8989void Make_weight_approx (void);
     
    141141
    142142
    143 unsigned long
     143mg_u_long
    144144get_NumPara (void)
    145145{
     
    158158
    159159
    160 unsigned long
     160mg_u_long
    161161get_StaticNumOfDocs (void)
    162162/* the static number of documents is the N parameter used to
     
    253253    {
    254254      u_char dummy1, dummy2[MAXSTEMLEN + 1];
    255       unsigned long fcnt, wcnt, blk, CurrDoc, p, j;
     255      mg_u_long fcnt, wcnt, blk, CurrDoc, p, j;
    256256      float idf;
    257257
     
    281281      /* check the inverted file index entry for this word */
    282282      {
    283     unsigned long loc;
     283    mg_u_long loc;
    284284    fread ((char *) &loc, sizeof (loc), 1, idx);
    285285    NTOHUL(loc);  /* [RPAP - Jan 97: Endian Ordering] */
     
    292292      for (j = 0; j < p; j++)
    293293    {
    294       unsigned long x, tf;
     294      mg_u_long x, tf;
    295295      BBLOCK_DECODE (x, blk);
    296296      CurrDoc += x;
     
    346346{
    347347  int i, pos, max;
    348   unsigned long buf;
     348  mg_u_long buf;
    349349  double U, L, B;
    350350  FILE *approx, *exact;
     
    368368
    369369    }
    370   fseek (exact, sizeof (u_long), SEEK_SET);
     370  fseek (exact, sizeof (mg_u_long), SEEK_SET);
    371371
    372372  B = pow (U / L, pow (2.0, -(double) bits));
     
    392392  for (buf = pos = i = 0; i < NumPara; i++)
    393393    {
    394       unsigned long fx;
     394      mg_u_long fx;
    395395      float wgt;
    396396      fread ((char *) &wgt, sizeof (wgt), 1, exact);
     
    476476    struct
    477477      {
    478     unsigned long Start;
     478    mg_u_long Start;
    479479    float Weight;
    480480      }
     
    483483      {
    484484    int count;
    485     fread ((char *) &data.Start, sizeof (unsigned long), 1, idx);
     485    fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx);
    486486    if (para && i < cth.num_of_docs)
    487487      {
     
    502502      }
    503503    /* Write out the extra entry for the idx file */
    504     fread ((char *) &data.Start, sizeof (unsigned long), 1, idx);
     504    fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx);
    505505    data.Weight = 0;
    506506    fwrite((char*)&data, sizeof(data), 1, idx_wgt);
Note: See TracChangeset for help on using the changeset viewer.