pike.git / src / modules / _WhiteFish / whitefish.c

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:1:   #include <math.h>      #include "global.h"   #include "stralloc.h"   #include "global.h" - RCSID("$Id: whitefish.c,v 1.16 2001/05/25 15:55:20 per Exp $"); + RCSID("$Id: whitefish.c,v 1.17 2001/05/25 16:17:59 per Exp $");   #include "pike_macros.h"   #include "interpret.h"   #include "program.h"   #include "program_id.h"   #include "object.h"   #include "operators.h"   #include "array.h"   #include "module_support.h"      #include "config.h"
pike.git/src/modules/_WhiteFish/whitefish.c:37:    if( t->res ) free_object( t->res );    for( i = 0; i<t->nblobs; i++ )    wf_blob_free( t->blobs[i] );    free( t->tmp );    free( t );   }      #define OFFSET(X) \    (X.type == HIT_BODY?X.u.body.pos:X.type==HIT_FIELD?(X.u.field.pos):(X.u.anchor.pos))    - #define DOFF(X) MINIMUM((int)X,7) + static int _distance_f( int distance ) + { +  if( distance < 2 ) return 0; +  if( distance < 6 ) return 1; +  if( distance < 11 ) return 2; +  if( distance < 22 ) return 3; +  if( distance < 42 ) return 4; +  if( distance < 82 ) return 5; +  if( distance < 161 ) return 6; +  return 7; + } +  + #define DOFF(X) _distance_f(X)   #define MOFF(X) (X.type==HIT_BODY?0:X.type==HIT_FIELD?X.u.field.type+2:1)      static void handle_hit( Blob **blobs,    int nblobs,    struct object *res,    int docid,    double *field_c[66],    double *prox_c[8],    double mc, double mp)   {