From: Ulrich Wilkens Date: Sun, 27 Jul 2014 14:48:57 +0000 (+0200) Subject: FreeBSD 10 clang port X-Git-Tag: 2.2.2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c3f74eec17c64cdeab814b9bf19eb5515ff50d52;p=oweals%2Fcde.git FreeBSD 10 clang port --- diff --git a/cde/Imakefile b/cde/Imakefile index e637aff9..c9194ddd 100644 --- a/cde/Imakefile +++ b/cde/Imakefile @@ -55,11 +55,7 @@ Everything:: @echo "" @date @echo "" - cd $(IMAKESRC) && if [ -f Makefile ]; then \ - $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - else \ - $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - fi + MakeImakeDir() -$(RM) xmakefile.bak; $(MV) xmakefile xmakefile.bak $(MAKE) $(MFLAGS) -f xmakefile.bak xmakefile $(MAKE) $(MFLAGS) $(MAKE_OPTS) Makefiles @@ -82,11 +78,7 @@ Everything.dev:: @echo "" @date @echo "" - cd $(IMAKESRC) && if [ -f Makefile ]; then \ - $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - else \ - $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - fi + MakeImakeDir() -$(RM) xmakefile.bak; $(MV) xmakefile xmakefile.bak $(MAKE) $(MFLAGS) -f xmakefile.bak xmakefile $(MAKE) $(MFLAGS) $(MAKE_OPTS) Makefiles @@ -120,11 +112,7 @@ Everything.doc:: @echo "" @date @echo "" - cd $(IMAKESRC) && if [ -f Makefile ]; then \ - $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - else \ - $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ - fi + MakeImakeDir() -$(RM) xmakefile.bak; $(MV) xmakefile xmakefile.bak $(MAKE) $(MFLAGS) -f xmakefile.bak xmakefile $(MAKE) $(MFLAGS) $(MAKE_OPTS) Makefiles.doc diff --git a/cde/admin/IntegTools/post_install/Imakefile b/cde/admin/IntegTools/post_install/Imakefile index e23ca60d..31556413 100644 --- a/cde/admin/IntegTools/post_install/Imakefile +++ b/cde/admin/IntegTools/post_install/Imakefile @@ -59,65 +59,19 @@ MakeSubdirs($(SUBDIRS)) all:: -configHelp:: $(DATABASE_DIR)/CDE-HELP-C.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-HELP-C.udb > CDE-HELP-C.lst - $(BUILD_UDB_TOOL) CDE-HELP-C ../../.. - -configHelpPrg:: $(DATABASE_DIR)/CDE-HELP-PRG.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-HELP-PRG.udb > CDE-HELP-PRG.lst - $(BUILD_UDB_TOOL) CDE-HELP-PRG ../../.. - -configDemos:: $(DATABASE_DIR)/CDE-DEMOS.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-DEMOS.udb > CDE-DEMOS.lst - $(BUILD_UDB_TOOL) CDE-DEMOS ../../.. - -configFonts:: $(DATABASE_DIR)/CDE-FONTS.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-FONTS.udb > CDE-FONTS.lst - $(BUILD_UDB_TOOL) CDE-FONTS ../../.. - -configHelpRun:: $(DATABASE_DIR)/CDE-HELP-RUN.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-HELP-RUN.udb > CDE-HELP-RUN.lst - $(BUILD_UDB_TOOL) CDE-HELP-RUN ../../.. - -configIcons:: $(DATABASE_DIR)/CDE-ICONS.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-ICONS.udb > CDE-ICONS.lst - $(BUILD_UDB_TOOL) CDE-ICONS ../../.. - -configInc:: $(DATABASE_DIR)/CDE-INC.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-INC.udb > CDE-INC.lst - $(BUILD_UDB_TOOL) CDE-INC ../../.. - -configManDev:: $(DATABASE_DIR)/CDE-MAN-DEV.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-MAN-DEV.udb > CDE-MAN-DEV.lst - $(BUILD_UDB_TOOL) CDE-MAN-DEV ../../.. - -configMan:: $(DATABASE_DIR)/CDE-MAN.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-MAN.udb > CDE-MAN.lst - $(BUILD_UDB_TOOL) CDE-MAN ../../.. - -configMsgCat:: $(DATABASE_DIR)/CDE-MSG-C.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-MSG-C.udb > CDE-MSG-C.lst - $(BUILD_UDB_TOOL) CDE-MSG-C ../../.. - -configPrg:: $(DATABASE_DIR)/CDE-PRG.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-PRG.udb > CDE-PRG.lst - $(BUILD_UDB_TOOL) CDE-PRG ../../.. - -configShlibs:: $(DATABASE_DIR)/CDE-SHLIBS.udb - $(UDB_TOOL) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-SHLIBS.udb > CDE-SHLIBS.lst - $(BUILD_UDB_TOOL) CDE-SHLIBS ../../.. +DoUDB_SCRIPT3(configHelp,CDE-HELP-C,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configHelpPrg,CDE-HELP-PRG,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configDemos,CDE-DEMOS,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configFonts,CDE-FONTS,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configHelpRun,CDE-HELP-RUN,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configIcons,CDE-ICONS,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configInc,CDE-INC,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configManDev,CDE-MAN-DEV,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configMan,CDE-MAN,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configMsgCat,CDE-MSG-C,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configPrg,CDE-PRG,$(UDB_TOOL),$(BUILD_UDB_TOOL)) +DoUDB_SCRIPT3(configShlibs,CDE-SHLIBS,$(UDB_TOOL),$(BUILD_UDB_TOOL)) + LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ @@ -125,7 +79,6 @@ LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ CppSourceFile(configHelp,configHelp.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(configHelpPrg,configHelpPrg.src,$(LOCAL_CPP_DEFINES),) - CppSourceFile(configDemos,configDemos.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(configFonts,configFonts.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(configHelpRun,configHelpRun.src,$(LOCAL_CPP_DEFINES),) diff --git a/cde/admin/IntegTools/post_install/freebsd/Imakefile b/cde/admin/IntegTools/post_install/freebsd/Imakefile index 7bf6c550..d4e78934 100644 --- a/cde/admin/IntegTools/post_install/freebsd/Imakefile +++ b/cde/admin/IntegTools/post_install/freebsd/Imakefile @@ -28,27 +28,14 @@ PLATFORM = uxp UDBTOANY = $(KORNSHELL) $(TOOL_DIR)/udbToAny.ksh BUILD_UDB_LIST = $(SHELL) ../build_udb_list -all:: - -configMin:: $(DATABASE_DIR)/CDE-MIN.udb - $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-MIN.udb > CDE-MIN.lst - $(BUILD_UDB_LIST) CDE-MIN ../../../.. -configTT:: $(DATABASE_DIR)/CDE-TT.udb - $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-TT.udb > CDE-TT.lst - $(BUILD_UDB_LIST) CDE-TT ../../../.. +all:: -configRun:: $(DATABASE_DIR)/CDE-RUN.udb - $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-RUN.udb > CDE-RUN.lst - $(BUILD_UDB_LIST) CDE-RUN ../../../.. +DoUDB_SCRIPT4(configMin,CDE-MIN,$(UDBTOANY),$(BUILD_UDB_LIST)) +DoUDB_SCRIPT4(configTT,CDE-TT,$(UDBTOANY),$(BUILD_UDB_LIST)) +DoUDB_SCRIPT4(configRun,CDE-RUN,$(UDBTOANY),$(BUILD_UDB_LIST)) +DoUDB_SCRIPT4(configShlibs,CDE-SHLIBS,$(UDBTOANY),$(BUILD_UDB_LIST)) -configShlibs:: $(DATABASE_DIR)/CDE-SHLIBS.udb - $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \ - $(DATABASE_DIR)/CDE-SHLIBS.udb > CDE-SHLIBS.lst - $(BUILD_UDB_LIST) CDE-SHLIBS ../../../.. LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ diff --git a/cde/config/cf/DtInfo.rules b/cde/config/cf/DtInfo.rules index 227df689..e6a120e6 100644 --- a/cde/config/cf/DtInfo.rules +++ b/cde/config/cf/DtInfo.rules @@ -40,26 +40,26 @@ XCOMM $TOG: DtInfo.rules /main/21 1997/09/05 11:31:01 samborn $ # define makelibT(libname) @@\ makelib(libname) @@\ @@\ -libname/lib/**/libname/**/T.a: FRC @@\ +Concat3(libname/lib,libname,T.a): FRC @@\ @(cd libname ; \ @@\ - echo "### Making lib libname Templates ###" ; \ @@\ - $(MAKE) lib/**/libname/**/T.a ; \ @@\ + echo STR(*** Making lib libname Templates ***) ; \ @@\ + $(MAKE) Concat3(lib,libname,T.a) ; \ @@\ ) # define makelibsubsubdir(subdir,libname) @@\ @@\ -subdir/libname/lib/**/libname.a: FRC @@\ +Concat(subdir/libname/lib,libname.a): FRC @@\ @(cd subdir ; \ @@\ - echo "### Making lib libname ###" ; \ @@\ - $(MAKE) libname/lib/**/libname.a ; \ @@\ + echo STR(*** Making lib libname ***) ; \ @@\ + $(MAKE) Concat(libname/lib,libname.a) ; \ @@\ ) # define makelibTsubsubdir(subdir,libname) @@\ @@\ -subdir/libname/lib/**/libname/**/T.a: FRC @@\ +Concat3(subdir/libname/lib,libname,T.a): FRC @@\ @(cd subdir ; \ @@\ - echo "### Making lib libname Templates ###" ; \ @@\ - $(MAKE) libname/lib/**/libname/**/T.a ; \ @@\ + echo STR(*** Making lib libname Templates ***) ; \ @@\ + $(MAKE) Concat3(libname/lib,libname,T.a) ; \ @@\ ) #else /* not defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 */ # define makelibT(libname) @@\ @@ -70,28 +70,28 @@ subdir/libname/lib/**/libname/**/T.a: FRC @@\ makelibd(libname,) #define makelibd(libname, deps) @@\ -libname/lib/**/libname.a: deps FRC @@\ +Concat(libname/lib,libname.a): deps FRC @@\ @(cd libname; \ @@\ - echo "### Making lib libname ###" ; \ @@\ - $(MAKE) lib/**/libname.a ; \ @@\ - if [ -d "$(TEMPLATE_DB)" ]; then \ @@\ - $(MAKE) lib/**/libname/**/T.a ; \ @@\ - fi \ @@\ + echo STR(*** Making lib libname ***) ; \ @@\ + $(MAKE) Concat(lib,libname.a) ; \ @@\ + if [ -d "$(TEMPLATE_DB)" ]; then \ @@\ + $(MAKE) Concat3(lib,libname,T.a) ; \ @@\ + fi \ @@\ ) @@\ libname/libname.d: libname/Classlist.mk @@\ @(cd libname; \ @@\ - echo "### Making dfiles in libname ###" ; \ @@\ - $(MAKE) libname.d ;\ @@\ + echo STR(*** Making dfiles in libname ***) ; \ @@\ + $(MAKE) libname.d ;\ @@\ ) @@\ libname/libname.h: libname/Classlist.mk @@\ @(cd libname; \ @@\ - echo "### Making dfiles in libname ###" ; \ @@\ - $(MAKE) libname.h ;\ @@\ + echo STR(*** Making dfiles in libname ***) ; \ @@\ + $(MAKE) libname.h ;\ @@\ ) @@\ libname/libname.msg: libname/Classlist.mk @@\ @(cd libname; \ @@\ - echo "### Making msgs in libname ###" ; \ @@\ - $(MAKE) libname.msg ;\ @@\ + echo STR(*** Making msgs in libname ***) ; \ @@\ + $(MAKE) libname.msg ;\ @@\ ) @@\ @@\ FRC: @@\ @@ -149,7 +149,7 @@ AllTarget(Concat(lib,libname.a)) @@\ @@\ Concat(lib,libname.a): objlist @@\ $(RM) $@ @@\ - @echo "### Making SimpleLibrary libname.a" @@\ + @echo STR(*** Making SimpleLibrary libname.a) @@\ $(LD) -r -o $@ objlist @@ -157,11 +157,11 @@ Concat(lib,libname.a): objlist @@\ #define SimpleLibraryT(libname,objlist,libdir) @@\ SimpleLibrary(libname,objlist,libdir) @@\ @@\ -AllTarget(Concat(lib,libname/**/T.a)) @@\ +AllTarget(Concat3(lib,libname,T.a)) @@\ @@\ -Concat(lib,libname/**/T.a): @@\ +Concat3(lib,libname,T.a): @@\ $(RM) $@ @@\ - @echo "### Making SimpleLibraryT libname Templates" @@\ + @echo STR(*** Making SimpleLibraryT libname Templates) @@\ find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\ @@\ clean:: @@\ @@ -170,11 +170,11 @@ clean:: @@\ #define SimpleLibraryT(libname,objlist,libdir) @@\ SimpleLibrary(libname,objlist,libdir) @@\ @@\ -AllTarget(Concat(lib,libname/**/T.a)) @@\ +AllTarget(Concat3(lib,libname,T.a)) @@\ @@\ -Concat(lib,libname/**/T.a): TemplateObjs @@\ +Concat3(lib,libname,T.a): TemplateObjs @@\ $(RM) $@ @@\ - @echo "### Making SimpleLibraryT libname Templates" @@\ + @echo STR(*** Making SimpleLibraryT libname Templates) @@\ $(AR) $@ TemplateObjs @@\ @@\ clean:: @@\ @@ -186,7 +186,7 @@ AllTarget(Concat(lib,libname.a)) @@\ @@\ Concat(lib,libname.a): objlist @@\ $(RM) $@ @@\ - @echo "### Making RealLibrary libname.a" @@\ + @echo STR(*** Making RealLibrary libname.a) @@\ ar cq $@ objlist @@\ RanLibrary($@) @@ -195,18 +195,18 @@ AllTarget(Concat(lib,libname.a)) @@\ @@\ Concat(lib,libname.a): objlist otherdeps @@\ $(RM) $@ @@\ - @echo "### Making NotSoSimpleLibrary libname.a" @@\ + @echo STR(*** Making NotSoSimpleLibrary libname.a) @@\ $(LD) -r -o $@ objlist #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\ NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\ @@\ -AllTarget(Concat(lib,libname/**/T.a)) @@\ +AllTarget(Concat3(lib,libname,T.a)) @@\ @@\ -Concat(lib,libname/**/T.a): @@\ +Concat3(lib,libname,T.a): @@\ $(RM) $@ @@\ - @echo "### Making NotSoSimpleLibraryT libname Templates"@@\ + @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\ find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\ @@\ clean:: @@\ @@ -215,11 +215,11 @@ clean:: @@\ #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\ NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\ @@\ -AllTarget(Concat(lib,libname/**/T.a)) @@\ +AllTarget(Concat3(lib,libname,T.a)) @@\ @@\ -Concat(lib,libname/**/T.a): @@\ +Concat3(lib,libname,T.a): @@\ $(RM) $@ @@\ - @echo "### Making NotSoSimpleLibraryT libname Templates"@@\ + @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\ $(AR) $@ TemplateObjs @@\ @@\ clean:: @@\ diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index 5a9f2ae6..2ef9ba0e 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -15,20 +15,33 @@ XCOMM platform: $TOG: FreeBSD.cf /main/21 1997/10/05 20:42:34 kaleb $ #ifndef OSTeenyVersion #define OSTeenyVersion DefaultOSTeenyVersion #endif -XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion) +XCOMM operating system: OSName (OSMajorVersion/**/./**/OSMinorVersion/**/./**/OSTeenyVersion) #define HasPutenv YES #define HasBSD44Sockets YES #define HasZlib YES +#if OSMajorVersion >= 10 && defined(UseGcc) +USE_GCC = UseGcc +#endif + #ifndef CppCmd -#if OSMajorVersion >= 5 -#define CppCmd /usr/bin/cpp -traditional -#define PreProcessCmd /usr/bin/cpp -traditional +#if OSMajorVersion >= 10 && defined(UseGcc) +# define CppCmd /usr/local/bin/cpp$(USE_GCC) #else -#define CppCmd /usr/libexec/cpp -traditional -#define PreProcessCmd /usr/libexec/cpp -traditional +# define CppCmd /usr/bin/cpp +#endif #endif +#define PreProcessCmd CppCmd + +#if OSMajorVersion >= 10 +#define CppArgs -Wno-invalid-pp-token +#else +#define CppArgs /**/ +#endif + +#ifndef StandardCppDefines +#define StandardCppDefines -traditional CppArgs #endif #undef InstallCmd @@ -71,19 +84,33 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #define MkdirHierCmd mkdir -p #ifndef CcCmd -#define CcCmd gcc +#if OSMajorVersion >= 10 +# if defined(UseGcc) +# define CcCmd /usr/local/bin/gcc$(USE_GCC) +# define CplusplusCmd /usr/local/bin/g++$(USE_GCC) +# else +# define CcCmd cc +# define CplusplusCmd c++ +# endif +#else +# define CcCmd gcc +# define CplusplusCmd g++ +#endif +#endif + #ifndef DefaultCCOptions #define DefaultCCOptions -pipe #endif -#endif +#ifndef CplusplusLibC #define CplusplusLibC -lstdc++ +#endif #if OSMajorVersion > 1 #define ServerOSDefines XFree86ServerOSDefines -DDDXTIME #define XawI18nDefines -DUSE_XWCHAR_STRING #define HasMakefileSafeInclude YES -#define IncludeMakefile(file) @@# dependencies are in .depend +#define IncludeMakefile(file) HASH_SIGN dependencies are in .depend #define DependFileName .depend #if OSMajorVersion < 3 #if OSMinorVersion < 2 @@ -148,7 +175,7 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #endif #ifndef OptimizedCDebugFlags -# ifdef i386Architecture +# if defined(i386Architecture) || defined(AMD64Architecture) # define OptimizedCDebugFlags DefaultGcc2i386Opt # else # define OptimizedCDebugFlags -O2 -fno-strict-aliasing @@ -156,11 +183,16 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #endif #ifdef HasGcc2 -CXXDEPENDINCLUDE != CppCmd -x c++ -Wp,-v < /dev/null \ - 2>&1 | sed -n 's/ \(.*[cg]++.*\)/-I\1/p' +CXXDEPENDINCLUDE != CcCmd -v -x c++ /dev/null -fsyntax-only \ + 2>&1 | sed -n 's/^ \(\/.*[cg]++.*\)/-I\1/p' #define CplusplusDependIncludes $(CXXDEPENDINCLUDE) #endif +/* beginning with svn version 254273 iconv functions are moved to libc */ +#if (OSMajorVersion >= 10) +ICONVSYSLIB != if test -f /usr/local/include/iconv.h; then echo -liconv; else echo; fi +#endif + #define ServerExtraDefines GccGasOption XFree86ServerDefines #define StandardDefines -DCSRG_BASED diff --git a/cde/config/cf/Imake.rules b/cde/config/cf/Imake.rules index 6fa1ecc8..7fd43030 100644 --- a/cde/config/cf/Imake.rules +++ b/cde/config/cf/Imake.rules @@ -162,6 +162,9 @@ XCOMM rules: $TOG: Imake.rules /main/227 1998/02/02 12:07:57 kaleb $ * CppSourceFile (dst,src,defs,deplist) * MakeDirectories (step,dirs) * AllTarget (depends) + * MakeImakeDir () + * DoUDB_SCRIPT3 (target, file, script, build) + * DoUDB_SCRIPT4 (target, file, script, build) * * * The following are in specific Lib.rules: @@ -175,6 +178,16 @@ XCOMM rules: $TOG: Imake.rules /main/227 1998/02/02 12:07:57 kaleb $ #define NullParameter +/* stringify macro */ +#ifndef STR +# if defined(__llvm__) +# define STR2(x) #x +# else +# define STR2(x) "x" +# endif +#define STR(x) STR2(x) +#endif + /* if [ -d ] or [ ! -d ] causes make to fail, define this as - */ #ifndef DirFailPrefix #define DirFailPrefix @@ -210,7 +223,7 @@ XCOMM special target for clearmake @@\ * Concat - concatenates two strings. */ #ifndef Concat -#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) +#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) #define Concat(a,b)a##b #else #define Concat(a,b)a/**/b @@ -221,7 +234,7 @@ XCOMM special target for clearmake @@\ * Concat3 - concatenates three strings. */ #ifndef Concat3 -#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) +#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) #define Concat3(a,b,c)a##b##c #else #define Concat3(a,b,c)a/**/b/**/c @@ -232,7 +245,7 @@ XCOMM special target for clearmake @@\ * Concat4 - concatenates four strings. */ #ifndef Concat4 -#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) +#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) #define Concat4(a,b,c,d)a##b##c##d #else #define Concat4(a,b,c,d)a/**/b/**/c/**/d @@ -262,7 +275,7 @@ XCOMM special target for clearmake @@\ * exists to avoid problems with some preprocessors */ #ifndef _XUseCat -# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) +# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) # if defined(UseInstalled) || UseInstalledX11 # define _XUseCat(a,b,c) a##c # else @@ -2486,6 +2499,44 @@ step:: @@\ all:: depends #endif /* AllTarget */ + +/* + * MakeImakeDir - call make in imake directory. + */ +#ifndef MakeImakeDir +#define MakeImakeDir() cd $(IMAKESRC) && \ @@\ + if [ -f Makefile ]; then \ @@\ + $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\ + else \ @@\ + $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\ + fi +#endif /* MakeImakeDir */ + + +/* + * DoUDB_SCRIPT3 - macro for creation of udb scripts for installation + */ +#ifndef DoUDB_SCRIPT3 +#define DoUDB_SCRIPT3(target, file, script, build) @@\ +target:: $(DATABASE_DIR)/file.udb @@\ + script -toLst -ReleaseStream $(PLATFORM) \ @@\ + $(DATABASE_DIR)/file.udb > file.lst @@\ + build file ../../.. +#endif + + +/* + * DoUDB_SCRIPT4 - macro for creation of udb scripts for installation + */ +#ifndef DoUDB_SCRIPT4 +#define DoUDB_SCRIPT4(target, file, script, build) @@\ +target:: $(DATABASE_DIR)/file.udb @@\ + script -toLst -ReleaseStream $(PLATFORM) \ @@\ + $(DATABASE_DIR)/file.udb > file.lst @@\ + build file ../../../.. +#endif + + #ifdef DefineOldLibraryRules #include #endif diff --git a/cde/config/cf/Imake.tmpl b/cde/config/cf/Imake.tmpl index bf0ca77d..71834124 100644 --- a/cde/config/cf/Imake.tmpl +++ b/cde/config/cf/Imake.tmpl @@ -22,6 +22,8 @@ XCOMM #define YES 1 #define NO 0 +#define HASH_SIGN # + /* Ensure that "all" is the default target in the Makefile. */ all:: diff --git a/cde/config/cf/Motif.tmpl b/cde/config/cf/Motif.tmpl index caa556d7..94de516d 100644 --- a/cde/config/cf/Motif.tmpl +++ b/cde/config/cf/Motif.tmpl @@ -57,7 +57,7 @@ XCOMM $TOG: Motif.tmpl /main/6 1999/05/19 17:00:05 mgreess $ #endif #ifndef _MUseCat -# if (defined(__STDC__) && !defined(UnixCpp)) || defined(AnsiCpp) +# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) # if UseInstalledMotif # define _MUseCat(a,b,c) a##c # else diff --git a/cde/config/cf/NetBSD.cf b/cde/config/cf/NetBSD.cf index 2642049c..1379dfa1 100644 --- a/cde/config/cf/NetBSD.cf +++ b/cde/config/cf/NetBSD.cf @@ -305,6 +305,10 @@ CXXDEPENDINCLUDE != CppCmd -x c++ -Wp,-v < /dev/null \ # define SharedDtSvcReqs $(LDPRELIBS) SharedXReqs $(CXXLIB) -Wl,-rpath,$(USRLIBDIRPATH) #endif +#ifndef SharedDtHelpReqs +# define SharedDtHelpReqs $(LDPRELIBS) $(ICONVSYSLIB) SharedXReqs -Wl,-rpath,$(USRLIBDIRPATH) +#endif + #ifndef SharedCsaReqs # define SharedCsaReqs -lXt $(LDPOSTLIBS) -Wl,-rpath,$(USRLIBDIRPATH) #endif diff --git a/cde/config/cf/bsdLib.tmpl b/cde/config/cf/bsdLib.tmpl index 29ff0d65..788208ae 100644 --- a/cde/config/cf/bsdLib.tmpl +++ b/cde/config/cf/bsdLib.tmpl @@ -30,6 +30,10 @@ XCOMM $XConsortium: bsdLib.tmpl /main/3 1996/09/28 16:09:25 rws $ # define SharedDtSvcReqs $(LDPRELIBS) SharedXReqs $(CXXLIB) #endif +#ifndef SharedDtHelpReqs +# define SharedDtHelpReqs $(LDPRELIBS) $(ICONVSYSLIB) SharedXReqs +#endif + #ifndef SharedCsaReqs # define SharedCsaReqs -lXt $(LDPOSTLIBS) #endif diff --git a/cde/config/cf/cde.tmpl b/cde/config/cf/cde.tmpl index 689f4853..197c4972 100644 --- a/cde/config/cf/cde.tmpl +++ b/cde/config/cf/cde.tmpl @@ -12,7 +12,7 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $ #endif #ifndef _CUseCat -# if (defined(__STDC__) && !defined(UnixCpp)) || defined(AnsiCpp) +# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__) # if UseInstalledCDE # define _CUseCat(a,b,c) a##c # else diff --git a/cde/config/imake/imakemdep.h b/cde/config/imake/imakemdep.h index 3267e21e..44c5eb05 100644 --- a/cde/config/imake/imakemdep.h +++ b/cde/config/imake/imakemdep.h @@ -227,7 +227,7 @@ in this Software without prior written authorization from The Open Group. * all colons). One way to tell if you need this is to see whether or not * your Makefiles have no tabs in them and lots of @@ strings. */ -#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE)) +#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || defined(__llvm__) || (defined(AMOEBA) && defined(CROSS_COMPILE)) #define FIXUP_CPP_WHITESPACE #endif #ifdef WIN32 @@ -275,6 +275,9 @@ in this Software without prior written authorization from The Open Group. || (defined(__FreeBSD__) && defined(CPP_IN_LIBEXEC)) #define DEFAULT_CPP "/usr/libexec/cpp" #endif +#if defined(__FreeBSD__) && (__FreeBSD__ >= 10) && !defined(__llvm__) +#undef DEFAULT_CPP +#endif #if defined(__sgi) && defined(__ANSI_CPP__) #define USE_CC_E #endif @@ -354,6 +357,11 @@ char *cpp_argv[ARGUMENTS] = { # ifdef __GNUC__ "-traditional", # endif +# ifdef __llvm__ + "-fms-extensions", + "-Wno-invalid-token-paste", + "-Wno-invalid-pp-token", +# endif #endif #ifdef M4330 @@ -643,12 +651,18 @@ char *cpp_argv[ARGUMENTS] = { # define DEFAULT_OS_MAJOR_REV "v V%[0-9]" # define DEFAULT_OS_MINOR_REV "v V%*dL%[0-9]" # define DEFAULT_OS_NAME "srvm %[^\n]" -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) +/* uname -r returns "x.y[.z]-mumble", e.g. "9.0-RELEASE" or "11.0-CURRENT" */ +# define DEFAULT_OS_MAJOR_REV "r %[0-9]" +# define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" +# define DEFAULT_OS_TEENY_REV "v %*s %*s %*s r%[0-9]" +# define DEFAULT_OS_NAME "srm %[^\n]" +#elif defined(__NetBSD__) /* 386BSD, and BSD/OS too? */ /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */ # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" -# define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]" +# define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]" # define DEFAULT_OS_NAME "srm %[^\n]" #elif defined(__OpenBSD__) # define DEFAULT_OS_MAJOR_REV "r %[0-9]" @@ -747,9 +761,12 @@ struct symtab predefs[] = { #ifdef mc68020 {"mc68020", "1"}, #endif -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(linux) {"__GNUC__", DEF_STRINGIFY(__GNUC__)}, #endif +#ifdef __GNUC_MINOR__ + {"__GNUC_MINOR__", DEF_STRINGIFY(__GNUC_MINOR__)}, +#endif #if __STDC__ {"__STDC__", "1"}, #endif diff --git a/cde/config/makedepend/cppsetup.c b/cde/config/makedepend/cppsetup.c index c6bf411a..3b281641 100644 --- a/cde/config/makedepend/cppsetup.c +++ b/cde/config/makedepend/cppsetup.c @@ -216,6 +216,7 @@ my_eval_variable (ip, var, len) const char *var; int len; { + long val; struct symtab **s; s = lookup_variable (ip, var, len); @@ -223,12 +224,14 @@ my_eval_variable (ip, var, len) return 0; do { var = (*s)->s_value; - if (!isvarfirstletter(*var)) + if (!isvarfirstletter(*var) || !strcmp((*s)->s_name, var)) break; s = lookup_variable (ip, var, strlen(var)); } while (s); - return strtol(var, NULL, 0); + var = ParseIfExpression(ip, var, &val); + if (var && *var) debug(4, ("extraneous: '%s'\n", var)); + return val; } diff --git a/cde/config/makedepend/ifparser.c b/cde/config/makedepend/ifparser.c index 44f54f48..9bec2d5a 100644 --- a/cde/config/makedepend/ifparser.c +++ b/cde/config/makedepend/ifparser.c @@ -81,6 +81,7 @@ #include "ifparser.h" #include +#include /**************************************************************************** Internal Macros and Utilities for Parser @@ -116,19 +117,48 @@ parse_number (g, cp, valp) const char *cp; long *valp; { + long base = 10; SKIPSPACE (cp); if (!isdigit(*cp)) return CALLFUNC(g, handle_error) (g, cp, "number"); - *valp = strtol(cp, &cp, 0); - /* skip trailing qualifiers */ + *valp = 0; + + if (*cp == '0') { + cp++; + if ((*cp == 'x') || (*cp == 'X')) { + base = 16; + cp++; + } else { + base = 8; + } + } + + /* Ignore overflows and assume ASCII, what source is usually written in */ + while (1) { + int increment = -1; + if (base == 8) { + if ((*cp >= '0') && (*cp <= '7')) + increment = *cp++ - '0'; + } else if (base == 16) { + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + else if ((*cp >= 'A') && (*cp <= 'F')) + increment = *cp++ - ('A' - 10); + else if ((*cp >= 'a') && (*cp <= 'f')) + increment = *cp++ - ('a' - 10); + } else { /* Decimal */ + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + } + if (increment < 0) + break; + *valp = (*valp * base) + increment; + } + + /* Skip trailing qualifiers */ while (*cp == 'U' || *cp == 'u' || *cp == 'L' || *cp == 'l') cp++; -#if 0 - *valp = atoi (cp); - /* EMPTY */ - for (cp++; isdigit(*cp); cp++) ; -#endif return cp; } @@ -272,7 +302,10 @@ parse_product (g, cp, valp) case '/': DO (cp = parse_product (g, cp + 1, &rightval)); - *valp = (*valp / rightval); + if (rightval) + *valp = (*valp / rightval); + else + *valp = LONG_MAX; break; case '%': diff --git a/cde/config/makedepend/main.c b/cde/config/makedepend/main.c index ae67ecbd..a28f2a54 100644 --- a/cde/config/makedepend/main.c +++ b/cde/config/makedepend/main.c @@ -255,6 +255,17 @@ main(argc, argv) argc--; } break; + case 'i': + if (strncmp(argv[0]+2, "system", 6) == 0) { + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = argv[0]+8; + if (**(incp-1) == '\0') { + *(incp-1) = *(++argv); + argc--; + } + } + break; case 'Y': defincdir = argv[0]+2; break; diff --git a/cde/config/makedepend/parse.c b/cde/config/makedepend/parse.c index 07153bee..942d1722 100644 --- a/cde/config/makedepend/parse.c +++ b/cde/config/makedepend/parse.c @@ -110,7 +110,7 @@ int deftype (line, filep, file_red, file, parse_it) int parse_it; { register char *p; - char *directive, savechar; + char *directive, savechar, *q; register int ret; /* @@ -167,6 +167,11 @@ int deftype (line, filep, file_red, file, parse_it) */ while (*p == ' ' || *p == '\t') p++; + q = p + strlen(p); + do { + q--; + } while (*q == ' ' || *q == '\t'); + q[1] = '\0'; switch (ret) { case IF: /* @@ -227,7 +232,7 @@ int deftype (line, filep, file_red, file, parse_it) /* * copy the definition back to the beginning of the line. */ - strcpy (line, p); + memmove (line, p, strlen(p) + 1); break; case ELSE: case ENDIF: diff --git a/cde/databases/Imakefile b/cde/databases/Imakefile index d7403a09..bb3f8e29 100644 --- a/cde/databases/Imakefile +++ b/cde/databases/Imakefile @@ -41,8 +41,9 @@ UDB_RELEASE_OPT = -ReleaseStream netbsd * Insure that symbols used in the .udb files are undefined for * pre-processing by cpp. */ -#ifdef RsArchitecture -/* AIX cpp rejects "hp-ux" as an invalid sub-option. */ +#if defined(LinuxArchitecture) || defined(BSDArchitecture) || \ + defined(RsArchitecture) +/* cpp of some systems reject "hp-ux" as an invalid sub-option. */ UDB_CPP_UNDEF_LIST = -UhpV4 -Uhpux -Uaix -Usun -Uusl -Udec -Uuxp -Uunix #else UDB_CPP_UNDEF_LIST = -UhpV4 -Uhpux -Uhp-ux -Uaix -Usun -Uusl -Udec -Uuxp -Uunix -Ulinux -Uopenbsd -Ufreebsd -Unetbsd @@ -56,10 +57,12 @@ clean:: @@\ Concat3(CDE-,Locale,.udb):: ResDB @@\ @echo Building readablename Resources database file. @@\ @rm -f $@ @@\ - @echo sed -e 's/%_LANG_%/Lang/g' -e 's/%_ALT_LANG_%/AltLang/g' \@@\ - -e 's/%_FILENAME_%/runfs/g' ResDB @@\ - @sed -e 's/%_LANG_%/Lang/g' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/runfs/g' ResDB > $@ @@\ + @echo $(SED) -e STR(s/%_LANG_%/Lang/g) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/runfs/g) ResDB @@\ + @$(SED) -e STR(s/%_LANG_%/Lang/g) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/runfs/g) ResDB > $@ @@\ @@\ clean:: @@\ $(RM) Concat3(CDE-HELP-,Locale,.udb) @@\ @@ -67,10 +70,12 @@ clean:: @@\ CDE-HELP-Locale.udb:: HelpDB @@\ @echo Building readablename Help database file. @@\ @rm -f $@ @@\ - @echo sed -e 's/%_LANG_%/HelpLang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/helpfs/g' HelpDB @@\ - @sed -e 's/%_LANG_%/HelpLang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/helpfs/g' HelpDB > $@ @@\ + @echo $(SED) -e STR(s/%_LANG_%/HelpLang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/helpfs/g) HelpDB @@\ + @$(SED) -e STR(s/%_LANG_%/HelpLang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/helpfs/g) HelpDB > $@ @@\ @@\ clean:: @@\ $(RM) Concat3(CDE-MSG-,Locale,.udb) @@\ @@ -78,10 +83,12 @@ clean:: @@\ CDE-MSG-Locale.udb:: MsgDB @@\ @echo Building readablename Message catalog database file. @@\ @rm -f $@ @@\ - @echo sed -e 's/%_LANG_%/Lang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/msgfs/g' MsgDB @@\ - @sed -e 's/%_LANG_%/Lang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/msgfs/g' MsgDB > $@ @@\ + @echo $(SED) -e STR(s/%_LANG_%/Lang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/msgfs/g) MsgDB @@\ + @$(SED) -e STR(s/%_LANG_%/Lang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/msgfs/g) MsgDB > $@ @@\ @@\ clean:: @@\ $(RM) Concat3(CDE-INFOLIB-,Locale,.udb) @@\ @@ -89,10 +96,12 @@ clean:: @@\ CDE-INFOLIB-Locale.udb:: InfoDB @@\ @echo Building readablename Infolib catalog database file. @@\ @rm -f $@ @@\ - @echo sed -e 's/%_LANG_%/Lang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/msgfs/g' InfoDB @@\ - @sed -e 's/%_LANG_%/Lang/' -e 's/%_ALT_LANG_%/AltLang/g' \ @@\ - -e 's/%_FILENAME_%/msgfs/g' InfoDB > $@ + @echo $(SED) -e STR(s/%_LANG_%/Lang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/msgfs/g) InfoDB @@\ + @$(SED) -e STR(s/%_LANG_%/Lang/) \ @@\ + -e STR(s/%_ALT_LANG_%/AltLang/g) \ @@\ + -e STR(s/%_FILENAME_%/msgfs/g) InfoDB > $@ .SUFFIXES: .db .udb diff --git a/cde/include/EUSCompat.h b/cde/include/EUSCompat.h index 3d85398a..130f0a19 100644 --- a/cde/include/EUSCompat.h +++ b/cde/include/EUSCompat.h @@ -114,11 +114,13 @@ typedef enum {B_FALSE, B_TRUE} boolean_t; typedef enum {B_FALSE, B_TRUE} boolean_t; #define MAXNAMELEN 256 +#if !defined(__FreeBSD__) #define iconv_t int #define iconv_open(a, b) ((iconv_t) -1) #define iconv(a, b, c, d, e) ((size_t) 0) #define iconv_close(a) (0) -#endif /* linux */ +#endif +#endif /* diff --git a/cde/lib/DtHelp/il/ilX.c b/cde/lib/DtHelp/il/ilX.c index 315cf682..a3859b41 100644 --- a/cde/lib/DtHelp/il/ilX.c +++ b/cde/lib/DtHelp/il/ilX.c @@ -914,12 +914,12 @@ int scaledX, scaledY ; nSrcLines = *pNLines; if (nSrcLines <= 0) - return; /* no lines, EXIT */ + return 0; /* no lines, EXIT */ pPriv = (ilXPrivPtr)pData->pPrivate; pSrcImage = pData->pSrcImage; width = pSrcImage->width; if (width <= 0) - return; /* no width, EXIT */ + return 0; /* no width, EXIT */ srcRowBytes = pSrcImage->plane[0].nBytesPerRow; pSrcLine = (ilPtr)(pSrcImage->plane[0].pPixels + pData->srcLine * srcRowBytes); diff --git a/cde/lib/DtHelp/il/ilbigray.c b/cde/lib/DtHelp/il/ilbigray.c index ae0bbcd5..4a06c455 100644 --- a/cde/lib/DtHelp/il/ilbigray.c +++ b/cde/lib/DtHelp/il/ilbigray.c @@ -242,7 +242,7 @@ register int shift, bitNumber; nLines = *pNLines; if (nLines <= 0) - return; /* no lines, EXIT */ + return 0; /* no lines, EXIT */ if (pPriv->srcBufferHeight) bottomLine = pPriv->srcBufferHeight - 1; else bottomLine = pData->srcLine + nLines - 1; diff --git a/cde/lib/DtHelp/il/ilimage.c b/cde/lib/DtHelp/il/ilimage.c index 357b106c..42dda23a 100644 --- a/cde/lib/DtHelp/il/ilimage.c +++ b/cde/lib/DtHelp/il/ilimage.c @@ -619,11 +619,11 @@ register ilImagePtr pImage; pImage = (ilImagePtr)image; if (mustBeZero != 0) { pImage->o.p.context->error = IL_ERROR_PAR_NOT_ZERO; - return; /* EXIT */ + return 0; /* EXIT */ } if (pImage->o.p.objectType != IL_INTERNAL_IMAGE) { pImage->o.p.context->error = IL_ERROR_OBJECT_TYPE; - return; /* EXIT */ + return 0; /* EXIT */ } pImage->o.p.context->error = IL_OK; diff --git a/cde/lib/DtHelp/il/ilinvert.c b/cde/lib/DtHelp/il/ilinvert.c index 0a1c092c..f36bd856 100644 --- a/cde/lib/DtHelp/il/ilinvert.c +++ b/cde/lib/DtHelp/il/ilinvert.c @@ -106,10 +106,10 @@ register long nLines, nPixels; dstnbytes = pPriv->dstRowBytes; pdstline = pPriv->pDstPixels + dstLine * dstnbytes; - if (pPriv->nPixels < 0) return; + if (pPriv->nPixels < 0) return 0; nLines = *pNLines; - if (nLines <= 0) return; + if (nLines <= 0) return 0; while ( nLines-- > 0 ) { psrc = psrcline; diff --git a/cde/lib/DtHelp/il/ilmap.c b/cde/lib/DtHelp/il/ilmap.c index fc0301aa..c62c445b 100644 --- a/cde/lib/DtHelp/il/ilmap.c +++ b/cde/lib/DtHelp/il/ilmap.c @@ -86,11 +86,11 @@ register ilPtr pSrc, pDst, pTranslate; pPriv = (ilMapPrivPtr)pData->pPrivate; nRowsM1 = pPriv->width; if (nRowsM1 <= 0) - return; + return 0; nRowsM1--; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; srcRowBytes = pPriv->srcRowBytes; @@ -135,11 +135,11 @@ register ilPtr pSrc, pDst, pTranslate; pPriv = (ilMapPrivPtr)pData->pPrivate; nRowsM1 = pPriv->width; if (nRowsM1 <= 0) - return; + return 0; nRowsM1--; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; srcRowBytes = pPriv->srcRowBytes; diff --git a/cde/lib/DtHelp/il/ilpalette.c b/cde/lib/DtHelp/il/ilpalette.c index 083e883d..46982c48 100644 --- a/cde/lib/DtHelp/il/ilpalette.c +++ b/cde/lib/DtHelp/il/ilpalette.c @@ -159,10 +159,10 @@ register long nLinesM1, nPixelsM1Temp; nPixelsM1 = pPriv->nPixelsM1; if (nPixelsM1 < 0) - return; + return 0; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; /* For each src byte: get a long from the cvt'd palette table, then take diff --git a/cde/lib/DtHelp/il/iltruegray.c b/cde/lib/DtHelp/il/iltruegray.c index b0004cd1..1cefa128 100644 --- a/cde/lib/DtHelp/il/iltruegray.c +++ b/cde/lib/DtHelp/il/iltruegray.c @@ -141,10 +141,10 @@ register INT32 i; dstnbytes = pPriv->dstRowBytes; pdstline = pPriv->pDstPixels + dstLine * dstnbytes; - if (pPriv->nPixels < 0) return; + if (pPriv->nPixels < 0) return 0; nLines = *pNLines; - if (nLines <= 0) return; + if (nLines <= 0) return 0; while ( nLines-- > 0 ) { diff --git a/cde/lib/DtHelp/il/ilycbcr.c b/cde/lib/DtHelp/il/ilycbcr.c index f940918c..b627bbac 100644 --- a/cde/lib/DtHelp/il/ilycbcr.c +++ b/cde/lib/DtHelp/il/ilycbcr.c @@ -327,11 +327,11 @@ ilImagePlaneInfo *pPlane; /* Set nPixels/LinesM1 to # pixels / lines - 1; exit if either 0. */ nPixelsM1Init = pData->pSrcImage->width; if (nPixelsM1Init <= 0) - return; + return 0; nPixelsM1Init--; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; /* Point pY/Cb/CrLine to 1st line in src planes; pDstLine to 1st line in dst. @@ -420,11 +420,11 @@ ilImagePlaneInfo *pPlane; /* Set nPixels/LinesM1 to # pixels / lines - 1; exit if either 0. */ nPixelsM1Init = pData->pSrcImage->width; if (nPixelsM1Init <= 0) - return; + return 0; nPixelsM1Init--; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; /* Point pY/Cb/CrLine to 1st line in src planes; pDstLine to 1st line in dst. @@ -1161,11 +1161,11 @@ register long R, G, B, pixel; pPriv = (ilRGBToYCbCrPrivPtr)pData->pPrivate; nPixelsM1Init = pData->pSrcImage->width; if (nPixelsM1Init <= 0) - return; + return 0; nPixelsM1Init--; nLinesM1 = *pNLines; if (nLinesM1 <= 0) - return; + return 0; nLinesM1--; /* Point pSrcLine to first line of src RGB (pixel-order) data; point diff --git a/cde/lib/DtPrint/PrintOptions.c b/cde/lib/DtPrint/PrintOptions.c index 948527f0..4a96a336 100644 --- a/cde/lib/DtPrint/PrintOptions.c +++ b/cde/lib/DtPrint/PrintOptions.c @@ -460,7 +460,7 @@ _DtPrintGetHdrFtrData( if (! option) return (void*) NULL; XtVaGetValues(option, XmNuserData, &info, NULL); - if (info == NULL) return; + if (info == NULL) return 0; index = _DtPrintGetHdrFtrIndex(option); return info->specs[index].data; @@ -484,7 +484,7 @@ _DtPrintGetHdrFtrString( if (! option) return (void*) NULL; XtVaGetValues(option, XmNuserData, &info, NULL); - if (info == NULL) return; + if (info == NULL) return 0; index = _DtPrintGetHdrFtrIndex(option); return info->specs[index].string; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimBuffer.c b/cde/lib/DtTerm/TermPrim/TermPrimBuffer.c index 3dda7943..4f992f80 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimBuffer.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimBuffer.c @@ -1025,7 +1025,7 @@ _DtTermPrimBufferInsert _DtTermPrimBufferInsertWc(tb, row, col, (wchar_t *)newChars, numChars, insertFlag, returnChars, returnCount); - return; + return 0; } if (WIDTH(line) < col) diff --git a/cde/lib/DtTerm/TermPrim/TermPrimParser.c b/cde/lib/DtTerm/TermPrim/TermPrimParser.c index 5f4738dc..c1f0b433 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimParser.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimParser.c @@ -121,7 +121,7 @@ _DtTermPrimParse if (*parseChar == debugChar) { ParseTrap(); - return; + return 0; } } } diff --git a/cde/lib/csa/Imakefile b/cde/lib/csa/Imakefile index d64baee2..1fb1e58d 100644 --- a/cde/lib/csa/Imakefile +++ b/cde/lib/csa/Imakefile @@ -105,12 +105,14 @@ rtable3_clnt.c rtable3_xdr.c: rtable3.h namechange1.sed namechange2.sed rtable2_clnt.c rtable2_xdr.c: rtable3.h namechange1.sed namechange2.sed agent_xdr.c agent.c: agent.h +#define RPCGEN rpcgen -h agent.x | $(EXTRASED) \ @@\ + $(SED) -f namechange1.sed | \ @@\ + $(SED) -f namechange2.sed >> agent.h + agent.h: $(RM) $@ cat agent.wrapbegin > agent.h - rpcgen -h agent.x | $(EXTRASED) \ - sed -f namechange1.sed | \ - sed -f namechange2.sed >> agent.h + RPCGEN cat agent.wrapend >> agent.h .SUFFIXES: .x diff --git a/cde/lib/tt/mini_isam/isdatconv.c b/cde/lib/tt/mini_isam/isdatconv.c index 32ba1696..eacbb6a6 100644 --- a/cde/lib/tt/mini_isam/isdatconv.c +++ b/cde/lib/tt/mini_isam/isdatconv.c @@ -140,7 +140,7 @@ ldchar(src, len, dst) register char *p; if (len <= 0) - return; + return 0; /* Load the entire string. */ memcpy((void *) dst, (const void *) src, len); @@ -165,7 +165,7 @@ stchar(src, dst, len) register char c; if (len <= 0) - return; + return 0; /* Copy up to NULL character. */ do { @@ -190,7 +190,7 @@ ldchar2(src, len, dst) register char *p; if (len <= 0) - return; + return 0; /* Load the entire string. */ memcpy((void *) dst, (const void *) src, len); @@ -206,7 +206,7 @@ stchar2(src, dst, len) register char c; if (len <= 0) - return; + return 0; /* Copy up to a NULL character. */ do { diff --git a/cde/lib/tt/mini_isam/isrepair.c b/cde/lib/tt/mini_isam/isrepair.c index 0d535e76..124a5052 100644 --- a/cde/lib/tt/mini_isam/isrepair.c +++ b/cde/lib/tt/mini_isam/isrepair.c @@ -411,7 +411,7 @@ printkey(n, pkdesc, print) if (pkdesc->k_nparts == 0) { print("%3d: --- NO PRIMARY KEY ---\n", n); - return; + return 0; } if (n == 1) diff --git a/cde/programs/dsdm/proxy.c b/cde/programs/dsdm/proxy.c index ac20864b..3d3c1730 100644 --- a/cde/programs/dsdm/proxy.c +++ b/cde/programs/dsdm/proxy.c @@ -517,7 +517,7 @@ AdvertiseMotifDropSite(dpy, win) XFree(data); } if (motif_receiver) - return; + return 0; #ifdef DEBUG printf("AdvertiseMotifDropSite\n"); diff --git a/cde/programs/dtcm/dtcm/todo.c b/cde/programs/dtcm/dtcm/todo.c index f30386bb..92495713 100644 --- a/cde/programs/dtcm/dtcm/todo.c +++ b/cde/programs/dtcm/dtcm/todo.c @@ -2483,7 +2483,7 @@ todo_insert(Dtcm_appointment *appt, CSA_entry_handle *new_a, Calendar *c) { * occurred. */ _DtTurnOffHourGlass(t->frame); - return; + return 0; case 4: default: /* @@ -2501,7 +2501,7 @@ todo_insert(Dtcm_appointment *appt, CSA_entry_handle *new_a, Calendar *c) { if (stat != CSA_SUCCESS) { _DtTurnOffHourGlass(t->frame); - return; + return 0; } csa_free((CSA_buffer) new_a); diff --git a/cde/programs/dtcm/dtcm/x_graphics.c b/cde/programs/dtcm/dtcm/x_graphics.c index ad850286..9458b6f3 100644 --- a/cde/programs/dtcm/dtcm/x_graphics.c +++ b/cde/programs/dtcm/dtcm/x_graphics.c @@ -1677,7 +1677,7 @@ cm_count_appts(CMGraphicsInfo *gInfo, CSA_entry_handle *list, int a_total, if (stat != CSA_SUCCESS) { free_appt_struct(&appt); - return; + return 0; } skip_appt = B_FALSE; diff --git a/cde/programs/dticon/image.c b/cde/programs/dticon/image.c index 860f64e7..4a013439 100644 --- a/cde/programs/dticon/image.c +++ b/cde/programs/dticon/image.c @@ -486,7 +486,7 @@ Flood_Fill( struct seg stack[MAX], *sp = stack; old_pixel = XGetPixel(color_image, x, y); /* read pv at seed point */ - if (old_pixel==new_pixel || x<0 || x>width || y<0 || y>height) return; + if (old_pixel==new_pixel || x<0 || x>width || y<0 || y>height) return 0; PUSH(y, x, x, 1); /* needed in some cases */ PUSH(y+1, x, x, -1); /* seed segment (popped 1st) */ diff --git a/cde/programs/dticon/utils.c b/cde/programs/dticon/utils.c index dc4e2fa0..30345291 100644 --- a/cde/programs/dticon/utils.c +++ b/cde/programs/dticon/utils.c @@ -1755,7 +1755,7 @@ Select_New_Pen( XmToggleButtonSetState(StaticWid[new_pen], True, False); else XmToggleButtonSetState(DynamicWid[new_pen], True, False); - return; + return 0; } /*** un-set the previous choice ***/ diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/Expression.C b/cde/programs/dtinfo/DtMmdb/StyleSheet/Expression.C index 0668ec00..cd1d8999 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/Expression.C +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/Expression.C @@ -293,6 +293,9 @@ ConstantNode::evaluate() const extern unsigned g_validation_mode; +#if defined(__FreeBSD__) && (__FreeBSD__ >= 10) && !defined(__llvm__) +__attribute__((optimize(0))) +#endif FeatureValue * SgmlAttributeNode::evaluate() const { diff --git a/cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.C b/cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.C index 15dae7df..686e1707 100644 --- a/cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.C +++ b/cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.C @@ -495,11 +495,13 @@ void defParser_init_buffer defParser_PROTO(( defParser_BUFFER_STATE b, FILE *fil #define defParser_new_buffer defParser_create_buffer +#if 0 #ifdef __cplusplus static int defParserinput defParser_PROTO(( void )); #else static int input defParser_PROTO(( void )); #endif +#endif defParser_DECL { @@ -1104,6 +1106,7 @@ register defParser_CHAR *defParser_bp; #endif +#if 0 #ifdef __cplusplus static int defParserinput() #else @@ -1170,6 +1173,7 @@ static int input() return ( c ); } +#endif #ifdef defParser_USE_PROTOS diff --git a/cde/programs/dtinfo/DtMmdb/compression/ps.C b/cde/programs/dtinfo/DtMmdb/compression/ps.C index 1e384f5d..598f3662 100644 --- a/cde/programs/dtinfo/DtMmdb/compression/ps.C +++ b/cde/programs/dtinfo/DtMmdb/compression/ps.C @@ -427,11 +427,13 @@ void ps_init_buffer ps_PROTO(( ps_BUFFER_STATE b, FILE *file )); #define ps_new_buffer ps_create_buffer +#if 0 #ifdef __cplusplus static int psinput ps_PROTO(( void )); #else static int input ps_PROTO(( void )); #endif +#endif ps_DECL { @@ -856,6 +858,7 @@ register ps_CHAR *ps_bp; #endif +#if 0 #ifdef __cplusplus static int psinput() #else @@ -922,6 +925,7 @@ static int input() return ( c ); } +#endif #ifdef ps_USE_PROTOS diff --git a/cde/programs/dtinfo/DtMmdb/compression/sgml.C b/cde/programs/dtinfo/DtMmdb/compression/sgml.C index e503afad..f1069923 100644 --- a/cde/programs/dtinfo/DtMmdb/compression/sgml.C +++ b/cde/programs/dtinfo/DtMmdb/compression/sgml.C @@ -433,11 +433,13 @@ void sgml_init_buffer sgml_PROTO(( sgml_BUFFER_STATE b, FILE *file )); #define sgml_new_buffer sgml_create_buffer +#if 0 #ifdef __cplusplus static int sgmlinput sgml_PROTO(( void )); #else static int input sgml_PROTO(( void )); #endif +#endif sgml_DECL { @@ -867,6 +869,7 @@ register sgml_CHAR *sgml_bp; #endif +#if 0 #ifdef __cplusplus static int sgmlinput() #else @@ -933,6 +936,7 @@ static int input() return ( c ); } +#endif #ifdef sgml_USE_PROTOS diff --git a/cde/programs/dtinfo/DtMmdb/compression/trie.C b/cde/programs/dtinfo/DtMmdb/compression/trie.C index c92abfee..d40449b1 100644 --- a/cde/programs/dtinfo/DtMmdb/compression/trie.C +++ b/cde/programs/dtinfo/DtMmdb/compression/trie.C @@ -163,7 +163,6 @@ void trie::extend_alphabet() new_alphabet[k + estimated_sz] = 0; } - new_alphabet = new_alphabet; estimated_sz *= 2; } } diff --git a/cde/programs/dtinfo/DtMmdb/index/mphf_index.h b/cde/programs/dtinfo/DtMmdb/index/mphf_index.h index b8301c80..042b7a36 100644 --- a/cde/programs/dtinfo/DtMmdb/index/mphf_index.h +++ b/cde/programs/dtinfo/DtMmdb/index/mphf_index.h @@ -112,7 +112,6 @@ protected: private: fast_mphf_handler *v_mphf; // hash func - inv_lists_handler *v_invlists; // list of inv_list char* f_key_file_name; }; diff --git a/cde/programs/dtinfo/DtMmdb/schema/token.C b/cde/programs/dtinfo/DtMmdb/schema/token.C index 0117c0ee..18cde82c 100644 --- a/cde/programs/dtinfo/DtMmdb/schema/token.C +++ b/cde/programs/dtinfo/DtMmdb/schema/token.C @@ -512,10 +512,12 @@ void schema_init_buffer schema_PROTO(( schema_BUFFER_STATE b, FILE *file )); #define schema_new_buffer schema_create_buffer +#if 0 #ifdef __cplusplus static int schemainput schema_PROTO(( void )); #else static int input schema_PROTO(( void )); +#endif #endif schema_DECL @@ -1116,6 +1118,7 @@ register schema_CHAR * schema_bp; #endif +#if 0 #ifdef __cplusplus static int schemainput() #else @@ -1182,6 +1185,7 @@ static int input() return ( c ); } +#endif #ifdef schema_USE_PROTOS diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.hh index d445361b..08e93b2a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.hh @@ -27,7 +27,7 @@ class WXmTextField; class WXmText; #include class Mark; -class MarkMoved; +struct MarkMoved; class BookmarkEdit : public Dialog, public UAS_Receiver { diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C index d504568e..b995f1d2 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C @@ -435,21 +435,16 @@ GraphicAgent::create_ui() PixmapGraphic &pgraphic = *(f_graphic->pixmap_graphic()); Graphic *graphic = f_graphic ; + UAS_String buffer = CATGETS(Set_GraphicAgent, 8, "Dtinfo: "); UAS_String titleStr(graphic->title()); const char *title = titleStr ; if (title == NULL || *title == '\0') // empty string title = (char *)CATGETS(Set_GraphicAgent, 2, "Detached Graphic"); + buffer = buffer + title; - { - - UAS_String buffer = CATGETS(Set_GraphicAgent, 8, "Dtinfo: "); - buffer = buffer + title; - - f_shell.Title((char*)buffer); - f_shell.IconName((char*)buffer); - - } + f_shell.Title((char*)buffer); + f_shell.IconName((char*)buffer); args.Reset(); panner.CanvasWidth (pgraphic.width(), args); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.hh index e4cd65e4..e76dfdc1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.hh @@ -95,7 +95,6 @@ private: UAS_Pointer f_node_ptr ; UAS_Pointer f_graphic ; WXawPanner *f_panner; - WXmLabel *f_label; WPixmap *f_pixmap_widget ; unsigned int f_panner_state ; unsigned int f_current_scale; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.hh index 78ecb891..1ba846d0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.hh @@ -38,7 +38,7 @@ class IcccmAgent; struct OutlineListSelectionData; -class TrackingEntry; +struct TrackingEntry; class LibraryAgent : public Agent, public UAS_Receiver diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkCanvas.hh b/cde/programs/dtinfo/dtinfo/src/Agents/MarkCanvas.hh index 9e7a144e..42268763 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkCanvas.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkCanvas.hh @@ -29,8 +29,8 @@ class Agent; class Mark; class MarkIcon; -class MarkSelectionChanged; -class MarkChanged; +struct MarkSelectionChanged; +struct MarkChanged; class MarkCanvas : public Destructable, public UAS_Receiver diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C index 357668e5..f8849fc7 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C @@ -93,8 +93,7 @@ MarkIcon::MarkIcon (Widget parent, Widget chooser_parent, MarkCanvas *mark, int ypos, int scrollbar_offset) -: f_icon_char (0), - f_selected (FALSE), +: f_selected (FALSE), f_y_position (ypos), f_chooser_parent (chooser_parent) { diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.hh index d5e59dc1..994edcc1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.hh @@ -88,7 +88,6 @@ private: // MarkTml objects are stored in reverse order in the list // to allow quick access to the last element. xList f_mark_list; - char f_icon_char; bool f_selected; unsigned int f_offset; unsigned int f_y_position ; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.hh b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.hh index 63605a39..c64fa285 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.hh @@ -32,8 +32,8 @@ #include #include -class MarkCreated; -class MarkDeleted; +struct MarkCreated; +struct MarkDeleted; class MarkListView : public WWL, public UAS_Receiver, diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C index fe5f7868..1bb1371b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C @@ -630,9 +630,11 @@ g_view_mark() } +#if 0 static unsigned find_segment_offset (_DtCvSegment *start, const _DtCvSegment *target, unsigned &offset); +#endif static void arm_callback (void *client_data) @@ -4451,6 +4453,7 @@ NodeWindowAgent::SetTopic(_DtCvTopicPtr topic) // stack of the parents +#if 0 static _DtCvSegment * contains(_DtCvSegment *root, _DtCvSegment *segment) { @@ -4527,6 +4530,7 @@ next_string_segment(_DtCvSegment *root, _DtCvSegment *start) return 0; } +#endif @@ -4650,6 +4654,7 @@ NodeWindowAgent::create_canvas_mark(_DtCvHandle canvas, return mark_canvas ; } +#if 0 static unsigned find_segment_offset (_DtCvSegment *start, const _DtCvSegment *target, unsigned &offset) @@ -4701,6 +4706,7 @@ find_segment_offset (_DtCvSegment *start, const _DtCvSegment *target, return found ; } +#endif void NodeWindowAgent::link_to (const char *locator) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh index 512a7423..28e52937 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh @@ -51,15 +51,15 @@ class WXmCascadeButton; class WXmForm; class HitList; class Ancestor; -class SelectionChanged; +struct SelectionChanged; class BookTab; class PixmapGraphic; -class MarkSelectionChanged; +struct MarkSelectionChanged; class ScopeMenu; class Graphic; class Mark; -class MarkCreated; -class MarkDeleted; +struct MarkCreated; +struct MarkDeleted; class MarkCanvas ; class MarkIcon ; // class DetachGraphic; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.hh b/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.hh index 6f27c87a..d2e3ce88 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.hh @@ -36,7 +36,7 @@ #include class WXmArrowButton; -class UpdateMenu; +struct UpdateMenu; // A ScopeMenu is not a real menu, it's only an object responsible to update diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.C b/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.C index c5060944..f48bac8a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.C @@ -55,8 +55,8 @@ public: // functions HashBucket() // NOTE: remove 3rd param after testing : List (10, 10, List::GROW_ADD) { }; - FolioObject *find (const FolioObject &); - void remove (const FolioObject &); + int find (FolioObject &); + void remove (FolioObject &); }; @@ -64,18 +64,18 @@ public: // functions // bucket find // ///////////////////////////////////////////////////////////////// -FolioObject * -HashBucket::find (const FolioObject &element) +int +HashBucket::find (FolioObject &element) { register int i; for (i = 0; i < f_length; i++) { if (((Hashable *)f_list_element[i])->equals ((Hashable &) element)) - return ((Hashable *) f_list_element[i]); + return (i); } - return (NULL); + return (-1); } @@ -84,7 +84,7 @@ HashBucket::find (const FolioObject &element) // ///////////////////////////////////////////////////////////////// void -HashBucket::remove (const FolioObject &element) +HashBucket::remove (FolioObject &element) { register int i; @@ -140,7 +140,7 @@ HashTbl::add (Hashable &element) f_hash_bucket[where] = new HashBucket(); /* -------- See if it exists. -------- */ - if (f_hash_bucket[where]->find (element) == NULL) + if (f_hash_bucket[where]->find (element) == -1) /* -------- Finally, add it. -------- */ f_hash_bucket[where]->append (element); } @@ -150,15 +150,15 @@ HashTbl::add (Hashable &element) // find - find an entry in the hash table // ///////////////////////////////////////////////////////////////// -Hashable * -HashTbl::find (const Hashable &element) const +int +HashTbl::find (Hashable &element) const { u_int where = element.hash_code (0, f_num_buckets - 1); if (f_hash_bucket[where] != NULL) - return ((Hashable *) f_hash_bucket[where]->find (element)); + return (f_hash_bucket[where]->find (element)); else - return (NULL); + return (-1); } @@ -167,7 +167,7 @@ HashTbl::find (const Hashable &element) const // ///////////////////////////////////////////////////////////////// void -HashTbl::remove (const Hashable &element) +HashTbl::remove (Hashable &element) { u_int where = element.hash_code (0, f_num_buckets - 1); if (f_hash_bucket[where] != NULL) diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.hh b/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.hh index e8397e85..6ccd67b0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/HashTbl.hh @@ -31,9 +31,9 @@ public: // functions void add (Hashable &); void add (Hashable *h) { add (*h); } - void remove (const Hashable &); + void remove (Hashable &); void remove_all (bool delete_elements = FALSE); - Hashable *find (const Hashable &) const; + int find (Hashable &) const; protected: // variables HashBucket **f_hash_bucket; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh index ffa585c4..58338698 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh @@ -99,7 +99,6 @@ private: // data char *f_lang; char *f_home; char *f_user_path; - char *f_lang_normalized; // option flags and data UAS_String f_infolibsStr; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh index 5d04af16..fa831fe8 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh @@ -27,8 +27,8 @@ #include "UAS.hh" -class HistoryDelete; -class HistoryAdd; +struct HistoryDelete; +struct HistoryAdd; class NodeHistoryAgent; class GlobalHistoryMgr : public Long_Lived, diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.hh index bd96d985..b396893c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.hh @@ -27,7 +27,7 @@ #include "UAS.hh" -class Anchor; +struct Anchor; class LocalHistoryEntry { diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh index 24791fec..39fd1278 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh @@ -30,7 +30,7 @@ class Mark; class MarkBase; -class Anchor; +struct Anchor; class MarkListView; class MarkMgr : public Long_Lived diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C index 3c6a9f98..dcc42d5e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C @@ -156,8 +156,7 @@ MessageMgr::MessageMgr() : f_nodeview_process(0), f_popped_up(False), f_pressed_ok(False), - f_exit_flag(False), - f_dialog_active(False) + f_exit_flag(False) { MessageAgent::request ((UAS_Receiver *) this); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh index e1bab10d..67e9bf36 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh @@ -83,7 +83,6 @@ private: // variables bool f_popped_up; bool f_pressed_ok; bool f_exit_flag; - bool f_dialog_active; private: LONG_LIVED_HH(MessageMgr,message_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C index 35a206c2..1c3ac58b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C @@ -128,7 +128,7 @@ static PrintNode node_printer; // ///////////////////////////////////////////////////////////////// PrintMgr::PrintMgr() - : f_print_panel(NULL), f_npa(NULL), f_font_scale(0) + : f_npa(NULL), f_font_scale(0) { RCS_DEBUG("PrintMgr::PrintMgr called."); set_font_scale(pref_mgr().get_int(PrefMgr::FontScale)); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh index e4c981df..24d07176 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh @@ -71,7 +71,6 @@ public: void set_font_scale(int); private: - PrintPanelAgent * f_print_panel; NodePrintAgent * f_npa; UAS_Pointer f_last_printed; int f_font_scale ; // for old style.sheet diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh index be507fb6..3bc61b45 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh @@ -79,7 +79,6 @@ class TtIpcMgr : public Long_Lived private: // data char *procid ; // tt id for process - Tt_pattern *sess_patterns ; // tt patterns array for process Tt_status tt_state ; } ; diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/Anchor.hh b/cde/programs/dtinfo/dtinfo/src/Marks/Anchor.hh index 5d8f0306..bd367cad 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/Anchor.hh +++ b/cde/programs/dtinfo/dtinfo/src/Marks/Anchor.hh @@ -26,7 +26,7 @@ */ -class Anchor +struct Anchor { public: Anchor (const char *location, const char *format, bool keep = FALSE) diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/Mark.hh b/cde/programs/dtinfo/dtinfo/src/Marks/Mark.hh index c33f142d..751af53f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/Mark.hh +++ b/cde/programs/dtinfo/dtinfo/src/Marks/Mark.hh @@ -31,12 +31,12 @@ # include "UAS.hh" -class Anchor; -class MarkChanged; -class MarkDeleted; -class MarkMoved; -class EditMark; -class ViewMark; +struct Anchor; +struct MarkChanged; +struct MarkDeleted; +struct MarkMoved; +struct EditMark; +struct ViewMark; class Mark { diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase.hh b/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase.hh index e1aedc9b..cdb0cb34 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase.hh +++ b/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase.hh @@ -23,7 +23,7 @@ template class xList; class Mark; -class Anchor; +struct Anchor; class MarkBase { diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C index 22bef9cd..4583f277 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C @@ -1835,7 +1835,6 @@ PartialElementFeatures::~PartialElementFeatures() ElementFeatures::ElementFeatures(CanvasRenderer* renderer) : PartialElementFeatures(renderer), f_row (NULL), - f_graphic (0), f_border (_DtCvBORDER_NONE), f_border_width(-1), // invalid border width f_table (NULL), diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.hh b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.hh index b8bdaca9..9e9118bf 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.hh +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.hh @@ -449,7 +449,6 @@ public: private: RowDefn* f_row ; - unsigned f_graphic; _DtCvFrmtOption f_border; int f_border_width; diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh index acfa21b0..2fa566ae 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh @@ -95,7 +95,6 @@ private: u_char f_connective; char *f_weight; char *f_proximity; - char *f_scope; bool f_term_string_fixed; u_char f_type; // may need some way to verify the scope... diff --git a/cde/programs/dtinfo/dtinfo/src/Templates.C b/cde/programs/dtinfo/dtinfo/src/Templates.C index 376645c2..926b6a28 100644 --- a/cde/programs/dtinfo/dtinfo/src/Templates.C +++ b/cde/programs/dtinfo/dtinfo/src/Templates.C @@ -53,7 +53,7 @@ class LinkAction; class BookTab; class MarkTml; class MarkIcon; -class MarkCreated; +struct MarkCreated; class MarkSelectionChanged; #ifndef _IBMR2 class DisplayDocument; diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c index f448c474..2d623894 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Tree.c @@ -962,9 +962,7 @@ static void set_tree_size (tw, insetvalues, width, height) return; } -static void layout_tree (tw, insetvalues) - TreeWidget tw; - Boolean insetvalues; +static void layout_tree (TreeWidget tw, Boolean insetvalues) { int i; Dimension *dp; diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/ContentType.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/ContentType.C index fb5d9170..f9ed1a71 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/ContentType.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/ContentType.C @@ -1758,11 +1758,13 @@ void ol_data_init_buffer ol_data_PROTO(( ol_data_BUFFER_STATE b, FILE *file )); #define ol_data_new_buffer ol_data_create_buffer +#if 0 #ifdef __cplusplus static int ol_datainput ol_data_PROTO(( void )); #else static int input ol_data_PROTO(( void )); #endif +#endif ol_data_DECL { @@ -2248,6 +2250,7 @@ register ol_data_CHAR *ol_data_bp; #endif +#if 0 #ifdef __cplusplus static int ol_datainput() #else @@ -2314,6 +2317,7 @@ static int input() return ( c ); } +#endif #ifdef ol_data_USE_PROTOS diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C index 0d2565ee..16bfba5f 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C @@ -2233,11 +2233,13 @@ void remote_init_buffer remote_PROTO(( remote_BUFFER_STATE b, FILE *file )); #define remote_new_buffer remote_create_buffer +#if 0 #ifdef __cplusplus static int remoteinput remote_PROTO(( void )); #else static int input remote_PROTO(( void )); #endif +#endif remote_DECL { @@ -2733,6 +2735,7 @@ register remote_CHAR *remote_bp; #endif +#if 0 #ifdef __cplusplus static int remoteinput() #else @@ -2799,6 +2802,7 @@ static int input() return ( c ); } +#endif #ifdef remote_USE_PROTOS diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/ReplaceIdIdref.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/ReplaceIdIdref.C index f628587d..78c82b74 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/ReplaceIdIdref.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/ReplaceIdIdref.C @@ -3038,11 +3038,13 @@ void nodedata_init_buffer nodedata_PROTO(( nodedata_BUFFER_STATE b, FILE *file ) #define nodedata_new_buffer nodedata_create_buffer +#if 0 #ifdef __cplusplus static int nodedatainput nodedata_PROTO(( void )); #else static int input nodedata_PROTO(( void )); #endif +#endif nodedata_DECL { @@ -3564,6 +3566,7 @@ register nodedata_CHAR *nodedata_bp; #endif +#if 0 #ifdef __cplusplus static int nodedatainput() #else @@ -3630,6 +3633,7 @@ static int input() return ( c ); } +#endif #ifdef nodedata_USE_PROTOS diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/gr_type.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/gr_type.C index 31ab30da..b22a2f18 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/gr_type.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/gr_type.C @@ -1873,11 +1873,13 @@ void graphics_task_init_buffer graphics_task_PROTO(( graphics_task_BUFFER_STATE #define graphics_task_new_buffer graphics_task_create_buffer +#if 0 #ifdef __cplusplus static int graphics_taskinput graphics_task_PROTO(( void )); #else static int input graphics_task_PROTO(( void )); #endif +#endif graphics_task_DECL { @@ -2349,6 +2351,7 @@ register graphics_task_CHAR *graphics_task_bp; #endif +#if 0 #ifdef __cplusplus static int graphics_taskinput() #else @@ -2415,6 +2418,7 @@ static int input() return ( c ); } +#endif #ifdef graphics_task_USE_PROTOS diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/lex.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/lex.C index 4f039390..3c5d6260 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/lex.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/lex.C @@ -1750,11 +1750,13 @@ void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); #define yy_new_buffer yy_create_buffer +#if 0 #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif +#endif YY_DECL { @@ -2322,6 +2324,7 @@ register YY_CHAR *yy_bp; #endif +#if 0 #ifdef __cplusplus static int yyinput() #else @@ -2388,6 +2391,7 @@ static int input() return ( c ); } +#endif #ifdef YY_USE_PROTOS diff --git a/cde/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c b/cde/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c index a31c87ac..c49059d5 100644 --- a/cde/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c +++ b/cde/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c @@ -89,6 +89,8 @@ #else #define __VA_START__(p,a) va_start(p) #endif +#define va_listval(p) (*(p)) +#define va_listarg va_list* #endif static const char id_hash[] = "\n@(#)hash (AT&T Bell Laboratories) 05/09/95\0\n"; @@ -112,7 +114,7 @@ hashalloc __PARAM__((Hash_table_t* ref, ...), (va_alist)) __OTORP__(va_dcl) register Hash_table_t* ret = 0; register int internal; int n; - va_list ap, vl; + va_list ap; va_list va[4]; va_list* vp = va; HASHregion region = 0; @@ -223,8 +225,7 @@ hashalloc __PARAM__((Hash_table_t* ref, ...), (va_alist)) __OTORP__(va_dcl) __va_copy( *vp, ap ); vp++; } - vl = va_arg(ap, va_list); - __va_copy(ap, vl); + __va_copy(ap, va_listval(va_arg(ap, va_listarg))); #endif break; case 0: diff --git a/cde/programs/dtksh/ksh93/src/lib/libast/string/tokscan.c b/cde/programs/dtksh/ksh93/src/lib/libast/string/tokscan.c index 3316b904..dcd5c261 100644 --- a/cde/programs/dtksh/ksh93/src/lib/libast/string/tokscan.c +++ b/cde/programs/dtksh/ksh93/src/lib/libast/string/tokscan.c @@ -89,6 +89,8 @@ #else #define __VA_START__(p,a) va_start(p) #endif +#define va_listval(p) (*(p)) +#define va_listarg va_list* #endif #include @@ -213,7 +215,6 @@ tokscan __PARAM__((register char* s, char** nxt, const char* fmt, ...), (va_alis char** p_string; char* prv_f = 0; va_list prv_ap; - va_list* pap; __VA_START__(ap, fmt); __OTORP__(s = va_arg(ap, char* );nxt = va_arg(ap, char** );fmt = va_arg(ap, const char* );) if (!*s || *s == '\n') @@ -258,8 +259,7 @@ tokscan __PARAM__((register char* s, char** nxt, const char* fmt, ...), (va_alis prv_f = f; f = va_arg(ap, char*); __va_copy( prv_ap, ap ); - pap = va_arg(ap, va_list*); - __va_copy( ap, pap ); + __va_copy(ap, va_listval(va_arg(ap, va_listarg))); continue; case 'c': p_char = va_arg(ap, char*); diff --git a/cde/programs/dtlogin/choose.c b/cde/programs/dtlogin/choose.c index 00efa810..c0853af7 100644 --- a/cde/programs/dtlogin/choose.c +++ b/cde/programs/dtlogin/choose.c @@ -389,7 +389,7 @@ ProcessChooserSocket ( if (client_fd == -1) { LogError ((unsigned char *)"Cannot accept chooser connection\n"); - return; + return 0; } Debug ("Accepted %d\n", client_fd); diff --git a/cde/programs/dtlogin/chooser.c b/cde/programs/dtlogin/chooser.c index afac4f8b..1a1380aa 100644 --- a/cde/programs/dtlogin/chooser.c +++ b/cde/programs/dtlogin/chooser.c @@ -470,7 +470,7 @@ RemoveHostname (host) prev = &hosts->next; } if (!hosts) - return; + return 0; *prev = host->next; DisposeHostname (host); NameTableSize--; @@ -563,12 +563,12 @@ RegisterHostaddr (addr, len, type) host = (HostAddr *) malloc (sizeof (HostAddr)); if (!host) - return; + return 0; host->addr = (struct sockaddr *) malloc (len); if (!host->addr) { free ((char *) host); - return; + return 0; } memmove( (char *) host->addr, (char *) addr, len); host->addrlen = len; @@ -602,7 +602,7 @@ RegisterHostname (name) ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; if (ioctl (socketFD, (int) SIOCGIFCONF, (char *) &ifc) < 0) - return; + return 0; for (ifr = ifc.ifc_req #if defined (__bsdi__) || defined(__NetBSD__) ; (char *)ifr < ifc.ifc_buf + ifc.ifc_len; @@ -665,9 +665,9 @@ RegisterHostname (name) { hostent = gethostbyname (name); if (!hostent) - return; + return 0; if (hostent->h_addrtype != AF_INET || hostent->h_length != 4) - return; + return 0; in_addr.sin_family = hostent->h_addrtype; memmove( &in_addr.sin_addr, hostent->h_addr, 4); } @@ -689,10 +689,10 @@ RegisterAuthenticationName (name, namelen) ARRAY8Ptr authName; if (!XdmcpReallocARRAYofARRAY8 (&AuthenticationNames, AuthenticationNames.length + 1)) - return; + return 0; authName = &AuthenticationNames.data[AuthenticationNames.length-1]; if (!XdmcpAllocARRAY8 (authName, namelen)) - return; + return 0; memmove( authName->data, name, namelen); } diff --git a/cde/programs/dtlogin/dm.c b/cde/programs/dtlogin/dm.c index f898d3bc..e4971976 100644 --- a/cde/programs/dtlogin/dm.c +++ b/cde/programs/dtlogin/dm.c @@ -350,7 +350,7 @@ ScanServers( void ) LogError( ReadCatalog(MC_LOG_SET,MC_LOG_NO_SRVACC,MC_DEF_LOG_NO_SRVACC), servers); - return; + return 0; } if (ServersModTime == 0) { @@ -861,7 +861,7 @@ StartDisplay( */ if (d->displayType.origin == FromFile && dt_shutdown ) { RemoveDisplay(d); - return; + return 0; } { @@ -949,7 +949,7 @@ StartDisplay( LogError ((unsigned char *)"All DT utmp IDs already in use. Removing display %s\n", d->name); RemoveDisplay(d); - return; + return 0; } } #endif @@ -1024,7 +1024,7 @@ StartDisplay( if (!StartGetty(d)) RemoveDisplay (d); - return; + return 0; } } else @@ -1442,12 +1442,12 @@ SetTitle( char *name, char *ptr ) * remove domain qualifiers and screens from name... */ - if ( (p = malloc(strlen(name) + 1)) == NULL) return; + if ( (p = malloc(strlen(name) + 1)) == NULL) return 0; strcpy(p, name); if ( (s = strchr(p,':')) == NULL ) { free(p); - return; + return 0; } if ( (t = strchr(s,'.')) != NULL ) diff --git a/cde/programs/dtlogin/dtchooser.c b/cde/programs/dtlogin/dtchooser.c index a6bc58a4..3bb9088b 100644 --- a/cde/programs/dtlogin/dtchooser.c +++ b/cde/programs/dtlogin/dtchooser.c @@ -1030,7 +1030,7 @@ MakeOptionsMenu( void ) static int ErrorHandler( Display *dpy, XErrorEvent *event ) { - return; + return 0; } diff --git a/cde/programs/dtlogin/file.c b/cde/programs/dtlogin/file.c index 16d843f4..357918cc 100644 --- a/cde/programs/dtlogin/file.c +++ b/cde/programs/dtlogin/file.c @@ -197,12 +197,12 @@ ParseDisplay( char *source, args = splitIntoWords (source); if (!args) - return; + return 0; if (!args[0]) { LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_NAME,MC_DEF_LOG_MISS_NAME)); freeArgs (args); - return; + return 0; } name = args[0]; if (!args[1]) @@ -210,7 +210,7 @@ ParseDisplay( char *source, LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_TYPE,MC_DEF_LOG_MISS_TYPE), args[0]); freeArgs (args); - return; + return 0; } /* diff --git a/cde/programs/dtlogin/fontpath.c b/cde/programs/dtlogin/fontpath.c index 87e490a3..265c6826 100644 --- a/cde/programs/dtlogin/fontpath.c +++ b/cde/programs/dtlogin/fontpath.c @@ -103,12 +103,12 @@ ApplyFontPathMods( struct display *d, Display *dpy ) if (d->displayType.location == Foreign) { Debug(" Foreign display\n"); - return; + return 0; } if (!(fontPath=XGetFontPath(dpy, &numPaths))) { Debug(" Can't get font path\n"); - return; + return 0; } /* diff --git a/cde/programs/dtlogin/genauth.c b/cde/programs/dtlogin/genauth.c index ae2ed219..5180cecb 100644 --- a/cde/programs/dtlogin/genauth.c +++ b/cde/programs/dtlogin/genauth.c @@ -120,6 +120,9 @@ extern int errno; # ifdef macII # define USE_CRYPT # endif +# ifdef __FreeBSD__ +# define USE_CRYPT +# endif # ifdef sun # define USE_CRYPT # if (OSMAJORVERSION >= 4) @@ -453,7 +456,7 @@ InitCryptoKey( void ) char *key_file = "/dev/mem"; #endif if (cryptoInited) - return; + return 0; /* * If the sumFile fails to produce a result diff --git a/cde/programs/dtlogin/protodpy.c b/cde/programs/dtlogin/protodpy.c index 42a59016..0aa6877b 100644 --- a/cde/programs/dtlogin/protodpy.c +++ b/cde/programs/dtlogin/protodpy.c @@ -152,7 +152,7 @@ DisposeProtoDisplay( struct protoDisplay *pdpy ) prev = p; } if (!p) - return; + return 0; if (prev) prev->next = pdpy->next; else diff --git a/cde/programs/dtlogin/resource.c b/cde/programs/dtlogin/resource.c index 2c4e62ff..e9ac4972 100644 --- a/cde/programs/dtlogin/resource.c +++ b/cde/programs/dtlogin/resource.c @@ -435,7 +435,7 @@ GetResource( char *name, char *class, int valueType, char **valuep, if (valueType == DM_STRING && *valuep) { if (string != NULL && strlen (*valuep) == len && !strncmp (*valuep, string, len)) - return; + return 0; else { free (*valuep); *(valuep) = NULL; @@ -450,7 +450,7 @@ GetResource( char *name, char *class, int valueType, char **valuep, if (!new_string) { LogOutOfMem( ReadCatalog(MC_LOG_SET,MC_LOG_GET_RSC,MC_DEF_LOG_GET_RSC)); - return; + return 0; } strncpy (new_string, string, len); new_string[len] = '\0'; diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index b36d2774..1a9e0f36 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -1746,7 +1746,7 @@ AbortClient( int pid ) MC_LOG_SET,MC_LOG_NO_KILLCL,MC_DEF_LOG_NO_KILLCL)); case EINVAL: case ESRCH: - return; + return 0; } } if (!setjmp (tenaciousClient)) { @@ -1834,11 +1834,11 @@ execute(char **argv, char **environ ) */ f = fopen (argv[0], "r"); if (!f) - return; + return 0; if (fgets (program, sizeof (program) - 1, f) == NULL) { fclose (f); - return; + return 0; } fclose (f); e = program + strlen (program) - 1; diff --git a/cde/programs/dtlogin/socket.c b/cde/programs/dtlogin/socket.c index a0e6dddb..b0f03d59 100644 --- a/cde/programs/dtlogin/socket.c +++ b/cde/programs/dtlogin/socket.c @@ -111,13 +111,13 @@ CreateWellKnownSockets () char *name, *localHostname(); if (request_port == 0) - return; + return 0; Debug ("creating socket %d\n", request_port); xdmcpFd = socket (AF_INET, SOCK_DGRAM, 0); if (xdmcpFd == -1) { LogError (ReadCatalog(MC_LOG_SET,MC_LOG_FAIL_SOCK,MC_DEF_LOG_FAIL_SOCK), request_port); - return; + return 0; } name = localHostname (); registerHostname (name, strlen (name)); @@ -136,7 +136,7 @@ CreateWellKnownSockets () request_port, errno); close (xdmcpFd); xdmcpFd = -1; - return; + return 0; } WellKnownSocketsMax = xdmcpFd; FD_SET (xdmcpFd, &WellKnownSocketsMask); @@ -146,7 +146,7 @@ CreateWellKnownSockets () if (chooserFd == -1) { LogError ((unsigned char *)"chooser socket creation failed, errno %d\n", errno); - return; + return 0; } listen (chooserFd, 5); if (chooserFd > WellKnownSocketsMax) diff --git a/cde/programs/dtlogin/vgmain.c b/cde/programs/dtlogin/vgmain.c index 06bf0eee..2bb59904 100644 --- a/cde/programs/dtlogin/vgmain.c +++ b/cde/programs/dtlogin/vgmain.c @@ -2106,7 +2106,7 @@ MyBackspace( Widget w, XEvent *event, char **params, Cardinal *num_params ) static int ErrorHandler( Display *dpy, XErrorEvent *event ) { - return; + return 0; } diff --git a/cde/programs/dtpad/printSetup.c b/cde/programs/dtpad/printSetup.c index 33e537e7..48277032 100644 --- a/cde/programs/dtpad/printSetup.c +++ b/cde/programs/dtpad/printSetup.c @@ -696,7 +696,7 @@ _psUiSpecsAreValid(PrintSetup *pSetup) if (pSetup == NULL || pSetup->dtprintSetup == NULL || pSetup->widgets == NULL) - return; + return 0; pOption = &pSetup->options; frame = pSetup->widgets->marginFrame; diff --git a/cde/programs/dtstyle/ColorPalette.c b/cde/programs/dtstyle/ColorPalette.c index f602b9b5..b73ad7c7 100644 --- a/cde/programs/dtstyle/ColorPalette.c +++ b/cde/programs/dtstyle/ColorPalette.c @@ -77,7 +77,7 @@ AllocatePaletteCells( XColor colors[XmCO_MAX_NUM_COLORS * 5]; if(style.count > 9) - return; + return 0; XmeGetPixelData (style.screenNum, &colorUse, pixels, &(pCurrentPalette->active), diff --git a/cde/programs/dtterm/DtTermMain.c b/cde/programs/dtterm/DtTermMain.c index 910ae96e..d385f198 100644 --- a/cde/programs/dtterm/DtTermMain.c +++ b/cde/programs/dtterm/DtTermMain.c @@ -535,8 +535,8 @@ static XtEventHandler TestProbeHandler( Arg al[5]; *ctd = True; - if (cm->send_event == False) return; - if (cm->message_type != xa_DTTERM_REMOTE_PROBE_REQUEST) return; + if (cm->send_event == False) return 0; + if (cm->message_type != xa_DTTERM_REMOTE_PROBE_REQUEST) return 0; reply = (unsigned char*) malloc(sizeof(unsigned char) * 1024); diff --git a/cde/programs/dtudcfonted/libfal/_fallcGeneric.c b/cde/programs/dtudcfonted/libfal/_fallcGeneric.c index 17d9ed8b..75b74b8b 100644 --- a/cde/programs/dtudcfonted/libfal/_fallcGeneric.c +++ b/cde/programs/dtudcfonted/libfal/_fallcGeneric.c @@ -472,7 +472,7 @@ XLCdGenericPart *gen; } if (charsetd == NULL && (charsetd = srch_charset_define(cset_name,&new)) == NULL) - return ; + return 0; } } else { if(i == 0){ @@ -484,7 +484,7 @@ XLCdGenericPart *gen; if(new){ tmp = (char *)Xmalloc(strlen(cset_name)+1); if(tmp == NULL){ - return ; + return 0; } strcpy(tmp,cset_name); charsetd->name = tmp; @@ -528,7 +528,7 @@ XLCdGenericPart *gen; */ tmp = (char *)Xmalloc(strlen(value[0])+1); if(tmp == NULL){ - return; + return 0; } charsetd->ct_sequence = tmp; string_to_encoding(value[0],tmp); @@ -597,7 +597,7 @@ XLCdGenericPart *gen; char *tmp; if (conversion == NULL && (conversion = faladd_conversion(gen)) == NULL) { - return ; + return 0; } dbg_printValue(name,value,num); } else { @@ -617,7 +617,7 @@ XLCdGenericPart *gen; dbg_printValue(name,value,num); tmp = (char *)Xmalloc(strlen(value[0])+1); if(tmp == NULL){ - return; + return 0; } strcpy(tmp,value[0]); conversion->source_encoding = tmp; @@ -625,7 +625,7 @@ XLCdGenericPart *gen; if(new){ tmp = (char *)Xmalloc(strlen(conversion->source_encoding)+1); if(tmp == NULL){ - return ; + return 0; } strcpy(tmp,conversion->source_encoding); conversion->source->name = tmp; @@ -639,7 +639,7 @@ XLCdGenericPart *gen; dbg_printValue(name,value,num); tmp = (char *)Xmalloc(strlen(value[0])+1); if(tmp == NULL){ - return; + return 0; } strcpy(tmp,value[0]); conversion->destination_encoding = tmp; @@ -648,7 +648,7 @@ XLCdGenericPart *gen; tmp = (char *)Xmalloc( strlen(conversion->destination_encoding)+1); if(tmp == NULL){ - return ; + return 0; } strcpy(tmp,conversion->destination_encoding); conversion->dest->name = tmp; @@ -729,7 +729,7 @@ int num; if(new){ tmp = (char *)Xmalloc(strlen(cset_name)+1); if(tmp == NULL){ - return ; + return 0; } strcpy(tmp,cset_name); ret->charset->name = tmp; diff --git a/cde/programs/localized/templates/types.tmpl b/cde/programs/localized/templates/types.tmpl index 957a62b3..8db1bbbb 100644 --- a/cde/programs/localized/templates/types.tmpl +++ b/cde/programs/localized/templates/types.tmpl @@ -146,13 +146,19 @@ DtstyleDescRule(hp.dt,hp.dt) DtstyleDescRule(ibm.dt,ibm.dt) #endif +#define NLS_CLEAN \ @@\ + for i in *.nls; do \ @@\ + [ -z $$i ] && continue; \ @@\ + [ -h $$i ] && $(RM) $$i; \ @@\ + done; true; + +#define OBJS_CLEAN \ @@\ + for i in $(OBJS); do \ @@\ + $(RM) $$i.tmsg; \ @@\ + done; true; + clean:: $(RM) $(OBJS) $(OBJS2) - for i in *.nls; do \ - [ -z $$i ] && continue; \ - [ -h $$i ] && $(RM) $$i; \ - done; true; - for i in $(OBJS); do \ - $(RM) $$i.tmsg; \ - done; true; + NLS_CLEAN + OBJS_CLEAN diff --git a/cde/programs/ttsnoop/Imakefile b/cde/programs/ttsnoop/Imakefile index 9d239141..16fe4b47 100644 --- a/cde/programs/ttsnoop/Imakefile +++ b/cde/programs/ttsnoop/Imakefile @@ -147,39 +147,45 @@ $(m.GEN_UI_C) Plus() $(m.GEN_UI_H) Plus() $(m.GEN_STUBS_C++): ttsnoop.bip $(m.SR # define CodeGenTarget(m) CodeGenAppendableTarget(m) #endif +#define SED_MoreButton $(SED) \ @@\ + -e 's/\(MoreButton;\)/\1Boolean _DtCanHelp( const char * );/' \ @@\ + -e 's/\(XtManageChild(Quick_help\)/XtSetSensitive(MoreButton,_DtCanHelp(help_data->help_text));\1/' \ @@\ + -e 's/\(buffer, vol, loc;\)/\1Boolean _DtHelped( Widget );/' \ @@\ + -e 's/\(if( (cp=strrchr\)/if (_DtHelped( help_dialog)) return;\1/' \ @@\ + dtb_utils.c > dtb_utils.c.patched + +#define SED_DtbTt $(SED) \ @@\ + -e 's/^DtbTt/extern String snooperArgv[];DtbTt/' \ @@\ + -e 's/XmNheight, 257,//' \ @@\ + -e 's/XmNwidth, 580,//' \ @@\ + -e 's/XmNcolumns, 80,//' \ @@\ + -e 's/XmNrows, 24/DtNsubprocessArgv, snooperArgv/' \ @@\ + ttsnoop_ui.c > ttsnoop_ui.c.patched + +#define SED_DtbApi $(SED) \ @@\ + -e 's/^DtbApi/extern String apiTracerArgv[];DtbApi/' \ @@\ + -e 's/XmNrows, 24/XmNrows, 24, DtNsubprocessArgv, apiTracerArgv/' \ @@\ + apiTracer_ui.c > apiTracer_ui.c.patched ttsnoop.C ttsnoop.h dtb_utils.c dtb_utils.h: ttsnoop.bip ttsnoop.C.src $(CP) ttsnoop.C.src ttsnoop.c - -if [ ! -w ttsnoop.c ]; then \ - chmod +w ttsnoop.c; fi + -if [ ! -w ttsnoop.c ]; then chmod +w ttsnoop.c; fi $(DTCODEGEN) -changed -merge -p ttsnoop.bip -main $(RM) ttsnoop.C $(MV) ttsnoop.c ttsnoop.C chmod -w ttsnoop.C cat externC.h dtb_utils.h closeBrace.h > dtb_utils.h.patched $(MV) dtb_utils.h.patched dtb_utils.h - sed \ - -e 's/\(MoreButton;\)/\1Boolean _DtCanHelp( const char * );/' \ - -e 's/\(XtManageChild(Quick_help\)/XtSetSensitive(MoreButton,_DtCanHelp(help_data->help_text));\1/' \ - -e 's/\(buffer, vol, loc;\)/\1Boolean _DtHelped( Widget );/' \ - -e 's/\(if( (cp=strrchr\)/if (_DtHelped( help_dialog)) return;\1/' \ - dtb_utils.c > dtb_utils.c.patched + SED_MoreButton $(MV) dtb_utils.c.patched dtb_utils.c ttsnoop.o: ttsnoop.C ttsnoop.bip $(TARGETS.h) $(TARGETS.h.merged) CodeGenAppendableTarget(ttsnoop) - sed -e 's/^DtbTt/extern String snooperArgv[];DtbTt/' \ - -e 's/XmNheight, 257,//' \ - -e 's/XmNwidth, 580,//' \ - -e 's/XmNcolumns, 80,//' \ - -e 's/XmNrows, 24/DtNsubprocessArgv, snooperArgv/' \ - ttsnoop_ui.c > ttsnoop_ui.c.patched + SED_DtbTt $(MV) ttsnoop_ui.c.patched ttsnoop_ui.c CodeGenAppendableTarget(apiTracer) - sed -e 's/^DtbApi/extern String apiTracerArgv[];DtbApi/' \ - -e 's/XmNrows, 24/XmNrows, 24, DtNsubprocessArgv, apiTracerArgv/' \ - apiTracer_ui.c > apiTracer_ui.c.patched + SED_DtbApi $(MV) apiTracer_ui.c.patched apiTracer_ui.c CodeGenTarget(ttChooser)