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

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:128:    double field_c[65],    double prox_c[8],    int cutoff)   {    struct object *res = wf_resultset_new();    struct tofree *__f = malloc( sizeof( struct tofree ) );    double max_c=0.0, max_p=0.0;    ONERROR e;    int i, j;    Blob **tmp; -  tmp = malloc( nblobs * sizeof( Blob *) ); +  tmp = calloc( nblobs, sizeof( Blob *) );       __f->res = res;    __f->blobs = blobs;    __f->nblobs = nblobs;    __f->tmp = tmp;    SET_ONERROR( e, free_stuff, __f );          for( i = 0; i<65; i++ )    if( field_c[i] > max_c )
pike.git/src/modules/_WhiteFish/whitefish.c:418:       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }    -  blobs = malloc( sizeof(Blob *) * numblobs ); +  blobs = calloc( numblobs, sizeof(Blob *) );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<65; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_phrase(blobs,numblobs, field_coefficients );    pop_n_elems( args );    wf_resultset_push( res );
pike.git/src/modules/_WhiteFish/whitefish.c:512:       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }    -  blobs = malloc( sizeof(Blob *) * numblobs ); +  blobs = calloc( numblobs, sizeof(Blob *) );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<65; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;   
pike.git/src/modules/_WhiteFish/whitefish.c:613:       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }    -  blobs = malloc( sizeof(Blob *) * numblobs ); +  blobs = calloc( numblobs, sizeof(Blob *) );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<65; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;