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

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:12:   #include "module.h"      #include "config.h"      #include "whitefish.h"   #include "resultset.h"   #include "blob.h"   #include "blobs.h"   #include "linkfarm.h"    - /* 7.2 compatibility stuff. */ -  - #ifndef PIKE_MODULE_INIT - /* must be included last */ - #include "module_magic.h" - #define PIKE_MODULE_INIT void pike_module_init(void) - #define PIKE_MODULE_EXIT void pike_module_exit(void) - #endif -  +    struct tofree   {    Blob **blobs;    Blob **tmp;    int nblobs;    struct object *res;   };      static void free_stuff( void *_t )   {
pike.git/src/modules/_WhiteFish/whitefish.c:76:    double mc, double mp,    int cutoff )   {    int i, j, k, end = 0;    Hit *hits = calloc( nblobs, sizeof(Hit) );    unsigned char *nhits = malloc( nblobs );    unsigned char *pos = malloc( nblobs );       int matrix[65][8];    -  MEMSET(matrix, 0, sizeof(matrix) ); +  memset(matrix, 0, sizeof(matrix) );       for( i = 0; i<nblobs; i++ )    nhits[i] = wf_blob_nhits( blobs[i] );          for( i = 0; i<nblobs; i++ )    { -  MEMSET( pos, 0, nblobs ); +  memset( pos, 0, nblobs );    for( j = 0; j<nhits[i]; j++ )    {    hits[i] = wf_blob_hit( blobs[i], j );    matrix[MOFF(hits[i])][3]++;       /* forward the other positions */    for( k = 0; k<nblobs; k++ )    if( k != i && pos[ k ] < nhits[ k ] )    {    while( (hits[k].raw < hits[i].raw) && (pos[ k ] < nhits[ k ]))
pike.git/src/modules/_WhiteFish/whitefish.c:203:    int docid,    double *field_c[65],    double mc )   {    int i, j, k;    unsigned char *nhits = malloc( nblobs*2 );    unsigned char *first = nhits+nblobs;    int matrix[65];    double accum = 0.0;    -  MEMSET(matrix, 0, sizeof(matrix) ); +  memset(matrix, 0, sizeof(matrix) );          for( i = 0; i<nblobs; i++ )    {    nhits[i] = wf_blob_nhits( blobs[i] );    first[i] = 0;    }          for( i = 0; i<nhits[0]; i++)