diff --git a/cde/.gitignore b/cde/.gitignore index 6272db374..0e4f11517 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -2284,8 +2284,8 @@ ylwrap .deps .objs .dirstamp -autotools_config.h -autotools_config.h.in +cde_config.h +cde_config.h.in lib/DtTerm/util/lineToData lib/csa/y.tab.c lib/csa/y.tab.h @@ -2307,3 +2307,10 @@ programs/localized/util/MsgCat.c programs/fontaliases/linux/en_US.UTF-8/fonts.alias programs/fontaliases/linux/en_US.UTF-8/mk_fonts_alias programs/fontaliases/linux/en_US.UTF-8/test_fonts_alias + +# files that are modified by configure for version information +copyright +doc/common/help/HELPEnt.sgm +include/Dt/Dt.h +lib/tt/bin/ttauth/ttauth.man +lib/tt/tooltalk.inc diff --git a/cde/configure.ac b/cde/configure.ac index bf0f85bdb..c86f925e3 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -1,7 +1,33 @@ -AC_INIT([cde-desktop], [2.4.0a], [https://sourceforge.net/projects/cdesktopenv]) -AC_CONFIG_HEADERS([include/autotools_config.h]) +dnl When changing the version below, also change the CDE_VERSION_* macros +dnl to match further below +AC_INIT([Common Desktop Environment], + [2.4.0c], + [https://sourceforge.net/projects/cdesktopenv], + [cde], + [https://sourceforge.net/projects/cdesktopenv]) +AC_CONFIG_HEADERS([include/cde_config.h]) AC_CONFIG_MACRO_DIRS([m4]) -AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_INIT_AUTOMAKE([foreign subdir-objects no-define]) + +dnl global CDE versioning + +CDE_VERSION_MAJOR=2 +CDE_VERSION_MINOR=4 +CDE_VERSION_MICRO=0 +dnl this is blank for a release, or contains an alpha character to indicate a +dnl dev release. +CDE_VERSION_DEV=c + +AC_SUBST(CDE_VERSION_MAJOR) +AC_SUBST(CDE_VERSION_MINOR) +AC_SUBST(CDE_VERSION_MICRO) +AC_SUBST(CDE_VERSION_DEV) + +dnl released in 2012, this should be sufficient +AC_PREREQ([2.69]) + +AC_CANONICAL_HOST +AC_CANONICAL_BUILD dnl These must be up here for the compiler search list to actually work AC_PROG_CC([cc gcc clang]) @@ -10,26 +36,9 @@ AC_PROG_CXX([c++ g++ clang++]) LT_INIT AC_PREFIX_DEFAULT(/usr/dt) -AC_ENABLE_STATIC([no]) PKG_PROG_PKG_CONFIG -dnl todo: determine what version of autoconf we depend on -dnl AC_PREREQ() - -AC_CANONICAL_HOST -AC_CANONICAL_BUILD - -dnl global CDE versioning - -CDE_VERSION_MAJOR=2 -CDE_VERSION_MINOR=3 -CDE_VERSION_MICRO=0 - -AC_SUBST(CDE_VERSION_MAJOR) -AC_SUBST(CDE_VERSION_MINOR) -AC_SUBST(CDE_VERSION_MICRO) - dnl SOURCE_DEFINES - start with CDE project default SOURCE_CPP_DEFINES="-DANSICPP -DMULTIBYTE -DNLS16" @@ -70,13 +79,17 @@ dnl other things as we go along. EXTRA_LIBS="" EXTRA_INCS="" -case "${host_os}" in +# pam currently only works on netbsd (9.2 tested) and linux +supports_pam=no + +case "${build_os}" in linux*) build_linux=yes OSMAJORVERSION=4 OSMINORVERSION=15 SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \ -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE" + supports_pam=yes ;; freebsd*) build_freebsd=yes @@ -98,6 +111,7 @@ case "${host_os}" in bsd=yes OSMAJORVERSION=8 OSMINORVERSION=0 + supports_pam=yes ;; solaris*|sun*) build_solaris=yes @@ -272,7 +286,7 @@ dnl do. This is not a replacement for cpp, used at runtime by dnl software such as tt_type_comp. AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp') -AM_PROG_LIBTOOL +LT_INIT dnl make sure it's installed AC_PROG_YACC @@ -280,7 +294,7 @@ if test -z "$ac_cv_prog_YACC"; then MISSING_PROGS="[bison or byacc] ${MISSING_PROGS}" fi -AM_PROG_LEX +AC_PROG_LEX(noyywrap) if test -z "$ac_cv_prog_LEX"; then MISSING_PROGS="[flex or lex] ${MISSING_PROGS}" fi @@ -299,14 +313,11 @@ AC_C_CONST AC_C_BIGENDIAN AC_C_INLINE AC_C_CHAR_UNSIGNED -AC_C_STRINGIZE AC_C_FLEXIBLE_ARRAY_MEMBER AC_SYS_POSIX_TERMIOS AX_PTHREAD -AC_PROG_CC_C99 - AC_PATH_X AC_PATH_XTRA @@ -401,7 +412,6 @@ dnl Used to check if program 'tic' is available to install terminfo files AC_CHECK_PROGS(TIC, tic, :) dnl headers -AC_HEADER_STDC AC_CHECK_HEADERS([locale.h security/pam_appl.h utempter.h]) dnl libraries @@ -419,6 +429,15 @@ AC_CHECK_LIB(tirpc, svc_register, TIRPCLIB=-ltirpc]) AC_SUBST(TIRPCLIB) +dnl see if the rpc_inline_t type exists +AC_CHECK_TYPE(rpc_inline_t, [], + [AC_DEFINE_UNQUOTED([rpc_inline_t], [int32_t], + [Define to int32_t if not defined by including rpc/rpc.h])], +[ +AC_INCLUDES_DEFAULT +#include +]) + dnl check sizeof time_t for RPC AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) @@ -442,12 +461,16 @@ dnl issues XTOOLLIB="" AC_CHECK_LIB(X11, XOpenDisplay, [XTOOLLIB="-lX11"], , [${EXTRA_INCS} ${EXTRA_LIBS}]) +AC_CHECK_LIB(Xext, XextFindDisplay, [XTOOLLIB="-lXext ${XTOOLLIB}"], , + [${EXTRA_INCS} ${EXTRA_LIBS}]) AC_CHECK_LIB(Xau, XauReadAuth, [XTOOLLIB="-lXau ${XTOOLLIB}"], , [${EXTRA_INCS} ${EXTRA_LIBS}]) AC_CHECK_LIB(Xpm, XpmLibraryVersion, [XTOOLLIB="-lXpm ${XTOOLLIB}"], , [${EXTRA_INCS} ${EXTRA_LIBS}]) AC_CHECK_LIB(Xt, XtInitialize, [XTOOLLIB="-lXt ${XTOOLLIB}"], , [${EXTRA_INCS} ${EXTRA_LIBS}]) +AC_CHECK_LIB(Xmu, XmuMakeAtom, [XTOOLLIB="-lXmu ${XTOOLLIB}"], , + [${EXTRA_INCS} ${EXTRA_LIBS}]) AC_CHECK_LIB(ICE, IceCloseConnection, [XTOOLLIB="-lICE ${XTOOLLIB}"], , [${EXTRA_INCS} ${EXTRA_LIBS}]) AC_CHECK_LIB(SM, SmcOpenConnection, [XTOOLLIB="-lSM ${XTOOLLIB}"], , @@ -457,13 +480,23 @@ AC_CHECK_LIB(Xm, XmTextSetString, [XTOOLLIB="-lXm ${XTOOLLIB}"], , XTOOLLIB="${EXTRA_INCS} ${EXTRA_LIBS} ${X_EXTRA_LIBS} ${XTOOLLIB}" AC_SUBST([XTOOLLIB]) +dnl only needed by dtlogin +AC_CHECK_LIB(Xdmcp, XdmcpFlush, [XDMCPLIB="-lXdmcp"], [XDMCPLIB=""], + [${EXTRA_INCS} ${EXTRA_LIBS}]) +AC_SUBST(XDMCPLIB) + dnl iconv AM_ICONV dnl figure out pam support - -AC_CHECK_LIB(pam, pam_start, +dnl Right now this only works on linux and netbsd (9.2 tested) +if test "$supports_pam" = "yes" +then + AC_CHECK_LIB(pam, pam_start, [SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DHAS_PAM_LIBRARY"]) +else + AC_CHECK_LIB(pam, NOTSUPPORTED) +fi AM_CONDITIONAL([HAS_PAM_LIBRARY], [test "x$ac_cv_lib_pam_pam_start" = "xyes"]) @@ -588,7 +621,6 @@ programs/dsdm/Makefile programs/dthelp/Makefile programs/dthelp/dthelpview/Makefile programs/dthelp/dthelpgen/Makefile -programs/dthelp/dthelpdemo/Makefile programs/dthelp/dthelpprint/Makefile programs/dthelp/parser/Makefile programs/dthelp/parser/pass1/Makefile @@ -866,6 +898,10 @@ doc/ja_JP.UTF-8/help/common/DesktopIntro.hf include/Makefile +copyright +doc/common/help/HELPEnt.sgm +include/Dt/Dt.h +lib/tt/bin/ttauth/ttauth.man ]) AC_OUTPUT diff --git a/cde/copyright b/cde/copyright.in similarity index 70% rename from cde/copyright rename to cde/copyright.in index a135c2d00..d280e349f 100644 --- a/cde/copyright +++ b/cde/copyright.in @@ -1,7 +1,7 @@ - Common Desktop Environment Version 2.4.0a + Common Desktop Environment Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@ (c) Copyright 1993-2012 The Open Group (c) Copyright 2012-2022 CDE Project contributors, see CONTRIBUTORS for details diff --git a/cde/doc/common/help/HELPEnt.sgm b/cde/doc/common/help/HELPEnt.sgm.in similarity index 87% rename from cde/doc/common/help/HELPEnt.sgm rename to cde/doc/common/help/HELPEnt.sgm.in index b1bf3a87b..4a34bb1ac 100644 --- a/cde/doc/common/help/HELPEnt.sgm +++ b/cde/doc/common/help/HELPEnt.sgm.in @@ -1,8 +1,8 @@ -Common Desktop Environment 2.4.0a, +Common Desktop Environment @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@, © Copyright 1993-2012 The Open Group -© Copyright 2012-2020 CDE Project contributors, see CONTRIBUTORS for details +© Copyright 2012-2023 CDE Project contributors, see CONTRIBUTORS for details Project Website: http://cdesktopenv.sourceforge.net/ diff --git a/cde/doc/en_US.UTF-8/Makefile.am b/cde/doc/en_US.UTF-8/Makefile.am index b30c5638c..a8b049e27 100644 --- a/cde/doc/en_US.UTF-8/Makefile.am +++ b/cde/doc/en_US.UTF-8/Makefile.am @@ -1,4 +1,8 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = m-guides man guides help - +if !NETBSD +SUBDIRS = m-guides man guides help +else +# building the guides on netbsd (9.2) doesn't work currently +SUBDIRS = m-guides man help +endif diff --git a/cde/include/Dt/Dt.h b/cde/include/Dt/Dt.h.in similarity index 89% rename from cde/include/Dt/Dt.h rename to cde/include/Dt/Dt.h.in index 3dfbfa23d..4e5cf4e7e 100644 --- a/cde/include/Dt/Dt.h +++ b/cde/include/Dt/Dt.h.in @@ -50,15 +50,15 @@ extern "C" { /* CDE Version information */ -#define DtVERSION 2 -#define DtREVISION 4 -#define DtUPDATE_LEVEL 0 +#define DtVERSION @CDE_VERSION_MAJOR@ +#define DtREVISION @CDE_VERSION_MINOR@ +#define DtUPDATE_LEVEL @CDE_VERSION_MICRO@ #define DtVERSION_NUMBER (DtVERSION * 10000 + \ DtREVISION * 100 + \ DtUPDATE_LEVEL) -#define DtVERSION_STRING "CDE Version 2.4.0a" +#define DtVERSION_STRING "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" /* diff --git a/cde/include/DtXinerama.h b/cde/include/Dt/DtXinerama.h similarity index 100% rename from cde/include/DtXinerama.h rename to cde/include/Dt/DtXinerama.h diff --git a/cde/include/Dt/SearchP.h b/cde/include/Dt/SearchP.h index 749c1c710..e4a1b090d 100644 --- a/cde/include/Dt/SearchP.h +++ b/cde/include/Dt/SearchP.h @@ -517,27 +517,23 @@ struct or_hwordrec { * Actual host_to_network functions defined in * which is not yet standardized. */ + +/* JET - Update 12/21/2021 - no need to define (or not) BYTE_SWAP + * anymore as we can determine that via autotools (for the code). + * Elsewhere, we can just use the systems hto*()/nto*() routines + * regardless. + */ + typedef enum {HTON=1, NTOH} SWABDIR; extern void swab_dbrec (struct or_dbrec *rec, SWABDIR direction); extern void swab_objrec (struct or_objrec *rec, SWABDIR direction); -#ifdef BYTE_SWAP /* ie (BYTE_ORDER != BIG_ENDIAN) */ - #define HTONL(x) x = htonl(x) #define HTONS(x) x = htons(x) #define NTOHL(x) x = ntohl(x) #define NTOHS(x) x = ntohs(x) -#else /* !BYTE_SWAP, ie (BYTE_ORDER == BIG_ENDIAN) */ - -#define HTONL(x) -#define HTONS(x) -#define NTOHL(x) -#define NTOHS(x) - -#endif /* BYTE_SWAP */ - /*--------------- TESKEY PARSE CHARACTER TYPES ------------ * Used in langmap.c for linguistic parsing modules. diff --git a/cde/include/EUSCompat.h b/cde/include/EUSCompat.h index 7e63b2bfc..320e6ccfd 100644 --- a/cde/include/EUSCompat.h +++ b/cde/include/EUSCompat.h @@ -52,8 +52,12 @@ extern "C" { ** System V R4 based systems define the stuff we need in ** sys/types.h. Include that and then we are done. */ -#if defined(HPUX) || defined(__linux__) || defined(SunOS) -#include +#if defined(HPUX) || defined(__linux__) || defined(SunOS) || defined(CSRG_BASED) +# include +#endif + +#if defined(CSRG_BASED) || defined(__linux__) +# include #endif #if defined(sun) && defined(_XOPEN_SOURCE) @@ -104,6 +108,7 @@ typedef enum {B_FALSE, B_TRUE} boolean_t; #endif /* HPUX */ #if defined(__linux__) || defined(CSRG_BASED) +#include /* memset for libcsa and others */ typedef enum {B_FALSE, B_TRUE} boolean_t; #define MAXNAMELEN 256 #endif diff --git a/cde/include/Makefile.am b/cde/include/Makefile.am index 2b923b889..5db7f3a8b 100644 --- a/cde/include/Makefile.am +++ b/cde/include/Makefile.am @@ -26,7 +26,9 @@ nobase_include_HEADERS = Dt/Editor.h \ csa/csa.h \ Dt/Info.h \ Dt/Search.h \ - Dt/Mmdb.h + Dt/Mmdb.h \ + Dt/DtXinerama.h \ + Dt/PamSvc.h diff --git a/cde/include/PamSvc.h b/cde/include/PamSvc.h deleted file mode 100644 index d76ff3e33..000000000 --- a/cde/include/PamSvc.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: pam_svc.h /main/3 1996/10/30 11:13:40 drk $ */ -/******************************************************************************* -** -** "@(#)pam_svc.h 1.4 95/09/12 -** -** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved. -** -** This file contains header info related to use of PAM -** (Pluggable Authentication Module) library. -** -*******************************************************************************/ -/* * - * (c) Copyright 1993, 1994 Hewlett-Packard Company * - * (c) Copyright 1993, 1994 International Business Machines Corp. * - * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. * - * (c) Copyright 1993, 1994 Novell, Inc. * - */ - -#ifndef _DT_PAM_SVC_H -#define _DT_PAM_SVC_H - -#include - -#define DT_BAD_GID 29 /* Invalid Group ID */ -#define DT_INITGROUP_FAIL 30 /* group IDs init failed */ -#define DT_BAD_UID 31 /* Invaid User ID */ - -/* - * External procedure declarations - */ - -extern int _DtAuthentication(char*, char*, char*, char*, char*); -extern int _DtAccounting(char*, char*, char[], char*, char*, pid_t, int, int); -extern int _DtSetCred(char*, char *, uid_t, gid_t); - -#endif /* _DT_PAM_SVC_H */ diff --git a/cde/lib/DtHelp/FormatMan.c b/cde/lib/DtHelp/FormatMan.c index 26695b43f..5914a3747 100644 --- a/cde/lib/DtHelp/FormatMan.c +++ b/cde/lib/DtHelp/FormatMan.c @@ -492,14 +492,14 @@ FormatManPage( int italicCnt = 0; int result = 0; int cread; - int lastLen; + int lastLen = 0; int checkLen; int retWCLen; wchar_t lastWC; wchar_t retWC; char *rloc = in_buf; char *retStrPtr; - char c; + char c = 0; char retC; Boolean flag = False; enum State newState; diff --git a/cde/lib/DtHelp/FormatSDL.c b/cde/lib/DtHelp/FormatSDL.c index 386df242a..e863cd8da 100644 --- a/cde/lib/DtHelp/FormatSDL.c +++ b/cde/lib/DtHelp/FormatSDL.c @@ -5089,11 +5089,11 @@ ProcessSDLAttribute( char *attrValue; char **strPtr; char numBuf[DTD_NAMELEN+1]; - char *varOffset1; + char *varOffset1 = NULL; SDLNumber *numPtr1; SdlOption *enumPtr1; SdlOption attrNum; - _DtHelpFontValue fontNum; + _DtHelpFontValue fontNum = 0; _DtHelpFontValue *fontPtr1; const SDLAttribute *pAttr = SDLAttributeList; diff --git a/cde/lib/DtHelp/GlobSearch.c b/cde/lib/DtHelp/GlobSearch.c index 987940358..7928f0648 100644 --- a/cde/lib/DtHelp/GlobSearch.c +++ b/cde/lib/DtHelp/GlobSearch.c @@ -2787,7 +2787,7 @@ static void SearchIndex( &indexEntry, &entryLen,indexEntry,entryLen) == 0 && SearchForPattern(indexEntry, srchWord, srchWordLen) == True ) ) { - _DtHelpGlobSrchHit * hit; + _DtHelpGlobSrchHit * hit = NULL; char * * topicIdList; HitListAddFound ( curFile, curVol->curIndexXmStr[0], diff --git a/cde/lib/DtHelp/Graphics.c b/cde/lib/DtHelp/Graphics.c index dae2174df..f9b77b9d1 100644 --- a/cde/lib/DtHelp/Graphics.c +++ b/cde/lib/DtHelp/Graphics.c @@ -1413,7 +1413,7 @@ static enum _DtGrLoadStatus processTiff( ilFile inFile; ilPipe inPipe; ilFileImage inImage; - const ilImageDes *inDes; + const ilImageDes *inDes = 0; static ilContext IlContext = NULL; Display *dpy = DisplayOfScreen(screen); Drawable drawable = RootWindowOfScreen(screen); @@ -2832,7 +2832,7 @@ int _DtGrOpenBuffer( int _DtGrCloseStream( _DtGrStream *stream) { - int status; + int status = 0; if ((stream == NULL) || (stream->type == _DtGrNONE)) return(EOF); /* Failure */ diff --git a/cde/lib/DtHelp/Helpos.c b/cde/lib/DtHelp/Helpos.c index e6257cbb7..3ff927643 100644 --- a/cde/lib/DtHelp/Helpos.c +++ b/cde/lib/DtHelp/Helpos.c @@ -48,7 +48,7 @@ #include #if defined(HAVE_CONFIG_H) -# include +# include #endif #if defined(HAVE_LOCALE_H) # include diff --git a/cde/lib/DtHelp/Layout.c b/cde/lib/DtHelp/Layout.c index 8f81f8271..9aadb7cd9 100644 --- a/cde/lib/DtHelp/Layout.c +++ b/cde/lib/DtHelp/Layout.c @@ -1677,10 +1677,10 @@ ResolveCell( CellInfo *ret_info) { int i; - char *id; + char *id = NULL; char *idRefs; - char *ptr; - char c; + char *ptr = NULL; + char c = 0; int count; int len; int done; @@ -1690,7 +1690,7 @@ ResolveCell( _DtCvUnit cellWidth; _DtCvUnit retWidth; _DtCvUnit retHeight; - _DtCvUnit saveTop; + _DtCvUnit saveTop = 0; CellInfo *thisCell = &ret_info[cell]; DataPoint basePt; _DtCvValue reformat = False; diff --git a/cde/lib/DtHelp/LayoutUtil.c b/cde/lib/DtHelp/LayoutUtil.c index a588cd44f..b858b241e 100644 --- a/cde/lib/DtHelp/LayoutUtil.c +++ b/cde/lib/DtHelp/LayoutUtil.c @@ -397,11 +397,11 @@ _DtCvCheckLineSyntax ( int str_len, _DtCvValue skip_hypen_ck) { - int myStrLen; - int wcFlag; - void *pChar; + int myStrLen = 0; + int wcFlag = 0; + void *pChar = NULL; wchar_t nextChar; - wchar_t lastChar; + wchar_t lastChar = 0; _DtCvValue lstCharMb = False; _DtCvValue nxtCharMb = False; diff --git a/cde/lib/DtHelp/Makefile.am b/cde/lib/DtHelp/Makefile.am index 1ac76b7bd..8aad06f3f 100644 --- a/cde/lib/DtHelp/Makefile.am +++ b/cde/lib/DtHelp/Makefile.am @@ -40,4 +40,9 @@ libDtHelp_la_SOURCES = Actions.c AsciiSpc.c Callbacks.c \ Layout.c LayoutUtil.c LinkMgr.c \ Selection.c VirtFuncs.c +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtHelp_la_LDFLAGS = -version-info 2:1:0 +else +libDtHelp_la_LDFLAGS = -version-info 3:0:1 +endif diff --git a/cde/lib/DtHelp/Selection.c b/cde/lib/DtHelp/Selection.c index 9d8714e32..1ea52dcc9 100644 --- a/cde/lib/DtHelp/Selection.c +++ b/cde/lib/DtHelp/Selection.c @@ -154,7 +154,7 @@ SearchForClosestLine ( _DtCvSelectData *next) { int i; - int maxI; + int maxI = 0; _DtCvUnit lineY; _DtCvUnit endX; _DtCvUnit begX; diff --git a/cde/lib/DtHelp/StringFuncs.c b/cde/lib/DtHelp/StringFuncs.c index 6853fb32d..71749f587 100644 --- a/cde/lib/DtHelp/StringFuncs.c +++ b/cde/lib/DtHelp/StringFuncs.c @@ -43,7 +43,7 @@ **************************************************************************** ************************************<+>*************************************/ #ifdef HAVE_CONFIG_H -#include +#include #endif /* * system includes diff --git a/cde/lib/DtHelp/decompress.c b/cde/lib/DtHelp/decompress.c index 0f08b00cd..0bb795040 100644 --- a/cde/lib/DtHelp/decompress.c +++ b/cde/lib/DtHelp/decompress.c @@ -362,7 +362,7 @@ BufCompressedSkip ( BufFilePtr f, int bytes) { - int c; + int c = 0; while (bytes-- && ((c = BufFileGet(f)) != BUFFILEEOF)) ; return c; diff --git a/cde/lib/DtHelp/il/ilX.c b/cde/lib/DtHelp/il/ilX.c index 367ed3af4..f271bc7bf 100644 --- a/cde/lib/DtHelp/il/ilX.c +++ b/cde/lib/DtHelp/il/ilX.c @@ -1221,7 +1221,7 @@ ilPipeInfo info; ilXWCPtr pXWC; ilXPrivPtr pPriv; ilSrcElementData *pSrcData, srcData; -unsigned long bufferSize; +unsigned long bufferSize = 0; /* ** We need to use the execute fucntion with the ratio parameter. */ diff --git a/cde/lib/DtHelp/il/ilcrop.c b/cde/lib/DtHelp/il/ilcrop.c index 52677559b..5f5e50251 100644 --- a/cde/lib/DtHelp/il/ilcrop.c +++ b/cde/lib/DtHelp/il/ilcrop.c @@ -440,7 +440,7 @@ ilBool ilCrop ( { unsigned int state; ilPipeInfo info; -ilCropPrivptr pPriv; +ilCropPrivptr pPriv = NULL; ilDstElementData dstdata; ilImageDes imdes; ilImageFormat imformat; diff --git a/cde/lib/DtHelp/il/ildecompg3.c b/cde/lib/DtHelp/il/ildecompg3.c index 4caa0733b..618c48f09 100644 --- a/cde/lib/DtHelp/il/ildecompg3.c +++ b/cde/lib/DtHelp/il/ildecompg3.c @@ -260,7 +260,7 @@ unsigned long *pNLines ilDecompG3G4PrivPtr pPriv; /* Pointer to private image data */ ilPtr dstImageP; /* Pointer to the Destn. Image */ - ilPtr pRefLine; /* Pointer to the Reference line */ + ilPtr pRefLine = NULL; /* Pointer to the Reference line */ ilError error; /* Returned error */ int dstBytesPerRow; /* no.of byte per Row in the dest image */ ilBool Is_2DCoding; /* G3 2 D coding is present, if True */ diff --git a/cde/lib/DtHelp/il/ildither.c b/cde/lib/DtHelp/il/ildither.c index d2b0f55be..659b4bb1a 100644 --- a/cde/lib/DtHelp/il/ildither.c +++ b/cde/lib/DtHelp/il/ildither.c @@ -1024,7 +1024,7 @@ IL_PRIVATE ilBool _ilConvertRGBToPalette ( unsigned short *pPalette; long *pColorTable; ilBool diffusion, chooseColors; - int i, shifts[3] = { 0, 0, 0 }, nColors; + int i, shifts[3] = { 0, 0, 0 }, nColors = 0; const unsigned short *pMulTable[3] = { NULL, NULL, NULL }; /* dither other than 484 only: pMul? */ static ilConvertToPaletteInfo defaultConvert = {IL_DIFFUSION, { 4, 8, 4 }, 8, IL_PALETTE, (ilObject)NULL}; diff --git a/cde/lib/DtHelp/il/ilimage.c b/cde/lib/DtHelp/il/ilimage.c index 494ed4a4b..84a817fa8 100644 --- a/cde/lib/DtHelp/il/ilimage.c +++ b/cde/lib/DtHelp/il/ilimage.c @@ -323,7 +323,7 @@ IL_PRIVATE ilError _ilMallocImagePixels ( ) { int plane, nPlanes; -int MCUMinus1; +int MCUMinus1 = 0; long nBytesToAlloc, nBytesPerRow, allocHeight; ilPtr pPixels; long rowBytesPerPlane [IL_MAX_SAMPLES]; diff --git a/cde/lib/DtHelp/il/ilint.h b/cde/lib/DtHelp/il/ilint.h index 376de0fda..2411089e8 100644 --- a/cde/lib/DtHelp/il/ilint.h +++ b/cde/lib/DtHelp/il/ilint.h @@ -45,7 +45,7 @@ /* use autotools detection to determine endianess */ #if defined(HAVE_CONFIG_H) -# include +# include #endif #ifndef WORDS_BIGENDIAN diff --git a/cde/lib/DtHelp/il/iljpgdecodejif.c b/cde/lib/DtHelp/il/iljpgdecodejif.c index 5c326f8c4..de642c304 100644 --- a/cde/lib/DtHelp/il/iljpgdecodejif.c +++ b/cde/lib/DtHelp/il/iljpgdecodejif.c @@ -120,7 +120,7 @@ iljpgError iljpgDecodeJIF ( iljpgDataPtr pData; iljpgBool firstMarker, SOSFound, SOF0Found; iljpgError error; - int value, nFrameComps, length; + int value, nFrameComps = 0, length; iljpgPtr *ppTable; iljpgCompDataPtr pComp; int i, index; diff --git a/cde/lib/DtHelp/il/iljpgdehuff.c b/cde/lib/DtHelp/il/iljpgdehuff.c index f0e588cd9..fb8d4f059 100644 --- a/cde/lib/DtHelp/il/iljpgdehuff.c +++ b/cde/lib/DtHelp/il/iljpgdehuff.c @@ -200,7 +200,7 @@ static iljpgError build_huffman_tables ( lookup_size, code, mask; tree_node *tree_nodes, /* pointer to pool of tree nodes */ - *nodep, *leafp, **followp; /* misc aux. tree pointers */ + *nodep, *leafp = NULL, **followp; /* misc aux. tree pointers */ LOOKUP *lookup_symb, *lookup_len; /* pointers to lookup tables */ int absize; /* actual number of Huffman-encoded symbols */ int *hufvals, *hufcodes, *huflen; /* intermediate tables */ diff --git a/cde/lib/DtHelp/il/ilscale.c b/cde/lib/DtHelp/il/ilscale.c index 846d850de..aa34e7c50 100644 --- a/cde/lib/DtHelp/il/ilscale.c +++ b/cde/lib/DtHelp/il/ilscale.c @@ -784,7 +784,7 @@ ilBool ilScale ( { unsigned int state; ilPipeInfo info; -ilScalePrivptr pPriv; +ilScalePrivptr pPriv = NULL; ilDstElementData dstdata; ilImageDes imdes; ilImageFormat imformat; diff --git a/cde/lib/DtHelp/il/iltiff.c b/cde/lib/DtHelp/il/iltiff.c index 26b6ca0f6..7260efc3f 100644 --- a/cde/lib/DtHelp/il/iltiff.c +++ b/cde/lib/DtHelp/il/iltiff.c @@ -490,17 +490,17 @@ static unsigned short tagNumbers [] = { #define AI_NTAGS (sizeof(tagNumbers) / sizeof (unsigned short)) #define AIL_FATAL_ERROR(_error) {error = (_error); goto AILFatalError; } -ilFileImageRelation imageType; +ilFileImageRelation imageType = mainImage; ilFileTag *tag [AI_NTAGS]; ilBool present; ilError error; ilPtr pTagAlloc; unsigned long value; -int i, tagIndex, nBits, resolutionUnit, fillOrder; +int i, tagIndex, nBits, resolutionUnit, fillOrder = 0; unsigned long group3CompData; unsigned long group4CompData; ilFileTag *pTag; -ilYCbCrInfo *pYCbCr; /* null if not YCbCr ; else -> des...YCbCr */ +ilYCbCrInfo *pYCbCr = NULL; /* null if not YCbCr ; else -> des...YCbCr */ /* Init/zero des and format in *pFileImage. */ diff --git a/cde/lib/DtHelp/il/iltiffread.c b/cde/lib/DtHelp/il/iltiffread.c index 2dff1b907..7bd67f23d 100644 --- a/cde/lib/DtHelp/il/iltiffread.c +++ b/cde/lib/DtHelp/il/iltiffread.c @@ -164,9 +164,9 @@ ilFileTag *pTag; int nTags; /* # of tags to read */ unsigned short numbers[MAX_NTAGS]; /* tag ids to read */ ilFileTag *tags [MAX_NTAGS]; /* ptr to returned data */ -int stripOffsetsIndex, stripByteCountsIndex, colorMapIndex, - QTablesIndex, DCTablesIndex, ACTablesIndex, softwareIndex, - restartIndex; +int stripOffsetsIndex, stripByteCountsIndex = 0, colorMapIndex, + QTablesIndex = 0, DCTablesIndex = 0, ACTablesIndex = 0, softwareIndex = 0, + restartIndex = 0; #define ADD_TAG(_index, _tagid) { \ _index = nTags++; \ numbers[_index] = _tagid; \ diff --git a/cde/lib/DtMmdb/utility/config.h b/cde/lib/DtMmdb/utility/config.h index 1efb80e31..aa2e1bb10 100644 --- a/cde/lib/DtMmdb/utility/config.h +++ b/cde/lib/DtMmdb/utility/config.h @@ -25,7 +25,7 @@ #ifndef _config_h #define _config_h 1 -#include // determine endianess +#include // determine endianess #if defined(WORDS_BIGENDIAN) # define OLIAS_BIG_ENDIAN diff --git a/cde/lib/DtMrm/Makefile.am b/cde/lib/DtMrm/Makefile.am index aa5dee6ad..3836d414b 100644 --- a/cde/lib/DtMrm/Makefile.am +++ b/cde/lib/DtMrm/Makefile.am @@ -7,4 +7,10 @@ libDtMrm_la_CFLAGS = -I../DtTerm/Term -I../DtTerm/TermPrim -I../DtHelp \ libDtMrm_la_SOURCES = DtMrm.c +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtMrm_la_LDFLAGS = -version-info 2:1:0 +else +libDtMrm_la_LDFLAGS = -version-info 3:0:1 +endif + diff --git a/cde/lib/DtPamSvc/Makefile.am b/cde/lib/DtPamSvc/Makefile.am index 60aa5afce..7c21e8d8f 100644 --- a/cde/lib/DtPamSvc/Makefile.am +++ b/cde/lib/DtPamSvc/Makefile.am @@ -7,5 +7,11 @@ libDtPamSvc_la_SOURCES = PamSvc.c ${top_srcdir}/include/Dt/PamSvc.h libDtPamSvc_la_LIBADD = -lpam +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtPamSvc_la_LDFLAGS = -version-info 2:1:0 +else +libDtPamSvc_la_LDFLAGS = -version-info 3:0:1 +endif + diff --git a/cde/lib/DtPamSvc/PamSvc.c b/cde/lib/DtPamSvc/PamSvc.c index 625656295..8addc6d62 100644 --- a/cde/lib/DtPamSvc/PamSvc.c +++ b/cde/lib/DtPamSvc/PamSvc.c @@ -54,7 +54,7 @@ #if defined(__linux__) #include #endif -#include "PamSvc.h" +#include
/* * Local function declarations diff --git a/cde/lib/DtPrint/Makefile.am b/cde/lib/DtPrint/Makefile.am index 22adcfb90..4c57e5573 100644 --- a/cde/lib/DtPrint/Makefile.am +++ b/cde/lib/DtPrint/Makefile.am @@ -3,15 +3,18 @@ MAINTAINERCLEANFILES = Makefile.in lib_LTLIBRARIES = libDtPrint.la libDtPrint_la_CFLAGS = -DMULTIBYTE -DI18N_MSG @DT_INCDIR@ + +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtPrint_la_LDFLAGS = -version-info 2:1:0 +else +libDtPrint_la_LDFLAGS = -version-info 3:0:1 +endif + if SOLARIS libDtPrint_la_CFLAGS += -DNO_REGCOMP endif -if HPUX -libDtPrint_la_CFLAGS += -DMESSAGE_CAT -endif - libDtPrint_la_SOURCES = PrintMsgs.c PrintDlgMgr.c PrintOptions.c PrintSetupB.c \ PsubDefProc.c PsubUtil.c diff --git a/cde/lib/DtPrint/PrintSetupB.c b/cde/lib/DtPrint/PrintSetupB.c index dce502f2e..ca729206e 100644 --- a/cde/lib/DtPrint/PrintSetupB.c +++ b/cde/lib/DtPrint/PrintSetupB.c @@ -948,7 +948,7 @@ ColumnGeoSetPreferredWidths( int row) { Dimension slack = 0; - int last_non_empty_col; + int last_non_empty_col = 0; int col; for(col = 0; col < PSUB_GEO_COL_COUNT; col++) diff --git a/cde/lib/DtSearch/Makefile.am b/cde/lib/DtSearch/Makefile.am index e9f815e8b..fce13b0b6 100644 --- a/cde/lib/DtSearch/Makefile.am +++ b/cde/lib/DtSearch/Makefile.am @@ -9,34 +9,22 @@ CLEANFILES = boolyac.h boolyac.c AM_YFLAGS = -d libDtSearch_la_CFLAGS = -DI18N_MSG -DMULTIBYTE -I./raima \ - @DT_INCDIR@ + $(DT_INCDIR) +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtSearch_la_LDFLAGS = -version-info 2:1:0 +else +libDtSearch_la_LDFLAGS = -version-info 3:0:1 +endif + libDtSearch_la_LIBADD = raima/libraima.la -if LINUX -libDtSearch_la_CFLAGS += -DBYTE_SWAP -libDtSearch_la_LIBADD += -lm -endif - -if BSD -libDtSearch_la_CFLAGS += -DBYTE_SWAP -endif - if SOLARIS -libDtSearch_la_CFLAGS += -DBYTE_SWAP libDtSearch_la_LIBADD += -lm -lc endif -if AIX -libDtSearch_la_LIBADD += -lisode -endif - -if HPUX -libDtSearch_la_LIBADD += -lm -endif - libDtSearch_la_SOURCES = apndext.c ausdopen.c ausexit.c \ bmstrstr.c boolpars.c boolsrch.c \ boolyac.y cuslang.c dbchange.c \ diff --git a/cde/lib/DtSearch/dtsrswab.c b/cde/lib/DtSearch/dtsrswab.c index c9083285c..c5bf83199 100644 --- a/cde/lib/DtSearch/dtsrswab.c +++ b/cde/lib/DtSearch/dtsrswab.c @@ -52,7 +52,8 @@ * * $Log$ */ -#include "SearchP.h" +#include +#include
/********************************/ /* */ @@ -61,7 +62,7 @@ /********************************/ void swab_objrec (struct or_objrec *rec, SWABDIR direction) { -#ifndef BYTE_SWAP +#if defined(WORDS_BIGENDIAN) return; #else if (direction == NTOH) { @@ -91,7 +92,7 @@ void swab_objrec (struct or_objrec *rec, SWABDIR direction) HTONS (rec->or_objeureka); } return; -#endif /* BYTE_SWAP */ +#endif /* WORDS_BIGENDIAN */ } /* swab_objrec() */ @@ -102,7 +103,7 @@ void swab_objrec (struct or_objrec *rec, SWABDIR direction) /********************************/ void swab_dbrec (struct or_dbrec *rec, SWABDIR direction) { -#ifndef BYTE_SWAP +#if defined(WORDS_BIGENDIAN) return; #else if (direction == NTOH) { @@ -147,7 +148,7 @@ void swab_dbrec (struct or_dbrec *rec, SWABDIR direction) HTONS (rec->or_language); } return; -#endif /* BYTE_SWAP */ +#endif /* WORDS_BIGENDIAN */ } /* swab_dbrec() */ /********************* DTSRSWAB.C **********************************/ diff --git a/cde/lib/DtSearch/hilite.c b/cde/lib/DtSearch/hilite.c index 52eb3d82f..e75f14960 100644 --- a/cde/lib/DtSearch/hilite.c +++ b/cde/lib/DtSearch/hilite.c @@ -94,7 +94,7 @@ long hilite_cleartext (int parse_type, char *stems, int stemcount) PARG parg; char * (*parser)() = usrblk.dblk->parser; char * (*stemmer)() = usrblk.dblk->stemmer; - DtSrHitword *hitwords; + DtSrHitword *hitwords = NULL; size_t hitwords_size = 0; long hitwcount = 0; long offset; @@ -158,10 +158,10 @@ long hilite_cleartext (int parse_type, char *stems, int stemcount) hitwords = realloc (hitwords, hitwords_size * sizeof(DtSrHitword) + 16); } - if (!hitwords) { - fputs (PROGNAME"091 Out of Memory!\n", aa_stderr); - DtSearchExit (91); - } + } + if (!hitwords) { + fputs (PROGNAME"091 Out of Memory!\n", aa_stderr); + DtSearchExit (91); } hitwords[hitwcount].offset = offset; hitwords[hitwcount].length = wordlen; diff --git a/cde/lib/DtSearch/raima/Makefile.am b/cde/lib/DtSearch/raima/Makefile.am index ae0884af0..5be3c10e4 100644 --- a/cde/lib/DtSearch/raima/Makefile.am +++ b/cde/lib/DtSearch/raima/Makefile.am @@ -2,10 +2,8 @@ MAINTAINERCLEANFILES = Makefile.in noinst_LTLIBRARIES = libraima.la -libraima_la_LIBADD = -lc -lm - libraima_la_CFLAGS = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \ - @DT_INCDIR@ -I$(top_srcdir)/include \ + $(DT_INCDIR) -I$(top_srcdir)/include \ -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \ -DNO_TRANS -DUNIX -D_POSIX_SOURCE -DMULTIBYTE @@ -21,10 +19,6 @@ if SOLARIS libraima_la_CFLAGS += -D_XOPEN_SOURCE=500 -DNO_REGCOMP endif -if HPUX -libraima_la_CFLAGS += -DMESSAGE_CAT -endif - libraima_la_SOURCES = alloc.c cmtype.c connect.c \ cotype.c crget.c crread.c crset.c \ diff --git a/cde/lib/DtSearch/raima/connect.c b/cde/lib/DtSearch/raima/connect.c index d992bb479..4e5160faf 100644 --- a/cde/lib/DtSearch/raima/connect.c +++ b/cde/lib/DtSearch/raima/connect.c @@ -84,8 +84,8 @@ int dbn /* Database number */ char *orec; /* ptr to current owner record contents in cache */ char *mrec; /* ptr to current member record contents in cache */ char *nrec; /* ptr to next member record contents in cache */ - DB_ADDR mdba; /* db address of current member record */ - DB_ADDR ndba; /* db address of next member record */ + DB_ADDR mdba = NULL; /* db address of current member record */ + DB_ADDR ndba = NULL; /* db address of next member record */ INT ordering; /* set order control variable */ int stat, compare; /* status code & sort comparison result */ SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/dbswab.c b/cde/lib/DtSearch/raima/dbswab.c index a059ba9e8..5327ae4ca 100644 --- a/cde/lib/DtSearch/raima/dbswab.c +++ b/cde/lib/DtSearch/raima/dbswab.c @@ -137,7 +137,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction) /* dba, or delete chain ptr */ memcpy (&align_LONG, slotptr + sizeof(INT), sizeof(LONG)); - align_LONG = HTONL (align_LONG); + HTONL (align_LONG); memcpy (slotptr + sizeof(INT), &align_LONG, sizeof(LONG)); /* If this is a deleted record, we're done */ @@ -151,7 +151,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction) curr_offset < data_offset; curr_offset += sizeof(LONG)) { memcpy (&align_LONG, slotptr + curr_offset, sizeof(LONG)); - align_LONG = HTONL (align_LONG); + HTONL (align_LONG); memcpy (slotptr + curr_offset, &align_LONG, sizeof(LONG)); } } /* end loop on each slot */ @@ -183,7 +183,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction) /* 'orphan' ptr or 'delete chain' ptr */ memcpy (&align_LONG, pgbuf + 6, sizeof(LONG)); - align_LONG = HTONL (align_LONG); + HTONL (align_LONG); memcpy (pgbuf + 6, &align_LONG, sizeof(LONG)); #ifdef DEBUG_DBSWAB @@ -234,7 +234,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction) cptr = slotptr + slsize - 8; memcpy (&align_LONG, cptr, sizeof(LONG)); - align_LONG = HTONL (align_LONG); + HTONL (align_LONG); memcpy (cptr, &align_LONG, sizeof(LONG)); #ifdef DEBUG_DBSWAB @@ -249,7 +249,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction) /* 'child ptr'. after dba, 4 bytes before end of slot. */ cptr += 4; memcpy (&align_LONG, cptr, sizeof(LONG)); - align_LONG = HTONL (align_LONG); + HTONL (align_LONG); memcpy (cptr, &align_LONG, sizeof(LONG)); } /* end loop on each slot */ diff --git a/cde/lib/DtSearch/raima/dbswab.h b/cde/lib/DtSearch/raima/dbswab.h index 2e53d52e7..889485241 100644 --- a/cde/lib/DtSearch/raima/dbswab.h +++ b/cde/lib/DtSearch/raima/dbswab.h @@ -68,7 +68,6 @@ #include #include -#include /* Record number for OR_MISCREC DtSearch record */ #define MISCREC_RECNO 3 @@ -81,22 +80,11 @@ typedef enum {HTON=1, NTOH} SWABDIR; extern void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction); -#if !defined(WORDS_BIGENDIAN) /* ie (BYTE_ORDER != BIG_ENDIAN) */ - #define HTONL(x) x = htonl(x) #define HTONS(x) x = htons(x) #define NTOHL(x) x = ntohl(x) #define NTOHS(x) x = ntohs(x) -#else /* !BYTE_SWAP, ie (BYTE_ORDER == BIG_ENDIAN) */ - -#define HTONL(x) -#define HTONS(x) -#define NTOHL(x) -#define NTOHS(x) - -#endif /* BYTE_SWAP */ - /******** debug stuff *******/ extern char *debug_keyslot_ptr; extern void snap_dump (char *label, void *ptr, int len); diff --git a/cde/lib/DtSearch/raima/dio.c b/cde/lib/DtSearch/raima/dio.c index 0f730c6e9..7ae7b7355 100644 --- a/cde/lib/DtSearch/raima/dio.c +++ b/cde/lib/DtSearch/raima/dio.c @@ -811,10 +811,10 @@ LOOKUP_ENTRY * *xlu_ptr /* pointer to lookup table slot for found page*/ { LOOKUP_ENTRY *lookup; /* = db_lookup or ix_lookup */ int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */ - long cmp; + long cmp = 0; int cnt; - int lu_slot, l, u; - LOOKUP_ENTRY *lu_ptr, *replu_ptr; + int lu_slot = 0, l, u; + LOOKUP_ENTRY *lu_ptr = NULL, *replu_ptr; PAGE_ENTRY *pg_ptr; int *lru_ptr; int pg_slot; diff --git a/cde/lib/DtSearch/raima/keyfcns.c b/cde/lib/DtSearch/raima/keyfcns.c index 9e0257f9a..7c35da814 100644 --- a/cde/lib/DtSearch/raima/keyfcns.c +++ b/cde/lib/DtSearch/raima/keyfcns.c @@ -55,7 +55,7 @@ /*--------------------------------------------------------------------------- db_VISTA Key File/Field Manipulation Functions ---------------------------------------------- - An implementation of the B-tree indexing method described in + An implementation of the B-tree indexing method described in "Sorting and Searching: The Art of Computer Programming, Vol III", Knuth, Donald E., Addison-Wesley, 1975. pp 473-480. @@ -164,12 +164,12 @@ key_open(void) } if ( no_of_keys ) { key_info = - /* Macro references must be on one line for some compilers */ + /* Macro references must be on one line for some compilers */ (KEY_INFO *) ALLOC(&db_global.Key_info, no_of_keys*sizeof(KEY_INFO), "key_info"); if ( ! key_info ) return( dberr(S_NOMEMORY) ); - for (i = 0, fld_ptr = &field_table[old_size_fd]; + for (i = 0, fld_ptr = &field_table[old_size_fd]; i < size_fd; ++i, ++fld_ptr) { if ( fld_ptr->fd_key != NOKEY ) { ki_ptr = &key_info[fld_ptr->fd_keyno]; @@ -180,7 +180,7 @@ key_open(void) ki_ptr->dba = NULL_DBA; file_ptr = &file_table[fld_ptr->fd_keyfile]; ki_ptr->keyval = - /* Macro references must be on one line for some compilers */ + /* Macro references must be on one line for some compilers */ ALLOC(&ki_ptr->Keyval, file_ptr->ft_slsize, db_avname); if ( ! ki_ptr->keyval ) return( dberr(S_NOMEMORY) ); @@ -258,7 +258,7 @@ int field /* field number to be processed */ -/* Reset key_info last status to reposition keys on file "fno" +/* Reset key_info last status to reposition keys on file "fno" */ int key_reset(FILE_NO fno) @@ -267,7 +267,7 @@ key_reset(FILE_NO fno) KEY_INFO *ki_ptr; for (i = 0, ki_ptr = key_info; i < no_of_keys; ++i, ++ki_ptr) { - if (((fno == size_ft) || (ki_ptr->keyfile == fno)) && + if (((fno == size_ft) || (ki_ptr->keyfile == fno)) && ((ki_ptr->lstat == KEYFOUND) || (ki_ptr->lstat == KEYNOTFOUND))) ki_ptr->lstat = KEYREPOS; } @@ -363,7 +363,7 @@ DB_ADDR *dba /* database address of located key */ /* return database address for d_keyfind */ if ( *dba == NULL_DBA ) bytecpy(dba, &curkey->dba, sizeof(DB_ADDR)); - + return( db_status ); } @@ -380,8 +380,8 @@ int *slot_offset, /* slot position offset */ F_ADDR *child /* child ptr of located key */ ) { - int cmp, i, l, u, slot_pos; - char *node_slot_ptr; + int cmp = 0, i = 0, l, u, slot_pos = 0; + char *node_slot_ptr = NULL; /* perform binary search on node */ l = 0; @@ -432,7 +432,7 @@ KEY_SLOT *slot, /* pointer to key slot to be compared */ DB_ADDR *dba /* database address included in comparison if not null */ ) { -/* +/* returns < 0 if key_val < slot > 0 if key_val > slot = 0 if key_val == slot @@ -529,7 +529,7 @@ DB_ADDR *dba /* db address of scanned record */ node_slot_ptr = &node->slots[np_ptr->slot*slot_len]; } bytecpy(&child, node_slot_ptr, sizeof(F_ADDR)); - } while ( child != NULL_NODE ); + } while ( child != NULL_NODE ); if (np_ptr->slot == node->used_slots) { --np_ptr->slot; @@ -686,9 +686,9 @@ DB_ADDR dba /* record's database address */ } db_status = stat; } - else if ( db_status == S_OKAY ) + else if ( db_status == S_OKAY ) dberr(S_SYSERR); - + return( db_status ); } @@ -925,7 +925,7 @@ static int delete(void) r_node_slot_ptr = &r_node->slots[sizeof(F_ADDR)]; bytecpy(node_slot_ptr, r_node_slot_ptr, slot_len - sizeof(F_ADDR)); dio_touch(pg); - + /* set up to delete key from leaf */ /* (this is more efficient than a recursive call) */ slot_pos = 0; @@ -1158,7 +1158,7 @@ d_keyread(char *key_val) if ( cfld_ptr->fd_type == COMKEY ) { /* copy compound key fields */ for (kt_lc = size_kt - cfld_ptr->fd_ptr, - key_ptr = &key_table[cfld_ptr->fd_ptr]; + key_ptr = &key_table[cfld_ptr->fd_ptr]; (--kt_lc >= 0) && (key_ptr->kt_key == fldno); ++key_ptr) { fld_ptr = &field_table[key_ptr->kt_field]; fptr = key_type.ks.data + key_ptr->kt_ptr; diff --git a/cde/lib/DtSearch/raima/recfcns.c b/cde/lib/DtSearch/raima/recfcns.c index 4c1229ed9..4d33fc1d7 100644 --- a/cde/lib/DtSearch/raima/recfcns.c +++ b/cde/lib/DtSearch/raima/recfcns.c @@ -303,7 +303,7 @@ DB_ADDR *db_addr char *fptr; const char *tfptr; int s, i, strfld; - FIELD_ENTRY *sfld_ptr; + FIELD_ENTRY *sfld_ptr = NULL; SORT_ENTRY *srt_ptr; DB_ADDR *co_ptr, *cm_ptr; @@ -402,7 +402,7 @@ DB_ADDR *db_addr } } } - if ( strfld >= 0 ) { + if ( strfld >= 0 && sfld_ptr) { /* insert the new struct key */ if ( key_insert( strfld, rec + sfld_ptr->fd_ptr, dba ) != S_OKAY ) return( db_status ); diff --git a/cde/lib/DtSvc/DtEncap/spc-proto.c b/cde/lib/DtSvc/DtEncap/spc-proto.c index 1d929b8ed..6795335f1 100644 --- a/cde/lib/DtSvc/DtEncap/spc-proto.c +++ b/cde/lib/DtSvc/DtEncap/spc-proto.c @@ -1658,7 +1658,7 @@ int SPC_Query_Logfile(SPC_Channel_Ptr channel) { SPC_Connection_Ptr connection=channel->connection; protocol_request_ptr prot; - XeString junk1, junk2; + XeString junk1 = NULL, junk2 = NULL; SPC_Write_Protocol_Request(connection, channel, QUERY_LOGFILE); prot=SPC_Filter_Connection(connection, channel, LOGFILE_REPLY, TRUE); @@ -1713,7 +1713,7 @@ SPC_Validate_User(XeString hostname, { XeString username = XeString_NULL; uid_t this_uid; - XeString proto_ver; + XeString proto_ver = NULL; XeString hostinfo; XeString path; protocol_request_ptr prot; diff --git a/cde/lib/DtSvc/DtEncap/spc-xt.c b/cde/lib/DtSvc/DtEncap/spc-xt.c index d1a935e64..b81e63bae 100644 --- a/cde/lib/DtSvc/DtEncap/spc-xt.c +++ b/cde/lib/DtSvc/DtEncap/spc-xt.c @@ -203,7 +203,7 @@ void SPC_XtAddInput(SPC_Channel_Ptr channel, SPC_Callback_Condition condition) /*-----------------------------------------------------------------------+*/ { - SbInputId id; + SbInputId id = 0; switch(condition) { @@ -224,8 +224,7 @@ void SPC_XtAddInput(SPC_Channel_Ptr channel, else id = (*SbAddException_hookfn)(fd, handler, channel); break; - - } + } *id_addr=SPC_AddInput(fd, condition, id); } diff --git a/cde/lib/DtSvc/DtUtil1/ActionDb.c b/cde/lib/DtSvc/DtUtil1/ActionDb.c index 9716d21a1..a31ecdae0 100644 --- a/cde/lib/DtSvc/DtUtil1/ActionDb.c +++ b/cde/lib/DtSvc/DtUtil1/ActionDb.c @@ -1003,7 +1003,7 @@ _DtActionConverter(DtDtsDbField * fields, char bigBuf[_DtAct_MAX_BUF_SIZE]; char *buf = bigBuf; char *fileName = _DtDbPathIdToString(pathId); - char *actionType; + char *actionType = NULL; _DtSvcProcessLock(); if (firstTime) diff --git a/cde/lib/DtSvc/DtUtil1/ActionTt.c b/cde/lib/DtSvc/DtUtil1/ActionTt.c index 02de21968..ee556fb18 100644 --- a/cde/lib/DtSvc/DtUtil1/ActionTt.c +++ b/cde/lib/DtSvc/DtUtil1/ActionTt.c @@ -885,7 +885,7 @@ TtRequestCallbackHandler( int argRepType; char *upttbuf; int upttbuflen, ivalue; - char *upVType, *upVType2; + char *upVType = NULL, *upVType2 = NULL; status = (Tt_status) tt_message_status(message); @@ -1174,7 +1174,7 @@ InitiateTtRequest( ActionRequest *request ) { - CallbackData *data; + CallbackData *data = NULL; ActionPtr action = request->clonedAction; tt_msgAttr * tt = &(action->u.tt_msg); int i; diff --git a/cde/lib/DtSvc/DtUtil1/DbReader.c b/cde/lib/DtSvc/DtUtil1/DbReader.c index 93ab9b7e1..3e1661d35 100644 --- a/cde/lib/DtSvc/DtUtil1/DbReader.c +++ b/cde/lib/DtSvc/DtUtil1/DbReader.c @@ -961,7 +961,7 @@ ReadNextEntry( char *start; char *last; char *save; - char *error_buffer; + char *error_buffer = NULL; short startDef; char * errorName; char * version; diff --git a/cde/lib/DtSvc/DtUtil1/Dts.c b/cde/lib/DtSvc/DtUtil1/Dts.c index c5160af30..0e29ba405 100644 --- a/cde/lib/DtSvc/DtUtil1/Dts.c +++ b/cde/lib/DtSvc/DtUtil1/Dts.c @@ -1951,7 +1951,7 @@ DtDtsSetDataType(const char *filename, const char *datatype_in, const int overid int fd; char *dt; int size; - u_char *buff; + u_char *buff = NULL; struct stat file_stat; char *datatype = 0; diff --git a/cde/lib/DtSvc/DtUtil1/SmComm.c b/cde/lib/DtSvc/DtUtil1/SmComm.c index 100a15090..c7422ce5c 100644 --- a/cde/lib/DtSvc/DtUtil1/SmComm.c +++ b/cde/lib/DtSvc/DtUtil1/SmComm.c @@ -196,7 +196,7 @@ _DtSetSmState( Window smWindow, SmStateInfo *pSmStateInfo) { - int propStatus; + int propStatus = Success; PropDtSmStateInfo propSmStateInfo; PropDtSmStateInfo *pPropSmStateInfo; Atom xaDtSmStateInfo; diff --git a/cde/lib/DtSvc/DtUtil2/ChkpntListen.c b/cde/lib/DtSvc/DtUtil2/ChkpntListen.c index 38c97154c..2f5124e32 100644 --- a/cde/lib/DtSvc/DtUtil2/ChkpntListen.c +++ b/cde/lib/DtSvc/DtUtil2/ChkpntListen.c @@ -67,7 +67,7 @@ _DtPerfChkpntListenInit(Display *display, Window parentwin) #endif { Time timestamp = INVALID_TIME; - Window tmpwin; + Window tmpwin = 0; Bool bsuccess = False; _DtSvcProcessLock(); diff --git a/cde/lib/DtSvc/DtUtil2/Hash.c b/cde/lib/DtSvc/DtUtil2/Hash.c index cc2b78c04..c27c36a19 100644 --- a/cde/lib/DtSvc/DtUtil2/Hash.c +++ b/cde/lib/DtSvc/DtUtil2/Hash.c @@ -110,12 +110,12 @@ GetTableIndex( #endif /* NeedWidePrototypes */ { DtHashEntry *entries = tab->entries; - int len, idx, i, rehash = 0; + int len = 0, idx, i, rehash = 0; char c; Signature sig = 0; DtHashEntry entry; String s1, s2; - DtHashKey compKey; + DtHashKey compKey = NULL; if (tab->keyIsString) { s1 = (String)key; diff --git a/cde/lib/DtSvc/DtUtil2/SharedProcs.c b/cde/lib/DtSvc/DtUtil2/SharedProcs.c index e473abdfa..395608d79 100644 --- a/cde/lib/DtSvc/DtUtil2/SharedProcs.c +++ b/cde/lib/DtSvc/DtUtil2/SharedProcs.c @@ -66,7 +66,7 @@ #include
#include
#ifdef USE_XINERAMA -#include +#include
#endif #include "SharedProcs.h" @@ -209,7 +209,7 @@ _DtMessageDialog( int dialogType ) { - Widget message; + Widget message = NULL; Widget widget; XmString message_string; XWindowAttributes attributes; diff --git a/cde/lib/DtSvc/DtUtil2/addToRes.c b/cde/lib/DtSvc/DtUtil2/addToRes.c index 7b9161328..8de1dbbb2 100644 --- a/cde/lib/DtSvc/DtUtil2/addToRes.c +++ b/cde/lib/DtSvc/DtUtil2/addToRes.c @@ -290,7 +290,7 @@ _DtGetEntries( int dosort ) { char *line, *colon, *temp, *str, *temp2; - Entry entry; + Entry entry = { NULL, NULL, 0, False }; int length; int lineno = 0; diff --git a/cde/lib/DtSvc/Makefile.am b/cde/lib/DtSvc/Makefile.am index 355e4cd06..273048f26 100644 --- a/cde/lib/DtSvc/Makefile.am +++ b/cde/lib/DtSvc/Makefile.am @@ -2,7 +2,13 @@ MAINTAINERCLEANFILES = Makefile.in lib_LTLIBRARIES = libDtSvc.la +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtSvc_la_LDFLAGS = -version-info 2:1:0 +else +libDtSvc_la_LDFLAGS = -version-info 3:0:1 +endif + # USe CPPFLAGS so it will apply to both C and C++ components libDtSvc_la_CPPFLAGS = -I./include -DMULTIBYTE -DNLS16 -I../include \ diff --git a/cde/lib/DtTerm/Makefile.am b/cde/lib/DtTerm/Makefile.am index cc7aa1ca5..7b96f2127 100644 --- a/cde/lib/DtTerm/Makefile.am +++ b/cde/lib/DtTerm/Makefile.am @@ -25,4 +25,10 @@ if HAS_UTEMPTER_LIBRARY libDtTerm_la_LIBADD += -lutempter endif +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtTerm_la_LDFLAGS = -version-info 2:1:0 +else +libDtTerm_la_LDFLAGS = -version-info 3:0:1 +endif + diff --git a/cde/lib/DtTerm/Term/TermBuffer.c b/cde/lib/DtTerm/Term/TermBuffer.c index 238e18bd1..5325b9f5e 100644 --- a/cde/lib/DtTerm/Term/TermBuffer.c +++ b/cde/lib/DtTerm/Term/TermBuffer.c @@ -984,8 +984,8 @@ _DtTermBufferErase DtEraseMode eraseSwitch ) { - short startCol; - short lastCol; + short startCol = 0; + short lastCol = 0; switch(eraseSwitch) { diff --git a/cde/lib/DtTerm/Term/TermParse.c b/cde/lib/DtTerm/Term/TermParse.c index d41035d11..9750ecca6 100644 --- a/cde/lib/DtTerm/Term/TermParse.c +++ b/cde/lib/DtTerm/Term/TermParse.c @@ -529,6 +529,8 @@ _DtTermEraseDisplay(Widget w) /* ED CSIpJ */ case 2: eraseMode = eraseBuffer; break ; + default: + return; } _DtTermFuncEraseInDisplay(w, (int)eraseMode, fromParser); vtw->term.tpd->cursorRow = row; @@ -746,6 +748,9 @@ _DtTermEraseInLine(Widget w) /* EL ESC[pK */ eraseMode = eraseLine; break; + default: + return; + } _DtTermFuncEraseInLine(w, (int)eraseMode, fromParser); } diff --git a/cde/lib/DtTerm/TermPrim/Makefile.am b/cde/lib/DtTerm/TermPrim/Makefile.am index 75ee28b63..6ecc554f4 100644 --- a/cde/lib/DtTerm/TermPrim/Makefile.am +++ b/cde/lib/DtTerm/TermPrim/Makefile.am @@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in noinst_LTLIBRARIES = libTermPrim.la -AM_CPPFLAGS = @DT_INCDIR@ +AM_CPPFLAGS = $(DT_INCDIR) libTermPrim_la_SOURCES = TermPrim.c \ TermPrimAction.c \ @@ -33,10 +33,6 @@ libTermPrim_la_SOURCES = TermPrim.c \ # JET there may be some more missing here... -if AIX -libTermPrim_la_SOURCES += TermPrimGetPty-clone.c -endif - if SOLARIS libTermPrim_la_SOURCES += TermPrimGetPty-svr4.c AM_CPPFLAGS += -DSUN_ARCHITECTURE diff --git a/cde/lib/DtTerm/TermPrim/TermPrimBufferWc.c b/cde/lib/DtTerm/TermPrim/TermPrimBufferWc.c index a29bcd0ad..f645cf685 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimBufferWc.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimBufferWc.c @@ -573,8 +573,8 @@ _DtTermPrimBufferInsertWc short *returnLength /* count of characters in overflow buffer */ ) { - short widthInc; /* incremental change in line width */ - short lengthInc; /* incremental change in line length */ + short widthInc = 0; /* incremental change in line width */ + short lengthInc = 0; /* incremental change in line length */ short widthInsert; /* column width of chars inserted */ short localCol; TermLine line; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c b/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c index ece7959e8..26f51edf0 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c @@ -68,8 +68,8 @@ _DtTermPrimRefreshTextWc(Widget w, short startColumn, short startRow, short chunkStartColumn; short chunkWidth; short chunkLength; - short thisStartColumn; - short thisEndColumn; + short thisStartColumn = 0; + short thisEndColumn = 0; enhValues enhancements; int i1; int lineNum; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c index c61d472df..da6f2b824 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c @@ -282,7 +282,7 @@ _DtTermPrimSubprocExec(Widget w, DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; static char *defaultCmd = (char *) 0; int i; - int pty; + int pty = -1; pid_t pid; char *c; int err; diff --git a/cde/lib/DtTerm/TermView/TermViewMenu.c b/cde/lib/DtTerm/TermView/TermViewMenu.c index 0ad1437c1..753c536ea 100644 --- a/cde/lib/DtTerm/TermView/TermViewMenu.c +++ b/cde/lib/DtTerm/TermView/TermViewMenu.c @@ -599,7 +599,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, Arg arglist[20]; Arg *newArglist; int i; - KeySym ks; + KeySym ks = NoSymbol; char *accelerator; char *acceleratorText; diff --git a/cde/lib/DtWidget/Control.c b/cde/lib/DtWidget/Control.c index 82ad592ee..8ca98320f 100644 --- a/cde/lib/DtWidget/Control.c +++ b/cde/lib/DtWidget/Control.c @@ -1290,8 +1290,8 @@ Draw( XRectangle clip; Position p_x, p_y, s_x, s_y; Dimension width = 0, height = 0; - Pixmap pix; - Pixmap mask; + Pixmap pix = 0; + Pixmap mask = 0; int index; Dimension left = 0, right = 0, top = 0, bottom = 0; Dimension v_pad; diff --git a/cde/lib/DtWidget/Editor.c b/cde/lib/DtWidget/Editor.c index ca23d66cb..168d95a19 100644 --- a/cde/lib/DtWidget/Editor.c +++ b/cde/lib/DtWidget/Editor.c @@ -1784,7 +1784,7 @@ extractFontMetrics( XmFontListEntry next_entry; XmFontType type_return = XmFONT_IS_FONT; XtPointer tmp_font; - XFontStruct *font; + XFontStruct *font = NULL; Boolean have_font_struct = False; Boolean have_font_set = False; Boolean use_font_set = False; diff --git a/cde/lib/DtWidget/Icon.c b/cde/lib/DtWidget/Icon.c index 8a234b5c8..7ce3f377b 100644 --- a/cde/lib/DtWidget/Icon.c +++ b/cde/lib/DtWidget/Icon.c @@ -3063,7 +3063,7 @@ Draw( GC gc; XRectangle clip; Position p_x, p_y, s_x, s_y; - Dimension width, height; + Dimension width = 0, height = 0; unsigned char behavior = G_Behavior (g); Position adj_x, adj_y; int rec_width=0,begin=0,diff=0; diff --git a/cde/lib/DtWidget/Makefile.am b/cde/lib/DtWidget/Makefile.am index 0498a2832..182717e2e 100644 --- a/cde/lib/DtWidget/Makefile.am +++ b/cde/lib/DtWidget/Makefile.am @@ -8,7 +8,12 @@ AM_CPPFLAGS = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) $(DT_INCDIR) libDtWidget_la_CFLAGS = -DI18N_MSG -DMULTIBYTE +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libDtWidget_la_LDFLAGS = -version-info 2:1:0 +else +libDtWidget_la_LDFLAGS = -version-info 3:0:1 +endif if SOLARIS libDtWidget_la_CFLAGS += -DNO_REGCOMP diff --git a/cde/lib/DtWidget/SpinBox.c b/cde/lib/DtWidget/SpinBox.c index e3e5e3c21..6d182092f 100644 --- a/cde/lib/DtWidget/SpinBox.c +++ b/cde/lib/DtWidget/SpinBox.c @@ -940,7 +940,7 @@ _SpinBoxBeginLine( DtSpinBoxWidget spin, Cardinal *num_params) { int new_position; - float new_current; + float new_current = 0.0; if (*num_params != 0) /* params means label or arrows */ spin = (DtSpinBoxWidget)XtParent(spin); @@ -978,7 +978,7 @@ _SpinBoxEndLine( DtSpinBoxWidget spin, Cardinal *num_params) { int new_position; - float new_current; + float new_current = 0.0; if (*num_params != 0) /* params means label or arrows */ spin = (DtSpinBoxWidget)XtParent(spin); diff --git a/cde/lib/DtWidget/TitleBox.c b/cde/lib/DtWidget/TitleBox.c index 2bf1e9345..c1913f40b 100644 --- a/cde/lib/DtWidget/TitleBox.c +++ b/cde/lib/DtWidget/TitleBox.c @@ -985,7 +985,7 @@ GeometryManager( height_req = request->request_mode & CWHeight, bw_req = request->request_mode & CWBorderWidth, almost = False; - XtGeometryResult result, parent_result; + XtGeometryResult result = XtGeometryYes, parent_result; XtWidgetGeometry parent_req, parent_reply; diff --git a/cde/lib/DtXinerama/DtXinerama.c b/cde/lib/DtXinerama/DtXinerama.c index 4ee3f8552..9de3f89e4 100644 --- a/cde/lib/DtXinerama/DtXinerama.c +++ b/cde/lib/DtXinerama/DtXinerama.c @@ -34,7 +34,7 @@ #include #include -#include "DtXinerama.h" +#include
/* return a DtXineramaInfo_t (or NULL if no Xinerama) available */ diff --git a/cde/lib/DtXinerama/Makefile.am b/cde/lib/DtXinerama/Makefile.am index ec85786c5..3844159d6 100644 --- a/cde/lib/DtXinerama/Makefile.am +++ b/cde/lib/DtXinerama/Makefile.am @@ -5,5 +5,12 @@ lib_LTLIBRARIES = libDtXinerama.la libDtXinerama_la_SOURCES = DtXinerama.c libDtXinerama_la_LIBADD = -lXinerama -libDtXinerama_la_LDFLAGS = -version-info 2:1:0 + +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD +libDtXinerama_la_LDFLAGS = -version-info 2:1:0 +else +libDtXinerama_la_LDFLAGS = -version-info 3:0:1 +endif + diff --git a/cde/lib/csa/Makefile.am b/cde/lib/csa/Makefile.am index c255667c7..b0362d32d 100644 --- a/cde/lib/csa/Makefile.am +++ b/cde/lib/csa/Makefile.am @@ -5,24 +5,20 @@ MAINTAINERCLEANFILES = Makefile.in lib_LTLIBRARIES = libcsa.la libcsa_la_CFLAGS = -DRFC_MIME -DLINE_COUNT -DV2 -DOW_I18N \ - @CSA_INCDIR@ + $(CSA_INCDIR) -libcsa_la_LIBADD = -lXt $(TIRPCLIB) +libcsa_la_LIBADD = $(XTOOLLIB) $(TIRPCLIB) +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libcsa_la_LDFLAGS = -version-info 2:1:0 - -if SOLARIS -libcsa_la_LDFLAGS += -G -z text -z defs -libcsa_la_CFLAGS += -v -endif - -if HPUX -libcsa_la_CFLAGS += -DHPUX +else +libcsa_la_LDFLAGS = -version-info 3:0:1 endif if LINUX else -libcsa_la_LIBADD += $(LIBSVC) -lXm +libcsa_la_LIBADD += $(LIBSVC) $(XTOOLLIB) endif AM_YFLAGS = -d diff --git a/cde/lib/csa/cmxdr.c b/cde/lib/csa/cmxdr.c index 18aa6126f..07ebc553d 100644 --- a/cde/lib/csa/cmxdr.c +++ b/cde/lib/csa/cmxdr.c @@ -33,7 +33,7 @@ */ #ifdef HAVE_CONFIG_H -#include +#include #endif #include #include "cm.h" diff --git a/cde/lib/csa/match.c b/cde/lib/csa/match.c index b1423b8e8..95dd7c5e2 100644 --- a/cde/lib/csa/match.c +++ b/cde/lib/csa/match.c @@ -102,7 +102,7 @@ _DtCmHashCriteria( time_t tstart1, tstart2, tend1, tend2; time_t tick; char *name; - cms_attribute_value *val, *hval; + cms_attribute_value *val, *hval = NULL; boolean_t keep; *hnum = 0; @@ -247,7 +247,7 @@ _DtCmHashCriteria( (*hattrs)[j].name.name = name; (*hattrs)[j].name.num = index; - if (val) { + if (val && hval) { (*hattrs)[j].value = &hval[j]; (*hattrs)[j].value->type = val->type; if (csaattrs && diff --git a/cde/lib/csa/rpccalls.c b/cde/lib/csa/rpccalls.c index beeb60794..678ebfe98 100644 --- a/cde/lib/csa/rpccalls.c +++ b/cde/lib/csa/rpccalls.c @@ -1206,7 +1206,7 @@ csa2cmsattrs( { CSA_return_code stat = CSA_SUCCESS; cms_attribute *cmsattrs; - CSA_enum *ops_r; + CSA_enum *ops_r = NULL; CSA_reminder *rptr1, *rptr2; int i,j; diff --git a/cde/lib/csa/table.c b/cde/lib/csa/table.c index c797bd7c8..1c8d38e4d 100644 --- a/cde/lib/csa/table.c +++ b/cde/lib/csa/table.c @@ -1055,7 +1055,7 @@ _DtCm_table_delete( extern CSA_return_code _DtCm_table_size(Calendar *cal, int *size) { - int *res; + int *res = NULL; CSA_return_code stat = CSA_SUCCESS; _DtCm_Connection *conn; @@ -1275,7 +1275,7 @@ _DtCm_table_unregister_target( nullreturned = B_TRUE; break; default: - stat = CSA_E_FAILURE; + return CSA_E_FAILURE; } if (nullreturned) { @@ -1360,7 +1360,7 @@ _DtCm_table_register_target( nullreturned = B_TRUE; break; default: - stat = CSA_E_FAILURE; + return CSA_E_FAILURE; } if (nullreturned) { diff --git a/cde/lib/tt/bin/dbck/Makefile.am b/cde/lib/tt/bin/dbck/Makefile.am index e86ff1126..905fae751 100644 --- a/cde/lib/tt/bin/dbck/Makefile.am +++ b/cde/lib/tt/bin/dbck/Makefile.am @@ -1,6 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" bin_PROGRAMS = ttdbck diff --git a/cde/lib/tt/bin/dbck/spec_repair.C b/cde/lib/tt/bin/dbck/spec_repair.C index 47d7b42fc..4e2117f74 100644 --- a/cde/lib/tt/bin/dbck/spec_repair.C +++ b/cde/lib/tt/bin/dbck/spec_repair.C @@ -151,9 +151,9 @@ const char* MP_TYPE_PROP = "_NODE_TYPE"; Prop_ptr sp; _Tt_string_list_cursor v; _Tt_db_property_ptr dbprop = new _Tt_db_property(); - uid_t euid; - gid_t group; - mode_t mode; + uid_t euid = 0; + gid_t group = 0; + mode_t mode = 0; int owner_written = 0; int group_written = 0; int mode_written = 0; diff --git a/cde/lib/tt/bin/scripts/Makefile.am b/cde/lib/tt/bin/scripts/Makefile.am index 490104a5d..fe31af94b 100644 --- a/cde/lib/tt/bin/scripts/Makefile.am +++ b/cde/lib/tt/bin/scripts/Makefile.am @@ -1,6 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" noinst_SCRIPTS = ttce2xdr BUILT_SOURCES = ttce2xdr diff --git a/cde/lib/tt/bin/shell/Makefile.am b/cde/lib/tt/bin/shell/Makefile.am index a66327187..04b2403ca 100644 --- a/cde/lib/tt/bin/shell/Makefile.am +++ b/cde/lib/tt/bin/shell/Makefile.am @@ -1,12 +1,13 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" bin_PROGRAMS = ttmv ttrm ttcp ttrmdir AM_CXXFLAGS = -I../../lib $(TT_VERSION_DEFINE) -LDADD = @LIBTT@ $(TIRPCLIB) $(XTOOLLIB) +LDADD = $(LIBTT) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS LDADD += -ldl -lintl -lsocket -lnsl diff --git a/cde/lib/tt/bin/tt_type_comp/Makefile.am b/cde/lib/tt/bin/tt_type_comp/Makefile.am index 5d334795b..c9e3dbf7e 100644 --- a/cde/lib/tt/bin/tt_type_comp/Makefile.am +++ b/cde/lib/tt/bin/tt_type_comp/Makefile.am @@ -1,6 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" BUILT_SOURCES = mp_types_gram.h CLEANFILES = mp_types_gram.h diff --git a/cde/lib/tt/bin/ttauth/ttauth.man b/cde/lib/tt/bin/ttauth/ttauth.man.in similarity index 98% rename from cde/lib/tt/bin/ttauth/ttauth.man rename to cde/lib/tt/bin/ttauth/ttauth.man.in index c065f57ee..49375b244 100644 --- a/cde/lib/tt/bin/ttauth/ttauth.man +++ b/cde/lib/tt/bin/ttauth/ttauth.man.in @@ -18,7 +18,7 @@ .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. -.TH TTAUTH 1 "Release 2.4.0a" "CDE" +.TH TTAUTH 1 "Release @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" "CDE" .SH NAME ttauth \- ToolTalk authority file utility .SH SYNOPSIS diff --git a/cde/lib/tt/bin/ttdbserverd/Makefile.am b/cde/lib/tt/bin/ttdbserverd/Makefile.am index fb9c08f25..976a2a74e 100644 --- a/cde/lib/tt/bin/ttdbserverd/Makefile.am +++ b/cde/lib/tt/bin/ttdbserverd/Makefile.am @@ -1,13 +1,14 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" bin_PROGRAMS = rpc.ttdbserver rpc_ttdbserver_CXXFLAGS = -I../../slib -I../../lib -I../../mini_isam \ $(TIRPC_DEFINES) $(TT_VERSION_DEFINE) -rpc_ttdbserver_LDADD = @LIBTT@ ${TIRPCLIB} $(X_LIBS) ../../slib/libstt.a \ +rpc_ttdbserver_LDADD = $(LIBTT) ${TIRPCLIB} $(X_LIBS) ../../slib/libstt.a \ ../../mini_isam/libisam.a if LINUX diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C index 2e506d336..d3cd8f113 100644 --- a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C +++ b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C @@ -1553,7 +1553,7 @@ _tt_db_results *_tt_queue_message_1 (_tt_queue_msg_args *args, _tt_get_rpc_strings(args->ptypes, message_info->ptypes); // Get the XDR size of the new message info structure - u_int length; + u_int length = 0; _Tt_xdr_size_stream xdrsz; if (!message_info->xdr((XDR *)xdrsz)) { results = TT_DB_ERR_ILLEGAL_MESSAGE; diff --git a/cde/lib/tt/bin/ttsession/Makefile.am b/cde/lib/tt/bin/ttsession/Makefile.am index cad1b8734..398d27b30 100644 --- a/cde/lib/tt/bin/ttsession/Makefile.am +++ b/cde/lib/tt/bin/ttsession/Makefile.am @@ -1,12 +1,13 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" bin_PROGRAMS = ttsession ttsession_CXXFLAGS = -I../../slib -I../../lib $(TT_VERSION_DEFINE) -ttsession_LDADD = @LIBTT@ $(X_LIBS) ../../slib/libstt.a +ttsession_LDADD = $(LIBTT) $(X_LIBS) ../../slib/libstt.a if LINUX ttsession_LDADD += $(TIRPCLIB) $(XTOOLLIB) diff --git a/cde/lib/tt/bin/tttar/Makefile.am b/cde/lib/tt/bin/tttar/Makefile.am index bfbbdf9fe..510810986 100644 --- a/cde/lib/tt/bin/tttar/Makefile.am +++ b/cde/lib/tt/bin/tttar/Makefile.am @@ -1,13 +1,14 @@ MAINTAINERCLENAFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" bin_PROGRAMS = tttar tttar_CXXFLAGS = -I../../lib $(TT_VERSION_DEFINE) tttar_LDADD = ../../slib/libstt.a ../../mini_isam/libisam.a \ - @LIBTT@ $(TIRPCLIB) $(XTOOLLIB) + $(LIBTT) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS tttar_LDADD += -ldl -lintl -lsocket -lnsl diff --git a/cde/lib/tt/bin/tttrace/Makefile.am b/cde/lib/tt/bin/tttrace/Makefile.am index ad67998f5..c7ae9a4c3 100644 --- a/cde/lib/tt/bin/tttrace/Makefile.am +++ b/cde/lib/tt/bin/tttrace/Makefile.am @@ -1,12 +1,10 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc - bin_PROGRAMS = tttrace tttrace_CXXFLAGS = -I../../lib -tttrace_LDADD = @LIBTT@ $(TIRPCLIB) $(XTOOLLIB) +tttrace_LDADD = $(LIBTT) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS tttrace_LDADD += -ldl -lintl -lsocket -lnsl diff --git a/cde/lib/tt/lib/Makefile.am b/cde/lib/tt/lib/Makefile.am index ebb9eeebc..895861805 100644 --- a/cde/lib/tt/lib/Makefile.am +++ b/cde/lib/tt/lib/Makefile.am @@ -2,20 +2,22 @@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = api db mp util tttk -include ../tooltalk.inc - lib_LTLIBRARIES = libtt.la -if AIX -libtt_la_SOURCES = realpath.c -else -libtt_la_SOURCES = -endif +# if you are on a system that does not support realpath(), you may need to +# include realpath.c in the _SOURCES +# +#libtt_la_SOURCES = realpath.c +libtt_la_SOURCES = + +# fake things so libtool creates this as a C++ library +nodist_EXTRA_libtt_la_SOURCES = dummy.cxx libtt_la_LIBADD = api/c/libapi.la api/dnd/libdnd.la db/libdb.la mp/libmp.la \ - util/libutil.la tttk/libtttk.la -lstdc++ + util/libutil.la tttk/libtttk.la if SOLARIS +# This stuff should be figured out by configure libtt_la_LIBADD += -lnsl -lsocket -lintl -ldl -lc -lw endif @@ -23,4 +25,10 @@ if LINUX libtt_la_LIBADD += $(TIRPCLIB) endif +# in order to try to keep lib versions the same across platforms, (2.1.0) +if BSD libtt_la_LDFLAGS = -version-info 2:1:0 +else +libtt_la_LDFLAGS = -version-info 3:0:1 +endif + diff --git a/cde/lib/tt/lib/api/c/Makefile.am b/cde/lib/tt/lib/api/c/Makefile.am index 55dbfd359..8d6e36600 100644 --- a/cde/lib/tt/lib/api/c/Makefile.am +++ b/cde/lib/tt/lib/api/c/Makefile.am @@ -2,8 +2,6 @@ ttdir = ${includedir}/Tt MAINTAINERCLEANFILES = Makefile.in -include ../../../tooltalk.inc - noinst_LTLIBRARIES = libapi.la libapi_la_CXXFLAGS = -I../../../lib diff --git a/cde/lib/tt/lib/api/dnd/Makefile.am b/cde/lib/tt/lib/api/dnd/Makefile.am index 13fc308b6..c09d824bd 100644 --- a/cde/lib/tt/lib/api/dnd/Makefile.am +++ b/cde/lib/tt/lib/api/dnd/Makefile.am @@ -1,7 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../../tooltalk.inc - noinst_LTLIBRARIES = libdnd.la libdnd_la_CFLAGS = -I../.. diff --git a/cde/lib/tt/lib/db/Makefile.am b/cde/lib/tt/lib/db/Makefile.am index 47701fe2e..5743db487 100644 --- a/cde/lib/tt/lib/db/Makefile.am +++ b/cde/lib/tt/lib/db/Makefile.am @@ -1,7 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc - noinst_LTLIBRARIES = libdb.la libdb_la_CXXFLAGS = -I../../lib -I../../mini_isam diff --git a/cde/lib/tt/lib/mp/Makefile.am b/cde/lib/tt/lib/mp/Makefile.am index 33189b540..1ff8ddd73 100644 --- a/cde/lib/tt/lib/mp/Makefile.am +++ b/cde/lib/tt/lib/mp/Makefile.am @@ -1,7 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc - noinst_LTLIBRARIES = libmp.la libmp_la_CXXFLAGS = -I../../lib -I../../mini_isam diff --git a/cde/lib/tt/lib/mp/mp_session.C b/cde/lib/tt/lib/mp/mp_session.C index 21bc4a326..32ef0da85 100644 --- a/cde/lib/tt/lib/mp/mp_session.C +++ b/cde/lib/tt/lib/mp/mp_session.C @@ -640,7 +640,7 @@ parsed_address(_Tt_string &addr_string) int junk_version = 1; Tt_status status; const char *addr_format_fmt = "%%ld %%d %%d %%d %%lu %%%ds %%d"; - char addr_format[32]; + char addr_format[64]; const char *fcs1_addr_format_fmt = "%%ld %%d %%d %%d %%lu %%%ds"; char fcs1_addr_format[32]; diff --git a/cde/lib/tt/lib/tttk/Makefile.am b/cde/lib/tt/lib/tttk/Makefile.am index 0a11019a5..acf8a90dd 100644 --- a/cde/lib/tt/lib/tttk/Makefile.am +++ b/cde/lib/tt/lib/tttk/Makefile.am @@ -1,8 +1,7 @@ -headerdir = ${prefix}/share/include/Tt - MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" noinst_LTLIBRARIES = libtttk.la diff --git a/cde/lib/tt/lib/util/Makefile.am b/cde/lib/tt/lib/util/Makefile.am index db05b9498..7d08584d3 100644 --- a/cde/lib/tt/lib/util/Makefile.am +++ b/cde/lib/tt/lib/util/Makefile.am @@ -1,6 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in -include ../../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" noinst_LTLIBRARIES = libutil.la diff --git a/cde/lib/tt/lib/util/tt_xdr_utils.C b/cde/lib/tt/lib/util/tt_xdr_utils.C index dff0326e2..26cd4f8c6 100644 --- a/cde/lib/tt/lib/util/tt_xdr_utils.C +++ b/cde/lib/tt/lib/util/tt_xdr_utils.C @@ -35,6 +35,7 @@ #include #include #include +#include #include "tt_options.h" #if defined(__OpenBSD__) @@ -77,11 +78,7 @@ tt_x_putbytes(XDR *xp, caddr_t, int len) return TRUE; } -#if defined(CSRG_BASED) || defined(__linux__) -static int32_t* -#else -static long * -#endif +rpc_inline_t * #if defined(CSRG_BASED) || defined(__linux__) tt_x_inline(XDR *xp, unsigned int len) #else @@ -99,11 +96,7 @@ tt_x_inline(XDR *xp, int len) if (len > 0 && (caddr_t) (intptr_t) len < xp->x_base) { xp->x_handy += RNDUP (len); -#if defined(CSRG_BASED) || defined(__linux__) - return (int32_t *) xp->x_private; -#else - return (long *) xp->x_private; -#endif + return (rpc_inline_t *) xp->x_private; } else return 0; } diff --git a/cde/lib/tt/mini_isam/Makefile.am b/cde/lib/tt/mini_isam/Makefile.am index 244fa668f..19453f8da 100644 --- a/cde/lib/tt/mini_isam/Makefile.am +++ b/cde/lib/tt/mini_isam/Makefile.am @@ -1,6 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in -include ../tooltalk.inc +TT_VERSION = "CDE Version @CDE_VERSION_MAJOR@.@CDE_VERSION_MINOR@.@CDE_VERSION_MICRO@@CDE_VERSION_DEV@" +TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" noinst_LIBRARIES= libisam.a diff --git a/cde/lib/tt/mini_isam/isbtree2.c b/cde/lib/tt/mini_isam/isbtree2.c index 2ce2396c3..50fb423c3 100644 --- a/cde/lib/tt/mini_isam/isbtree2.c +++ b/cde/lib/tt/mini_isam/isbtree2.c @@ -56,11 +56,11 @@ _isbtree_insert(Btree *btree, char *key) Keydesc2 *pkeydesc2 = btree->keydesc2; int keylength = pkeydesc2->k2_len; int nkeys; /* Number of keys in the page */ - int capac; + int capac = 0; char keybuf[MAXKEYSIZE]; int i; Blkno blkno; - char *pkp, *pkp2, *pkp3; + char *pkp = NULL, *pkp2, *pkp3; Bufhdr *kp2bhdr, *kp3bhdr; Blkno blkno2, blkno3; int level; diff --git a/cde/lib/tt/mini_isam/isread.c b/cde/lib/tt/mini_isam/isread.c index 262fea70f..4abfc13af 100644 --- a/cde/lib/tt/mini_isam/isread.c +++ b/cde/lib/tt/mini_isam/isread.c @@ -149,13 +149,13 @@ _amread(Bytearray *isfhandle, char *record, int *reclen, struct errcode *errcode) { Fcb *fcb = NULL; - Recno recnum2; + Recno recnum2 = 0; int err; Crp *crp; Btree *btree = NULL; Keydesc2 *pkeydesc2; char keybuf1[MAXKEYSIZE], keybuf2[MAXKEYSIZE]; - char *pkey, *pkeynext; + char *pkey = NULL, *pkeynext; int skipbytes; int ret; Bytearray oldcurpos; diff --git a/cde/lib/tt/mini_isam/isstart.c b/cde/lib/tt/mini_isam/isstart.c index d390c534a..b3c5788c1 100644 --- a/cde/lib/tt/mini_isam/isstart.c +++ b/cde/lib/tt/mini_isam/isstart.c @@ -158,7 +158,7 @@ _amstart(Bytearray *isfhandle, char *record, int *reclen, Bytearray *curpos, Recno *recnum, struct errcode *errcode) { Fcb *fcb; - Recno recnum2; + Recno recnum2 = 0; int err; Crp *newcrp = NULL; char recbuf [ISMAXRECLEN]; diff --git a/cde/lib/tt/slib/Makefile.am b/cde/lib/tt/slib/Makefile.am index a6499ca01..a987b2aaf 100644 --- a/cde/lib/tt/slib/Makefile.am +++ b/cde/lib/tt/slib/Makefile.am @@ -1,7 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -include ../tooltalk.inc - noinst_LIBRARIES = libstt.a libstt_a_CXXFLAGS = $(TIRPC_DEFINES) -I../lib diff --git a/cde/lib/tt/slib/mp_s_procid.C b/cde/lib/tt/slib/mp_s_procid.C index 357374a03..2e3744c12 100644 --- a/cde/lib/tt/slib/mp_s_procid.C +++ b/cde/lib/tt/slib/mp_s_procid.C @@ -632,10 +632,12 @@ update_message(const _Tt_message_ptr &m, Tt_state newstate) // delivered messages, update the message and then // change it to its new state. - _Tt_dispatch_reason reason; + _Tt_dispatch_reason reason ; while (mcursor.next()) { if (mcursor->is_equal(m)) { + bool recognised_state = false; + dm = (_Tt_s_message *)(*mcursor).c_pointer(); mcursor.remove(); if (dm.c_pointer() != m.c_pointer()) { @@ -649,26 +651,35 @@ update_message(const _Tt_message_ptr &m, Tt_state newstate) switch (newstate) { case TT_FAILED: reason = TTDR_MESSAGE_FAIL; + recognised_state = true; break; case TT_REJECTED: reason = TTDR_MESSAGE_REJECT; + recognised_state = true; break; case TT_HANDLED: reason = TTDR_MESSAGE_REPLY; + recognised_state = true; break; case TT_ACCEPTED: reason = TTDR_MESSAGE_ACCEPT; + recognised_state = true; break; case TT_ABSTAINED: reason = TTDR_MESSAGE_ABSTAIN; + recognised_state = true; break; +// default: + /* TODO what is the default reason? */ } #ifdef OPT_BUG_SUNOS_5 { #endif // Keep this in sync with ::add_message() - _Tt_msg_trace trace( *dm, reason ); - dm->change_state(this, newstate, trace); + if(recognised_state) { + _Tt_msg_trace trace( *dm, reason ); + dm->change_state(this, newstate, trace); + } #ifdef OPT_BUG_SUNOS_5 // SunPro cfront calls diff --git a/cde/lib/tt/tooltalk.inc b/cde/lib/tt/tooltalk.inc deleted file mode 100644 index 494645c35..000000000 --- a/cde/lib/tt/tooltalk.inc +++ /dev/null @@ -1,13 +0,0 @@ -# This file is imbedded near the top of every ToolTalk Imakefile. -# It contains definitions and redefinitions that are common to all -# of ToolTalk but which aren't referred to anywhere else in the -# build. - -# It should match tooltalk.tmpl in terms of definitions... - -# TT_VERSION defines the version string which is imbedded in all the -# binaries and shipped libraries. - -TT_VERSION = "CDE Version 2.4.0a" -TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" - diff --git a/cde/m4/ax_pthread.m4 b/cde/m4/ax_pthread.m4 index d218d1af7..724cdcb9e 100644 --- a/cde/m4/ax_pthread.m4 +++ b/cde/m4/ax_pthread.m4 @@ -294,7 +294,7 @@ if test "x$ax_pthread_clang" = "xyes"; then # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_link_step=`echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do diff --git a/cde/m4/tcl.m4 b/cde/m4/tcl.m4 index 55538c5a5..a508b2558 100644 --- a/cde/m4/tcl.m4 +++ b/cde/m4/tcl.m4 @@ -28,7 +28,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, - AC_HELP_STRING([--with-tcl], + AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), with_tclconfig="${withval}") AC_MSG_CHECKING([for Tcl configuration]) @@ -159,7 +159,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, - AC_HELP_STRING([--with-tk], + AS_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), with_tkconfig="${withval}") AC_MSG_CHECKING([for Tk configuration]) @@ -528,7 +528,7 @@ AC_DEFUN([SC_BUILD_TCLSH], [ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], + AS_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) @@ -570,7 +570,7 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ if test "`uname -s`" = "Darwin" ; then AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, - AC_HELP_STRING([--enable-framework], + AS_HELP_STRING([--enable-framework], [package shared libraries in MacOSX frameworks (default: off)]), [enable_framework=$enableval], [enable_framework=no]) if test $enable_framework = yes; then @@ -621,7 +621,7 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ AC_DEFUN([SC_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, - AC_HELP_STRING([--enable-threads], + AS_HELP_STRING([--enable-threads], [build with threads (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) @@ -737,7 +737,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, - AC_HELP_STRING([--enable-symbols], + AS_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. @@ -797,7 +797,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_DEFUN([SC_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, - AC_HELP_STRING([--enable-langinfo], + AS_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) @@ -849,7 +849,7 @@ AC_DEFUN([SC_ENABLE_LANGINFO], [ AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to use symlinks for manpages]) AC_ARG_ENABLE(man-symlinks, - AC_HELP_STRING([--enable-man-symlinks], + AS_HELP_STRING([--enable-man-symlinks], [use symlinks for the manpages (default: off)]), test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks", enableval="no") @@ -857,7 +857,7 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to compress the manpages]) AC_ARG_ENABLE(man-compression, - AC_HELP_STRING([--enable-man-compression=PROG], + AS_HELP_STRING([--enable-man-compression=PROG], [compress the manpages with PROG (default: off)]), [case $enableval in yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);; @@ -878,7 +878,7 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to add a package name suffix for the manpages]) AC_ARG_ENABLE(man-suffix, - AC_HELP_STRING([--enable-man-suffix=STRING], + AS_HELP_STRING([--enable-man-suffix=STRING], [use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]), [case $enableval in yes) enableval="AC_PACKAGE_NAME" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; @@ -1029,7 +1029,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, - AC_HELP_STRING([--enable-64bit], + AS_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) @@ -1038,7 +1038,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, - AC_HELP_STRING([--enable-64bit-vis], + AS_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) @@ -1067,7 +1067,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_MSG_CHECKING([if rpath support is requested]) AC_ARG_ENABLE(rpath, - AC_HELP_STRING([--disable-rpath], + AS_HELP_STRING([--disable-rpath], [disable rpath support (default: on)]), [doRpath=$enableval], [doRpath=yes]) AC_MSG_RESULT([$doRpath]) @@ -1632,7 +1632,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ PLAT_SRCS='${MAC_OSX_SRCS}' AC_MSG_CHECKING([whether to use CoreFoundation]) AC_ARG_ENABLE(corefoundation, - AC_HELP_STRING([--enable-corefoundation], + AS_HELP_STRING([--enable-corefoundation], [use CoreFoundation API on MacOSX (default: on)]), [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) AC_MSG_RESULT([$tcl_corefoundation]) @@ -1986,7 +1986,7 @@ dnl # preprocessing tests use only CPPFLAGS. # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, - AC_HELP_STRING([--enable-load], + AS_HELP_STRING([--enable-load], [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) AS_IF([test "$tcl_ok" = no], [DL_OBJS=""]) @@ -2666,7 +2666,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, - AC_HELP_STRING([--with-encoding], + AS_HELP_STRING([--with-encoding], [encoding for configuration values (default: iso8859-1)]), with_tcencoding=${withval}) diff --git a/cde/programs/backdrops/Makefile.am b/cde/programs/backdrops/Makefile.am index eb91fc1a3..c54eafd59 100644 --- a/cde/programs/backdrops/Makefile.am +++ b/cde/programs/backdrops/Makefile.am @@ -1,10 +1,10 @@ backdropdir = $(CDE_INSTALLATION_TOP)/share/backdrops -dist_backdrop_DATA = Ankh.bm Crochet.pm Lattice.pm Paver.pm SkyLight.pm \ -Background.bm Foreground.bm Leaves.pm Pebbles.pm Sprinkles.pm \ -BrickWall.bm InlayColor.pm Makefile.am PinStripe.pm SunLogo.pm \ -Concave.pm InlayPlain.pm NoBackdrop.bm RakedSand.bm Toronto.bm \ -Convex.pm KnitLight.pm NoBackdrop.pm RicePaper.pm WaterDrops.pm \ +dist_backdrop_DATA = Ankh.bm Crochet.pm Lattice.pm Paver.pm \ +SkyLight.pm Background.bm Foreground.bm Leaves.pm Pebbles.pm \ +Sprinkles.pm BrickWall.bm InlayColor.pm PinStripe.pm SunLogo.pm \ +Concave.pm InlayPlain.pm NoBackdrop.bm RakedSand.bm Toronto.bm \ +Convex.pm KnitLight.pm NoBackdrop.pm RicePaper.pm WaterDrops.pm \ Corduroy.pm LatticeBig.pm OldChars.pm SkyDark.pm Wooly.pm install-data-hook: diff --git a/cde/programs/dsdm/dsdm.c b/cde/programs/dsdm/dsdm.c index d795c4efd..77880ba51 100644 --- a/cde/programs/dsdm/dsdm.c +++ b/cde/programs/dsdm/dsdm.c @@ -65,7 +65,7 @@ #include #include #if defined(HAVE_CONFIG_H) -# include +# include #endif #if defined(HAVE_STRING_H) # include diff --git a/cde/programs/dtaction/Main.c b/cde/programs/dtaction/Main.c index 222735725..74b767f78 100644 --- a/cde/programs/dtaction/Main.c +++ b/cde/programs/dtaction/Main.c @@ -622,7 +622,7 @@ AddSuLog( * take away write access from SULog */ - if(chmod (SULog, (int) (st.st_mode & 07777) & ~0222) == -1) { + if(chmod (SULog, 0400) == -1) { fprintf(stderr, "Error on chmod of '%s', %s\n", SULog, strerror(errno)); } diff --git a/cde/programs/dtappbuilder/Makefile.am b/cde/programs/dtappbuilder/Makefile.am index bb371c635..7bc72afdd 100644 --- a/cde/programs/dtappbuilder/Makefile.am +++ b/cde/programs/dtappbuilder/Makefile.am @@ -1,7 +1,3 @@ MAINTAINERCLEANFILES = Makefile.in -if SOLARIS -.NO_PARALLEL: -endif - SUBDIRS = src diff --git a/cde/programs/dtappbuilder/src/Makefile.am b/cde/programs/dtappbuilder/src/Makefile.am index c84f01b69..d10daf263 100644 --- a/cde/programs/dtappbuilder/src/Makefile.am +++ b/cde/programs/dtappbuilder/src/Makefile.am @@ -1,7 +1,3 @@ MAINTAINERCLEANFILES = Makefile.in -if SOLARIS -.NO_PARALLEL: -endif - SUBDIRS = libAButil libABobj libABobjXm libABil abmf ab diff --git a/cde/programs/dtappbuilder/src/ab/Makefile.am b/cde/programs/dtappbuilder/src/ab/Makefile.am index bd279d40f..0d43ea0cf 100644 --- a/cde/programs/dtappbuilder/src/ab/Makefile.am +++ b/cde/programs/dtappbuilder/src/ab/Makefile.am @@ -47,7 +47,7 @@ SOURCES.msg = \ dtbuilder_LDADD = ../libABil/libABil.a ../libABobjXm/libABobjXm.a \ ../libABobj/libABobj.a ../libAButil/libAButil.a \ $(LIBWIDGET) $(LIBTERM) $(LIBHELP) $(LIBSVC) \ - $(LIBTT) $(LIBXIN) -lUil $(MRESOURCELIB) -lXm $(XTOOLLIB) ${X_LIB} \ + $(LIBTT) $(LIBXIN) -lUil $(MRESOURCELIB) $(XTOOLLIB) ${X_LIB} \ $(UTILLIB) -lm dtbuilder_CFLAGS = -DPIXMAP_WORKAROUND $(ABINCLUDES) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_edit.c b/cde/programs/dtappbuilder/src/ab/abobj_edit.c index 180f329b8..cf28f88ce 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_edit.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_edit.c @@ -2201,7 +2201,7 @@ abobj_paste( ABObj project = proj_get_project(), newObj, root, - newroot, + newroot = NULL, parent; ABSelectedRec sel; STRING name = (STRING) NULL; diff --git a/cde/programs/dtappbuilder/src/ab/cgen_utils.c b/cde/programs/dtappbuilder/src/ab/cgen_utils.c index 5e477ecf2..2d6f58ce4 100644 --- a/cde/programs/dtappbuilder/src/ab/cgen_utils.c +++ b/cde/programs/dtappbuilder/src/ab/cgen_utils.c @@ -1204,7 +1204,7 @@ exec_run(void) { ABObj project= NULL; char executable_name[1024]; - char cmd[1024]; + char cmd[sizeof(executable_name) + 3]; STRING argv[5]; *executable_name = 0; *cmd = 0; diff --git a/cde/programs/dtappbuilder/src/ab/conn_drag.c b/cde/programs/dtappbuilder/src/ab/conn_drag.c index 71b97e753..24c75e790 100644 --- a/cde/programs/dtappbuilder/src/ab/conn_drag.c +++ b/cde/programs/dtappbuilder/src/ab/conn_drag.c @@ -275,7 +275,7 @@ process_chord_extend( int dum_x; int dum_y; unsigned int mask_ret; - Cursor cur_cursor; + Cursor cur_cursor = curs_nw; x_conn_fullscreen_chord(widget, root_win, @@ -288,6 +288,8 @@ process_chord_extend( new_dir = find_drag_dirn(start_x, start_y, new_x, new_y); if (new_dir != find_drag_dirn(start_x, start_y, cur_x, cur_y)) { + int do_cursor = 1; + switch(new_dir) { case NORTH_WEST: @@ -304,19 +306,21 @@ process_chord_extend( break; default: /* catch-all to avoid compiler warnings */ + do_cursor = 0; break; } - if (XGrabPointer(display, root_win, True, + if(do_cursor) { + if (XGrabPointer(display, root_win, True, ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, root_win, - cur_cursor, CurrentTime) != - GrabSuccess) - { - fprintf(stderr, "Pointer grab failed.\n"); - XUngrabKeyboard(display, CurrentTime); - XUngrabServer(display); - return; + cur_cursor, CurrentTime) != GrabSuccess) + { + fprintf(stderr, "Pointer grab failed.\n"); + XUngrabKeyboard(display, CurrentTime); + XUngrabServer(display); + return; + } } } x_conn_fullscreen_chord(widget, root_win, diff --git a/cde/programs/dtappbuilder/src/ab/conn_stubs.c b/cde/programs/dtappbuilder/src/ab/conn_stubs.c index f398fabdc..10688ada4 100644 --- a/cde/programs/dtappbuilder/src/ab/conn_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/conn_stubs.c @@ -3872,7 +3872,7 @@ get_cur_func_type(void) Widget label_wid = XmOptionButtonGadget(action_type_opmenu); XmString xm_act_label = (XmString)NULL; char *act_label = NULL; - int i; + int i = -1; AB_FUNC_TYPE func_type = AB_FUNC_UNDEF; XtVaGetValues(label_wid, XmNlabelString, &xm_act_label, NULL); @@ -3904,6 +3904,7 @@ get_cur_func_type(void) func_type = AB_FUNC_HELP_VOLUME; break; default: + func_type = AB_FUNC_UNDEF; break; } diff --git a/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src b/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src index 54500197c..5c45a3f07 100644 --- a/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src +++ b/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src @@ -692,11 +692,11 @@ output_handler(STRING msg) /* * Free help data strings */ - if (help_data.help_text); + if (help_data.help_text) XtFree(help_data.help_text); - if (help_data.help_volume); + if (help_data.help_volume) XtFree(help_data.help_volume); - if (help_data.help_locationID); + if (help_data.help_locationID) XtFree(help_data.help_locationID); } else diff --git a/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c b/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c index 658aaafb3..1a393a24b 100644 --- a/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c @@ -1412,6 +1412,9 @@ more_help_dispatch(Widget widget, XtPointer clientData, XtPointer callData) *cp++ = 0; vol = buffer; loc = cp; + } else { + /* No slash found, give up */ + return; } if(GeneralHelpDialog == (Widget)NULL) { diff --git a/cde/programs/dtappbuilder/src/ab/pal_group.c b/cde/programs/dtappbuilder/src/ab/pal_group.c index 0441803da..5da93db29 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_group.c +++ b/cde/programs/dtappbuilder/src/ab/pal_group.c @@ -1884,7 +1884,7 @@ group_align_hcenters( cell_width, cell_height, group_width, - group_height, + group_height = 0, offset, gridline, i, @@ -2235,8 +2235,8 @@ group_align_labels( for (i = 0; i < num_columns; i++) { - ABObj ref_obj; - int ref_width; + ABObj ref_obj = NULL; + int ref_width = 0; for (j = 0; j < num_rows; j++) one_col[j] = get_child(obj, i, j); @@ -2300,7 +2300,7 @@ group_align_vcenters( num_rows, cell_width, cell_height, - group_width, + group_width = 0, group_height, offset, gridline, diff --git a/cde/programs/dtappbuilder/src/ab/projP_utils.c b/cde/programs/dtappbuilder/src/ab/projP_utils.c index 6e12bd8c9..4c808cd33 100644 --- a/cde/programs/dtappbuilder/src/ab/projP_utils.c +++ b/cde/programs/dtappbuilder/src/ab/projP_utils.c @@ -371,7 +371,7 @@ projP_save_export_bil( } else /* An error occurred with stat */ { - sprintf(Buf, "%s: %s", new_filename, strerror(errno)); + snprintf(Buf, sizeof(Buf), "%s: %s", new_filename, strerror(errno)); util_printf_err(Buf); } XtUnmanageChild(AB_generic_chooser); diff --git a/cde/programs/dtappbuilder/src/ab/proj_utils.c b/cde/programs/dtappbuilder/src/ab/proj_utils.c index 5e185de92..026d1bac6 100644 --- a/cde/programs/dtappbuilder/src/ab/proj_utils.c +++ b/cde/programs/dtappbuilder/src/ab/proj_utils.c @@ -1492,7 +1492,7 @@ proj_save_exploded( else /* An error occurred with stat */ { obj_set_name(project, old_name); - sprintf(Buf, "%s: %s", mod_exp_file, strerror(errno)); + snprintf(Buf, sizeof(Buf), "%s: %s", mod_exp_file, strerror(errno)); util_printf_err(Buf); if (old_name != NULL) util_free(old_name); if (old_file != NULL) util_free(old_file); @@ -1558,7 +1558,7 @@ proj_save_exploded( if ((iRet = util_mkdir_hier(dir)) < 0) { obj_set_name(project, old_name); - sprintf(Buf, "%s: %s", dir, strerror(errno)); + snprintf(Buf, sizeof(Buf), "%s: %s", dir, strerror(errno)); util_printf_err(Buf); if (rel_path) util_free(rel_path); if (old_name != NULL) util_free(old_name); @@ -2135,7 +2135,7 @@ save_proj_as_bix( } else /* An error occurred with stat */ { - sprintf(Buf, "%s: %s", bix_file, strerror(errno)); + snprintf(Buf, sizeof(Buf), "%s: %s", bix_file, strerror(errno)); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); (void)dtb_show_modal_message(dtb_get_toplevel_widget(), diff --git a/cde/programs/dtappbuilder/src/ab/prop.c b/cde/programs/dtappbuilder/src/ab/prop.c index b2f19f023..8e9453107 100644 --- a/cde/programs/dtappbuilder/src/ab/prop.c +++ b/cde/programs/dtappbuilder/src/ab/prop.c @@ -4068,7 +4068,7 @@ menu_newCB( PropStateInfo *pstate; AB_PROP_TYPE alt_prop_type = AB_PROP_FIXED; ABObj module; - Widget prop_dialog; + Widget prop_dialog = NULL; STRING base = NULL; STRING unique_name; STRING menu_name; diff --git a/cde/programs/dtappbuilder/src/abmf/Makefile.am b/cde/programs/dtappbuilder/src/abmf/Makefile.am index f039c5233..4578520f1 100644 --- a/cde/programs/dtappbuilder/src/abmf/Makefile.am +++ b/cde/programs/dtappbuilder/src/abmf/Makefile.am @@ -4,14 +4,6 @@ ABINCLUDES = ../include EXTRA_DEFINES = -D_POSIX_SOURCE=1 -if HPUX -CCOPTIONS = -Ae -endif - -if AIX -CCOPTIONS = -qnoro -endif - if BSD UTILLIB = -lutil endif @@ -30,11 +22,11 @@ noinst_DATA = dtcodegen.cat dtcodegen_CFLAGS = $(EXTRA_DEFINES) -I$(ABINCLUDES) -I../libABil -dtcodegen_LDADD = -lXext ../libABil/libABil.a \ +dtcodegen_LDADD = ../libABil/libABil.a \ ../libABobjXm/libABobjXm.a \ ../libABobj/libABobj.a ../libAButil/libAButil.a \ $(LIBTERM) $(LIBSVC) $(LIBTT) $(LIBHELP) $(LIBXIN) \ - $(LIBWIDGET) $(UTILLIB) $(XTOOLLIB) -lm + $(LIBWIDGET) $(UTILLIB) $(XTOOLLIB) dtcodegen_SOURCES = abmf.c args.c \ diff --git a/cde/programs/dtappbuilder/src/abmf/generate_code.c b/cde/programs/dtappbuilder/src/abmf/generate_code.c index d92eb60ba..1c4dd0ec7 100644 --- a/cde/programs/dtappbuilder/src/abmf/generate_code.c +++ b/cde/programs/dtappbuilder/src/abmf/generate_code.c @@ -563,7 +563,7 @@ write_module_files( strcpy(uiHeaderDefineName, abmfP_get_define_from_file_name(uiHeaderFileName)); sprintf(stubsFileName, "%s_stubs.c", obj_get_name(module)); - sprintf(stubsBakFileName, "%s.BAK", stubsFileName); + snprintf(stubsBakFileName, sizeof(stubsBakFileName), "%s.BAK", stubsFileName); /* * ***** WRITE UI HEADER FILE ***** @@ -733,7 +733,7 @@ write_module_files( if ((stubsCFileChanged) && (deltaFile != NULL)) { char deltaFileName[MAXPATHLEN]; - sprintf(deltaFileName, "%s.delta", stubsFileName); + snprintf(deltaFileName, sizeof(deltaFileName), "%s.delta", stubsFileName); replace_file(deltaFileName, deltaFile, TRUE); } @@ -799,9 +799,9 @@ write_project_files( sprintf(headerFileName, "%s.h", obj_get_name(project)); strcpy(headerDefineName, abmfP_get_define_from_file_name(headerFileName)); - sprintf(headerBakFileName, "%s.BAK", headerFileName); + snprintf(headerBakFileName, sizeof(headerBakFileName), "%s.BAK", headerFileName); sprintf(stubsFileName, "%s.c", obj_get_name(project)); - sprintf(stubsBakFileName, "%s.BAK", stubsFileName); + snprintf(stubsBakFileName, sizeof(stubsBakFileName), "%s.BAK", stubsFileName); /***** PROJECT HEADER FILE *****/ diff --git a/cde/programs/dtappbuilder/src/abmf/lib_func_strings.c b/cde/programs/dtappbuilder/src/abmf/lib_func_strings.c index cb9bf804b..7af71ef54 100644 --- a/cde/programs/dtappbuilder/src/abmf/lib_func_strings.c +++ b/cde/programs/dtappbuilder/src/abmf/lib_func_strings.c @@ -1117,7 +1117,7 @@ static LibFuncRec abmfP_lrc_more_help_dispatch = "{\n" " int i;\n" " Arg wargs[10];\n" - " String buffer, vol, loc;\n" + " String buffer, vol = NULL, loc = NULL;\n" " char *cp;\n" " static Widget GeneralHelpDialog = (Widget) 0;\n" " Widget help_dialog = (Widget)clientData;\n" @@ -3902,7 +3902,7 @@ static LibFuncRec abmfP_lrc_align_labels = ")\n" "{\n" " WidgetList children_list = NULL,\n" - " one_col;\n" + " one_col = NULL;\n" " Widget previous_child = 0,\n" " child,\n" " ref_widget,\n" diff --git a/cde/programs/dtappbuilder/src/abmf/lib_funcs.c b/cde/programs/dtappbuilder/src/abmf/lib_funcs.c index 969df1390..d39da76da 100644 --- a/cde/programs/dtappbuilder/src/abmf/lib_funcs.c +++ b/cde/programs/dtappbuilder/src/abmf/lib_funcs.c @@ -1246,7 +1246,7 @@ dtb_more_help_dispatch( { int i; Arg wargs[10]; - String buffer, vol, loc; + String buffer, vol = NULL, loc = NULL; char *cp; static Widget GeneralHelpDialog = (Widget) NULL; Widget help_dialog = (Widget)clientData; @@ -3310,7 +3310,7 @@ align_labels( ) { WidgetList children_list = NULL, - one_col; + one_col = NULL; Widget previous_child = NULL, child, ref_widget, diff --git a/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c b/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c index 768f6a5ce..11ed489d3 100644 --- a/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c +++ b/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c @@ -1026,7 +1026,7 @@ abmfP_write_action_function( ABObj toObj = obj_get_to(action); ABObj module = NULL; char actionName[1024]; - char actionPrintf[1024]; + char actionPrintf[32 + sizeof(actionName)]; abmfP_gencode_enter_func(genCodeInfo); abmfP_ip_obj(genCodeInfo) = obj_get_to(action); diff --git a/cde/programs/dtappbuilder/src/libABil/abuil_load.c b/cde/programs/dtappbuilder/src/libABil/abuil_load.c index c60806557..ee5d3fe67 100644 --- a/cde/programs/dtappbuilder/src/libABil/abuil_load.c +++ b/cde/programs/dtappbuilder/src/libABil/abuil_load.c @@ -527,7 +527,7 @@ object_child_into_module( sym_entry_type *uil_section_entries ) { - ABObjPtr ret_val; + ABObjPtr ret_val = NULL; sym_widget_entry_type *uil_widget; if (uil_section_entries == (sym_entry_type *)NULL) @@ -1112,7 +1112,7 @@ parse_uil( Uil_status_type compile_stat; int user_mess_data = 1; int user_stat_data = 1; - char *ret_val; + char *ret_val = NULL; /* Set up command description structure */ diff --git a/cde/programs/dtappbuilder/src/libABil/bil_lexer.c b/cde/programs/dtappbuilder/src/libABil/bil_lexer.c index 2f031d6bc..8d78b98b6 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_lexer.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_lexer.c @@ -381,7 +381,7 @@ yyerror(const char *message) CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 37, ", near '%s'"), tokenText); } - sprintf(errMsg, "%s%s\n", message, tokenMsg); + snprintf(errMsg, sizeof(errMsg), "%s%s\n", message, tokenMsg); abil_print_custom_load_err(errMsg); } diff --git a/cde/programs/dtappbuilder/src/libABobj/Makefile.am b/cde/programs/dtappbuilder/src/libABobj/Makefile.am index 6e725a8fd..3bf1128f7 100644 --- a/cde/programs/dtappbuilder/src/libABobj/Makefile.am +++ b/cde/programs/dtappbuilder/src/libABobj/Makefile.am @@ -6,14 +6,6 @@ EXTRA_DEFINES = -D_POSIX_SOURCE=1 EXTRALIBS = -lm -if HPUX -CCOPTIONS = -Ae -endif - -if AIX -EXTRALIBS += -liconv -endif - if SOLARIS EXTRALIBS += -ldl -lgen endif diff --git a/cde/programs/dtappbuilder/src/libABobj/obj_notify.c b/cde/programs/dtappbuilder/src/libABobj/obj_notify.c index 7540f2a19..13cd2682d 100644 --- a/cde/programs/dtappbuilder/src/libABobj/obj_notify.c +++ b/cde/programs/dtappbuilder/src/libABobj/obj_notify.c @@ -908,7 +908,7 @@ event_print(OBJ_EVENT *event, FILE *outFile, BOOL addNewline, STRING name) { ABObj obj= NULL; char eventName[1024]; - char eventParams[1024]; + char eventParams[1024 + 2]; char *eventParamsPtr= eventParams; char buf1[256]; char buf2[256]; diff --git a/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c b/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c index c115940e3..453e3d906 100644 --- a/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c +++ b/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c @@ -520,7 +520,7 @@ objxm_comp_set_color_args( static XtArgVal bgvalue; static BOOL cgen_args; AB_TRAVERSAL trav; - Widget widget; + Widget widget = NULL; Pixel pixel; ABObj subObj; int status; diff --git a/cde/programs/dtcalc/calctool.c b/cde/programs/dtcalc/calctool.c index 5f91e8884..279582000 100644 --- a/cde/programs/dtcalc/calctool.c +++ b/cde/programs/dtcalc/calctool.c @@ -1201,11 +1201,38 @@ make_number(int *MPnumber, BOOLEAN mkFix) } +/*ARGSUSED*/ /* Default math library exception handling routine. */ -void -matherr(void) +int +matherr(struct exception *exc) { +#if 0 + char msg[100]; + + if (exc) { + strcpy(msg, exc->name); + strcat(msg, ": "); + if(exc->type == DOMAIN) + strcat(msg, "DOMAIN "); + else if(exc->type == SING) + strcat(msg, "SING "); + else if(exc->type == OVERFLOW) + strcat(msg, "OVERFLOW "); + else if(exc->type == UNDERFLOW) + strcat(msg, "UNDERFLOW "); + else if(exc->type == TLOSS) + strcat(msg, "TLOSS "); + else if(exc->type == PLOSS) + strcat(msg, "PLOSS "); + + strcat(msg, vstrs[(int) V_ERROR]); + + _DtSimpleError (v->appname, DtWarning, NULL, msg); + } +#endif + doerr(vstrs[(int) V_ERROR]) ; + return(1) ; /* Value ignored. */ } /* Convert string into an MP number. */ diff --git a/cde/programs/dtcalc/calctool.h b/cde/programs/dtcalc/calctool.h index 42cdcf6a8..3377e9f47 100644 --- a/cde/programs/dtcalc/calctool.h +++ b/cde/programs/dtcalc/calctool.h @@ -36,7 +36,7 @@ #include - +#include #include #include #include
@@ -545,9 +545,6 @@ extern struct calcVars CalcVars; typedef struct calcVars *Vars ; extern Vars v ; /* Calctool variables and options. */ -extern void matherr(void); // calctool.c - - /* Structure, resource definitions, for View's optional parameters. */ typedef struct diff --git a/cde/programs/dtcalc/functions.c b/cde/programs/dtcalc/functions.c index 1f985dc23..fa96fe484 100644 --- a/cde/programs/dtcalc/functions.c +++ b/cde/programs/dtcalc/functions.c @@ -677,7 +677,7 @@ do_factorial(int *MPval, int *MPres) /* Calculate the factorial of MPval. */ } mpcim(&i, MPa) ; mpcmi(MP1, &i) ; - if (!i) matherr() ; + if (!i) matherr((struct exception *) NULL) ; else while (i > 0) { @@ -687,7 +687,7 @@ do_factorial(int *MPval, int *MPres) /* Calculate the factorial of MPval. */ i-- ; } } - else matherr() ; + else matherr((struct exception *) NULL) ; mpstr(MPa, MPres) ; } diff --git a/cde/programs/dtcm/dtcm/Makefile.am b/cde/programs/dtcm/dtcm/Makefile.am index 0b24f3f7f..93fbbf3a1 100644 --- a/cde/programs/dtcm/dtcm/Makefile.am +++ b/cde/programs/dtcm/dtcm/Makefile.am @@ -7,10 +7,6 @@ AM_CFLAGS = $(DT_INCDIR) $(CSA_INCDIR) -I../../../lib/csa \ LDADD = ../libDtCmP/libDtCmP.a $(LIBCSA) $(DTCLIENTLIBS) $(XTOOLLIB) -if SOLARIS -AM_CFLAGS += -xstrconst -Xc -v -endif - if FREEBSD LDADD += -lcompat endif @@ -46,4 +42,4 @@ dtcm_editor_SOURCES = datefield.c deskset.c dssw.c \ reminders.c rfp.c install-exec-hook: - mkdir -p $(DESTDIR)/var/spool/calendar + $(INSTALL) -m 0755 -d $(DESTDIR)/var/spool/calendar diff --git a/cde/programs/dtcm/dtcm/RFCMIME.c b/cde/programs/dtcm/dtcm/RFCMIME.c index af8e2c0b9..951d817aa 100644 --- a/cde/programs/dtcm/dtcm/RFCMIME.c +++ b/cde/programs/dtcm/dtcm/RFCMIME.c @@ -46,7 +46,7 @@ static char sccsid[] = "$TOG: RFCMIME.c /main/11 1999/06/30 12:08:55 mgreess $"; */ #ifdef HAVE_CONFIG_H -#include +#include #endif #include @@ -1300,8 +1300,9 @@ writeQPrint(char *buf, const char * bp, const unsigned long bp_len, */ if ( *cur == (char)0x1b ) { /* Only 0x1b ????? */ - char tmp[3]; - sprintf(tmp, "=%02X", (int)(unsigned char)*cur); + const int tmpsz = 4; + char tmp[tmpsz]; + snprintf(tmp, tmpsz, "=%02X", (int)(unsigned char)*cur); memcpy(&line_buf[off], tmp, 3); off += 3; continue; diff --git a/cde/programs/dtcm/dtcm/browser.c b/cde/programs/dtcm/dtcm/browser.c index 8ab86f1b8..8de446cd8 100644 --- a/cde/programs/dtcm/dtcm/browser.c +++ b/cde/programs/dtcm/dtcm/browser.c @@ -1417,7 +1417,7 @@ mb_draw_chartgrid(Browser *b, Calendar *c) Props *p = (Props*)c->properties; XFontSetExtents fontextents; int char_height, char_width; - char label[5], buf[160]; + char label[12], buf[160]; new_XContext *xc = b->xcontext; int dayy, dayweek; Tick daytick; diff --git a/cde/programs/dtcm/dtcm/cm_i18n.c b/cde/programs/dtcm/dtcm/cm_i18n.c index e3ccec08f..ddd32e059 100644 --- a/cde/programs/dtcm/dtcm/cm_i18n.c +++ b/cde/programs/dtcm/dtcm/cm_i18n.c @@ -51,7 +51,7 @@ #endif #ifdef HAVE_CONFIG_H -#include +#include #endif #include diff --git a/cde/programs/dtcm/dtcm/cm_insert.c b/cde/programs/dtcm/dtcm/cm_insert.c index 95063c083..ae35d7da5 100644 --- a/cde/programs/dtcm/dtcm/cm_insert.c +++ b/cde/programs/dtcm/dtcm/cm_insert.c @@ -200,7 +200,7 @@ prompt_for_insert(Props *p) { } } - sprintf(buf, "%s %s", date_str, cm_start); + snprintf(buf, sizeof(buf), "%s %s", date_str, cm_start); next = (int) cm_getdate(buf, NULL); next = next + hrsec; diff --git a/cde/programs/dtcm/dtcm/dayglance.c b/cde/programs/dtcm/dtcm/dayglance.c index 20f4dbef2..16d51db32 100644 --- a/cde/programs/dtcm/dtcm/dayglance.c +++ b/cde/programs/dtcm/dtcm/dayglance.c @@ -923,7 +923,7 @@ static int day_xytoclock(Calendar *c, int x, int y, Tick t) { int daybegin, hr, val; - char buf[10]; + char buf[36]; struct tm tm; Props *p; _Xltimeparams localtime_buf; diff --git a/cde/programs/dtcm/dtcm/dssw.c b/cde/programs/dtcm/dtcm/dssw.c index b8a739553..10964cc3e 100644 --- a/cde/programs/dtcm/dtcm/dssw.c +++ b/cde/programs/dtcm/dtcm/dssw.c @@ -579,7 +579,7 @@ dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int } else ampm_buf[0] = '\0'; - sprintf(buf, "%s %s%s", + snprintf(buf, sizeof(buf), "%s %s%s", dssw->date_val, dssw->start_val.val, ampm_buf); if (!blank_buf(dssw->stop_val.val) @@ -627,7 +627,7 @@ dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int } else ampm_buf[0] = '\0'; - sprintf(buf, "%s %s%s", dssw->date_val, + snprintf(buf, sizeof(buf), "%s %s%s", dssw->date_val, dssw->stop_val.val, ampm_buf); if ((stop_tick = cm_getdate(buf, NULL)) <= 0) { editor_err_msg(dssw->parent, name, INVALID_DATE, @@ -719,7 +719,7 @@ dssw_form_to_todo(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t) } else ampm_buf[0] = '\0'; - sprintf(buf, "%s %s%s", + snprintf(buf, sizeof(buf), "%s %s%s", dssw->date_val, dssw->start_val.val, ampm_buf); /* diff --git a/cde/programs/dtcm/dtcm/find.c b/cde/programs/dtcm/dtcm/find.c index f55e71f48..c0b8b9138 100644 --- a/cde/programs/dtcm/dtcm/find.c +++ b/cde/programs/dtcm/dtcm/find.c @@ -575,7 +575,7 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs int num_items, mo, last_match_total = 0, match_total = 0; pr_pos xy; Tick end_of_time, start, stop; - Tick_list *ptr, *next_ptr, *tail_ptr, *new_tick; + Tick_list *ptr, *next_ptr, *tail_ptr = NULL, *new_tick; CSA_session_handle cal = 0; CSA_return_code stat; CSA_entry_handle *entries = NULL; @@ -713,8 +713,7 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs (const time_t *)&new_tick->tick, localtime_buf)); fmt_time_what(appt, what_buf, dt); - sprintf (buf2, "%10s %s", - buf, what_buf); + snprintf(buf2, sizeof(buf2), "%10s %s", buf, what_buf); buf_str = XmStringCreateLocalized(buf2); XmListAddItem(f->find_list, buf_str, 0); XmStringFree(buf_str); diff --git a/cde/programs/dtcm/dtcm/font.c b/cde/programs/dtcm/dtcm/font.c index dda3482c5..cc4f154bb 100644 --- a/cde/programs/dtcm/dtcm/font.c +++ b/cde/programs/dtcm/dtcm/font.c @@ -60,7 +60,7 @@ get_font( XmFontContext fl_context; XmFontListEntry fl_entry; XtPointer fl_entry_font, - font_to_use; + font_to_use = NULL; char *fl_entry_font_tag; Boolean found_font_set = False, found_font_struct = False; diff --git a/cde/programs/dtcm/dtcm/misc.c b/cde/programs/dtcm/dtcm/misc.c index 947e0d67c..5915488bd 100644 --- a/cde/programs/dtcm/dtcm/misc.c +++ b/cde/programs/dtcm/dtcm/misc.c @@ -682,7 +682,7 @@ dialog_popup(Widget parent, ...) { char *text_str = NULL, *ptr, buf[MAXNAMELEN], *help_str; Pixmap px; va_list pvar; - Widget frame, form, image, sep, text, last_text, button; + Widget frame, form, image, sep, text, last_text = NULL, button; Display *dpy = XtDisplayOfObject(parent); XmString xmstr; Dialog_create_op op; @@ -1301,7 +1301,7 @@ Dimension *dim, ... ) { va_list ap; - int i, _high; + int i, _high = 0; Dimension _max; Widget _targetW, _highestW; Arg _args[3]; @@ -1355,7 +1355,7 @@ Dimension *dim, ... ) { va_list ap; - int i, _wide; + int i, _wide = 0; Widget _targetW, _widestW; Dimension _max; XtWidgetGeometry geo; @@ -1425,7 +1425,7 @@ Dimension *dim, ... ) { va_list ap; - int i, _high; + int i, _high = 0; Dimension _max; Widget _targetW, _highestW; Arg _args[3]; diff --git a/cde/programs/dtcm/dtcm/props_pu.c b/cde/programs/dtcm/dtcm/props_pu.c index 99da5130f..cc6b0bc05 100644 --- a/cde/programs/dtcm/dtcm/props_pu.c +++ b/cde/programs/dtcm/dtcm/props_pu.c @@ -2638,7 +2638,7 @@ extern Boolean get_editor_vals_from_ui(Props_pu *pu, Props *p) { int i, hr, min; char buf[5]; - Widget text; + Widget text = NULL; DisplayType dt = get_int_prop(p, CP_DEFAULTDISP); Reminders_val *val; char *msg, *dur_txt; @@ -2733,7 +2733,7 @@ get_editor_vals_from_ui(Props_pu *pu, Props *p) { if ((status = get_reminders_vals(&pu->ep_reminders, False)) != REMINDERS_OK) { char *title = XtNewString(CATGETS(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); - char *text; + char *text = NULL; char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); switch (status) { diff --git a/cde/programs/dtcm/dtcm/timezone.c b/cde/programs/dtcm/dtcm/timezone.c index df17802d2..a89767707 100644 --- a/cde/programs/dtcm/dtcm/timezone.c +++ b/cde/programs/dtcm/dtcm/timezone.c @@ -299,7 +299,7 @@ make_timezone(Calendar *c) cm_strcpy(tmp_buf, (char*)getenv("TZ")); cm_strcpy(t->mytimezone, tmp_buf); - sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), + snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), t->mytimezone); set_message(t->timezone_message, buf); set_message(c->message_text, buf); @@ -385,7 +385,7 @@ tz_set_timezone(Calendar *c, Timezone *t) if (t->timezone_type == mytime) { set_timezone(t->mytimezone); - sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), + snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), t->mytimezone); /* get utc time */ @@ -413,7 +413,7 @@ tz_set_timezone(Calendar *c, Timezone *t) cm_strcpy(t->gmttimezone, tmp_buf); sprintf(gmt, "GMT%s", tmp_buf); set_timezone(gmt); - sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), gmt); + snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), gmt); } set_message(t->timezone_message, buf); paint_canvas(c, NULL, RENDER_CLEAR_FIRST); diff --git a/cde/programs/dtcm/dtcm/todo.c b/cde/programs/dtcm/dtcm/todo.c index c74e3e8d5..a416bd72a 100644 --- a/cde/programs/dtcm/dtcm/todo.c +++ b/cde/programs/dtcm/dtcm/todo.c @@ -2128,8 +2128,10 @@ build_todo_list(ToDo *t, Tick date, Glance glance, CSA_entry_handle **a, CSA_uin state = CSA_STATUS_COMPLETED; use_state = B_TRUE; } - else + else { + state = 0; use_state = B_FALSE; + } setup_range(&range_attrs, &ops, &range_count, start, stop, CSA_TYPE_TODO, state, use_state, t->cal->general->version); @@ -2210,7 +2212,7 @@ build_todo_view(ToDo *t, Glance glance, Boolean redisplay) { step = (TodoView *)ckalloc(sizeof(TodoView)); sprintf(str1, "%d", cnt); - sprintf(str2, "%s.", str1); + sprintf(str2, "%d.", cnt); str = XmStringCreateLocalized(str2); step->view_item_number = XtVaCreateManagedWidget("cnt", xmLabelGadgetClass, t->view_form_mgr, diff --git a/cde/programs/dtcm/dtcm/weekglance.c b/cde/programs/dtcm/dtcm/weekglance.c index 6c8d55f31..583e3a281 100644 --- a/cde/programs/dtcm/dtcm/weekglance.c +++ b/cde/programs/dtcm/dtcm/weekglance.c @@ -1186,7 +1186,7 @@ draw_chart(Calendar *c, Week *w, XRectangle *rect) int n; XFontSetExtents fontextents; int char_height; - char label[5]; + char label[12]; new_XContext *xc = c->xcontext; Props *p = (Props*)c->properties; DisplayType dt = get_int_prop(p, CP_DEFAULTDISP); diff --git a/cde/programs/dtcm/dtcm/x_graphics.c b/cde/programs/dtcm/dtcm/x_graphics.c index c86266f8d..7233d3c67 100644 --- a/cde/programs/dtcm/dtcm/x_graphics.c +++ b/cde/programs/dtcm/dtcm/x_graphics.c @@ -2660,7 +2660,7 @@ x_print_header(void *gInfoP, char *buf, int pageNum, int numPages) } } - sprintf(pageStr, "%s %d %s %d", str2, pageNum, str, numPages); + snprintf(pageStr, sizeof(pageStr), "%s %d %s %d", str2, pageNum, str, numPages); /* Header/footer strings are all set - print 'em! */ cm_print_header_string(gInfo, CP_PRINTLHEADER, @@ -3186,7 +3186,7 @@ x_print_todo(void *gInfoP, CSA_entry_handle *list, int a_total, _csa_iso8601_to_tick(appt->time->value->item.date_time_value, &start_tick); format_date3(start_tick, ot, st, buf2); - sprintf(buf3, "%s %s", buf2, buf1); + snprintf(buf3, sizeof(buf3), "%s %s", buf2, buf1); } else cm_strcpy(buf3, buf1); diff --git a/cde/programs/dtcm/libDtCmP/Makefile.am b/cde/programs/dtcm/libDtCmP/Makefile.am index bd9bebd84..0841b0938 100644 --- a/cde/programs/dtcm/libDtCmP/Makefile.am +++ b/cde/programs/dtcm/libDtCmP/Makefile.am @@ -5,10 +5,6 @@ noinst_LIBRARIES = libDtCmP.a libDtCmP_a_CFLAGS = $(CSA_INCDIR) -I../../../lib/csa -DRFC_MIME \ -DLINE_COUNT -DV2 -DOW_I18N -if SOLARIS -libDtCmP_a_CFLAGS += -xstrconst -Xc -v -endif - libDtCmP_a_SOURCES = cm_tty.c cmfns.c dtfns.c props.c resource.c \ timeops.c util.c getdate.y diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.c b/cde/programs/dtcm/libDtCmP/cm_tty.c index 1c39aaf43..58bef93c9 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.c +++ b/cde/programs/dtcm/libDtCmP/cm_tty.c @@ -650,7 +650,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date, format_time(end_tick, dt, end_buf); else *end_buf = '\0'; - sprintf(buf, "%s%c%7s ", start_buf, + snprintf(buf, sizeof(buf), "%s%c%7s ", start_buf, (*end_buf ? '-' : ' '), end_buf); } @@ -1747,7 +1747,7 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs) growcat(&buffer, tmp_buf); _csa_iso8601_to_duration(attrs[i].value->item.reminder_value->lead_time, &advance_time); - sprintf(tmp_buf, "reminder:%d:", advance_time); + sprintf(tmp_buf, "reminder:%ld:", (long) advance_time); growcat(&buffer, tmp_buf); if (attrs[i].value->item.reminder_value->reminder_data.data) cat_indented_string(&buffer, diff --git a/cde/programs/dtcm/libDtCmP/getdate.y b/cde/programs/dtcm/libDtCmP/getdate.y index b199fdeeb..c31360a6d 100644 --- a/cde/programs/dtcm/libDtCmP/getdate.y +++ b/cde/programs/dtcm/libDtCmP/getdate.y @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems /* @(#)getdate.y 2.6 4/20/84 */ #ifdef HAVE_CONFIG_H -#include +#include #endif #include #include diff --git a/cde/programs/dtcm/libDtCmP/timeops.c b/cde/programs/dtcm/libDtCmP/timeops.c index dcb016df4..ffdb8d338 100644 --- a/cde/programs/dtcm/libDtCmP/timeops.c +++ b/cde/programs/dtcm/libDtCmP/timeops.c @@ -52,7 +52,7 @@ static char sccsid[] = "@(#)timeops.c 1.13 95/05/02 Copyr 1991 Sun Microsystems, #endif #ifdef HAVE_CONFIG_H -#include +#include #endif #include #include diff --git a/cde/programs/dtcm/libDtCmP/util.c b/cde/programs/dtcm/libDtCmP/util.c index dc8b62c45..75e902578 100644 --- a/cde/programs/dtcm/libDtCmP/util.c +++ b/cde/programs/dtcm/libDtCmP/util.c @@ -377,7 +377,7 @@ text_to_lines(char *s, int n) Lines *prev_l = NULL, *l = NULL, *head= NULL; int i = 0; char *_p; - int clen; + int clen = 0; if (s == NULL || n <= 0) return NULL; @@ -1227,7 +1227,7 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, . va_list pvar; CmDataList *api_ids = CmDataListCreate(); Dtcm_appointment *appt; - int def_attr_count; + int def_attr_count = 0; /* * The Dtcm_appointment wrapper array diff --git a/cde/programs/dtcm/server/Makefile.am b/cde/programs/dtcm/server/Makefile.am index 4638a34bc..9321ca858 100644 --- a/cde/programs/dtcm/server/Makefile.am +++ b/cde/programs/dtcm/server/Makefile.am @@ -7,7 +7,6 @@ rpc_cmsd_CFLAGS = -I../../../lib/csa $(DT_INCDIR) $(CSA_INCDIR) rpc_cmsd_LDADD = $(LIBCSA) $(DTCLIENTLIBS) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS -rpc_cmsd_CFLAGS += -xstrconst -Xc -v rpc_cmsd_LDADD += -lsocket -lnsl -lintl -lm -ldl endif diff --git a/cde/programs/dtcm/server/cmsfunc.c b/cde/programs/dtcm/server/cmsfunc.c index effc6f63e..5e6d37d0a 100644 --- a/cde/programs/dtcm/server/cmsfunc.c +++ b/cde/programs/dtcm/server/cmsfunc.c @@ -778,7 +778,7 @@ cms_insert_entry_5_svc(cms_insert_args *args, struct svc_req *svcrq) cms_key key; char *user; uint access, needaccess; - Appt_4 *appt; + Appt_4 *appt = NULL; if (debug) fprintf(stderr, "cms_insert_entry_5_svc called\n"); diff --git a/cde/programs/dtcm/server/lookup.c b/cde/programs/dtcm/server/lookup.c index cb98523d9..8730bf529 100644 --- a/cde/programs/dtcm/server/lookup.c +++ b/cde/programs/dtcm/server/lookup.c @@ -341,10 +341,10 @@ _DtCmsGetEntryAttrByKey( CSA_return_code stat; CSA_return_code stat2; cms_entry *entry = NULL; - char *stime, *etime; + char *stime, *etime = NULL; char sbuf[TIME_BUF_LEN], ebuf[TIME_BUF_LEN]; time_t firsttick = 0; - List_node *lnode; + List_node *lnode = NULL; cms_get_entry_attr_res_item *res = NULL; if (entry_r == NULL && res_r == NULL) @@ -529,7 +529,7 @@ _EnumerateSequence( stat == CSA_SUCCESS && tick < start2; tick = NextTick(tick, fsttick, lnode->re, restate)) { - char *stime, *etime; + char *stime, *etime = NULL; char sbuf[TIME_BUF_LEN], ebuf[TIME_BUF_LEN]; if (tick <= 0 || tick > lnode->lasttick) diff --git a/cde/programs/dtcm/server/reclotick.c b/cde/programs/dtcm/server/reclotick.c index d1d7ddba2..7d75db603 100644 --- a/cde/programs/dtcm/server/reclotick.c +++ b/cde/programs/dtcm/server/reclotick.c @@ -77,7 +77,7 @@ ClosestTick( RepeatEvent *re, RepeatEventState **res) { - Tick closest_tick, + Tick closest_tick = 0, real_start_time, target_time = _target_time; diff --git a/cde/programs/dtcm/server/relasttick.c b/cde/programs/dtcm/server/relasttick.c index 89747dcbe..41c6d0310 100644 --- a/cde/programs/dtcm/server/relasttick.c +++ b/cde/programs/dtcm/server/relasttick.c @@ -61,7 +61,7 @@ LastTick( const Tick start_time, RepeatEvent *re) { - Tick last_time; + Tick last_time = 0; if (!re) return (Tick)0; diff --git a/cde/programs/dtcm/server/renexttick.c b/cde/programs/dtcm/server/renexttick.c index 9f19e9007..19e584e1c 100644 --- a/cde/programs/dtcm/server/renexttick.c +++ b/cde/programs/dtcm/server/renexttick.c @@ -77,7 +77,7 @@ NextTick( RepeatEvent *re, RepeatEventState *res) { - Tick next_time; + Tick next_time = 0; if (!re) return (Tick)0; diff --git a/cde/programs/dtcm/server/repeat.c b/cde/programs/dtcm/server/repeat.c index ac3b15cae..c58d333f3 100644 --- a/cde/programs/dtcm/server/repeat.c +++ b/cde/programs/dtcm/server/repeat.c @@ -339,6 +339,9 @@ _DtCms_closest_tick_v4(time_t target, time_t ftick, Period_4 period, int *ordina struct tm tm1, tm2; _Xltimeparams localtime_buf; + tm1.tm_isdst = 0; + tm2.tm_isdst = 0; + if (target <= ftick) { *ordinal = 1; return(ftick); diff --git a/cde/programs/dtcm/server/reprevtick.c b/cde/programs/dtcm/server/reprevtick.c index c62bd8ded..458c8925d 100644 --- a/cde/programs/dtcm/server/reprevtick.c +++ b/cde/programs/dtcm/server/reprevtick.c @@ -89,7 +89,7 @@ PrevTick( RepeatEvent *re, RepeatEventState *res) { - Tick next_time; + Tick next_time = 0; Tick _start_time; if (!re) return (Tick)0; diff --git a/cde/programs/dtcm/server/rerule.c b/cde/programs/dtcm/server/rerule.c index fe8079a49..4e5fb78a6 100644 --- a/cde/programs/dtcm/server/rerule.c +++ b/cde/programs/dtcm/server/rerule.c @@ -129,7 +129,7 @@ NumsToBuf( { int i, size = 0; - char tmp_buf[32], + char tmp_buf[34], tmp_buf2[32]; for (i = 0; i < array_size; i++) { diff --git a/cde/programs/dtcm/server/rtable4.c b/cde/programs/dtcm/server/rtable4.c index 0d0d42b56..f7f34f44e 100644 --- a/cde/programs/dtcm/server/rtable4.c +++ b/cde/programs/dtcm/server/rtable4.c @@ -33,7 +33,7 @@ */ #ifdef HAVE_CONFIG_H -#include +#include #endif #include #include diff --git a/cde/programs/dtcreate/AddFiletype.c b/cde/programs/dtcreate/AddFiletype.c index ef0501aa8..e744dcf4e 100644 --- a/cde/programs/dtcreate/AddFiletype.c +++ b/cde/programs/dtcreate/AddFiletype.c @@ -255,7 +255,7 @@ static Widget _Uxbuild_AddFiletype(void) int ntotalbuttons = 4; int nbutton = 0; Widget AF_ScrolledWindow; - Widget AF_BigForm; + Widget AF_BigForm = NULL; XtArgVal /* Dimension */ dim1, dim2, dim3; Widget AF_MED_IconForm, AF_TINY_IconForm; IconData *pIconData; diff --git a/cde/programs/dtcreate/FileCharacteristics.c b/cde/programs/dtcreate/FileCharacteristics.c index 748845fae..43b0641b3 100644 --- a/cde/programs/dtcreate/FileCharacteristics.c +++ b/cde/programs/dtcreate/FileCharacteristics.c @@ -524,7 +524,7 @@ static Widget _Uxbuild_FileCharacteristics(void) int nbutton = 0; #define TIGHTNESS 20 Widget FC_ScrolledWindow; - Widget FC_BigForm; + Widget FC_BigForm = NULL; char *dialog_title, *pre, *suf; diff --git a/cde/programs/dtcreate/parser.c b/cde/programs/dtcreate/parser.c index b76d42b49..1b4f476db 100644 --- a/cde/programs/dtcreate/parser.c +++ b/cde/programs/dtcreate/parser.c @@ -1051,7 +1051,7 @@ char *s1,*tmp,*s2,buf[10],*cts; Boolean IsLastSingle(char *str) { - int n; + int n = 0; if(MB_CUR_MAX == 1) return(TRUE); diff --git a/cde/programs/dtdocbook/instant/browse.c b/cde/programs/dtdocbook/instant/browse.c index cef5a7596..0cc3efbb2 100644 --- a/cde/programs/dtdocbook/instant/browse.c +++ b/cde/programs/dtdocbook/instant/browse.c @@ -103,7 +103,7 @@ static char *br_help_msg[] = { void Browse(void) { - char buf[256], *cmd, **av, **sv, *cmapfile, *sdatafile; + char buf[256], *cmd = NULL, **av, **sv, *cmapfile, *sdatafile; char *Prompt; Element_t *ce; /* current element */ Element_t *e; diff --git a/cde/programs/dtfile/ChangeDirP.c b/cde/programs/dtfile/ChangeDirP.c index 412749907..e529ff23a 100644 --- a/cde/programs/dtfile/ChangeDirP.c +++ b/cde/programs/dtfile/ChangeDirP.c @@ -904,7 +904,7 @@ DrawCurrentDirectory( int draw_x; int draw_y; int dir_width; - int msg_width; + int msg_width = 0; short columns; Boolean msg_drawn; diff --git a/cde/programs/dtfile/Directory.c b/cde/programs/dtfile/Directory.c index 2f9fbb6c1..8f2d4f18c 100644 --- a/cde/programs/dtfile/Directory.c +++ b/cde/programs/dtfile/Directory.c @@ -1635,7 +1635,7 @@ ReadDirectoryProcess( position_count = 0; if ((fptr = fopen(file_name, "r")) != NULL) { - PositionInfo * position_info; + PositionInfo * position_info = NULL; fscanf(fptr, "%d\n", &position_count); if (position_count > 0) @@ -2142,7 +2142,7 @@ ReaddirPipeCallback( Boolean done; short msg; Boolean update_due; - FileData *new_data, **new_nextp; + FileData *new_data = NULL, **new_nextp; FileData *old_data, **old_nextp; char *ptr; char *err_msg; @@ -2285,7 +2285,9 @@ ReaddirPipeCallback( new_nextp = &(*new_nextp)->next) ; *new_nextp = new_data; - new_data->next = NULL; + if(new_data ) { + new_data->next = NULL; + } } if (activity == activity_reading) @@ -2814,7 +2816,7 @@ _ReadDir( { char subdir_name[MAX_PATH]; FileData *fp, *file_data; - FileViewData **lp, *ip; + FileViewData **lp = NULL, *ip; int i, j, n, rc; TreeShow ts; Boolean busy_reading; @@ -2894,7 +2896,7 @@ _ReadDir( } /* add new entry to linked list */ - if (dp) + if (dp && lp) { *lp = ip; lp = &ip->next; @@ -5130,7 +5132,7 @@ SelectDesktopFile( FileMgrData *file_mgr_data) { DirectorySet *directory_data; - FileViewData *file_view_data; + FileViewData *file_view_data = NULL; int j; directory_data = file_mgr_data->directory_set[0]; @@ -5149,5 +5151,7 @@ FileMgrData *file_mgr_data) } ActivateSingleSelect(file_mgr_data->file_mgr_rec, file_mgr_data->selection_list[0]->file_data->logical_type); - PositionFileView(file_view_data, file_mgr_data); + if(file_view_data) { + PositionFileView(file_view_data, file_mgr_data); + } } diff --git a/cde/programs/dtfile/Encaps.c b/cde/programs/dtfile/Encaps.c index ed72e1c85..0357b9a45 100644 --- a/cde/programs/dtfile/Encaps.c +++ b/cde/programs/dtfile/Encaps.c @@ -100,7 +100,7 @@ #include "Main.h" #include "ModAttr.h" #ifdef USE_XINERAMA -#include +#include
#endif #define MAX_NAME_LIST_SIZE 25 diff --git a/cde/programs/dtfile/File.c b/cde/programs/dtfile/File.c index 14b878676..87f0be00e 100644 --- a/cde/programs/dtfile/File.c +++ b/cde/programs/dtfile/File.c @@ -785,7 +785,7 @@ OrderFiles( FileViewData ** file_view_data; int file_count; FileViewData ** order_list; - int * sort; + int * sort = NULL; int * sub_sort; int i; int start; @@ -853,11 +853,14 @@ OrderFiles( else sort = (int *) FileSizeDescending; } - + else + { + /* Unknown sort order? */ + return; + } /* Sort the files and if the sub_sort function is non-null, */ /* sort sets of the files broken according to file type. */ - qsort (order_list, file_count, sizeof (FileViewData *), (int (*)())sort); if (sub_sort != NULL) @@ -3177,8 +3180,8 @@ CreateNameChangeDialog ( int type) { XRectangle textExtent; - FileMgrData * file_mgr_data; - DesktopRec * desktopWindow; + FileMgrData * file_mgr_data = NULL; + DesktopRec * desktopWindow = NULL; Widget parent = XtParent(w); Widget text; Arg args[8]; @@ -3317,18 +3320,20 @@ CreateNameChangeDialog ( else { text = XmCreateTextField(parent, "nameChangeT", args, n); - file_mgr_data->renaming = file_view_data; - XtAddCallback (text, XmNmotionVerifyCallback, - (XtCallbackProc)ChangeIconName, - (XtPointer)file_mgr_data); - XtAddCallback (text, XmNmodifyVerifyCallback, - (XtCallbackProc)ChangeIconName, - (XtPointer)file_mgr_data); - XtAddCallback (text, XmNactivateCallback, - (XtCallbackProc)ChangeIconName, - (XtPointer)file_mgr_data); - XtAddCallback(text, XmNhelpCallback, (XtCallbackProc)HelpRequestCB, - HELP_NAMECHANGE_DIALOG_STR); + if(file_mgr_data) { + file_mgr_data->renaming = file_view_data; + XtAddCallback(text, XmNmotionVerifyCallback, + (XtCallbackProc)ChangeIconName, + (XtPointer)file_mgr_data); + XtAddCallback(text, XmNmodifyVerifyCallback, + (XtCallbackProc)ChangeIconName, + (XtPointer)file_mgr_data); + XtAddCallback(text, XmNactivateCallback, + (XtCallbackProc)ChangeIconName, + (XtPointer)file_mgr_data); + XtAddCallback(text, XmNhelpCallback, (XtCallbackProc)HelpRequestCB, + HELP_NAMECHANGE_DIALOG_STR); + } } XtAddCallback (text, XmNdestroyCallback, DestroyIconName, (XtPointer)NULL); @@ -3425,7 +3430,7 @@ CreateNameChangeDialog ( XtManageChild(text); XmProcessTraversal(text, XmTRAVERSE_CURRENT); - if(type != DESKTOP) + if(type != DESKTOP && file_mgr_data) { FileMgrRec *file_mgr_rec; diff --git a/cde/programs/dtfile/FileDialog.c b/cde/programs/dtfile/FileDialog.c index 277bb55a4..497b03415 100644 --- a/cde/programs/dtfile/FileDialog.c +++ b/cde/programs/dtfile/FileDialog.c @@ -1482,7 +1482,7 @@ RenameOk( char to_host[256]; char to_dir[MAX_PATH]; char to_file[256]; - unsigned int modifiers; + unsigned int modifiers = 0; char *host_set[1], *file_set[1]; int file_count = 1; diff --git a/cde/programs/dtfile/FileOp.c b/cde/programs/dtfile/FileOp.c index 15823bedc..67afc0def 100644 --- a/cde/programs/dtfile/FileOp.c +++ b/cde/programs/dtfile/FileOp.c @@ -567,7 +567,7 @@ FileMoveCopyProcess( int mode, DesktopRec *desktopWindow) { - char * target_dir, * from, * to; + char * target_dir, * from = NULL, * to; int i, j, rc, result; Boolean return_val = False; Boolean isContainer; @@ -587,7 +587,7 @@ FileMoveCopyProcess( Boolean targetError = FALSE; Boolean CopyError=FALSE,MoveError1=FALSE,MoveError2=FALSE; char *CopyString=NULL,*MoveString1=NULL,*MoveString2=NULL; - Boolean Same; + Boolean Same = FALSE; /* Get the fully qualified destination path. */ target_dir = (char *)ResolveLocalPathName(host, directory, NULL, home_host_name, &tt_status); @@ -1971,7 +1971,7 @@ FileOpPipeCB( if( cb_data->mode == MOVE_FILE ) { - sprintf( fileName, "%s/%s", tmpDir, cb_data->updates[i].file ); + snprintf( fileName, sizeof(fileName), "%s/%s", tmpDir, cb_data->updates[i].file ); if( cb_data->updates[i].operationStatus == True ) { if( status == PIPEMSG_MOVE_TO_SAME_DIR ) @@ -1988,7 +1988,7 @@ FileOpPipeCB( if(initiating_view == NULL && cb_data->callback_data == NULL) { - sprintf( fileName, "%s/%s", cb_data->directory, + snprintf( fileName, sizeof(fileName), "%s/%s", cb_data->directory, cb_data->updates[i].file ); DtEliminateDots(fileName); RemoveIconFromWorkspace( fileName, cb_data->directory ); @@ -2489,7 +2489,7 @@ ChangeIconPipeCB( Widget msg_widget; DirectorySet *directory_set; FileMgrData *file_mgr_data = NULL; - FileMgrRec *file_mgr_rec; + FileMgrRec *file_mgr_rec = NULL; short pipe_msg; int i, j, n; int rc; diff --git a/cde/programs/dtfile/Find.c b/cde/programs/dtfile/Find.c index 067964f02..8688f500d 100644 --- a/cde/programs/dtfile/Find.c +++ b/cde/programs/dtfile/Find.c @@ -2107,7 +2107,7 @@ AlternateInputHandler( int offset = 0; char next; XmString string; - int count; + int count = 0; Arg args[1]; char * findptr; char * end; @@ -2260,7 +2260,7 @@ AlternateInputHandler2( FindRec * find_rec = (FindRec *) client_data; int offset = 0; char next; - int count; + int count = 0; char * findptr; struct stat stat_data; char * content; @@ -2381,7 +2381,7 @@ AlternateInputHandler3( int offset = 0; char next; XmString string; - int count; + int count = 0; Arg args[1]; char * findptr; struct stat stat_data; diff --git a/cde/programs/dtfile/IconWindow.c b/cde/programs/dtfile/IconWindow.c index a4bbeaf6c..cf3b70fb5 100644 --- a/cde/programs/dtfile/IconWindow.c +++ b/cde/programs/dtfile/IconWindow.c @@ -290,8 +290,8 @@ FileWindowInputCallback( DirectorySet * directoryData; XEvent *new_event; XButtonPressedEvent *event; - XKeyEvent *kevent; - Widget eventIcon; + XKeyEvent *kevent = NULL; + Widget eventIcon = NULL; int i, j; FileViewData * fileViewData = NULL; Arg args[10]; @@ -373,8 +373,11 @@ FileWindowInputCallback( /* get the gadget that received the input */ if (keybdFocusPolicy == XmEXPLICIT) eventIcon = (Widget) XmGetFocusWidget(w); - else - eventIcon = (Widget) InputForGadget(w, kevent->x, kevent->y); + else { + if(kevent) { + eventIcon = (Widget) InputForGadget(w, kevent->x, kevent->y); + } + } if (eventIcon == NULL) return; diff --git a/cde/programs/dtfile/Main.c b/cde/programs/dtfile/Main.c index 2460cebb7..e52f36c08 100644 --- a/cde/programs/dtfile/Main.c +++ b/cde/programs/dtfile/Main.c @@ -3219,7 +3219,7 @@ LoadViews ( static char * name_list[] = { DTFILE_CLASS_NAME, NULL, NULL }; char view_number[11]; DialogData * dialog_data; - FileMgrData * file_mgr_data; + FileMgrData * file_mgr_data = NULL; char * workspaces; XClassHint classHints; char * iconify = NULL; @@ -3397,7 +3397,7 @@ LoadViews ( view_count++; } - if (openDirType == NEW) + if (openDirType == NEW && file_mgr_data) ForceMyIconOpen(file_mgr_data->host, NULL); } diff --git a/cde/programs/dtfile/Makefile.am b/cde/programs/dtfile/Makefile.am index a3afa1c05..539761047 100644 --- a/cde/programs/dtfile/Makefile.am +++ b/cde/programs/dtfile/Makefile.am @@ -18,7 +18,7 @@ dtfile_CPPFLAGS = -I./dtcopy -DSHAPE -D_ILS_MACROS -DSUN_PERF \ dtfile_LDADD = dtcopy/sharedFuncs.o \ dtcopy/fsrtns.o \ - $(DTCLIENTLIBS) $(TIRPCLIB) -lXm -lXext $(XTOOLLIB) + $(DTCLIENTLIBS) $(TIRPCLIB) $(XTOOLLIB) if OPENBSD dtfile_CPPFLAGS += -DFILE_MAP_OPTIMIZE @@ -29,7 +29,6 @@ dtfile_CPPFLAGS += -DFILE_MAP_OPTIMIZE endif if SOLARIS -dtfile_CFLAGS = -xF dtfile_LDADD += -lintl -lresolv endif diff --git a/cde/programs/dtfile/OverWrite.c b/cde/programs/dtfile/OverWrite.c index 59fb7bbab..1026e62fe 100644 --- a/cde/programs/dtfile/OverWrite.c +++ b/cde/programs/dtfile/OverWrite.c @@ -312,7 +312,7 @@ buffer_replace_rename_ok_callback( XtPointer call_data) { int rc = 0; - String newFile, renameNewName, destinationName; + String newFile = NULL, renameNewName, destinationName; struct stat buf; int saveError = 0; static char msg[38+MAX_PATH]; diff --git a/cde/programs/dtfile/dtcopy/Makefile.am b/cde/programs/dtfile/dtcopy/Makefile.am index c3d33fbeb..4859aad7d 100644 --- a/cde/programs/dtfile/dtcopy/Makefile.am +++ b/cde/programs/dtfile/dtcopy/Makefile.am @@ -4,11 +4,7 @@ bin_PROGRAMS = dtfile_copy dtfile_copy_CFLAGS = -DSHAPE -if SOLARIS -dtfile_copy_CFLAGS += -xF -endif - -dtfile_copy_LDADD = @DTCLIENTLIBS@ -lXm $(TIRPCLIB) $(XTOOLLIB) +dtfile_copy_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) $(TIRPCLIB) dtfile_copy_SOURCES = main_dtcopy.c copydialog.c overwrtdialog.c dosync.c \ fsrtns.c utils.c errordialog.c sharedFuncs.c diff --git a/cde/programs/dtfile/fsDialog.c b/cde/programs/dtfile/fsDialog.c index 3e34a2c07..9817fd3ca 100644 --- a/cde/programs/dtfile/fsDialog.c +++ b/cde/programs/dtfile/fsDialog.c @@ -119,7 +119,7 @@ * global variables *----------------------*/ -#define EMSGMAX 1024 +#define EMSGMAX 4096 char g_errorMessage[EMSGMAX]; diff --git a/cde/programs/dthello/Makefile.am b/cde/programs/dthello/Makefile.am index 360e1dbbb..4f5775685 100644 --- a/cde/programs/dthello/Makefile.am +++ b/cde/programs/dthello/Makefile.am @@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in bin_PROGRAMS = dthello -dthello_LDADD = $(DTCLIENTLIBS) ${X_LIBS} -lXm $(XTOOLLIB) +dthello_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) if SOLARIS dthello_LDADD += -ldl -lgen diff --git a/cde/programs/dthelp/Makefile.am b/cde/programs/dthelp/Makefile.am index 4d351c9f5..29c6a5450 100644 --- a/cde/programs/dthelp/Makefile.am +++ b/cde/programs/dthelp/Makefile.am @@ -1,4 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = dthelpview dthelpgen dthelpdemo dthelpprint parser +SUBDIRS = dthelpview dthelpgen dthelpprint parser +# dthelpdemo - removed from list above - I can't see anyone needing to +# build this example code for the forseeable future. diff --git a/cde/programs/dthelp/dthelpprint/PrintTopics.c b/cde/programs/dthelp/dthelpprint/PrintTopics.c index 5ca32e852..dad18dac5 100644 --- a/cde/programs/dthelp/dthelpprint/PrintTopics.c +++ b/cde/programs/dthelp/dthelpprint/PrintTopics.c @@ -43,12 +43,13 @@ $COPYRIGHT$: #endif #ifdef HAVE_CONFIG_H -#include +#include #endif #include #include #include +#include #include #include /* for stat() */ #if defined(sun) diff --git a/cde/programs/dthelp/parser/canon1/helptag/help.c b/cde/programs/dthelp/parser/canon1/helptag/help.c index ffffb6c2a..d8652b757 100644 --- a/cde/programs/dthelp/parser/canon1/helptag/help.c +++ b/cde/programs/dthelp/parser/canon1/helptag/help.c @@ -85,7 +85,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F'))) /* fills ``install'' with path to ourself */ { char *path, *cp; -char buf[200]; +char buf[BUFSIZ]; char patbuf[BUFSIZ]; int quit, none; @@ -135,7 +135,7 @@ else quit++; else *cp = '\0'; - sprintf(buf, "%s/%s", path, m_argv[0]); + snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]); if (access(buf, 1) == 0) { diff --git a/cde/programs/dthelp/parser/pass1/helptag/help.c b/cde/programs/dthelp/parser/pass1/helptag/help.c index 7ce66db49..8b31d1cea 100644 --- a/cde/programs/dthelp/parser/pass1/helptag/help.c +++ b/cde/programs/dthelp/parser/pass1/helptag/help.c @@ -86,7 +86,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F'))) /* fills ``install'' with path to ourself */ { char *path, *cp; -char buf[200]; +char buf[BUFSIZ]; char patbuf[BUFSIZ]; int quit, none; @@ -136,7 +136,7 @@ else quit++; else *cp = '\0'; - sprintf(buf, "%s/%s", path, m_argv[0]); + snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]); if (access(buf, 1) == 0) { diff --git a/cde/programs/dthelp/parser/pass2/htag2/sdl.c b/cde/programs/dthelp/parser/pass2/htag2/sdl.c index c304fe4bb..53f990e42 100644 --- a/cde/programs/dthelp/parser/pass2/htag2/sdl.c +++ b/cde/programs/dthelp/parser/pass2/htag2/sdl.c @@ -1448,7 +1448,7 @@ static void MarkUsedStyle(M_WCHAR *level, M_WCHAR *class, M_WCHAR *ssi) { ElementPtr pThis; M_WCHAR *rlevel = NULL, *rclass = NULL, *rssi = NULL; -LOGICAL *pBeenUsed; +LOGICAL *pBeenUsed = NULL; pThis = pTossChain; while (pThis) @@ -1490,7 +1490,7 @@ while (pThis) (!rssi || (w_strcmp(rssi, ssi) == 0)) && (w_strcmp(rclass, class) == 0)) { - if (*pBeenUsed == FALSE) + if (pBeenUsed && *pBeenUsed == FALSE) { nStyles++; *pBeenUsed = TRUE; @@ -2229,7 +2229,7 @@ while (pThis) */ static void MarkUsedTOSS(ElementPtr pRoot) { -ElementPtr pParent, pSnb, pItem, pThis; +ElementPtr pParent, pSnb = NULL, pItem, pThis; static char errMess[] = "internal error - unrecognized element type in MarkUsedTOSS"; @@ -3254,7 +3254,7 @@ int zFileSize, length; unsigned char zTemp[4]; int zFd; char buffer[BUFSIZ]; -FILE *saveOutFile; +FILE *saveOutFile = NULL; char cCount[32]; static char errMess[] = "internal error - unrecognized element type in EmitSDL"; diff --git a/cde/programs/dticon/fileIO.c b/cde/programs/dticon/fileIO.c index aeaa57250..60f28edd9 100644 --- a/cde/programs/dticon/fileIO.c +++ b/cde/programs/dticon/fileIO.c @@ -452,7 +452,7 @@ Write_File( { extern int tt_tmpfile_fd; int i, j; - int mask_needed; + int mask_needed = False; Boolean SUN; char *base_name, *suffix, fname[MAXPATHLEN], *tmp, *tmp2, *vend; Pixmap scratch_pix; diff --git a/cde/programs/dtimsstart/Makefile.am b/cde/programs/dtimsstart/Makefile.am index c2d91440a..0b91977db 100644 --- a/cde/programs/dtimsstart/Makefile.am +++ b/cde/programs/dtimsstart/Makefile.am @@ -10,10 +10,6 @@ dtimsstart_CFLAGS = -DNLS dtimsstart_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) -if SOLARIS -dtimsstart_CFLAGS += -xF -endif - dtimsstart_SOURCES = action.c env.c file.c main.c remote.c select.c \ start.c util.c win.c ximserr.h ximsfunc.h xims.h \ ximspath.h diff --git a/cde/programs/dtimsstart/file.c b/cde/programs/dtimsstart/file.c index f611fc39a..cd19ba8d7 100644 --- a/cde/programs/dtimsstart/file.c +++ b/cde/programs/dtimsstart/file.c @@ -150,7 +150,7 @@ int read_cmd_conf(void) char *conf_dir, *path; char *p, *lp, *valp; int line_num, num_alias; - DtEnv *dt; + DtEnv *dt = NULL; RemoteEnv *remote; FILE *fp; # ifdef old_hpux @@ -979,7 +979,7 @@ int set_select_mode(int cur_mode, int new_mode) char *lp, *valp; int n, line_num, mode_line; - sprintf(new_fname, "%s,tmp", path); + snprintf(new_fname, sizeof(new_fname), "%s,tmp", path); if (!(new_fp = fopen(new_fname, "w"))) { fclose(fp); DPR(("set_select_mode(): cannot create %s\n", new_fname)); diff --git a/cde/programs/dtimsstart/main.c b/cde/programs/dtimsstart/main.c index 834a5c076..8756e2183 100644 --- a/cde/programs/dtimsstart/main.c +++ b/cde/programs/dtimsstart/main.c @@ -393,7 +393,7 @@ void ximsFinish(void) static int ximsShowImsList(void) { - int ret; + int ret = NoError; int i; int host_type = HOST_LOCAL; char *hostname; @@ -769,7 +769,7 @@ static int parse_options(int argc, char **argv) int i, n; int wac = 1; char *wav[80]; - int orgMode; + int orgMode = MODE_START; static bool first_time = True; #define SET_FLAG(f) OpFlag |= (f) diff --git a/cde/programs/dtimsstart/remote.c b/cde/programs/dtimsstart/remote.c index 71d329777..6b24ea37d 100644 --- a/cde/programs/dtimsstart/remote.c +++ b/cde/programs/dtimsstart/remote.c @@ -370,7 +370,7 @@ static int parse_ims_list(char *ptr, ImsList *list) char *def_name; int i, num_ent; ImsEnt *ent = 0; - ImsConf *ims; + ImsConf *ims = NULL; CLR(list, ImsList); list->default_idx = -1; diff --git a/cde/programs/dtinfo/dtinfo/src/Makefile.am b/cde/programs/dtinfo/dtinfo/src/Makefile.am index 603b40391..8b18891e2 100644 --- a/cde/programs/dtinfo/dtinfo/src/Makefile.am +++ b/cde/programs/dtinfo/dtinfo/src/Makefile.am @@ -67,6 +67,6 @@ bin_PROGRAMS = dtinfo dtinfo_CXXFLAGS = $(DTINFO_DEFINES) $(DTINFO_INCLUDES) dtinfo_LDADD = $(OLIASNORMALLIBS) $(LIBSEARCH) $(MMDB_LIBS) $(WWL_LIBS) \ - $(DTCLIENTLIBS) -lXmu $(XTOOLLIB) + $(DTCLIENTLIBS) $(XTOOLLIB) dtinfo_SOURCES = main.C Support/InputNotifier.C diff --git a/cde/programs/dtksh/Makefile.am b/cde/programs/dtksh/Makefile.am index 32bb57e5c..603ba6af4 100644 --- a/cde/programs/dtksh/Makefile.am +++ b/cde/programs/dtksh/Makefile.am @@ -10,10 +10,6 @@ dist_ksh_SCRIPTS = DtFuncs.dtsh KSH93SRC = ./ksh93 -if SOLARIS -.NO_PARALLEL: -endif - KSH93LIBSHELL = $(KSH93SRC)/lib/libshell.a bin_PROGRAMS = dtksh @@ -31,9 +27,9 @@ dtksh_CPPFLAGS = -I$(KSH93SRC)/include/ast -I$(KSH93SRC)/src/cmd/ksh93/include \ -DSHOPT_SUID_EXEC -D_API_ast=20100309 -DSHOPT_BRACEPAT \ -DBUILD_DTKSH -dtksh_LDADD = $(DTCLIENTLIBS) -lXm pmain.o $(XTOOLLIB) ${X_LIB} \ +dtksh_LDADD = $(DTCLIENTLIBS) pmain.o $(XTOOLLIB) \ libshell.a $(KSH93SRC)/lib/libcmd.a $(KSH93SRC)/lib/libast.a \ - $(KSH93SRC)/lib/libdll.a -lm + $(KSH93SRC)/lib/libdll.a if LINUX dtksh_LDADD += -ldl diff --git a/cde/programs/dtksh/dtkcmds.c b/cde/programs/dtksh/dtkcmds.c index c166fbf26..13b1c56f5 100644 --- a/cde/programs/dtksh/dtkcmds.c +++ b/cde/programs/dtksh/dtkcmds.c @@ -1317,7 +1317,7 @@ do_XtHasCallbacks( { wtab_t *w; char *arg0 = argv[0]; - char * msg; + char * msg = ""; char * variable = argv[1]; XtCallbackStatus callbackStatus; XrmValue fval, tval; @@ -2476,18 +2476,18 @@ invokeXDrawFunction( char * functionName = argv[0]; Display * display; Window drawable; - Window destination; - int srcX, srcY; - int destX, destY; - unsigned int width, height; + Window destination = 0; + int srcX = 0, srcY = 0; + int destX = 0, destY = 0; + unsigned int width = 0, height = 0; char *s; char *sp; int i; - int mode, parse; + int mode, parse = 0; int text = FALSE; - int (*func)(); + int (*func)() = NULL; int argtype = 0; - int polymode; + int polymode = 0; int coordmode; GC gc = NULL; int p[MAXDRAWARGS]; diff --git a/cde/programs/dtksh/dtkcvt.c b/cde/programs/dtksh/dtkcvt.c index 2b0a2d36a..81064051e 100644 --- a/cde/programs/dtksh/dtkcvt.c +++ b/cde/programs/dtksh/dtkcvt.c @@ -279,7 +279,7 @@ DtkshCvtBooleanToString( XrmValuePtr toval ) { char * errmsg; - Boolean booleanState; + Boolean booleanState = False; if (fval->size != sizeof(int) && fval->size != sizeof(short) && fval->size != sizeof(char)) diff --git a/cde/programs/dtlogin/Makefile.am b/cde/programs/dtlogin/Makefile.am index ca0f6d487..38aaab42f 100644 --- a/cde/programs/dtlogin/Makefile.am +++ b/cde/programs/dtlogin/Makefile.am @@ -4,7 +4,7 @@ bin_PROGRAMS = dtlogin dtgreet dtchooser if HAS_PAM_LIBRARY PAM_LIB = -lpam -DTPAMSVCLIB = @LIBPAMSVC@ +DTPAMSVCLIB = $(LIBPAMSVC) else PAM_LIB = DTPAMSVCLIB = @@ -56,12 +56,12 @@ dtgreet_SOURCES = vgcallback.c vglogo.c vgmain.c vgutil.c vglang.c dtchooser_SOURCES = chooser.c dtchooser.c vglogo.c vgutil.c vgcallback.c \ vglang.c -dtlogin_LDADD = libresource.a @DTCLIENTLIBS@ -lXau -lXmu -lXext -lXdmcp \ +dtlogin_LDADD = libresource.a $(DTCLIENTLIBS) $(XDMCPLIB) \ $(XTOOLLIB) $(TIRPCLIB) $(DTPAMSVCLIB) $(PAM_LIB) dtgreet_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) -dtchooser_LDADD = $(DTCLIENTLIBS) -lXmu -lXext -lXdmcp $(XTOOLLIB) +dtchooser_LDADD = $(DTCLIENTLIBS) $(XDMCPLIB) $(XTOOLLIB) if LINUX diff --git a/cde/programs/dtlogin/dtchooser.c b/cde/programs/dtlogin/dtchooser.c index d299a2680..ce9b6cee2 100644 --- a/cde/programs/dtlogin/dtchooser.c +++ b/cde/programs/dtlogin/dtchooser.c @@ -90,7 +90,7 @@ #include
#ifdef USE_XINERAMA -#include +#include
#endif @@ -667,7 +667,7 @@ MakeDialog( DialogType dtype ) char buffer[128]; char *str; - Widget w, text; + Widget w = NULL, text; Dimension txt_width, txt_height; XmString ok, cancel, nw, sv; diff --git a/cde/programs/dtlogin/server.c b/cde/programs/dtlogin/server.c index ffb3a71cb..d72a29888 100644 --- a/cde/programs/dtlogin/server.c +++ b/cde/programs/dtlogin/server.c @@ -47,6 +47,7 @@ */ # include +# include # include # include # include diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index c346ecc1f..20461ff36 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -109,7 +109,7 @@ #endif #ifdef HAS_PAM_LIBRARY -#include +#include
#endif int ApplyFontPathMods(struct display *d, Display *dpy); // fontpath.c @@ -365,7 +365,7 @@ void ManageSession( struct display *d ) { int pid; - Window root; + Window root = 0; /* Display *dpy; */ #ifdef BYPASSLOGIN char *BypassUsername; @@ -809,7 +809,7 @@ LoadAltDtsResources(struct display *d) if ((strcmp(dp->d_name, DOT) != 0) && (strcmp(dp->d_name, DOTDOT) != 0)) { - sprintf (res_file, "%s%s", dirname[j],dp->d_name); + snprintf(res_file, sizeof(res_file), "%s%s", dirname[j], dp->d_name); if ((access (res_file, R_OK)) != 0) { Debug("LoadAltDtsResources- cant access %s.\n", @@ -1199,8 +1199,6 @@ StartClient( struct verify_info *verify, struct display *d, int *pidp ) long ngroups, groups[NGROUPS]; #endif /* __AFS */ - waitType status; - if (verify->argv) { Debug ("StartSession %s: ", verify->argv[0]); for (f = verify->argv; *f; f++) { @@ -1283,7 +1281,7 @@ StartClient( struct verify_info *verify, struct display *d, int *pidp ) #endif #if !defined(sun) && (!defined(CSRG_BASED) || defined(HAS_PAM_LIBRARY)) - Account(d, user, NULL, getpid(), USER_PROCESS, status); + Account(d, user, NULL, getpid(), USER_PROCESS, 0); #endif #ifdef AIXV3 diff --git a/cde/programs/dtlogin/vg.h b/cde/programs/dtlogin/vg.h index b079c84ee..7a34eaefd 100644 --- a/cde/programs/dtlogin/vg.h +++ b/cde/programs/dtlogin/vg.h @@ -67,7 +67,7 @@ extern int errno; #endif #ifdef USE_XINERAMA -# include +# include
#endif #define SIGVAL void diff --git a/cde/programs/dtlogin/vgcallback.c b/cde/programs/dtlogin/vgcallback.c index 63f7e338a..3da9a5d3d 100644 --- a/cde/programs/dtlogin/vgcallback.c +++ b/cde/programs/dtlogin/vgcallback.c @@ -1791,7 +1791,7 @@ SetDtLabelAndIcon(void) static void _DtShowDialog( DialogType dtype, XmString msg) { - Widget *w; + Widget *w = NULL; #ifdef VG_TRACE vg_TRACE_EXECUTION("main: entered _DtShowDialog ..."); @@ -1804,6 +1804,7 @@ _DtShowDialog( DialogType dtype, XmString msg) case help: w = &help_message; break; case hostname: w = &hostname_message; break; case help_chooser: w = &help_message; break; + default: return; } if (*w == NULL) diff --git a/cde/programs/dtlogin/vgmain.c b/cde/programs/dtlogin/vgmain.c index 323478b3f..cf3067986 100644 --- a/cde/programs/dtlogin/vgmain.c +++ b/cde/programs/dtlogin/vgmain.c @@ -91,7 +91,7 @@ #ifdef USE_XINERAMA -#include +#include
#endif #if !defined(NL_CAT_LOCALE) diff --git a/cde/programs/dtlogin/xdmcp.c b/cde/programs/dtlogin/xdmcp.c index 0e94d6687..c562eec21 100644 --- a/cde/programs/dtlogin/xdmcp.c +++ b/cde/programs/dtlogin/xdmcp.c @@ -554,8 +554,8 @@ forward_respond (struct sockaddr *from, int fromlen, int length) ARRAY8 clientAddress; ARRAY8 clientPort; ARRAYofARRAY8 authenticationNames; - struct sockaddr *client; - int clientlen; + struct sockaddr *client = NULL; + int clientlen = 0; int expectedLen; int i; diff --git a/cde/programs/dtmail/MotifApp/Makefile.am b/cde/programs/dtmail/MotifApp/Makefile.am index c77f7b7b1..e6bb5005a 100644 --- a/cde/programs/dtmail/MotifApp/Makefile.am +++ b/cde/programs/dtmail/MotifApp/Makefile.am @@ -4,21 +4,6 @@ noinst_LIBRARIES = libMotifApp.a libMotifApp_a_CXXFLAGS = -I../include/MotifApp -I../include -I../include/utils -# FIXME - some of these aren't set and sould be by configure.ac -#if SOLARIS - -#if USE_SPRO_V3 -#libMotifApp_a_CXXFLAGS += -noex -xO0 -USPRO_V2 -#endif - -#if DEBUGTREE -#libMotifApp_a_CXXFLAGS += -xsb -#endif -# -#libMotifApp_a_CXXFLAGS += -DMMAP_NORESERVE -DSPRO_V2 - -#endif - libMotifApp_a_SOURCES = Application.C AskFirstCmd.C \ BasicComponent.C BusyPixmap.C \ ButtonInterface.C Cmd.C \ @@ -36,8 +21,3 @@ libMotifApp_a_SOURCES = Application.C AskFirstCmd.C \ UndoCmd.C WarnNoUndoCmd.C \ WorkingDialogManager.C -if SOLARIS -clean-local: - $(RM) -r .sb - $(RM) .make.state* -endif diff --git a/cde/programs/dtmail/MotifApp/MenuBar.C b/cde/programs/dtmail/MotifApp/MenuBar.C index c7cd0d139..9dc377fe9 100644 --- a/cde/programs/dtmail/MotifApp/MenuBar.C +++ b/cde/programs/dtmail/MotifApp/MenuBar.C @@ -703,7 +703,7 @@ MenuBar::rotateLabels( XtArgVal num_children; WidgetList children; XmString label, endlabel; - Widget prevwid, wid; + Widget prevwid = NULL, wid; if (startindex < 0 || endindex < 0) return; @@ -763,9 +763,11 @@ MenuBar::rotateLabels( prevwid = (Widget) children[j]; } while (!XtIsManaged(prevwid)); - XtVaGetValues(prevwid, - XmNlabelString, &label, - NULL); + if(prevwid) { + XtVaGetValues(prevwid, + XmNlabelString, &label, + NULL); + } XtVaSetValues(wid, XmNlabelString, label, diff --git a/cde/programs/dtmail/dtmail/DmxMessage.C b/cde/programs/dtmail/dtmail/DmxMessage.C index 0f6d0f861..b14a855b1 100644 --- a/cde/programs/dtmail/dtmail/DmxMessage.C +++ b/cde/programs/dtmail/dtmail/DmxMessage.C @@ -566,9 +566,9 @@ DmxMsg::parse (void) if (handleError (env, "getContents") == DTM_TRUE) exit (1); - bodyParts = new (DtMail::BodyPart *[bc]); + bodyParts = new DtMail::BodyPart *[bc]; cachedValues = DTM_TRUE; - + // cache values bodyParts [0] = part; numBPs++; diff --git a/cde/programs/dtmail/dtmail/Makefile.am b/cde/programs/dtmail/dtmail/Makefile.am index 78975dea8..bc02a1448 100644 --- a/cde/programs/dtmail/dtmail/Makefile.am +++ b/cde/programs/dtmail/dtmail/Makefile.am @@ -7,35 +7,8 @@ dtmail_CXXFLAGS = -I../include -I../include/MotifApp -I../include/utils \ -I$(srcdir)/lib -I../../dthelp -DRELEASE_NOTES \ -DDTMAIL_TOOLTALK -DDTEDITOR -dtmail_LDADD = ../libDtMail/libDtMail.a ../MotifApp/libMotifApp.a -lXm \ - @DTCLIENTLIBS@ $(XTOOLLIB) $(TIRPCLIB) - -# FIXME solaris.... -#if SOLARIS -#dtmail_LDFLAGS = -lw -#if SUNPRODIR -#SUNPRO_DIR = SUNPRODIR -#else -#SUNPRO_DIR = /opt/SUNWspro -#endif -#C++LIBPATH = -L$(SUNPRO_DIR)/lib -# -#if USE_SPRO_V3 -#SPRO_V3_OPTIONS = -noex -USPRO_V2 -#if DEBUGTREE -#3SPRO_V3_OPTIONS += -xsb -#endif -#else -#EXTRA_CCOPTIONS += -DSPRO_V2 -#endif -# -#EXTRA_C++OPTIONS = -xF +w $(SPRO_V3_OPTIONS) -#EXTRA_CCOPTIONS = -xF -xstrconst -Xa -v -#if USE_EDITRES -#EXTRA_LIBRARIES = $(XMULIB) ExtraLibraries -#endif -#endif SOLARIS - +dtmail_LDADD = ../libDtMail/libDtMail.a ../MotifApp/libMotifApp.a \ + $(DTCLIENTLIBS) $(XTOOLLIB) $(TIRPCLIB) dtmail_SOURCES = AliasListUiItem.C AlternatesListUiItem.C \ AntiCheckBoxUiItem.C AttachArea.C \ @@ -71,7 +44,7 @@ dtmail_SOURCES = AliasListUiItem.C AlternatesListUiItem.C \ dtb_utils.C options_stubs.C \ options_ui.C options_util.C +# Don't fail if we can't set the mail group which might not exist on +# some systems install-exec-hook: - chown root $(DESTDIR)$(bindir)/dtmail - chgrp mail $(DESTDIR)$(bindir)/dtmail - chmod 2755 $(DESTDIR)$(bindir)/dtmail + -(chgrp mail $(DESTDIR)$(bindir)/dtmail && chmod 2755 $(DESTDIR)$(bindir)/dtmail) diff --git a/cde/programs/dtmail/dtmail/RoamCmds.C b/cde/programs/dtmail/dtmail/RoamCmds.C index 1dc98940b..bf1ae94d8 100644 --- a/cde/programs/dtmail/dtmail/RoamCmds.C +++ b/cde/programs/dtmail/dtmail/RoamCmds.C @@ -2549,7 +2549,7 @@ SaveAsTextCmd::writeText(XtPointer filedes, char *text_buf) void SaveAsTextCmd::doit() { - MsgScrollingList *list; + MsgScrollingList *list = NULL; Widget listW; int *pos_list = NULL; int pos_count = 0; diff --git a/cde/programs/dtmail/dtmail/dtb_utils.C b/cde/programs/dtmail/dtmail/dtb_utils.C index 951f8722d..9a0f96b40 100644 --- a/cde/programs/dtmail/dtmail/dtb_utils.C +++ b/cde/programs/dtmail/dtmail/dtb_utils.C @@ -904,6 +904,9 @@ dtb_more_help_dispatch( *cp++ = 0; vol = buffer; loc = cp; + } else { + /* No / in help string, invalid */ + return; } if(GeneralHelpDialog == (Widget)NULL) { @@ -2489,7 +2492,7 @@ align_labels( ) { WidgetList children_list = NULL, - one_col; + one_col = NULL; Widget previous_child = NULL, child, previous_ref_widget = NULL; diff --git a/cde/programs/dtmail/include/DtMail/DtMailServer.hh b/cde/programs/dtmail/include/DtMail/DtMailServer.hh index f3c56cf95..c4c7a0be2 100644 --- a/cde/programs/dtmail/include/DtMail/DtMailServer.hh +++ b/cde/programs/dtmail/include/DtMail/DtMailServer.hh @@ -194,7 +194,7 @@ protected: char *_shroud; // String to shroud in debug output. char _transtag[DTMAS_TAGSIZE]; // Tag of the current transaction. - int _transnum; // Number of the current transaction. + unsigned _transnum; // Number of the current transaction. int _timeout; // Timeout seconds waiting for server. char *_username; diff --git a/cde/programs/dtmail/libDtMail/Common/DtMailError.C b/cde/programs/dtmail/libDtMail/Common/DtMailError.C index 3e2e9f420..6ff659800 100644 --- a/cde/programs/dtmail/libDtMail/Common/DtMailError.C +++ b/cde/programs/dtmail/libDtMail/Common/DtMailError.C @@ -404,7 +404,7 @@ char * DtMailEnv::getMessageText(int set, int msg, char *dft) { static int oneTimeFlag = 0; // Only attempt to open message catalog once - char *message; + char *message = NULL; if ((oneTimeFlag == 0) && (_errorCatalog == (nl_catd) -1)) { diff --git a/cde/programs/dtmail/libDtMail/Common/DtMailServer.C b/cde/programs/dtmail/libDtMail/Common/DtMailServer.C index 861d06afd..973c96bdf 100644 --- a/cde/programs/dtmail/libDtMail/Common/DtMailServer.C +++ b/cde/programs/dtmail/libDtMail/Common/DtMailServer.C @@ -67,7 +67,7 @@ #endif #define dtmasTAGCLR() *_transtag = '\0'; _transnum=0; -#define dtmasTAGGEN() (sprintf(_transtag, "a%04d", ++_transnum), _transtag) +#define dtmasTAGGEN() (sprintf(_transtag, "a%04u", ++_transnum), _transtag) #define dtmasTAGGET() (_transtag) static jmp_buf restart; diff --git a/cde/programs/dtmail/libDtMail/Common/Makefile.am b/cde/programs/dtmail/libDtMail/Common/Makefile.am index 2098dd808..c46b6c6db 100644 --- a/cde/programs/dtmail/libDtMail/Common/Makefile.am +++ b/cde/programs/dtmail/libDtMail/Common/Makefile.am @@ -6,7 +6,7 @@ libCommon_a_CXXFLAGS = -I../../include -I../../include/utils -I$(srcdir)/lib \ -DDL_NOT_DYNAMIC -DUSE_SOCKSTREAM if SOLARIS -libCommon_a_CXXFLAGS += -DMMAP_NORESERVE -DSPRO_V2 +libCommon_a_CXXFLAGS += -DMMAP_NORESERVE endif libCommon_a_SOURCES = APOPServer.C \ diff --git a/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C b/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C index 243b52677..fe0f08359 100644 --- a/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C +++ b/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C @@ -108,7 +108,7 @@ getNamedValueString(const char *string, const char *name) { int stringLen = strlen(string); int nameLen = strlen(name); - const char * results; + const char * results = NULL; char * stringEnd; unsigned int offset; diff --git a/cde/programs/dtmail/libDtMail/RFC/Makefile.am b/cde/programs/dtmail/libDtMail/RFC/Makefile.am index df15c2041..bb7826b43 100644 --- a/cde/programs/dtmail/libDtMail/RFC/Makefile.am +++ b/cde/programs/dtmail/libDtMail/RFC/Makefile.am @@ -6,7 +6,7 @@ libRFC_a_CXXFLAGS = -I../Common -I../../include -I../../include/utils \ -DTTLOCK_OFF if SOLARIS -libRFC_a_CXXFLAGS += -DMMAP_NORESERVE -DSPRO_V2 +libRFC_a_CXXFLAGS += -DMMAP_NORESERVE endif libRFC_a_SOURCES = AliasExpand.C MIMEBodyPart.C \ diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCBodyPart.C b/cde/programs/dtmail/libDtMail/RFC/RFCBodyPart.C index 6fa98bdfc..4b608354f 100644 --- a/cde/programs/dtmail/libDtMail/RFC/RFCBodyPart.C +++ b/cde/programs/dtmail/libDtMail/RFC/RFCBodyPart.C @@ -420,6 +420,7 @@ RFCBodyPart::flagIsSet(DtMailEnv & error, default: error.setError(DTME_OperationInvalid); + return(DTM_FALSE); } return(answer); diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCMIME.C b/cde/programs/dtmail/libDtMail/RFC/RFCMIME.C index f31196fb3..44e8c68ea 100644 --- a/cde/programs/dtmail/libDtMail/RFC/RFCMIME.C +++ b/cde/programs/dtmail/libDtMail/RFC/RFCMIME.C @@ -1398,7 +1398,7 @@ RFCMIME::formatBodies(DtMailEnv & error, free(bp_contents); } else { - char *content_type = new char[100]; + char *content_type = new char[100 + sizeof(boundary)]; sprintf(content_type, "Content-Type: multipart/mixed;boundary=%s", boundary); diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C b/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C index 5c4681da7..d947cb5aa 100644 --- a/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C +++ b/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C @@ -381,6 +381,8 @@ RFCValue::toDate(void) const char *token_end[12]; int n_tokens = 0; + token_end[0] = NULL; + // Look for the end of each token. Date tokens are white space // separated. while (*pos) { @@ -407,7 +409,7 @@ RFCValue::toDate(void) // Some dates will have a comma after the day of the week. We // want to remove that. It will always be the first token if // we have the day of the week. - if (*token_end[0] == ',') { + if (token_end[0] && *token_end[0] == ',') { token_end[0]--; } diff --git a/cde/programs/dtpad/Makefile.am b/cde/programs/dtpad/Makefile.am index 03adbe52a..345061eb6 100644 --- a/cde/programs/dtpad/Makefile.am +++ b/cde/programs/dtpad/Makefile.am @@ -4,10 +4,9 @@ bin_PROGRAMS = dtpad dtpad_CFLAGS = -DDT_LITE -DWORDWRAP -dtpad_LDADD = @DTCLIENTLIBS@ -lXm $(TIRPCLIB) $(XTOOLLIB) +dtpad_LDADD = $(DTCLIENTLIBS) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS -dtpad_CFLAGS += -xF dtpad_LDFLAGS = -lintl -lresolv endif diff --git a/cde/programs/dtpad/main.c b/cde/programs/dtpad/main.c index 1e485631c..72ccbc818 100644 --- a/cde/programs/dtpad/main.c +++ b/cde/programs/dtpad/main.c @@ -1362,7 +1362,7 @@ SetWindowSize( XSizeHints size_hints; XWMHints *wmhints; long supplied_return; - int geometryBits; + int geometryBits = 0; XWindowChanges changesStruct; WMShellWidget wm; diff --git a/cde/programs/dtprintinfo/UI/DtApp.C b/cde/programs/dtprintinfo/UI/DtApp.C index dcc98dfa4..dbb83fc5e 100644 --- a/cde/programs/dtprintinfo/UI/DtApp.C +++ b/cde/programs/dtprintinfo/UI/DtApp.C @@ -221,7 +221,7 @@ DtApp::DtApp(char *progname, int *argc, char **argv) : // Save print job's class name for registering GUI actions PrintJob *dummy_printjob; - char *className; + char *className = NULL; if (app_mode != CONFIG_PRINTERS) { dummy_printjob = new PrintJob(NULL, "_FOO", NULL, NULL, NULL, NULL, NULL); @@ -718,7 +718,7 @@ void DtApp::OpenClose(BaseUI *obj) n_icons = rc->NumChildren(); for (i = 0; i < n_jobs; i++) { - char number[5]; + char number[11]; sprintf(number, "%d", i + 1); icons[i]->TopString(number); } @@ -907,7 +907,7 @@ void DtApp::ActionCB(BaseUI *obj, char *actionReferenceName) IconObj **children = (IconObj **)parent->Children(); for (i = 0; i < parent->NumChildren(); i++) { - char number[5]; + char number[11]; sprintf(number, "%d", i + 1); children[i]->TopString(number); } diff --git a/cde/programs/dtprintinfo/UI/DtFindD.C b/cde/programs/dtprintinfo/UI/DtFindD.C index 658455317..441332203 100644 --- a/cde/programs/dtprintinfo/UI/DtFindD.C +++ b/cde/programs/dtprintinfo/UI/DtFindD.C @@ -389,7 +389,7 @@ void DtFindD::Stop() for (i = 0; i < n_matches; i++) { DtPrtJobIcon *job = (DtPrtJobIcon *)matches[i]; - char number[9]; + char number[12]; sprintf(number, "%d", job->Order() + 1); fields->fields[0] = (char *)job->Parent()->Parent()->Name(); if (n_fields == 3) diff --git a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C index 69a65960b..305c50c7b 100644 --- a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C +++ b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C @@ -67,7 +67,7 @@ DtPrinterIcon::DtPrinterIcon(DtMainW *mainW, AnyUI *parent, Queue *que, if (app_mode == INITIALIZE_PRINTERS) return; - char *buf = new char[300]; + char *buf = new char[sizeof(DtPrinterIcon::homeDir) + 32]; struct stat statbuff; if (*homeDir == '\0') { diff --git a/cde/programs/dtprintinfo/UI/DtSetPref.C b/cde/programs/dtprintinfo/UI/DtSetPref.C index d3fafdc04..a68960b60 100644 --- a/cde/programs/dtprintinfo/UI/DtSetPref.C +++ b/cde/programs/dtprintinfo/UI/DtSetPref.C @@ -177,7 +177,7 @@ static void TurnOffHourGlass(BaseUI *obj, void *data) void DtSetPref::Apply() { - IconStyle style; + IconStyle style = NAME_ONLY; boolean add_timeout = false; if (by_name->Selected()) diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/ComboBoxObj.C b/cde/programs/dtprintinfo/libUI/MotifUI/ComboBoxObj.C index 1151ff9d5..66b21a08f 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/ComboBoxObj.C +++ b/cde/programs/dtprintinfo/libUI/MotifUI/ComboBoxObj.C @@ -42,7 +42,7 @@ ComboBoxObj::ComboBoxObj(MotifUI *parent, ComboBoxCallback callback, : MotifUI(parent, name, NULL) { XmString *items_list; - int itemCount; + int itemCount = 0; if (items && n_items) { items_list = new XmString [n_items]; diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/Dialog.C b/cde/programs/dtprintinfo/libUI/MotifUI/Dialog.C index 4c1ba2341..72c0155cd 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/Dialog.C +++ b/cde/programs/dtprintinfo/libUI/MotifUI/Dialog.C @@ -247,7 +247,7 @@ Dialog::Dialog(MotifUI *parent, char *title, char *caption, boolean editable, Arg args[8]; int n; XmString xm_string = StringCreate(title); - XmString xm_message; + XmString xm_message = NULL; Pixmap pixmap; _dialog_type = PROMPT_DIALOG; diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/Icon.c b/cde/programs/dtprintinfo/libUI/MotifUI/Icon.c index a95544e99..2dcbff241 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/Icon.c +++ b/cde/programs/dtprintinfo/libUI/MotifUI/Icon.c @@ -1056,7 +1056,7 @@ CalculateSize( Window junkwin; int x, y; Boolean show_fields = False; - Dimension _width; + Dimension _width = 0; if (query_geometry) { @@ -1361,7 +1361,7 @@ CalculateSize( XSetClipOrigin(XtDisplay(w), MaskStippleGC(w), PixmapX(w), PixmapY(w)); if (StatePixmap(w) != XmUNSPECIFIED_PIXMAP) { - Dimension x_offset, y_offset; + Dimension x_offset = 0, y_offset = 0; XGetGeometry(XtDisplay(w), StatePixmap(w), &junkwin, (int *) &junk, (int *) &junk, &width, &height, &junk, &junk); @@ -2001,7 +2001,7 @@ QueryGeometry( XtWidgetGeometry *desired ) { - Dimension width, width1, height, height1; + Dimension width = 0, width1, height = 0, height1; Boolean show_fields = False; width1 = Max(TopLabelWidth(w), BottomLabelWidth(w)); diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/IconObj.C b/cde/programs/dtprintinfo/libUI/MotifUI/IconObj.C index cdaaa3835..de30eb209 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/IconObj.C +++ b/cde/programs/dtprintinfo/libUI/MotifUI/IconObj.C @@ -68,15 +68,15 @@ void IconObj::CreateIconObj(MotifUI *parent, char *name, char * /*category*/, char *iconFile, char *details, char *topString, char *bottomString, IconFields _fields) { - Pixmap pixmap; - Pixmap mask; + Pixmap pixmap = XmUNSPECIFIED_PIXMAP; + Pixmap mask = XmUNSPECIFIED_PIXMAP; Pixel bg; Widget p, super_node; XmString xm_string, xm_topString, xm_bottomString; char *s; int shrinkOutline = false; - int pixmapPlacement; - int alignment; + int pixmapPlacement = GuiPIXMAP_LEFT; + int alignment = XmALIGNMENT_BEGINNING; int isOpened; GuiIconFields gui_fields; @@ -95,7 +95,7 @@ void IconObj::CreateIconObj(MotifUI *parent, char *name, char * /*category*/, gui_fields->alignments = new unsigned char[fields->n_fields]; gui_fields->fields = new XmString[fields->n_fields]; - unsigned char alignment; + unsigned char alignment = XmALIGNMENT_BEGINNING; for (i = 0; i < fields->n_fields; i++) { gui_fields->widths[i] = fields->fields_widths[i]; @@ -454,7 +454,7 @@ boolean IconObj::SetIcon(IconStyle style) { Pixmap pixmap, mask; int shrinkOutline = false; - int pixmapPlacement; + int pixmapPlacement = GuiPIXMAP_LEFT; int alignment; int isOpened; diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/LabelObj.C b/cde/programs/dtprintinfo/libUI/MotifUI/LabelObj.C index 9825b1db6..b08fcc475 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/LabelObj.C +++ b/cde/programs/dtprintinfo/libUI/MotifUI/LabelObj.C @@ -43,7 +43,7 @@ LabelObj::LabelObj(MotifUI *parent, XmString xm_string = StringCreate(name); Widget p, super_node; Pixel bg; - int alignment; + int alignment = XmALIGNMENT_BEGINNING; switch (_style = style) { @@ -79,7 +79,7 @@ LabelObj::LabelObj(MotifUI *parent, void LabelObj::LabelStyle(LabelType style) { - int alignment; + int alignment = XmALIGNMENT_BEGINNING; switch (_style = style) { diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/MainWindow.C b/cde/programs/dtprintinfo/libUI/MotifUI/MainWindow.C index 3821f7260..17194a5fd 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/MainWindow.C +++ b/cde/programs/dtprintinfo/libUI/MotifUI/MainWindow.C @@ -222,7 +222,7 @@ void MainWindow::PopupMenu(Widget widget, XtPointer client_data, { XRectangle pixmap_rect, label_rect; XButtonEvent * ev; - Window child, parent, root; + Window child, parent = 0, root; int root_x, root_y, win_x, win_y; unsigned int modMask; Display * display = XtDisplay(widget); diff --git a/cde/programs/dtprintinfo/libUI/MotifUI/WorkArea.c b/cde/programs/dtprintinfo/libUI/MotifUI/WorkArea.c index 286d34df1..37ee38b35 100644 --- a/cde/programs/dtprintinfo/libUI/MotifUI/WorkArea.c +++ b/cde/programs/dtprintinfo/libUI/MotifUI/WorkArea.c @@ -502,7 +502,7 @@ Realize( XtValueMask *valueMask, XSetWindowAttributes *attr) { - Boolean sw_child; + Boolean sw_child = FALSE; Widget sw; Widget vbar; Dimension width, vbar_width, shadow_thickness, highlight_thickness; diff --git a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C index de1781acc..0eff7c7ce 100644 --- a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C +++ b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C @@ -456,7 +456,6 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, DIR *lp_tmp_dir; struct dirent *dir_struct; char buf[256]; - int req_len; int spool_len; int line_ct; char *line; @@ -472,16 +471,15 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, char *jobname; StatusLineList j_list; - char *filename = new char[200]; - char *filename1 = new char[200]; - char *request = new char[300]; - char *spool_dir = new char[300]; + char *filename = new char[PATH_MAX]; + char *filename1 = new char[PATH_MAX]; + char *request = new char[PATH_MAX]; + char *spool_dir = new char[PATH_MAX]; if (getenv("REQ_DIR")) snprintf(request, sizeof(request), "%s/%s", getenv("REQ_DIR"), tmp_dir); else - sprintf(request, sizeof(request), "%s", REQ_DIR, tmp_dir); - req_len = strlen(request); + snprintf(request, sizeof(request), REQ_DIR, tmp_dir); snprintf(spool_dir, sizeof(spool_dir), "%s/%s", SPOOL_DIR, tmp_dir); spool_len = strlen(spool_dir); @@ -503,9 +501,7 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, if (strcmp(dir_struct->d_name + len - 2, "-0")) continue; -// *(request + req_len) = '\0'; -// strcat(request + req_len, dir_struct->d_name); - std:string file_req(request); + std::string file_req(request); file_req.append(dir_struct->d_name); if (!(req = fopen(file_req.c_str(), "r"))) diff --git a/cde/programs/dtprintinfo/util/Invoke.C b/cde/programs/dtprintinfo/util/Invoke.C index c96bdaec1..8d6b61619 100644 --- a/cde/programs/dtprintinfo/util/Invoke.C +++ b/cde/programs/dtprintinfo/util/Invoke.C @@ -56,8 +56,8 @@ Invoke::Invoke(const char *command, // Command to Run pid_t c_pid; // child's pid pid_t w; // temp vars int out_num,err_num; // # of chars read - char *out_tmp, *err_tmp; // temp buffer ptrs - char *out_end,*err_end; // ptr to end of buffer + char *out_tmp, *err_tmp = NULL; // temp buffer ptrs + char *out_end = NULL, *err_end = NULL; // ptr to end of buffer int outb_size,errb_size; // buffer size int out_count, err_count; // # of buffers allocated int trap_out,trap_err; // flags; if >0, trap output diff --git a/cde/programs/dtsearchpath/dtappg/Makefile.am b/cde/programs/dtsearchpath/dtappg/Makefile.am index d5321335a..915c76af3 100644 --- a/cde/programs/dtsearchpath/dtappg/Makefile.am +++ b/cde/programs/dtsearchpath/dtappg/Makefile.am @@ -12,6 +12,7 @@ endif dtappgather_SOURCES = Options.C dtappgather.C dtappgather.h Options.h +# can't use INSTALL here as the program is already installed install-exec-hook: chown root $(DESTDIR)$(bindir)/dtappgather chmod 4755 $(DESTDIR)$(bindir)/dtappgather diff --git a/cde/programs/dtsession/Makefile.am b/cde/programs/dtsession/Makefile.am index 0bd35b5df..83c224cef 100644 --- a/cde/programs/dtsession/Makefile.am +++ b/cde/programs/dtsession/Makefile.am @@ -5,7 +5,7 @@ bin_PROGRAMS = dtsession bin_SCRIPTS = dtsession_res if HAS_PAM_LIBRARY -DTPAMSVCLIB = @LIBPAMSVC@ +DTPAMSVCLIB = $(LIBPAMSVC) else DTPAMSVCLIB = endif @@ -131,10 +131,8 @@ sys.session.ive: sys.session.src # systems without a PAM library need dtsession to be SUID root install-exec-hook: +if !HAS_PAM_LIBRARY chown root $(DESTDIR)$(bindir)/dtsession -if HAS_PAM_LIBRARY - chmod 755 $(DESTDIR)$(bindir)/dtsession -else chmod 4755 $(DESTDIR)$(bindir)/dtsession endif diff --git a/cde/programs/dtsession/Sm.h b/cde/programs/dtsession/Sm.h index 6b433a884..f1d8014ec 100644 --- a/cde/programs/dtsession/Sm.h +++ b/cde/programs/dtsession/Sm.h @@ -62,7 +62,7 @@ #include "SmError.h" #ifdef USE_XINERAMA -# include +# include
#endif /* diff --git a/cde/programs/dtsession/SmLock.c b/cde/programs/dtsession/SmLock.c index d881dfd54..83d1c183b 100644 --- a/cde/programs/dtsession/SmLock.c +++ b/cde/programs/dtsession/SmLock.c @@ -86,7 +86,7 @@ #endif #ifdef HAS_PAM_LIBRARY -#include +#include
#endif #include "Sm.h" diff --git a/cde/programs/dtsession/SmMain.c b/cde/programs/dtsession/SmMain.c index 6176003ed..5d7b6a97b 100644 --- a/cde/programs/dtsession/SmMain.c +++ b/cde/programs/dtsession/SmMain.c @@ -68,7 +68,7 @@ #include
#include
#ifdef USE_XINERAMA -#include /* JET - Xinerama support */ +#include
/* JET - Xinerama support */ #endif #include "Sm.h" #include "SmError.h" diff --git a/cde/programs/dtsession/SmUI.c b/cde/programs/dtsession/SmUI.c index 6f07ec406..eccb4665f 100644 --- a/cde/programs/dtsession/SmUI.c +++ b/cde/programs/dtsession/SmUI.c @@ -90,7 +90,7 @@ #include "SmGlobals.h" #ifdef USE_XINERAMA -#include +#include
#endif typedef enum { diff --git a/cde/programs/dtsr/Makefile.am b/cde/programs/dtsr/Makefile.am index 657f7387e..d69064725 100644 --- a/cde/programs/dtsr/Makefile.am +++ b/cde/programs/dtsr/Makefile.am @@ -13,18 +13,6 @@ MsgCat.c: ${top_srcdir}/lib/DtSvc/DtUtil2/MsgCat.c $(RM) MsgCat.c && ln -s ${top_srcdir}/lib/DtSvc/DtUtil2/MsgCat.c MsgCat.c -if I386 -AM_CFLAGS += -DBYTE_SWAP -endif - -if X86_64 -AM_CFLAGS += -DBYTE_SWAP -endif - -if ARM -AM_CFLAGS += -DBYTE_SWAP -endif - LDADD = ../../lib/DtSearch/libDtSearch.la dtsrcreate_SOURCES = dtsrcreate.c MsgCat.c diff --git a/cde/programs/dtsr/dtsrclean.c b/cde/programs/dtsr/dtsrclean.c index 392b30de4..b0234765c 100644 --- a/cde/programs/dtsr/dtsrclean.c +++ b/cde/programs/dtsr/dtsrclean.c @@ -737,10 +737,9 @@ static void copy_new_d99 (long keyfield) * dbrec offset. */ if (validation_mode) { -#ifdef BYTE_SWAP for (swapx = 0; swapx < num_reads; swapx++) NTOHL (word_addrs[swapx]); -#endif + /* set x to number of good addrs in this block */ if (good_addrs_left > num_reads) { x = num_reads; @@ -868,10 +867,9 @@ static void copy_new_d99 (long keyfield) * dba loop for this word. */ if (good_addrs_this_block > 0) { -#ifdef BYTE_SWAP for (swapx = 0; swapx < good_addrs_this_block; swapx++) NTOHL (word_addrs_out[swapx]); -#endif + num_writes = fwrite (word_addrs_out, sizeof (DB_ADDR), (size_t)good_addrs_this_block, fp_d99_new); if (num_writes != good_addrs_this_block) diff --git a/cde/programs/dtsr/dtsrhan.c b/cde/programs/dtsr/dtsrhan.c index 5ce00aaac..ae8058472 100644 --- a/cde/programs/dtsr/dtsrhan.c +++ b/cde/programs/dtsr/dtsrhan.c @@ -561,14 +561,14 @@ void process_profile (void) int line_num = 0; int i; char *tok; - struct line_id *line_current; - struct field_id *field_current; + struct line_id *line_current = NULL; + struct field_id *field_current = NULL; struct key_id *key_current; struct date_id *date_current; - struct key_id *abstract_current; - struct finclude *finclude_current; - struct include *include_current; - struct include *i_i_current; + struct key_id *abstract_current = NULL; + struct finclude *finclude_current = NULL; + struct include *include_current = NULL; + struct include *i_i_current = NULL; int found; int tok_type; @@ -2052,7 +2052,7 @@ void process_infile (void) { int line_num = 0; struct line_id *line_current; - struct rec *record; + struct rec *record = NULL; char buffer[200]; int cant_be; time_t startime = 0L; diff --git a/cde/programs/dtsr/dtsrindex.c b/cde/programs/dtsr/dtsrindex.c index 79e85d200..8b0a817db 100644 --- a/cde/programs/dtsr/dtsrindex.c +++ b/cde/programs/dtsr/dtsrindex.c @@ -111,7 +111,8 @@ * 2.1.5b cborodin bug. Segfault due to overflowing bitvector * after many deletions and no mrclean. */ -#include "SearchP.h" +#include +#include
#include #include #include @@ -801,13 +802,11 @@ static void put_addrs_2_dtbs_addr_file ( **** num addrs in database by 1 (!?) ******/ /* (...only if prev 'overlay/compression' didn't delete all) */ -#ifdef BYTE_SWAP - /* Put both arrays in 'network' byte order */ - for (int32 = 0; int32 < nitems; int32++) - HTONL (addrs_array[int32]); - for (int32 = 0; int32 < num_addrs; int32++) - HTONL (word_addrs_ii[int32]); -#endif + /* Put both arrays in 'network' byte order */ + for (int32 = 0; int32 < nitems; int32++) + HTONL (addrs_array[int32]); + for (int32 = 0; int32 < num_addrs; int32++) + HTONL (word_addrs_ii[int32]); /* * If number of new addresses greater than number of free holes, @@ -921,7 +920,7 @@ void write_2_dtbs_addr_file (void) { DtSrINT32 num_addrs_ii; DtSrINT32 num_reads; - DtSrINT32 i_start, k, cur_ind; + DtSrINT32 i_start, k, cur_ind = 0; DtSrINT32 num_delete_addrs = 0; char addrs_removed = FALSE; DtSrINT32 i; @@ -966,11 +965,10 @@ void write_2_dtbs_addr_file (void) (long)got_word.or_hwoffset, (long)num_reads); DtSearchExit (98); } -#ifdef BYTE_SWAP + for (i = 0; i < num_addrs_ii; i++) NTOHL (word_addrs_ii[i]); /* Now both addr arrays are in 'host' byte swap order */ -#endif /* If there are only new docs, * this switch will prevent the checking for updates. @@ -1116,11 +1114,11 @@ void write_new_word_2_dtbs (void) (long)record_addr_word[int32] & 0xffL); } } -#ifdef BYTE_SWAP - /* Put addr array in 'network' byte order */ - for (int32 = 0; int32 < num_addrs_for_word; int32++) - HTONL (record_addr_word[int32]); -#endif + + /* Put addr array in 'network' byte order */ + for (int32 = 0; int32 < num_addrs_for_word; int32++) + HTONL (record_addr_word[int32]); + num_writes = fwrite (record_addr_word, sizeof(DB_ADDR), (size_t)num_addrs_for_word, dtbs_addr_fp); if (num_writes != num_addrs_for_word) diff --git a/cde/programs/dtsr/dtsrkdump.c b/cde/programs/dtsr/dtsrkdump.c index 0a025b942..a7dd624fb 100644 --- a/cde/programs/dtsr/dtsrkdump.c +++ b/cde/programs/dtsr/dtsrkdump.c @@ -103,7 +103,7 @@ static struct or_dbrec /****************************************/ void count_words (int index) { - long vista_field; + long vista_field = 0; UCHAR *ptr; DtSrINT32 offset, free, addrs; int tabstop; diff --git a/cde/programs/dtstyle/Audio.c b/cde/programs/dtstyle/Audio.c index c22522247..cf120a778 100644 --- a/cde/programs/dtstyle/Audio.c +++ b/cde/programs/dtstyle/Audio.c @@ -714,8 +714,8 @@ saveAudio( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*audioDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*audioDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*audioDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*audioDlg.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); } diff --git a/cde/programs/dtstyle/ColorEdit.c b/cde/programs/dtstyle/ColorEdit.c index bc90c1d7c..45ec662df 100644 --- a/cde/programs/dtstyle/ColorEdit.c +++ b/cde/programs/dtstyle/ColorEdit.c @@ -1338,7 +1338,7 @@ HSVtoRGB( { double p1, p2, p3; double hue, sat, val; - double red, green, blue; + double red = 0.0, green = 0.0, blue = 0.0; double i, f; hue = (double)h / 60.0; @@ -1730,8 +1730,8 @@ saveColorEdit( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*colorEditDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*colorEditDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*colorEditDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*colorEditDlg.y: %d\n", bufr, y); /*any other parameter you want to save goes here*/ if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/ColorMain.c b/cde/programs/dtstyle/ColorMain.c index bfe900831..cb1e00b58 100644 --- a/cde/programs/dtstyle/ColorMain.c +++ b/cde/programs/dtstyle/ColorMain.c @@ -2095,7 +2095,7 @@ void SaveOrgPalette( void ) { int i; - palette *tmp_palette, *tmp2_palette; + palette *tmp_palette = NULL, *tmp2_palette = NULL; if(save.restoreFlag && defaultName_restore[0] != 0) { tmp_palette = pHeadPalette; @@ -2455,11 +2455,11 @@ saveColor( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*paletteDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*paletteDlg.y: %d\n", bufr, y); - sprintf(bufr, "%s*paletteDlg.selected_palette: %s\n", bufr, + snprintf(bufr, sizeof(style.tmpBigStr), "%s*paletteDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*paletteDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*paletteDlg.selected_palette: %s\n", bufr, pCurrentPalette->name); - sprintf(bufr, "%s*paletteDlg.selected_button: %d\n", bufr, + snprintf(bufr, sizeof(style.tmpBigStr), "%s*paletteDlg.selected_button: %d\n", bufr, selected_button); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/Dtwm.c b/cde/programs/dtstyle/Dtwm.c index f9c5aebdb..eac57cb3c 100644 --- a/cde/programs/dtstyle/Dtwm.c +++ b/cde/programs/dtstyle/Dtwm.c @@ -982,10 +982,10 @@ saveDtwm( width = XtWidth(style.dtwmDialog); height = XtHeight(style.dtwmDialog); - sprintf(bufr, "%s*dtwmDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*dtwmDlg.y: %d\n", bufr, y); - sprintf(bufr, "%s*dtwmDlg.width: %d\n", bufr, width); - sprintf(bufr, "%s*dtwmDlg.height: %d\n", bufr, height); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*dtwmDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*dtwmDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*dtwmDlg.width: %d\n", bufr, width); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*dtwmDlg.height: %d\n", bufr, height); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); } diff --git a/cde/programs/dtstyle/Font.c b/cde/programs/dtstyle/Font.c index c4ea13dd0..66678a9ca 100644 --- a/cde/programs/dtstyle/Font.c +++ b/cde/programs/dtstyle/Font.c @@ -754,8 +754,8 @@ saveFonts( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*Fonts.x: %d\n", bufr, x); - sprintf(bufr, "%s*Fonts.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Fonts.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Fonts.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/I18nMain.c b/cde/programs/dtstyle/I18nMain.c index 5e52a2582..03cd14713 100644 --- a/cde/programs/dtstyle/I18nMain.c +++ b/cde/programs/dtstyle/I18nMain.c @@ -1204,10 +1204,10 @@ saveI18n( width = XtWidth(style.i18nDialog); height = XtHeight(style.i18nDialog); - sprintf(bufr, "%s*i18nDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*i18nDlg.y: %d\n", bufr, y); - sprintf(bufr, "%s*i18nDlg.width: %d\n", bufr, width); - sprintf(bufr, "%s*i18nDlg.height: %d\n", bufr, height); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*i18nDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*i18nDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*i18nDlg.width: %d\n", bufr, width); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*i18nDlg.height: %d\n", bufr, height); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); } diff --git a/cde/programs/dtstyle/Keyboard.c b/cde/programs/dtstyle/Keyboard.c index c67c4cb53..adf444a04 100644 --- a/cde/programs/dtstyle/Keyboard.c +++ b/cde/programs/dtstyle/Keyboard.c @@ -633,8 +633,8 @@ saveKeybd( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*keyboardDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*keyboardDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*keyboardDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*keyboardDlg.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/MainWin.c b/cde/programs/dtstyle/MainWin.c index ff9d60cff..eee333720 100644 --- a/cde/programs/dtstyle/MainWin.c +++ b/cde/programs/dtstyle/MainWin.c @@ -784,8 +784,8 @@ saveMain( /* Get and write out the geometry info for our Window */ x = XtX(XtParent(style.mainWindow)); y = XtY(XtParent(style.mainWindow)); - sprintf(bufr, "%s*mainWindow.x: %d\n", bufr, x); - sprintf(bufr, "%s*mainWindow.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*mainWindow.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*mainWindow.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/Makefile.am b/cde/programs/dtstyle/Makefile.am index 11c826eca..728a2956c 100644 --- a/cde/programs/dtstyle/Makefile.am +++ b/cde/programs/dtstyle/Makefile.am @@ -4,7 +4,7 @@ bin_PROGRAMS = dtstyle dtstyle_CPPFLAGS = -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \ -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" -I../dthelp \ - -I$(DT_INCDIR) + $(DT_INCDIR) dtstyle_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) diff --git a/cde/programs/dtstyle/Mouse.c b/cde/programs/dtstyle/Mouse.c index 13eb5de5b..6e459a23f 100644 --- a/cde/programs/dtstyle/Mouse.c +++ b/cde/programs/dtstyle/Mouse.c @@ -1502,7 +1502,7 @@ ButtonCB( Bool do_accel, do_thresh; Bool set; char message1[6], message2[50], message3[6], message4[6]; - char pointerStr[70]; + char pointerStr[128]; static char dclickRes[40]; static char enableBtn1Res[40]; int dclick; @@ -1773,8 +1773,8 @@ saveMouse( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*Mouse.x: %d\n", bufr, x); - sprintf(bufr, "%s*Mouse.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Mouse.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Mouse.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/Screen.c b/cde/programs/dtstyle/Screen.c index 0a429d82c..ce25e379a 100644 --- a/cde/programs/dtstyle/Screen.c +++ b/cde/programs/dtstyle/Screen.c @@ -2921,8 +2921,8 @@ saveScreen( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*Screen.x: %d\n", bufr, x); - sprintf(bufr, "%s*Screen.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Screen.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*Screen.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtstyle/Startup.c b/cde/programs/dtstyle/Startup.c index f1e028590..a31bbf246 100644 --- a/cde/programs/dtstyle/Startup.c +++ b/cde/programs/dtstyle/Startup.c @@ -725,8 +725,8 @@ saveStartup( x -= vendorExt->vendor.xOffset; y -= vendorExt->vendor.yOffset; - sprintf(bufr, "%s*startupDlg.x: %d\n", bufr, x); - sprintf(bufr, "%s*startupDlg.y: %d\n", bufr, y); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*startupDlg.x: %d\n", bufr, x); + snprintf(bufr, sizeof(style.tmpBigStr), "%s*startupDlg.y: %d\n", bufr, y); if(-1 == write (fd, bufr, strlen(bufr))) { perror(strerror(errno)); diff --git a/cde/programs/dtterm/DtTermMain.c b/cde/programs/dtterm/DtTermMain.c index 7a5062f97..4a96142f0 100644 --- a/cde/programs/dtterm/DtTermMain.c +++ b/cde/programs/dtterm/DtTermMain.c @@ -60,6 +60,7 @@ #include "TermPrimRenderP.h" #include "TermPrimLineDrawP.h" #include "TermPrimLineFontP.h" +#include "TermPrimSetUtmp.h" #include "TermBufferP.h" #include "TermP.h" #include "TermParseTableP.h" diff --git a/cde/programs/dtudcexch/Makefile.am b/cde/programs/dtudcexch/Makefile.am index 4bce8dcc5..0d3359470 100644 --- a/cde/programs/dtudcexch/Makefile.am +++ b/cde/programs/dtudcexch/Makefile.am @@ -6,7 +6,7 @@ dtudcexch_CFLAGS = -I$(FONTEDT_PATH1) -I$(FONTEDT_PATH1)/include \ -I$(FONTEDT_PATH1)/libfal -I$(FONTEDT_PATH1)/dtgpftobdf \ -DFONTC='"'$(BDFTOPCF)'"' -dtudcexch_LDADD = $(LIBSVC) $(LIBTT) -lXm $(XTOOLLIB) ${X_LIBS} \ +dtudcexch_LDADD = $(LIBSVC) $(LIBTT) $(XTOOLLIB) ${X_LIBS} \ $(FONTEDT_PATH1)/libfuty/liboakfuty.a \ $(FONTEDT_PATH1)/libfal/libfal.a @@ -14,10 +14,6 @@ if SOLARIS dtudcexch_LDADD += -ldl -lgen endif -if AIX -dtudcexch_LDADD += -ldl -liconv -endif - if FREEBSD dtudcexch_LDADD += -liconv endif diff --git a/cde/programs/dtwm/Callback.c b/cde/programs/dtwm/Callback.c index 05a4b39a6..1c2949064 100644 --- a/cde/programs/dtwm/Callback.c +++ b/cde/programs/dtwm/Callback.c @@ -1360,7 +1360,7 @@ PushCB (Widget w, BoxData * box_data; SubpanelData * subpanel_data; - ControlData * main_control_data; + ControlData * main_control_data = NULL; char m_state; diff --git a/cde/programs/dtwm/DataBaseLoad.c b/cde/programs/dtwm/DataBaseLoad.c index c6e9737c3..e9782bf48 100644 --- a/cde/programs/dtwm/DataBaseLoad.c +++ b/cde/programs/dtwm/DataBaseLoad.c @@ -1796,7 +1796,7 @@ ResolveDuplicates (RecordData * record_data, int i, start_index, lock_index, last_index; ElementValue * element_values; int cont_type; - char *cont_name, *record_name; + char *cont_name = NULL, *record_name; int count = *record_count; Boolean locked; diff --git a/cde/programs/dtwm/Makefile.am b/cde/programs/dtwm/Makefile.am index 548f7271f..caf248448 100644 --- a/cde/programs/dtwm/Makefile.am +++ b/cde/programs/dtwm/Makefile.am @@ -12,8 +12,8 @@ AM_CPPFLAGS = -DLARGECURSORS -DR2_COMPAT -DOPAQUE -DSHAPE -DUNMAP_ON_RESTART \ -DBATCH_DRAG_REQUESTS -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \ -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" -dtwm_LDADD = $(DTCLIENTLIBS) -lXext $(XTOOLLIB) -dtfplist_LDADD = @DTCLIENTLIBS@ $(TIRPCLIB) -lXm -lXext $(XTOOLLIB) +dtwm_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB) +dtfplist_LDADD = $(DTCLIENTLIBS) $(TIRPCLIB) $(XTOOLLIB) if SOLARIS dtwm_LDADD += -lintl -lresolv diff --git a/cde/programs/dtwm/PopupMenu.c b/cde/programs/dtwm/PopupMenu.c index 5186cd696..1c5b44477 100644 --- a/cde/programs/dtwm/PopupMenu.c +++ b/cde/programs/dtwm/PopupMenu.c @@ -1046,7 +1046,7 @@ UpdateMainControlMenu (ControlData * control_data) long control_type; Arg args[5]; - ElementValue * old_element_values; + ElementValue * old_element_values = NULL; /* Save element values of control then load values of default control */ @@ -1769,7 +1769,7 @@ WSPopupMenu (Widget w, XmAnyCallbackStruct * callback; XEvent * event; Widget form, focus_widget; - SwitchData * switch_data; + SwitchData * switch_data = NULL; ControlData * control_data = NULL; Boolean is_button = False; Position x, y; diff --git a/cde/programs/dtwm/UI.c b/cde/programs/dtwm/UI.c index 54f0c349c..0391dc8f0 100644 --- a/cde/programs/dtwm/UI.c +++ b/cde/programs/dtwm/UI.c @@ -2317,7 +2317,7 @@ SwitchButtonCreate (SwitchData * switch_data, for (i = 0; i < switch_count; i++) { - int pixel_set_index, map_index; + int pixel_set_index = 1, map_index; if (one == True) i = switch_count - 1; diff --git a/cde/programs/dtwm/WmFunction.c b/cde/programs/dtwm/WmFunction.c index 3f52e2c31..869b9a2fa 100644 --- a/cde/programs/dtwm/WmFunction.c +++ b/cde/programs/dtwm/WmFunction.c @@ -82,7 +82,7 @@ extern XmMenuState _XmGetMenuState(); #if defined(HAVE_CONFIG_H) -#include +#include #endif #if defined(HAVE_SYS_TYPES_H) diff --git a/cde/programs/dtwm/WmHelp.c b/cde/programs/dtwm/WmHelp.c index f00cfa8a5..b7ec15130 100644 --- a/cde/programs/dtwm/WmHelp.c +++ b/cde/programs/dtwm/WmHelp.c @@ -1625,7 +1625,7 @@ RestoreHelpDialogs( Position xLoc, yLoc; short columns, rows; - int helpType; + int helpType = DtHELP_TYPE_TOPIC; char geometry[40]; int wsCnt; int cCount; @@ -2060,7 +2060,7 @@ SaveHelpResources( char *wsName; char workspaces[MAXWMPATH+1]; - char buffer[MAXWMPATH+1]; + char buffer[MAXWMPATH + 1 + 1024]; char *res_class; char *data; int cum_len; diff --git a/cde/programs/dtwm/WmInitWs.c b/cde/programs/dtwm/WmInitWs.c index 740fb5cc0..3fd1b9412 100644 --- a/cde/programs/dtwm/WmInitWs.c +++ b/cde/programs/dtwm/WmInitWs.c @@ -2209,8 +2209,8 @@ void InitWmDisplayEnv (void) { char *pDisplayName; - char buffer[256]; char displayName[256]; + char buffer[10 + sizeof(displayName)]; pDisplayName = DisplayString (DISPLAY); diff --git a/cde/programs/dtwm/WmManage.c b/cde/programs/dtwm/WmManage.c index 60aab5657..b627bbc3c 100644 --- a/cde/programs/dtwm/WmManage.c +++ b/cde/programs/dtwm/WmManage.c @@ -2404,7 +2404,7 @@ RegisterPushRecallClients ( WmFpPushRecallClientList pPRCD, int count) { - WmScreenData *pSD; + WmScreenData *pSD = NULL; int i; for (i= 0; i < wmGD.numScreens; i++) diff --git a/cde/programs/dtwm/WmMenu.c b/cde/programs/dtwm/WmMenu.c index d7a533308..a20d801c7 100644 --- a/cde/programs/dtwm/WmMenu.c +++ b/cde/programs/dtwm/WmMenu.c @@ -377,7 +377,7 @@ void CheckTerminalSeparator(MenuSpec *menuSpec, Widget buttonWidget, Boolean man static MenuItem * DuplicateMenuItems (MenuItem *menuItems) { - MenuItem *newMenuItem = (MenuItem *) NULL, *returnMenuItem, *curMenuItem; + MenuItem *newMenuItem = NULL, *returnMenuItem = NULL, *curMenuItem; for (curMenuItem = menuItems; curMenuItem != (MenuItem *) NULL; diff --git a/cde/programs/dtwm/WmMultiHead.c b/cde/programs/dtwm/WmMultiHead.c index b42f1e130..a850c176c 100644 --- a/cde/programs/dtwm/WmMultiHead.c +++ b/cde/programs/dtwm/WmMultiHead.c @@ -26,7 +26,7 @@ /* * Included Files: */ -#include +#include
#include "WmMultiHead.h" diff --git a/cde/programs/dtwm/WmParse.c b/cde/programs/dtwm/WmParse.c index 607bb01eb..2b0de2a17 100644 --- a/cde/programs/dtwm/WmParse.c +++ b/cde/programs/dtwm/WmParse.c @@ -1477,7 +1477,7 @@ _DtWmParseExpandEnvironmentVariables ( int lenNonEnv; int lenEnvVar; int lenEnvValue; - int lenReturn; + int lenReturn = 0; int lenSave; static unsigned char pchDefaultBrk[] = { DTWM_CHAR_ENVIRONMENT, diff --git a/cde/programs/dtwm/WmResource.c b/cde/programs/dtwm/WmResource.c index a35a91eca..5d174c590 100644 --- a/cde/programs/dtwm/WmResource.c +++ b/cde/programs/dtwm/WmResource.c @@ -4916,7 +4916,7 @@ ProcessDefaultBackdropImages (WmScreenData *pSD) void ProcessWorkspaceList (WmScreenData *pSD) { - int i, wsNameCount, wsNamesAlloced; + int i, wsNameCount = 0, wsNamesAlloced; WmWorkspaceData *pwsI; unsigned char *lineP = NULL; unsigned char *string; diff --git a/cde/programs/dtwm/WmWinInfo.c b/cde/programs/dtwm/WmWinInfo.c index cfde984bd..a213ead25 100644 --- a/cde/programs/dtwm/WmWinInfo.c +++ b/cde/programs/dtwm/WmWinInfo.c @@ -1414,8 +1414,8 @@ ProcessWmNormalHints (ClientData *pCD, Boolean firstTime, long manageFlags) int diff; unsigned long decoration; unsigned int boxdim, tmpMin; - unsigned int oldWidthInc, oldHeightInc; - unsigned int oldBaseWidth, oldBaseHeight; + unsigned int oldWidthInc = 0, oldHeightInc = 0; + unsigned int oldBaseWidth = 0, oldBaseHeight = 0; unsigned int incWidth, incHeight; /* diff --git a/cde/programs/dtwm/WmWinState.c b/cde/programs/dtwm/WmWinState.c index b70ca7ff9..47ac90c13 100644 --- a/cde/programs/dtwm/WmWinState.c +++ b/cde/programs/dtwm/WmWinState.c @@ -614,7 +614,7 @@ void ConfigureNewState (ClientData *pcd) } else { - long decor; + long decor = WM_DECOR_DEFAULT; WmHeadInfo_t *WmHI; if (pcd->isFullscreen) diff --git a/cde/programs/localized/util/mkcatdefs.c b/cde/programs/localized/util/mkcatdefs.c index de8b2f8a6..a9877e6cb 100644 --- a/cde/programs/localized/util/mkcatdefs.c +++ b/cde/programs/localized/util/mkcatdefs.c @@ -484,7 +484,7 @@ chkcontin(char *line) { int len; /* # bytes in character */ wchar_t wc; /* process code of current character in line */ - wchar_t wcprev; /* process code of previous character in line */ + wchar_t wcprev = '\0'; /* process code of previous character in line */ for (wc=0; *line; line+=len) { wcprev = wc; diff --git a/cde/programs/ttsnoop/messageProps_stubs.C.src b/cde/programs/ttsnoop/messageProps_stubs.C.src index fa2e1ee76..ca6cab792 100644 --- a/cde/programs/ttsnoop/messageProps_stubs.C.src +++ b/cde/programs/ttsnoop/messageProps_stubs.C.src @@ -317,7 +317,7 @@ _DtTtMessageUpdate( if (tt_is_err( status ) || (instance == 0)) { return; } - char *func; + char *func = NULL; switch (choice) { case _DtStringChooseMessageOtype: status = tt_message_otype_set( msg, val ); diff --git a/cde/programs/ttsnoop/ttChooser_stubs.C.src b/cde/programs/ttsnoop/ttChooser_stubs.C.src index ef0e550c6..244691695 100644 --- a/cde/programs/ttsnoop/ttChooser_stubs.C.src +++ b/cde/programs/ttsnoop/ttChooser_stubs.C.src @@ -60,9 +60,9 @@ _DtTtChooserSet( dtb_tt_chooser_chooser_initialize( instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin ); } - char *okString; - char *title; - char *valueLabel; + char *okString = NULL; + char *title = NULL; + char *valueLabel = NULL; char *valuesLabel; switch (choice) { case _DtTtChooserNone: @@ -148,7 +148,7 @@ _DtTtChooserSet( title = "ttdt_close"; break; } - DtTtType type; + DtTtType type = DTTT_OP; switch (choice) { case _DtTtChooserNone: return; @@ -269,7 +269,7 @@ choiceSelected( XmListCallbackStruct *info = (XmListCallbackStruct *)callData; int choice; XtVaGetValues( instance->chooserOkButton, XmNuserData, &choice, NULL ); - DtTtType type; + DtTtType type = DTTT_OP; Boolean isString = False; switch ((_DtTtChooserAction)choice) { case _DtTtChooserNone: @@ -338,14 +338,14 @@ choiceOkayed( XtVaGetValues( instance->chooserOkButton, XmNuserData, &ival, NULL ); _DtTtChooserAction choice = (_DtTtChooserAction)ival; Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label; + Tt_status status = TT_OK; + char *func = NULL, *procid; switch (choice) { void *pval; int ival, fd; Tt_message msg; Tt_pattern pat; Tt_pattern *pats; - Tt_status status; - char *func, *procid; XtPointer xtPtr; XtInputId id; Widget newWidget; diff --git a/cde/programs/types/dthelp.dt.src b/cde/programs/types/dthelp.dt.src index efada845d..9e7e1c132 100644 --- a/cde/programs/types/dthelp.dt.src +++ b/cde/programs/types/dthelp.dt.src @@ -130,7 +130,7 @@ ACTION Dthelpview TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /bin/sh -c '/usr/dt/bin/dthelpgen -dir $HOME/.dt/help/$DTUSERSESSION; \ - /usr/dt/bin/dthelpview -helpVolume browser ' + /usr/dt/bin/dthelpview -helpVolume browser ' DESCRIPTION %|nls-11007-#The#| } ACTION Dthelpview diff --git a/cde/util/tradcpp/Makefile.am b/cde/util/tradcpp/Makefile.am index 1a1c86dca..899374c81 100644 --- a/cde/util/tradcpp/Makefile.am +++ b/cde/util/tradcpp/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -bin_PROGRAMS = tradcpp +noinst_PROGRAMS = tradcpp tradcpp_SOURCES = array.c directive.c files.c macro.h output.h \ utils.c array.h directive.h files.h main.c place.c utils.h \