From: Ulrich Wilkens Date: Tue, 1 Apr 2014 02:45:33 +0000 (+0200) Subject: Fix dtinfo search engine X-Git-Tag: 2.2.2~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=38dfc9e235fbac2f9ab6de3a27a12becffc495d4;p=oweals%2Fcde.git Fix dtinfo search engine --- diff --git a/cde/config/cf/DtInfo.tmpl b/cde/config/cf/DtInfo.tmpl index 25c5d581..9211d5cc 100644 --- a/cde/config/cf/DtInfo.tmpl +++ b/cde/config/cf/DtInfo.tmpl @@ -426,7 +426,7 @@ TEMPLATE_OBJS=TemplateDB//**/*.o #define TemplateObjs $(TEMPLATE_OBJS) -#if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) +#if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) || defined(ARMArchitecture) # define ByteOrderDefines LittleEndianDefines #elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(AIXArchitecture) || defined(HPArchitecture) || defined(UXPArchitecture) # define ByteOrderDefines BigEndianDefines diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index e57082ba..5a9f2ae6 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -21,6 +21,7 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #define HasBSD44Sockets YES #define HasZlib YES +#ifndef CppCmd #if OSMajorVersion >= 5 #define CppCmd /usr/bin/cpp -traditional #define PreProcessCmd /usr/bin/cpp -traditional @@ -28,6 +29,8 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #define CppCmd /usr/libexec/cpp -traditional #define PreProcessCmd /usr/libexec/cpp -traditional #endif +#endif + #undef InstallCmd #define InstallCmd /usr/bin/install #undef KornShell @@ -67,10 +70,12 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #define MkdirHierCmd mkdir -p +#ifndef CcCmd #define CcCmd gcc #ifndef DefaultCCOptions #define DefaultCCOptions -pipe #endif +#endif #define CplusplusLibC -lstdc++ @@ -142,10 +147,12 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #endif #endif -#ifdef i386Architecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt -#else -# define OptimizedCDebugFlags -O2 -fno-strict-aliasing +#ifndef OptimizedCDebugFlags +# ifdef i386Architecture +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# else +# define OptimizedCDebugFlags -O2 -fno-strict-aliasing +# endif #endif #ifdef HasGcc2 diff --git a/cde/config/cf/NetBSD.cf b/cde/config/cf/NetBSD.cf index 90f6375f..2642049c 100644 --- a/cde/config/cf/NetBSD.cf +++ b/cde/config/cf/NetBSD.cf @@ -108,7 +108,9 @@ XCOMM operating system: OSName #ifdef i386Architecture -# define OptimizedCDebugFlags -O2 +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O2 -fno-strict-aliasing +# endif # if OSMajorVersion < 1 # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF # else @@ -118,7 +120,9 @@ XCOMM operating system: OSName # define ServerExtraSysLibs -li386 # endif #else -# define OptimizedCDebugFlags -O2 +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O2 -fno-strict-aliasing +# endif # if defined(SparcArchitecture) # define ServerOSDefines -DDDXOSINIT # else diff --git a/cde/config/cf/OpenBSD.cf b/cde/config/cf/OpenBSD.cf index 36188409..6a119d3a 100644 --- a/cde/config/cf/OpenBSD.cf +++ b/cde/config/cf/OpenBSD.cf @@ -483,6 +483,13 @@ install:: fonts.alias @@\ # define HasAgpGart YES +# ifndef DefaultGcc2i386Opt +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing +# endif +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif + # define LdPostLib -L/usr/X11R6/lib -L/usr/local/lib # define ServerExtraSysLibs -lamd64 @@ -553,7 +560,9 @@ install:: fonts.alias @@\ # define DefaultGcc2i386Opt -O2 -fno-strict-aliasing # endif # endif -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME # define ServerExtraSysLibs -li386 # define LdPostLib -L/usr/X11R6/lib -L/usr/local/lib @@ -1032,8 +1041,12 @@ CXXDEPENDINCLUDE != echo | `CcCmd -print-prog-name=cc1plus` -v 2>&1 | \ #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB) #define CplusplusLibC -lstdc++ +#ifndef CplusplusOptions #define CplusplusOptions -Wall -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch +#endif +#ifndef LibraryCplusplusOptions #define LibraryCplusplusOptions -Wall -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch +#endif #define ArchitectureDefines -DOPENBSD_ARCHITECTURE diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index 276071bc..858627ed 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -192,6 +192,9 @@ TIRPCLIB = #endif /* SparcArchitecture */ #ifdef ARMArchitecture +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__arm__ # define LSBBitOrder YES @@ -202,7 +205,9 @@ TIRPCLIB = #endif /* ARMArchitecture */ #ifdef i386Architecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__i386__ /* For DtHelp TIFF processing routines. */ # define LSBBitOrder YES @@ -214,7 +219,9 @@ TIRPCLIB = #endif /* i386Architecture */ #ifdef AMD64Architecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__x86_64__ /* For DtHelp TIFF processing routines. */ # define LSBBitOrder YES @@ -226,17 +233,23 @@ TIRPCLIB = #endif /* AMD64Architecture */ #ifdef PpcArchitecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__powerpc__ #endif /* PpcArchitecture */ #ifdef AlphaArchitecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__alpha__ #endif /* AlphaArchitecture */ #ifdef Mc68020Architecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif # define LinuxMachineDefines -D__mc68000__ # define StandardCppDefines -traditional #endif /* Mc68020Architecture */ diff --git a/cde/doc/C/Imakefile b/cde/doc/C/Imakefile index 7635914d..43c2e9f1 100644 --- a/cde/doc/C/Imakefile +++ b/cde/doc/C/Imakefile @@ -12,12 +12,13 @@ MakeDirectories(all,help-sdl cde.dti) XCOMM We need to build Motif documentation as part of CDE MakeDirectories(Makefiles,m-guides) Makefiles:: - $(RM) m-guides/?*; \ + $(RM) -r m-guides/?*; \ cd m-guides; \ if test -f ../$(MDOCSRC)/C/guides/bookcase.bc; \ then $(LN) ../$(MDOCSRC)/C/guides/?* .; \ else $(CP) /dev/null ./Imakefile; \ - $(LN) ../$(MDOCSRC)/C/guides/common .; \ + $(MKDIRHIER) ./common; \ + $(LN) ../../guides/common/ManLinksMotif.sgm common/ManLinks.sgm; \ fi; \ cd .. diff --git a/cde/doc/C/guides/common/ManLinksMotif.sgm b/cde/doc/C/guides/common/ManLinksMotif.sgm new file mode 100644 index 00000000..c9ec4779 --- /dev/null +++ b/cde/doc/C/guides/common/ManLinksMotif.sgm @@ -0,0 +1,33 @@ + + +XmFontList(3)"> +XmText(3)"> +XmInstallImage(3)"> +VendorShell(3)"> +XmGetPixmap(3)"> +VirtualBindings(3)"> +Composite(3)"> +Constraint(3)"> +Core(3)"> +XmList(3)"> +XmManager(3)"> +XmTextField(3)"> +XmBulletinBoard(3)"> +XmForm(3)"> +XmRowColumn(3)"> +XmLabel(3)"> +XmPrimitive(3)"> +XmFrame(3)"> +XmCreateDragIcon(3)"> +XmDragIcon(3)"> +XmDragStart(3)"> +XmDragContext(3)"> +XmDropSiteRegister(3)"> +XmDropSite(3)"> +XmDropSiteUpdate(3)"> +XmDropTransfer(3)"> +XmDropTransferStart(3)"> +XmDropSiteUnregister(3)"> +XmTrackingLocate(3)"> +XmeWarning(3)"> +mwm(1)"> diff --git a/cde/doc/C/guides/man/book.sgm b/cde/doc/C/guides/man/book.sgm index 5b59eb48..46b8c395 100644 --- a/cde/doc/C/guides/man/book.sgm +++ b/cde/doc/C/guides/man/book.sgm @@ -33,7 +33,7 @@ %SEntities; - + %MotifLinks; %CDELinks; diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/BitVector.C b/cde/programs/dtinfo/DtMmdb/StyleSheet/BitVector.C index bc267f2d..e2ff8d60 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/BitVector.C +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/BitVector.C @@ -164,7 +164,7 @@ BitVector& BitVector::shiftLeftOneBit() unsigned int lsb = 0; - for ( unsigned int i=f_words-1; i>=0; i++ ) { + for ( int i=f_words-1; i>=0; i++ ) { msb = (BIT_TEST((int)f_array[i], wordWithMSBSet)) ? wordWithMSBSet : 0x0; f_array[i] = f_array[i] << 1; f_array[i] |= lsb; diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.h b/cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.h index 1c763311..0da2f152 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.h +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.h @@ -55,7 +55,7 @@ public: enum TagType { StartTag, EndTag, AttributeSection, OliasAttribute, NoTag }; DocParser(Resolver &); - ~DocParser(); + virtual ~DocParser(); // returns a boolean unsigned int parse(istream &); diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureDefDictionary.C b/cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureDefDictionary.C index 4cab8c51..c977266c 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureDefDictionary.C +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureDefDictionary.C @@ -183,7 +183,7 @@ ostream& TypeValues::print(ostream& out, int tabs) const return out; } -unsigned hash(const FeatureDef& key) +unsigned fhash(const FeatureDef& key) { return key.name() -> hash(); } diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/Resolver.h b/cde/programs/dtinfo/DtMmdb/StyleSheet/Resolver.h index 90df5e17..ddbe8bea 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/Resolver.h +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/Resolver.h @@ -57,7 +57,7 @@ class Resolver : public Destructable { public: Resolver(PathTable& pTable, Renderer& r); - ~Resolver(); + virtual ~Resolver(); // beginElement returns a non-zero value if element is to be ignored unsigned int beginElement(Element*); diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/VariableTable.C b/cde/programs/dtinfo/DtMmdb/StyleSheet/VariableTable.C index e5bd43f6..1cf3f7b8 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/VariableTable.C +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/VariableTable.C @@ -25,13 +25,13 @@ #include "Types.h" #include "VariableTable.h" -static unsigned hash(const Symbol& key) +static unsigned shash(const Symbol& key) { return key.hash(); } VariableTable::VariableTable() -: hashTable(hash) +: hashTable(shash) { } diff --git a/cde/programs/dtinfo/DtMmdb/api/info_lib.h b/cde/programs/dtinfo/DtMmdb/api/info_lib.h index f380575a..0cb01ad5 100644 --- a/cde/programs/dtinfo/DtMmdb/api/info_lib.h +++ b/cde/programs/dtinfo/DtMmdb/api/info_lib.h @@ -67,7 +67,7 @@ class info_lib : public primitive public: info_lib(char** set_name_array, char** list_name_array, char* info_lib_dir = 0, char* selected_base_name = 0, - char* info_lib_name = "", int descriptor = -1); + char* info_lib_name = (char*)"", int descriptor = -1); virtual ~info_lib(); diff --git a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mktemp.c b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mktemp.c index 434f5cec..e9eaea09 100644 --- a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mktemp.c +++ b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mktemp.c @@ -71,7 +71,7 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; extern int errno; #endif -static int _gettemp(); +static int _gettemp(char*, int*); int mkstemp(path) char *path; @@ -142,7 +142,7 @@ _gettemp(path, doopen) if (*trv == 'z') *trv++ = 'a'; else { - if (isdigit(*trv)) + if (isdigit((unsigned char) *trv)) *trv = 'a'; else ++*trv; diff --git a/cde/programs/dtinfo/DtMmdb/dti_cc/cc_vvect.C b/cde/programs/dtinfo/DtMmdb/dti_cc/cc_vvect.C index f635253d..3b9f2d98 100644 --- a/cde/programs/dtinfo/DtMmdb/dti_cc/cc_vvect.C +++ b/cde/programs/dtinfo/DtMmdb/dti_cc/cc_vvect.C @@ -63,7 +63,7 @@ void value_vector::_grow(size_t t) template T value_vector::operator[](size_t i) const { - if ( i<0 || i>= f_size ) + if ( (long)i < 0 || i >= f_size ) throw(ccBoundaryException(0, f_size-1, i)); else return f_array[i]; @@ -72,7 +72,7 @@ T value_vector::operator[](size_t i) const template T& value_vector::operator[](size_t i) { - if ( i<0 || i>= f_size ) + if ( (long)i < 0 || i >= f_size ) throw(ccBoundaryException(0, f_size-1, i)); else return f_array[i]; diff --git a/cde/programs/dtinfo/DtMmdb/dti_excs/Exception.C b/cde/programs/dtinfo/DtMmdb/dti_excs/Exception.C index da289322..3837dc96 100644 --- a/cde/programs/dtinfo/DtMmdb/dti_excs/Exception.C +++ b/cde/programs/dtinfo/DtMmdb/dti_excs/Exception.C @@ -218,7 +218,7 @@ Exception::relocate (Exception **exception, int length) // Slide the specified exception down to fill the hole below it. if (g_next_avail >= (char *) *exception) abort(); - memcpy (g_next_avail, *exception, length); + memcpy (g_next_avail, (void*)*exception, length); *exception = (Exception *) g_next_avail; g_next_avail = ((char *) *exception) + length; } @@ -233,13 +233,15 @@ Exception::is (const char *type, const char *this_class) { PRINTF (("Type specified is <%s>\n", type)); - while (isalnum (*type) && isalnum (*this_class) && + while (isalnum ((unsigned char) *type) && + isalnum ((unsigned char) *this_class) && *type++ == *this_class++); - if (isalnum (*type) || isalnum (*this_class)) + if (isalnum ((unsigned char) *type) || + isalnum ((unsigned char) *this_class)) return (0); // Check for pointer types - while (isspace (*type)) + while (isspace ((unsigned char) *type)) { type++; } diff --git a/cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.C b/cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.C index f702a29f..745d2591 100644 --- a/cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.C +++ b/cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.C @@ -276,7 +276,7 @@ int write_spec(buckets& bs, params& pms, buffer& mphf_buffer) int compact(buckets& bs, unsigned s[], int t, Boolean swap) { - int target, k, i, remaining_bits, branch; + int target, k, i, remaining_bits, branch = 0; unsigned unsigned_g, high_part_bits; unsigned lower_part_bits = 0; diff --git a/cde/programs/dtinfo/DtMmdb/index/fast_mphf.C b/cde/programs/dtinfo/DtMmdb/index/fast_mphf.C index dbd1fb72..a60b76ae 100644 --- a/cde/programs/dtinfo/DtMmdb/index/fast_mphf.C +++ b/cde/programs/dtinfo/DtMmdb/index/fast_mphf.C @@ -135,7 +135,7 @@ void fast_mphf::init_persistent_info(persistent_info* x) r = 0; v_seed = 0; t = 0; - hash::init_data_member(); + ihash::init_data_member(); } } @@ -495,14 +495,14 @@ int fast_mphf::print_bits(unsigned x, ostream& out) int fast_mphf::cdr_sizeof() { - return long_pstring::cdr_sizeof() + hash::cdr_sizeof() + + return long_pstring::cdr_sizeof() + ihash::cdr_sizeof() + 6*sizeof(unsigned int); } io_status fast_mphf::cdrOut(buffer& buf) { long_pstring::cdrOut(buf); - hash::cdrOut(buf); + ihash::cdrOut(buf); buf.put(v_no_ps); buf.put(v_p1); @@ -517,7 +517,7 @@ io_status fast_mphf::cdrOut(buffer& buf) io_status fast_mphf::cdrIn(buffer& buf) { long_pstring::cdrIn(buf); - hash::cdrIn(buf); + ihash::cdrIn(buf); buf.get(v_no_ps); buf.get(v_p1); diff --git a/cde/programs/dtinfo/DtMmdb/index/fast_mphf.h b/cde/programs/dtinfo/DtMmdb/index/fast_mphf.h index cbdd03ee..34847381 100644 --- a/cde/programs/dtinfo/DtMmdb/index/fast_mphf.h +++ b/cde/programs/dtinfo/DtMmdb/index/fast_mphf.h @@ -102,7 +102,7 @@ public: friend class fast_mphf; }; -class fast_mphf : public long_pstring, public hash +class fast_mphf : public long_pstring, public ihash { public: diff --git a/cde/programs/dtinfo/DtMmdb/index/hash.C b/cde/programs/dtinfo/DtMmdb/index/hash.C index c870d943..d428a90e 100644 --- a/cde/programs/dtinfo/DtMmdb/index/hash.C +++ b/cde/programs/dtinfo/DtMmdb/index/hash.C @@ -51,16 +51,16 @@ #include #include "index/hash.h" -hash::hash() : v_key_set_sz(0), v_hash_func_sz(0), v_hash_tbl_sz(0) +ihash::ihash() : v_key_set_sz(0), v_hash_func_sz(0), v_hash_tbl_sz(0) { } -hash::~hash() +ihash::~ihash() { } void -hash::init_data_member(unsigned int a, unsigned int b, unsigned int c) +ihash::init_data_member(unsigned int a, unsigned int b, unsigned int c) { v_key_set_sz = a; v_hash_func_sz = b; @@ -68,15 +68,15 @@ hash::init_data_member(unsigned int a, unsigned int b, unsigned int c) } -int hash::cdr_sizeof() +int ihash::cdr_sizeof() { return sizeof(v_key_set_sz) + sizeof(v_hash_func_sz) + sizeof(v_hash_tbl_sz); } -io_status hash::cdrOut(buffer& buf) +io_status ihash::cdrOut(buffer& buf) { /* -MESSAGE(cerr, "hash::cdrOut"); +MESSAGE(cerr, "ihash::cdrOut"); debug(cerr, v_hash_tbl_sz); debug(cerr, v_key_set_sz); */ @@ -86,9 +86,9 @@ debug(cerr, v_key_set_sz); return done; } -io_status hash::cdrIn(buffer& buf) +io_status ihash::cdrIn(buffer& buf) { -//MESSAGE(cerr, "hash::cdrIn"); +//MESSAGE(cerr, "ihash::cdrIn"); buf.get(v_key_set_sz); buf.get(v_hash_func_sz); diff --git a/cde/programs/dtinfo/DtMmdb/index/hash.h b/cde/programs/dtinfo/DtMmdb/index/hash.h index 7d9bd19d..40a8e292 100644 --- a/cde/programs/dtinfo/DtMmdb/index/hash.h +++ b/cde/programs/dtinfo/DtMmdb/index/hash.h @@ -55,12 +55,12 @@ #include "utility/buffer.h" #include "utility/key.h" -class hash +class ihash { public: - hash(); - virtual ~hash() ; + ihash(); + virtual ~ihash() ; virtual void init_data_member(unsigned int v_key_set_sz = 0, unsigned int v_hash_func_sz = 0, diff --git a/cde/programs/dtinfo/DtMmdb/mgrs/misc.h b/cde/programs/dtinfo/DtMmdb/mgrs/misc.h index dbf747eb..97751932 100644 --- a/cde/programs/dtinfo/DtMmdb/mgrs/misc.h +++ b/cde/programs/dtinfo/DtMmdb/mgrs/misc.h @@ -92,7 +92,7 @@ void delete_name_oid_rec_f(const void* name_oid_ptr); class mark_t : private ostring { public: - mark_t(char* marks = "\t\n "); + mark_t(char* marks = (char*)"\t\n "); virtual ~mark_t() {}; friend istream& operator >>(istream&, mark_t&); friend ostream& operator <<(ostream&, mark_t&); diff --git a/cde/programs/dtinfo/DtMmdb/misc/unique_id.c b/cde/programs/dtinfo/DtMmdb/misc/unique_id.c index f8f76f7f..0038c22e 100644 --- a/cde/programs/dtinfo/DtMmdb/misc/unique_id.c +++ b/cde/programs/dtinfo/DtMmdb/misc/unique_id.c @@ -198,7 +198,7 @@ unique_id (void) buf[i] = mapping[(int)buf[i]]; } - } while (!isalnum (buf[0])); + } while (!isalnum ((unsigned char) buf[0])); return (buf); } diff --git a/cde/programs/dtinfo/DtMmdb/oliasdb/c_api_common.C b/cde/programs/dtinfo/DtMmdb/oliasdb/c_api_common.C index 890d923f..6a360b4c 100644 --- a/cde/programs/dtinfo/DtMmdb/oliasdb/c_api_common.C +++ b/cde/programs/dtinfo/DtMmdb/oliasdb/c_api_common.C @@ -136,14 +136,14 @@ void DtMmdbQuit() } -void* operator new( size_t sz ) +void* operator new( size_t sz ) throw(std::bad_alloc) { void* p = (void*)malloc(sz); //printf("a::operator new called(). sz= %d, allo=%x\n", sz, p); return p; } -void operator delete( void* p ) +void operator delete( void* p ) throw() { //printf("a::operator free called(). alloc= %x\n", p); if ( p ) diff --git a/cde/programs/dtinfo/DtMmdb/oliasdb/collectionIterator.h b/cde/programs/dtinfo/DtMmdb/oliasdb/collectionIterator.h index 70277c8f..88c06a46 100644 --- a/cde/programs/dtinfo/DtMmdb/oliasdb/collectionIterator.h +++ b/cde/programs/dtinfo/DtMmdb/oliasdb/collectionIterator.h @@ -35,7 +35,7 @@ class collectionIterator { public: collectionIterator(info_base*, int set_position); - ~collectionIterator(); + virtual ~collectionIterator(); // advance the iterator to the next position. // A newly constructed iterator's position is diff --git a/cde/programs/dtinfo/DtMmdb/utility/funcs.C b/cde/programs/dtinfo/DtMmdb/utility/funcs.C index ab51d6d0..2a2c0ce9 100644 --- a/cde/programs/dtinfo/DtMmdb/utility/funcs.C +++ b/cde/programs/dtinfo/DtMmdb/utility/funcs.C @@ -145,22 +145,25 @@ int gethostname(char* name, int namelen) int compare_stream(ostringstream& x, ostringstream& y) { - if ( x.str().size() != y.str().size() ) { - cerr << x.str().size() << "---" << y.str().size() << endl; -//debug(cerr, x.str().c_str()); -//debug(cerr, y.str().c_str()); + string xstr = x.str(); + string ystr = y.str(); + + if ( xstr.size() != ystr.size() ) { + cerr << xstr.size() << "---" << ystr.size() << endl; +//debug(cerr, xstr.c_str()); +//debug(cerr, ystr.c_str()); return 1; } else { - char* u = (char *)x.str().c_str(); - char* v = (char *)y.str().c_str(); + char* u = (char *)xstr.c_str(); + char* v = (char *)ystr.c_str(); //debug(cerr, u); //debug(cerr, v); //fprintf(stderr, "u=%s, pcount() = %d\n", u, x.pcount()); //fprintf(stderr, "v=%s, pcount() = %d\n", v, y.pcount()); - if ( memcmp(u, v, x.str().size()) != 0 ) { + if ( memcmp(u, v, xstr.size()) != 0 ) { STDERR_MESSAGE("two streams do not match."); debug(cerr, u); debug(cerr, v); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C index 0f3f14d6..84cd2f5b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C @@ -133,7 +133,7 @@ IcccmAgent::value_handler(Widget w, XtPointer ia, Atom *selection, char* mbs = (char *)value; wchar_t *wcs = (wchar_t*)malloc(strlen(mbs) + 1); // check if value string can be valid in current locale - if (mbstowcs(wcs, mbs, strlen(mbs) + 1) < 0) { // invalid + if ((long)mbstowcs(wcs, mbs, strlen(mbs) + 1) < 0) { // invalid const char* p = extract_ascii((char*)value); XtFree((char*)value); value = (XtPointer)p; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.hh b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.hh index 34afb8cf..a86dd039 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.hh @@ -26,7 +26,7 @@ public: IcccmAgent(void*, data_handler_t); IcccmAgent(void*, data_exporter_t); - ~IcccmAgent(); + virtual ~IcccmAgent(); data_handler_t set_string_handler(data_handler_t); data_exporter_t set_string_exporter(data_exporter_t); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C index 253391f6..23c957dc 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C @@ -1756,7 +1756,7 @@ LibraryAgent::library_removed (UAS_Pointer lib) { OutlineList &rootList = *(f_doc_tree_view->list()); unsigned int i; - for (i = rootList.length() - 1; i >= 0; i --) { + for (i = rootList.length() - 1; (int) i >= 0; i --) { TOC_Element *te = (TOC_Element *) rootList[i]; if (te->toc()->get_library() == lib) { if (f_tracking_hierarchy && f_tracking_hierarchy->f_toc == lib) { diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C index 9ba7c542..5809b162 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C @@ -121,9 +121,9 @@ ListView::display() if (f_shell == NULL) { create_ui_objects(); - display_list(); } + display_list(); f_shell->Popup(); f_shell->DeIconify(); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.hh index c4fb5113..8f6eb13b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.hh @@ -40,7 +40,7 @@ public: // notification types enum { ENTRY_ACTIVATE = FolioObjectLast, _LAST }; public: // functions -ListView (List *the_list = NULL, char *name = "ListView") +ListView (List *the_list = NULL, char *name = (char*)"ListView") : f_the_list(NULL), f_shell (NULL), f_name (name) { list (the_list); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C index 936bcdd4..fe5f7868 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C @@ -2229,7 +2229,7 @@ NodeWindowAgent::search_on_selectionCB(Widget, XtPointer client_data, void NodeWindowAgent::text_callback(WCallback *wcb) { - (XmAnyCallbackStruct*)wcb->CallData(); + (void) (XmAnyCallbackStruct*)wcb->CallData(); char *text = XmTextGetString(wcb->GetWidget()); if (text == NULL) return; @@ -2846,7 +2846,7 @@ NodeWindowAgent::initialize_tabs() { List_Iterator > tabs (g_tab_list); List_Iterator btns (f_tab_btn_list); - BookTab *current; + BookTab *current = NULL; bool changed = FALSE; static int old_count = -1; int count = 0; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C index e22729ca..c4a24149 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C @@ -533,7 +533,7 @@ OutlineListView::y_to_outline_element (Position y) #endif // Another Motif 1.2 bug. YToPos should return 0 for bogus position, // but it doesn't check the range. - if (f_item_pos < 0 || (int) f_item_pos >= ItemCount()) + if ((int) f_item_pos < 0 || (int) f_item_pos >= ItemCount()) return (NULL); oe = item_at (f_item_pos); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C index a646eb83..13920a16 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C @@ -149,7 +149,10 @@ static WXmToggleButton f_print_hierarchy; static Boolean print_hierarchy; // keep track of hierarchy vs section +#if defined(PRINTING_SUPPORTED) static void PrintEverything(AppPrintData *p); +#endif /* PRINTING_SUPPORTED */ + static void PrintOneUASCommon(UAS_Pointer &doc, Widget pshell, int *cur_pageP); PrintPanelAgent::PrintPanelAgent() @@ -431,9 +434,10 @@ void PdmNotifyCB(Widget pr_shell, XtPointer client_data, XtPointer call_data) { RCS_DEBUG("PdmNotifyCB called.\n"); - char *msg; #if defined(PRINTING_SUPPORTED) + char *msg; + XmPrintShellCallbackStruct* pr_cbs = (XmPrintShellCallbackStruct*) call_data; @@ -463,10 +467,10 @@ PdmNotifyCB(Widget pr_shell, XtPointer client_data, XtPointer call_data) void CreatePrintShell(Widget widget, AppPrintData* p) { - char buf[BUFSIZ]; - RCS_DEBUG("CreatePrintShell called.\n"); + #if defined(PRINTING_SUPPORTED) + char buf[BUFSIZ]; /* * create a print_shell if none available. the print dialog callback @@ -523,11 +527,10 @@ CreatePrintShell(Widget widget, AppPrintData* p) void PrintSetupCB(Widget print_dialog, XtPointer client_data, XtPointer call_data) { - char *msg; - RCS_DEBUG("PrintSetupCB called.\n"); -#if defined(PRINTING_SUPPORTED) +#if defined(PRINTING_SUPPORTED) + char *msg; AppPrintData *p = (AppPrintData*)client_data; DtPrintSetupCallbackStruct *pbs = (DtPrintSetupCallbackStruct*)call_data; @@ -925,6 +928,7 @@ DoPrint(Widget widget, AppPrintData * p) } +#if defined(PRINTING_SUPPORTED) /* * ------------------------------------------------------------------------ * Name: PrintEverything @@ -958,6 +962,7 @@ PrintEverything(AppPrintData *p) RCS_DEBUG("PrintEverything exiting.\n"); } +#endif /* PRINTING_SUPPORTED */ static void PrintOneUASCommon(UAS_Pointer &doc, Widget pshell, int *cur_pageP) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C index 73da2458..9b88e21e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C @@ -267,8 +267,10 @@ SearchResultsAgent::compose_header() void SearchResultsAgent::resize() { + UAS_Pointer > tmpList = + f_results->results()->create_results(0, f_count); UAS_List& rlist = - *(f_results->results()->create_results(0, f_count)); + *(UAS_List *)tmpList; fill_list(rlist); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C index 3d64ba1c..028b05b6 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C @@ -1252,7 +1252,7 @@ SearchScopeAgent::set_components (u_int mask) #define ADD(LIST,STRING,CHILD,EXPANDED) \ oe = new OutlineString (STRING); \ - if (CHILD) oe->set_children (CHILD); \ + if ((bool)CHILD) oe->set_children (CHILD); \ if (EXPANDED) oe->set_expanded (0x1); \ LIST->append (*oe); diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/Iterator.hh b/cde/programs/dtinfo/dtinfo/src/Basic/Iterator.hh index dfc9e0c1..d03d3e1c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/Iterator.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/Iterator.hh @@ -24,6 +24,8 @@ class FolioObject; class Iterator { public: + virtual ~Iterator() {} + // initialize iterator, find first element virtual FolioObject *init() = 0; diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C b/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C index 535782b9..6a303061 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C @@ -250,7 +250,7 @@ DtCvStrVccToIndex(_DtCvSegment* seg, unsigned int vcc) unsigned int index = 0; unsigned int rel_vcc; - if ((rel_vcc = vcc - ((SegClientData*)seg->client_use)->vcc()) < 0) + if ((int)(rel_vcc = vcc - ((SegClientData*)seg->client_use)->vcc()) < 0) return (unsigned int)-1; if (seg->type & _DtCvWIDE_CHAR) { diff --git a/cde/programs/dtinfo/dtinfo/src/Imakefile b/cde/programs/dtinfo/dtinfo/src/Imakefile index e5330200..4434d38a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Imakefile @@ -439,16 +439,18 @@ GENCAT=gencat -m GENCAT=gencat #endif +#define MACRO_Messages @(messages=; \ @@\ + for i in $(MSGS) ; \ @@\ + do \ @@\ + messages="$$messages $$i/$$i.msg"; \ @@\ + done; \ @@\ + cat $$messages > $(PROGRAM_NAME).cpp ) + messages:: foreach_subdirs(messages, $(MSGS)) @echo "### Making msgs in src ###" @$(RM) $(PROGRAM_NAME).msg.updated - @(messages=; \ - for i in $(MSGS) ; \ - do \ - messages="$$messages $$i/$$i.msg"; \ - done; \ - cat $$messages > $(PROGRAM_NAME).cpp ) + MACRO_Messages $(CPP) -P -C $(PROGRAM_NAME)_msg.tmpl | $(TOOLS)/misc/msgsets > $(PROGRAM_NAME).msg.updated @$(RM) $(PROGRAM_NAME).cpp diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C index 95bf699a..29ee396c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C @@ -41,6 +41,7 @@ * */ +#include #include #include using namespace std; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/WString.C b/cde/programs/dtinfo/dtinfo/src/Managers/WString.C index a04e4863..80fde32e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/WString.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/WString.C @@ -133,7 +133,7 @@ WString::get_mbstr() int buffer_size = MB_CUR_MAX * f_wstringrep->f_length + 1; char* buffer = new char[buffer_size]; - if (wcstombs(buffer, f_wstringrep->f_data, buffer_size) < 0) + if ((long)wcstombs(buffer, f_wstringrep->f_data, buffer_size) < 0) *buffer = 0; return buffer; diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C index 566e0153..22bef9cd 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C @@ -2406,7 +2406,7 @@ TGDefn::build() } end_try; - unsigned int i, start_index; + unsigned int i, start_index = 0; for (i = 0; i < num_columns; i++) { if (grid[current_row][i] == NULL) { start_index = i; diff --git a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C index 81be16e0..1072b71f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C +++ b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C @@ -241,7 +241,7 @@ PreferenceRecord::read_prefs() if (*value == '\0') // Ignore bogus lines. continue; *value++ = '\0'; - while (isspace (*value)) + while (isspace ((unsigned char) *value)) value++; int len = strlen(value); value[len-1] = '\0'; diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C index cfcdcd89..1923eb3f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C @@ -327,7 +327,7 @@ QueryTermView::create_ui() void QueryTermView::select_toggle (WCallback *wcb) { - (XmToggleButtonCallbackStruct *) wcb->CallData(); + (void) (XmToggleButtonCallbackStruct *) wcb->CallData(); // notify someone about selection state... invert_colors(); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C index 2703c600..2ac39915 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C @@ -21,8 +21,8 @@ * Floor, Boston, MA 02110-1301 USA */ // $TOG: UAS_BookcaseEntry.C /main/5 1998/04/17 11:40:44 mgreess $ -#include "UAS_BookcaseEntry.hh" #include "UAS_Exceptions.hh" +#include "UAS_BookcaseEntry.hh" #include "UAS_Collection.hh" #include diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.hh index 192a48ff..2f68dc28 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.hh @@ -12,6 +12,8 @@ class UAS_EmbeddedObject; class UAS_Factory { public: + virtual ~UAS_Factory() {} + static void initialize (UAS_List&); static void finalize (); static UAS_List getRootLocators (); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C index 70b07d70..8693eec5 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C @@ -24,7 +24,7 @@ /* Copyright (c) 1995 FUJITSU LIMITED */ /* All Rights Reserved */ -#if defined(__uxp__) || defined(USL) || defined(linux) +#if defined(__uxp__) || defined(USL) || defined(linux) || defined(CSRG_BASED) #include #else #include @@ -646,6 +646,7 @@ UAS_OQLParser::determine_caps() } end_try; +#if 0 /* not supported by libDtSearch */ caps |= 0x01 << OQL_WEIGHT; mtry { se_construct(WEIGHT, word, digits, ""); @@ -663,6 +664,7 @@ UAS_OQLParser::determine_caps() caps &= ~(0x01 << OQL_COMPLETION); } end_try; +#endif caps |= 0x01 << OQL_PHRASE; mtry { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C index 5762392f..7673b543 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C @@ -22,6 +22,7 @@ */ // $XConsortium: UAS_PtrList.cc /main/5 1996/08/06 09:23:58 rcs $ +#include "UAS_Exceptions.hh" #include "Managers/CatMgr.hh" #include "Registration.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Receiver.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Receiver.hh index e288e533..44a0caa8 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Receiver.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Receiver.hh @@ -24,7 +24,7 @@ friend class UAS_Sender; protected: // This is an abstract base class. UAS_Receiver() { } - ~UAS_Receiver(); + virtual ~UAS_Receiver(); virtual void receive (T &message, void *client_data = 0) = 0; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C index cc712669..6f7bca32 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C @@ -24,6 +24,7 @@ /* Copyright (c) 1995,1996 FUJITSU LIMITED */ /* All Rights Reserved */ +#include "UAS_Exceptions.hh" #include "DtSR_SearchEngine.hh" #include "DtSR_SearchResultsEntry.hh" #include "DtSR_SearchResults.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C index 7e60465f..748db330 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C @@ -306,8 +306,8 @@ DtSR_SearchResultsEntry::create_matches() } end_try; - char* text = (char*)output.str().c_str(); - *(text + output.str().size()) = '\0'; + string outpstr = output.str(); + char* text = (char*)outpstr.c_str(); #ifdef DUMP_NODES { @@ -350,8 +350,8 @@ DtSR_SearchResultsEntry::create_matches() for (int i = 0; i < count; i++) { stemsbuf << (f_search_res->stems(f_dbn)->stems())[i] << '\n'; } - char* stems = (char*)stemsbuf.str().c_str(); - *(stems + stemsbuf.str().size()) = '\0'; + string stemsbstr = stemsbuf.str(); + char* stems = (char*)stemsbstr.c_str(); parseout = StringParser::hilite(text, count, stems); @@ -383,17 +383,16 @@ DtSR_SearchResultsEntry::create_matches() matches = new UAS_List; // convert kwics to textrun + string textrbstr; if (parseout == NULL && kwics) { ostringstream textrunbuf; for (int i = 0; i < n_kwics; i++) textrunbuf << kwics[i].offset << '\t' << kwics[i].length << '\n'; - parseout = (char*)textrunbuf.str().c_str(); - *(parseout + textrunbuf.str().size()) = '\0'; + textrbstr = textrunbuf.str(); + parseout = (char*)textrbstr.c_str(); } else if (parseout == NULL) { - if (text) - delete[] text; return matches; } @@ -438,8 +437,11 @@ DtSR_SearchResultsEntry::create_matches() } else { scanned = mblen(cursor, MB_CUR_MAX); - assert( scanned >= 0 ); vcc++; + + /* skip one byte in case of failure */ + if (scanned < 0) + scanned = 1; } off -= scanned; @@ -477,11 +479,6 @@ DtSR_SearchResultsEntry::create_matches() matches->insert_item(textrun); } - if (text) - delete[] text; - if (parseout) - delete[] parseout; - return matches; } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C index 0fc48957..67af02cb 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C @@ -153,6 +153,7 @@ StringParser::brute_force(const char* text_in, int n_of_pats, #endif char* caped_text = NULL; + string capstr; if (sensitive == False) { // case-insensitive search unsigned char *p; @@ -169,8 +170,8 @@ StringParser::brute_force(const char* text_in, int n_of_pats, else capitalized << *p; } - text_in = caped_text = (char *)capitalized.str().c_str(); - *(char*)(text_in + capitalized.str().size()) = '\0'; + capstr = capitalized.str(); + text_in = caped_text = (char *)capstr.c_str(); } ostringstream text_run; @@ -237,7 +238,8 @@ StringParser::brute_force(const char* text_in, int n_of_pats, if (caped_text) delete[] caped_text; - char* ret_text = (char *)text_run.str().c_str(); + string trunstr = text_run.str(); + char* ret_text = (char *)trunstr.c_str(); if (ret_text == NULL) return NULL; @@ -323,7 +325,8 @@ StringParser::project_textrun(const char* org_textrun) ret_text << off << '\t' << len << '\n' << '\0'; - return (char *)ret_text.str().c_str(); + string rettstr = ret_text.str(); + return (char *)rettstr.c_str(); } char * diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C index e4e6e048..ec0dd5a6 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C @@ -55,8 +55,8 @@ main(int argc, char** argv) char ch; while (cin.get(ch)) text << ch; - char* buf = (char *)text.str().c_str(); - *(buf + text.str().size()) = '\0'; + string textstr = text.str(); + char* buf = (char *)textstr.c_str(); char* p = buf; if (buf == NULL || *buf == '\0') { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C index d95b7199..55404254 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C @@ -63,8 +63,8 @@ main(int argc, char** argv) char ch; while (cin.get(ch)) text << ch; - char* buf = (char *)text.str().c_str(); - *(buf + text.str().size()) = '\0'; + string textstr = text.str(); + char* buf = (char *)textstr.c_str(); char* match = StringParser::brute_force(buf, npat, patterns); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C index ed0b3d6c..0f66308f 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C @@ -22,6 +22,7 @@ */ // $XConsortium: MMDB_Library.C /main/9 1996/09/14 13:10:52 cde-hal $ +# include "UAS_Exceptions.hh" # include "MMDB_Library.hh" # include "MMDB_BookCase.hh" # include "MMDB_Factory.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Panner.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Panner.c index 112c86e8..236f040b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Panner.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Panner.c @@ -102,8 +102,13 @@ static char defaultTranslations[] = Home: page(0,0) "; -static void ActionStart(), ActionStop(), ActionAbort(), ActionMove(); -static void ActionPage(), ActionNotify(), ActionSet(); +static void ActionStart(Widget, XEvent*, String*, Cardinal*); +static void ActionStop(Widget, XEvent*, String*, Cardinal*); +static void ActionAbort(Widget, XEvent*, String*, Cardinal*); +static void ActionMove(Widget, XEvent*, String*, Cardinal*); +static void ActionPage(Widget, XEvent*, String*, Cardinal*); +static void ActionSet(Widget, XEvent*, String*, Cardinal*); +static void ActionNotify(Widget, XEvent*, String*, Cardinal*); static XtActionsRec actions[] = { { "start", ActionStart }, /* start tmp graphics */ @@ -467,7 +472,8 @@ static int parse_page_string (s, pagesize, canvassize, relative) * syntax: spaces [+-] number spaces [pc\0] spaces */ - for (; isascii(*s) && isspace(*s); s++) ; /* skip white space */ + /* skip white space */ + for (; isascii(*s) && isspace((unsigned char) *s); s++) ; if (*s == '+' || *s == '-') { /* deal with signs */ rel = TRUE; @@ -480,11 +486,11 @@ static int parse_page_string (s, pagesize, canvassize, relative) } /* skip over numbers */ - for (cp = s; isascii(*s) && (isdigit(*s) || *s == '.'); s++) ; + for (cp = s; isascii(*s) && (isdigit((unsigned char)*s)|| *s == '.'); s++) ; val *= atof (cp); /* skip blanks */ - for (; isascii(*s) && isspace(*s); s++) ; + for (; isascii(*s) && isspace((unsigned char) *s); s++) ; if (*s) { /* if units */ switch (s[0]) { diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c index 1a46fe0b..bbd4b37b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c @@ -90,8 +90,12 @@ static XtResource resources[] = { #undef offset }; -static void ClassPartInitialize(), ClassInitialize(),Realize(),ConvertCursor(); -static Boolean SetValues(), ChangeSensitive(); +static void ClassPartInitialize(WidgetClass); +static void ClassInitialize(); +static void Realize(Widget, Mask*, XSetWindowAttributes*); +static void ConvertCursor(Widget); +static Boolean SetValues(); +static Boolean ChangeSensitive(Widget); SimpleClassRec simpleClassRec = { { /* core fields */ diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c index 284afcea..f448c474 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c @@ -98,9 +98,9 @@ static void Redisplay(); static XtGeometryResult QueryGeometry(); /* utility routines */ -static void insert_node(); -static void delete_node(); -static void layout_tree(); +static void insert_node(Widget, Widget); +static void delete_node(Widget, Widget); +static void layout_tree(TreeWidget, Boolean); /* diff --git a/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c b/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c index 95739b65..3d85a6c8 100644 --- a/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c +++ b/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c @@ -778,7 +778,7 @@ static int fontlist(dat_ptr, cmd_ptr, cgm_s) } } /* zero out the rest of the fonts */ - for (; i>MAX_FONTS; ++i) cgm_s->fontlist[i] = NULL; + for (; ifontlist[i] = NULL; return 1; } diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WCallback.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WCallback.h index 0530e7d6..ee561f5f 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WCallback.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WCallback.h @@ -50,7 +50,7 @@ protected: WCallback* cbList; public: WWL (); - ~WWL (); + virtual ~WWL (); void AddCb (WCallback *); Boolean RemoveCb (WCallback *); diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/NCFGen.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/NCFGen.C index 2293bb9a..16dbd5fb 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/NCFGen.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/NCFGen.C @@ -129,6 +129,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed) const char *stitle; const char *style; int dupID = 0; + string outstr; OLIAS_DB mmdb_handle; info_lib *mmdb = @@ -199,6 +200,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed) stylesheet_smart_ptr sheet(base_ptr, style); ostringstream strout; sheet.its_oid().asciiOut(strout); + outstr = strout.str(); ncf->insert(STRING_CODE, nodeLocator, STRING_CODE, title, @@ -206,7 +208,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed) COMPRESSED_STRING_CODE, comp_agent, "", STRING_CODE, bookLocator, OID_CODE, "0.0", /* pointer to Book/CCF/DOC object */ - OID_CODE, (char *)strout.str().c_str(), + OID_CODE, (char *)outstr.c_str(), NULL); } diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C index e8701f00..0d2565ee 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C @@ -2378,9 +2378,11 @@ case 10: CC_String *val = (CC_String *)hd->findValue( &key ); if ( !val ) { NeedRemote = 1; +#ifdef REMOTE_DEBUG cerr << "(WARNING) Unresolved link = " << (const char *)key << endl << " file = " << current_file_name << endl << " line no. = " << current_line_num << "\n\n"; +#endif } // cleanup and reset diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/SGMLName.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/SGMLName.C index a4e5a979..b5988f87 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/SGMLName.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/SGMLName.C @@ -88,7 +88,7 @@ SGMLName::intern(const char *name, int upcase) const char *src; char *dest; for(src = name, dest=buf; *src; src++, dest++){ - *dest = toupper(*src); + *dest = toupper((unsigned char) *src); } *dest = 0; diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c index 1e8e96d1..ae894268 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c @@ -1596,8 +1596,8 @@ buildBookcase(char *cmdSrc, char *dirName) dieRWD(-1, "%s: Cannot find %s: %s\n", EXEC_NAME, newDir, strerror(errno)); - snprintf(cmd, sizeof(cmd), "dtsrcreate %s-o -l%d %s", - (gStruct->verbose) ? "" : "-q ", + snprintf(cmd, sizeof(cmd), "dtsrcreate %s-o -a%d -l%d %s", + (gStruct->verbose) ? "" : "-q ", 210, langtbl[gStruct->dtsridx].dtsrlang, bookCaseName); runShellCmd(cmd); @@ -1717,7 +1717,7 @@ validateBookCaseName(char *bookCaseName) for (i = 0; bookCaseName[i] != '\0'; i++) { - if (!isalnum(bookCaseName[i])) + if (!isalnum((unsigned char) bookCaseName[i])) break; } @@ -1823,7 +1823,7 @@ editMapFile(char *bookCaseName, char *bookCaseMap) for (i = 1; fileVector[i] != (char *)NULL; i++) { if ((strncmp(fileVector[i], bookCaseName, bcNameLen) == 0) && - (!isalnum(fileVector[i][bcNameLen])) && + (!isalnum((unsigned char) fileVector[i][bcNameLen])) && (fileVector[i][bcNameLen] != '_')) { if (!replaced) @@ -1996,8 +1996,9 @@ makeTOC(char *id, char *title) tocTitle = sgmlData(title); for (i = 0; id[i] != '\0'; i++) { - if ((!isalnum(id[i])) && (id[i] != '.') && (id[i] != '-')) - die(-1, "bad ID: %s\n", id); + if ((!isalnum((unsigned char) id[i])) && + (id[i] != '.') && (id[i] != '-')) + die(-1, "bad ID: %s\n", id); } fileIn = buildPath("%s/NodeMeta", makeWorkDir()); diff --git a/cde/programs/dtinfo/dtinfogen/mmdb/src/main_c_api.c b/cde/programs/dtinfo/dtinfogen/mmdb/src/main_c_api.c index ae7a6c84..9b0782fb 100644 --- a/cde/programs/dtinfo/dtinfogen/mmdb/src/main_c_api.c +++ b/cde/programs/dtinfo/dtinfogen/mmdb/src/main_c_api.c @@ -73,7 +73,7 @@ int main( int argc, char** argv ) int ok = 0; DtMmdbInit(); - if ( argc == 1 || 0==isdigit(argv[1][0]) ) { + if ( argc == 1 || 0==isdigit((unsigned char) argv[1][0]) ) { usage(argc, argv); } else switch ( atoi(argv[1]) ) { diff --git a/cde/programs/dtinfo/tools/misc/msgsets.C b/cde/programs/dtinfo/tools/misc/msgsets.C index ae63714d..669484f1 100644 --- a/cde/programs/dtinfo/tools/misc/msgsets.C +++ b/cde/programs/dtinfo/tools/misc/msgsets.C @@ -1127,9 +1127,10 @@ FILE *file; } -main() +int main() { int i,j; + string setstr; yylex(); @@ -1152,7 +1153,8 @@ main() } for (i = 0; i < sets_cnt; i++) { - const char* record = sets[sorted[i]]->str().c_str(); + setstr = sets[sorted[i]]->str(); + const char* record = setstr.c_str(); std::cout << record << '\n' << std::flush; } diff --git a/cde/programs/dtsr/Imakefile b/cde/programs/dtsr/Imakefile index 9f6a8358..3d5eaecb 100644 --- a/cde/programs/dtsr/Imakefile +++ b/cde/programs/dtsr/Imakefile @@ -20,6 +20,11 @@ EXTRA_DEFINES = -DBYTE_SWAP -D_XOPEN_SOURCE -D_OSF_SOURCE EXTRA_DEFINES = -DBYTE_SWAP -D_XOPEN_SOURCE #endif +#if defined(i386Architecture) || defined(AMD64Architecture) || \ + defined(ARMArchitecture) +EXTRA_DEFINES = -DBYTE_SWAP +#endif + #ifdef AIXArchitecture BYTE_SWAP_LIB = -lisode #else