Ignore:
Timestamp:
1999-10-18T12:43:31+13:00 (25 years ago)
Author:
cs025
Message:

Changes to eradicate Xmalloc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/weights.cpp

    r655 r711  
    4343/*
    4444   $Log$
     45   Revision 1.2  1999/10/17 23:43:31  cs025
     46   Changes to eradicate Xmalloc
     47
    4548   Revision 1.1  1999/10/11 02:58:41  cs025
    4649   Base install of MG-PP
     
    6871  int num;
    6972
    70   if (!(awd = (approx_weights_data *) Xmalloc (sizeof (*awd))))
     73  if (!(awd = new approx_weights_data))
    7174    {
    7275      mg_errno = MG_NOMEM;
     
    8487
    8588  num = (num_of_docs * awd->bits + 31) / 32;
    86   if (!(awd->DocWeights = (long unsigned int *) Xmalloc (sizeof (unsigned long) * num)))
     89  if (!(awd->DocWeights = new (unsigned long)[num]))
    8790    {
    88       Xfree (awd);
     91      delete awd;
    8992      mg_errno = MG_NOMEM;
    9093      return (NULL);
     
    107110    {
    108111      int i, size = (1 << awd->bits);
    109       if (!(awd->table = (float *) Xmalloc (size * sizeof (float))))
     112      if (!(awd->table = new float[size]))
    110113      return (awd);
    111114      awd->table[0] = awd->L;
     
    155158FreeWeights (approx_weights_data * awd)
    156159{
    157   Xfree (awd->DocWeights);
     160  delete (awd->DocWeights);
    158161  if (awd->table)
    159     Xfree (awd->table);
    160   Xfree (awd);
     162    delete (awd->table);
     163  delete awd;
    161164}
    162165
Note: See TracChangeset for help on using the changeset viewer.