Changeset 2541


Ignore:
Timestamp:
2001-06-13T12:24:49+12:00 (23 years ago)
Author:
jrm21
Message:

1) replaced obsolete bzero() calls with memset() calls.
2) Makefile.in fixed for c++ variables (CXX instead of CPP), and GSDLOS is now

set from configure, so files are installed in the right place.

3) text.pass1.cpp now prints an error message if index file can't be created.

Location:
trunk/gsdl/src/mgpp/text
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/Makefile.in

    r2477 r2541  
    3636AR = ar
    3737CC = @CC@
    38 CPP = @CXX@
     38CXX = @CXX@
    3939CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
    40 CPPFLAGS = @CPPFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
     40CXXFLAGS = @CXXFLAGS@ -DSILENT -DSHORT_SUFFIX
    4141DEFS = @DEFS@
    4242RANLIB = @RANLIB@
     
    5656#
    5757##########################################
    58 
     58GSDLOS = @gsdlos@
    5959
    6060bindir = $(top_srcdir)/bin/$(GSDLOS)
     
    6464mandir = $(prefix)/man/man1
    6565
    66 COMPILE = $(CC) -c $(DEFS) $(TREC_MODE) $(READLINE) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
    67 CPPCOMPILE = $(CPP) -c $(DEFS) $(TREC_MODE) $(READLINE) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
     66COMPILE = $(CC) -c $(DEFS) $(TREC_MODE) $(READLINE) $(INCLUDES) $(CFLAGS)
     67CXXCOMPILE = $(CXX) -c $(DEFS) $(TREC_MODE) $(READLINE) $(INCLUDES) $(CXXFLAGS)
    6868LINK = $(CC) $(LDFLAGS) -o $@
    6969
     
    7575.SUFFIXES: .cpp .o
    7676.cpp.o:
    77     $(CPPCOMPILE) -D__cplusplus $<
     77    $(CXXCOMPILE) $<
    7878
    7979
     
    158158
    159159depend:
    160     makedepend -Y -- $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -- $(SOURCES)
     160    makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) $(CFLAGS) -- $(SOURCES)
    161161
    162162# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  • trunk/gsdl/src/mgpp/text/comp_dict.cpp

    r2468 r2541  
    8181  words = ht->words;
    8282
    83   bzero ((char *) ht->table, ht_size * sizeof (ht->table[0]));
     83  memset (ht->table, '\0', ht_size * sizeof (ht->table[0]));
    8484
    8585  if (!(allwords = (u_char *) Xmalloc (sizeof (u_char) * cfh->uncompressed_size)))
  • trunk/gsdl/src/mgpp/text/text.pass1.cpp

    r2468 r2541  
    4141#include "TextEl.h"
    4242
     43/* for more meaningful messages - jrm21 (gsdl) */
     44#ifdef HAVE_STRERROR
     45#include <string.h>
     46#include <errno.h>
     47#endif
     48
     49
    4350#define POOL_SIZE 1024*1024
    4451#define INITIAL_HASH_SIZE 7927
     
    111118    }
    112119    ChangeMem (sizeof (hash_rec) * dd->HashSize);
    113     bzero ((char *) (dd->HashTable), sizeof (hash_rec) * dd->HashSize);
     120    memset (dd->HashTable,'\0' , sizeof (hash_rec) * dd->HashSize);
    114121
    115122    word = Pool;
     
    222229      }
    223230      ChangeMem (sizeof (hash_rec) * size);
    224       bzero ((char *) ht, sizeof (hash_rec) * size);
     231      memset (ht, '\0', sizeof (hash_rec) * size);
    225232
    226233      for (i = 0; i < dd->HashSize; i++)
     
    349356  if (!(fp = create_file (file_name, TEXT_STATS_DICT_SUFFIX, "wb",
    350357              MAGIC_STATS_DICT, MG_MESSAGE)))  /* [RPAP - Feb 97: WIN32 Port] */
    351     return COMPERROR;
    352  
     358    {
     359#ifdef HAVE_STRERROR
     360      fprintf(stderr,"Couldn't create file %s:%s\n",
     361              file_name,
     362              strerror(errno)
     363              );
     364#endif
     365      return COMPERROR;
     366    }
     367
    353368  temp_str = msg_prefix;
    354369  msg_prefix = "text.pass1";
  • trunk/gsdl/src/mgpp/text/text.pass2.cpp

    r2468 r2541  
    118118 
    119119  // write out the compressed text header
    120   bzero ((char *) &cth, sizeof (cth));
     120  memset (&cth, '\0', sizeof (cth));
    121121  if (fwrite (&cth, sizeof (cth), 1, text) != 1)
    122122    return COMPERROR;
     
    139139    nht[i].HashSize = INITIAL_HASH_SIZE;
    140140    nht[i].HashTable = (novel_hash_rec *) Xmalloc (sizeof (novel_hash_rec) * nht[i].HashSize);
    141     bzero ((char *) nht[i].HashTable,
     141    memset (nht[i].HashTable, '\0',
    142142           sizeof (novel_hash_rec) * nht[i].HashSize);
    143143    nht[i].HashUsed = 0;
     
    329329              return (COMPERROR);
    330330            }
    331               bzero ((char *) ht, sizeof (novel_hash_rec) * size);
     331              memset (ht, '\0', sizeof (novel_hash_rec) * size);
    332332             
    333333              for (i = 0; i < h->HashSize; i++)
     
    467467      long lens[16], flens[16];
    468468      char_pool *cp;
    469       bzero ((char *) chars, sizeof (chars));
    470       bzero ((char *) lens, sizeof (lens));
     469      memset (chars, '\0', sizeof (chars));
     470      memset (lens, '\0', sizeof (lens));
    471471      for (cp = nht[i].first_pool; cp; cp = cp->next)
    472472    {
Note: See TracChangeset for help on using the changeset viewer.