Changeset 2928


Ignore:
Timestamp:
2002-01-30T15:40:53+13:00 (20 years ago)
Author:
jrm21
Message:

replaced bzero and bcopy with memset and memcpy in the src, even though it was
already done in the headers, just to make the code a bit clearer.

Location:
trunk/gsdl/src/mgpp
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/lib/bitio_m_random.cpp

    r2377 r2928  
    6868  // copy the buffer
    6969  buffer = new u_char [len];
    70   //  bcopy ((char *)_rbb.buffer, (char *)buffer, len);
     70  //  memcpy (buffer, _rbb.buffer, len);
    7171memcpy (buffer, _rbb.buffer, len);
    7272 
  • trunk/gsdl/src/mgpp/lib/huffman.cpp

    r2468 r2928  
    5252      *mem += num * sizeof (char);
    5353    }
    54   bcopy ((void *) freqs, (void *) &heap[num], num * sizeof (*heap));
    55   bzero ((char *) heap, num * sizeof (*heap));
     54  memcpy (&heap[num], freqs, num * sizeof (*heap));
     55  memset (heap, '\0', num * sizeof (*heap));
    5656
    5757  /* Initialise the pointers to the leaves */
     
    147147
    148148  /* zero the lencount's array */
    149   bzero ((char *) hd->lencount, sizeof (hd->lencount));
     149  memset (hd->lencount, '\0', sizeof (hd->lencount));
    150150  hd->maxcodelen = 0;
    151151  hd->mincodelen = 100;
     
    203203  if (mem)
    204204    *mem += data->num_codes * sizeof (*codes);
    205   bcopy ((void *) data->min_code, (void *) mc, sizeof (mc));
     205  memcpy (mc, data->min_code, sizeof (mc));
    206206  for (i = 0; i < data->num_codes; i++)
    207207    if (data->clens[i])
     
    230230    }
    231231
    232   bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
     232  memset (values, '\0', (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
    233233
    234234  if (mem)
     
    343343      int i;  /* [RPAP - Jan 97: Endian Ordering] */
    344344
    345       bzero ((char *) (hd->lencount), sizeof (hd->lencount));
     345      memset (hd->lencount, '\0', sizeof (hd->lencount));
    346346      if (fread (hd->lencount + hd->mincodelen, sizeof (*hd->lencount),
    347347          hd->maxcodelen - hd->mincodelen + 1, f) !=
     
    356356    (*disk) += sizeof (*hd->lencount) * (hd->maxcodelen - hd->mincodelen + 1);
    357357
    358       bzero ((char *) (hd->min_code), sizeof (hd->min_code));
     358      memset (hd->min_code, '\0', sizeof (hd->min_code));
    359359
    360360      if (fread (hd->min_code, sizeof (*hd->min_code), hd->maxcodelen + 1, f) !=
  • trunk/gsdl/src/mgpp/lib/local_strings.cpp

    r2468 r2928  
    189189    return NULL;
    190190
    191   bcopy ((void *) src_str, (void *) (copy), src_str[0] + 1);
     191  memcpy (copy, src_str, src_str[0] + 1);
    192192  return copy;
    193193
     
    282282  int i, len = (int) *s++;
    283283
    284   bzero (buf, sizeof (buf));
     284  memset (buf, '\0', sizeof(buf));
    285285  for (i = 0; i < len; i++)
    286286    {
  • trunk/gsdl/src/mgpp/lib/lovinstem.cpp

    r2468 r2928  
    450450  /* [RPAP - Jan 97: Stem Index Change] */
    451451  u_char copy[MAX_STEM_LENGTH + 2];
    452   bcopy ((void *) word, (void *) copy, *word + 1);
     452  memcpy (copy, word, *word + 1);
    453453
    454454  old_length = *copy; /* [RPAP - Jan 97: Stem Index Change] */
     
    470470
    471471  /* [RPAP - Jan 97: Stem Index Change] */
    472   bcopy ((void *) copy, (void *) word, *copy + 1);
     472  memcpy (word, copy, *copy + 1);
    473473
    474474}               /*stem_complex */
  • trunk/gsdl/src/mgpp/lib/perf_hash.cpp

    r2468 r2928  
    603603  int i, j;
    604604
    605   bzero ((char *) translate, sizeof (translate));
     605  memset (translate, '\0', sizeof (translate));
    606606
    607607  MAX_L = 1;
     
    740740  perf_hash_data *phd;
    741741  translate = (u_char *)Xmalloc (sizeof (u_char) * 256);
    742   bzero ((char *) translate, sizeof (u_char) * 256);  /* [RPAP - Feb 97: WIN32 Port] */
     742  memset(translate, '\0', sizeof (u_char) * 256);  /* [RPAP - Feb 97: WIN32 Port] */
    743743  make_trans_func (num, keys);
    744744
  • trunk/gsdl/src/mgpp/text/TextGet.cpp

    r2468 r2928  
    4747    }
    4848
    49   bzero ((char *) ad, sizeof (*ad));
     49  memset (ad, '\0', sizeof (*ad));
    5050
    5151  for (i = 0; i <= 1; i++)
     
    144144    }
    145145
    146   bzero ((char *) num_set, sizeof (num_set));
     146  memset (num_set, '\0', sizeof (num_set));
    147147
    148148  for (i = 0; i < cfh->hd.num_codes; i++)
     
    232232  int which;
    233233
    234   bzero ((char *) &cd, sizeof (compression_dict));
     234  memset (&cd, '\0', sizeof (compression_dict));
    235235
    236236  cd.MemForCompDict = sizeof (compression_dict);
  • trunk/gsdl/src/mgpp/text/locallib.cpp

    r2468 r2928  
    199199    (*disk) += sizeof (cfh->uncompressed_size);
    200200
    201   bzero ((char *) cfh->huff_words_size, sizeof (cfh->huff_words_size));
     201  memset (cfh->huff_words_size, '\0', sizeof (cfh->huff_words_size));
    202202
    203203  if ((int)fread (cfh->huff_words_size + cfh->hd.mincodelen,
  • trunk/gsdl/src/mgpp/text/mgpp_compression_dict.cpp

    r2557 r2928  
    435435  escape[0] = 0;
    436436  escape[1] = 0;
    437   bzero ((char *) char_freqs, sizeof (char_freqs));
    438   bzero ((char *) len_freqs, sizeof (len_freqs));
     437  memset (char_freqs, '\0', sizeof (char_freqs));
     438  memset (len_freqs, '\0', sizeof (len_freqs));
    439439  for (i = 0; i < num; i++, wd++)
    440440    {
     
    807807
    808808
    809   bzero ((char *) &huff_words_size, sizeof (huff_words_size));
    810   bzero ((char *) &lencounts, sizeof (lencounts));
     809  memset (&huff_words_size, '\0', sizeof (huff_words_size));
     810  memset (&lencounts, '\0', sizeof (lencounts));
    811811
    812812  mem_reqd = 0;
     
    873873  huff_data *hd;
    874874
    875   bzero ((char *) freqs, sizeof (freqs));
     875  memset (freqs, '\0', sizeof (freqs));
    876876
    877877  for (j = 0; j < dd->num_wds; j++, wd++)
     
    909909  huff_data *hd;
    910910
    911   bzero ((char *) freqs, sizeof (freqs));
     911  memset (freqs, '\0', sizeof (freqs));
    912912
    913913  for (j = 0; j < dd->num_wds; j++, wd++)
     
    943943           MAGIC_DICT, MG_ABORT);  /* [RPAP - Feb 97: WIN32 Port] */
    944944
    945   bzero((char *) &cdh, sizeof(cdh));
     945  memset (&cdh, '\0', sizeof(cdh));
    946946
    947947  cdh.dict_type = type;
  • trunk/gsdl/src/mgpp/text/mgpp_fast_comp_dict.cpp

    r2557 r2928  
    489489    }
    490490
    491   bzero ((char *) num_set, sizeof (num_set));
     491  memset (num_set, '\0', sizeof (num_set));
    492492
    493493  for (i = 0; i < cfh->hd.num_codes; i++)
     
    550550           sizeof (long *));
    551551
    552   bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
     552  memset (values, '\0', (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
    553553
    554554  if (mem)
Note: See TracChangeset for help on using the changeset viewer.