From 92424bd1693aa3efe83d0c4a73b8876ae7beb34c Mon Sep 17 00:00:00 2001 From: Ulrich Wilkens Date: Wed, 28 Aug 2013 20:32:11 +0200 Subject: [PATCH] dtinfo subdirectory mmdb --- cde/programs/dtinfo/Imakefile | 8 +++----- cde/programs/dtinfo/clients/Imakefile | 6 +++--- .../dtinfo/clients/dtinfo_start/dtinfo_start.c | 18 +++++++++++------- cde/programs/dtinfo/mmdb/HardCopy/Imakefile | 4 ++-- cde/programs/dtinfo/mmdb/Imakefile | 6 +++--- cde/programs/dtinfo/mmdb/StyleSheet/Imakefile | 4 ++-- cde/programs/dtinfo/mmdb/dstr/Imakefile | 2 +- cde/programs/dtinfo/mmdb/dti_cc/main.C | 2 +- cde/programs/dtinfo/mmdb/dti_excs/Imakefile | 2 +- cde/programs/dtinfo/mmdb/hmphf/Imakefile | 2 +- cde/programs/dtinfo/tools/Imakefile | 6 +++--- cde/programs/dtinfo/tools/misc/dfiles.c | 4 ++-- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/cde/programs/dtinfo/Imakefile b/cde/programs/dtinfo/Imakefile index 0607cd74..61f5beef 100644 --- a/cde/programs/dtinfo/Imakefile +++ b/cde/programs/dtinfo/Imakefile @@ -25,11 +25,9 @@ INDEPENDENT_SUBDIRS = clients SUBDIRS = $(PRE_REQ_SUBDIRS) $(BROWSER_SUBDIRS) $(TOOLKIT_SUBDIRS) $(INDEPENDENT_SUBDIRS) XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir -#undef TopLevelProject -#define TopLevelProject DtInfo -IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ - -DProjectTmplFile='' \ - -DProjectRulesFile='' +IMAKE_DEF_DTINFO = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' XCOMM Variables to switch on debug mode temporarily XCOMM CDEBUGFLAGS = -g -DDEBUG diff --git a/cde/programs/dtinfo/clients/Imakefile b/cde/programs/dtinfo/clients/Imakefile index 858ed710..76fe3ae9 100644 --- a/cde/programs/dtinfo/clients/Imakefile +++ b/cde/programs/dtinfo/clients/Imakefile @@ -8,9 +8,9 @@ SUBDIRS = dtinfo_start XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir #undef TopLevelProject #define TopLevelProject DtInfo -IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ - -DProjectTmplFile='' \ - -DProjectRulesFile='' +IMAKE_DEF_DTINFO = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/cde/programs/dtinfo/clients/dtinfo_start/dtinfo_start.c b/cde/programs/dtinfo/clients/dtinfo_start/dtinfo_start.c index 6d96f18a..dfd70198 100644 --- a/cde/programs/dtinfo/clients/dtinfo_start/dtinfo_start.c +++ b/cde/programs/dtinfo/clients/dtinfo_start/dtinfo_start.c @@ -45,6 +45,7 @@ #include
#include
#include
+#include
#include @@ -162,8 +163,8 @@ main ( /* * Initialize the desktop */ - if (DtAppInitialize (app_context, display, top_level, argv[0], name) - == False) { + if (DtAppInitialize (app_context, display, top_level, + argv[0], (char *)name) == False) { DtMsgLogMessage (argv[0], DtMsgLogError, (char *) GETMESSAGE (SET_NUM, 8, "DtAppInitialize() failed. Perhaps the desktop environment\nis not properly installed.")); exit (1); @@ -190,6 +191,8 @@ main ( DtDbLoad(); XtAppMainLoop (app_context); + + return (0); } @@ -500,7 +503,7 @@ ReceiveMessage ( * Put locale into the environment so that DtActionInvoke * will propagate it to the dtinfo process. */ - (void) sprintf (lang, "LANG=%s", locale); + (void) snprintf (lang, sizeof(lang), "LANG=%s", locale); (void) putenv (lang); } @@ -576,15 +579,16 @@ DieFromToolTalkError(Widget parent, char *errfmt, Tt_status status) { Arg args[10]; Widget dialog, dialogShell; - char *errmsg, *statmsg, *title; + char *errmsg, *statmsg; XmString xms_errmsg, xms_ok, xms_title; - int n; + int n, errmsglen; if (! tt_is_err(status)) return; statmsg = tt_status_message(status); - errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); - sprintf(errmsg, errfmt, statmsg); + errmsglen = strlen(errfmt) + strlen(statmsg) + 2; + errmsg = XtMalloc(errmsglen); + snprintf(errmsg, errmsglen, errfmt, statmsg); xms_ok = GETXMSTRING(2, 3, "OK"); xms_errmsg = XmStringCreateLocalized(errmsg); diff --git a/cde/programs/dtinfo/mmdb/HardCopy/Imakefile b/cde/programs/dtinfo/mmdb/HardCopy/Imakefile index 70d03f1f..689526f9 100644 --- a/cde/programs/dtinfo/mmdb/HardCopy/Imakefile +++ b/cde/programs/dtinfo/mmdb/HardCopy/Imakefile @@ -45,7 +45,7 @@ CXXEXTRA_DEFINES = -ptr../templates CXXEXTRA_DEFINES = -Xo #endif -#if defined(HPArchitecture) || defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4) +#if defined(HPArchitecture) || defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4) LinkSourceFile(TemplatesAutoNumber.C,$(DTMMDBSRC)/HardCopy) EXTRA_SRCS = TemplatesAutoNumber.C @@ -71,7 +71,7 @@ LinkSourceFile(all_tmpls,$(DTMMDBSRC)/HardCopy) SpecialCPlusPlusObjectRule(TemplatesAutoNumber.o,,+Tall_tmpls -DEXPAND_TEMPLATES) #elif defined(AlphaArchitecture) SpecialCPlusPlusObjectRule(TemplatesAutoNumber.o,,-ptf -DEXPAND_TEMPLATES) -#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) SpecialCPlusPlusObjectRule(TemplatesAutoNumber.o,,-DEXPAND_TEMPLATES) SpecialCPlusPlusExpandRule(TemplatesAutoNumber..c,TemplatesAutoNumber.C,-DEXPAND_TEMPLATES) #else diff --git a/cde/programs/dtinfo/mmdb/Imakefile b/cde/programs/dtinfo/mmdb/Imakefile index d8c61af4..cb51595f 100644 --- a/cde/programs/dtinfo/mmdb/Imakefile +++ b/cde/programs/dtinfo/mmdb/Imakefile @@ -46,9 +46,9 @@ EXTRALIBRARYDEPS = $(DONES) XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir #undef TopLevelProject #define TopLevelProject DtInfo -IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ - -DProjectTmplFile='' \ - -DProjectRulesFile='' +IMAKE_DEF_DTINFO = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' MakeSubdirs($(SUBDIRS)) ForceSubdirs($(SUBDIRS)) diff --git a/cde/programs/dtinfo/mmdb/StyleSheet/Imakefile b/cde/programs/dtinfo/mmdb/StyleSheet/Imakefile index c75f9079..9093310e 100644 --- a/cde/programs/dtinfo/mmdb/StyleSheet/Imakefile +++ b/cde/programs/dtinfo/mmdb/StyleSheet/Imakefile @@ -93,7 +93,7 @@ NORMAL_SRCS = \ VariableTable.C defParser.C defToken.C \ style.C tokenStyle.C -#if defined(HPArchitecture) || defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4) +#if defined(HPArchitecture) || defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4) LinkSourceFile(SSTemplates.C,$(DTMMDBSRC)/StyleSheet) TEMPLATE_SRCS = SSTemplates.C @@ -111,7 +111,7 @@ LinkSourceFile(all_tmpls,$(DTMMDBSRC)/StyleSheet) SpecialCPlusPlusObjectRule(SSTemplates.o,,+Tall_tmpls -DEXPAND_TEMPLATES) #elif defined(AlphaArchitecture) SpecialCPlusPlusObjectRule(SSTemplates.o,,-ptf -DEXPAND_TEMPLATES) -#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) SpecialCPlusPlusObjectRule(SSTemplates.o,,-DEXPAND_TEMPLATES) SpecialCPlusPlusExpandRule(SSTemplates..c,SSTemplates.C,-DEXPAND_TEMPLATES) #else diff --git a/cde/programs/dtinfo/mmdb/dstr/Imakefile b/cde/programs/dtinfo/mmdb/dstr/Imakefile index 4e453452..2335ba99 100644 --- a/cde/programs/dtinfo/mmdb/dstr/Imakefile +++ b/cde/programs/dtinfo/mmdb/dstr/Imakefile @@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb//Imakefile #define CplusplusSource YES DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) -#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) EXCEPTION_DEFINES = -DNATIVE_EXCEPTIONS #endif diff --git a/cde/programs/dtinfo/mmdb/dti_cc/main.C b/cde/programs/dtinfo/mmdb/dti_cc/main.C index 013de2f1..9928af39 100644 --- a/cde/programs/dtinfo/mmdb/dti_cc/main.C +++ b/cde/programs/dtinfo/mmdb/dti_cc/main.C @@ -218,7 +218,7 @@ main() char str[128]; - sprintf(str, "\t\nthis is \t another string\t\n"); + snprintf(str, sizeof(str), "\t\nthis is \t another string\t\n"); CC_String cc_str2( (const char *)str); CC_Tokenizer next2( cc_str2 ); diff --git a/cde/programs/dtinfo/mmdb/dti_excs/Imakefile b/cde/programs/dtinfo/mmdb/dti_excs/Imakefile index bb5ce19b..f2348d05 100644 --- a/cde/programs/dtinfo/mmdb/dti_excs/Imakefile +++ b/cde/programs/dtinfo/mmdb/dti_excs/Imakefile @@ -25,7 +25,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 EXCEPTION_DEFINES = -DHAS_TERMINATE -#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) EXCEPTION_DEFINES = -DNATIVE_EXCEPTIONS #endif diff --git a/cde/programs/dtinfo/mmdb/hmphf/Imakefile b/cde/programs/dtinfo/mmdb/hmphf/Imakefile index 919ca249..b3bc5fa3 100644 --- a/cde/programs/dtinfo/mmdb/hmphf/Imakefile +++ b/cde/programs/dtinfo/mmdb/hmphf/Imakefile @@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb//Imakefile #define CplusplusSource YES DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) -#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) EXCEPTION_DEFINES = -DNATIVE_EXCEPTIONS #endif diff --git a/cde/programs/dtinfo/tools/Imakefile b/cde/programs/dtinfo/tools/Imakefile index 65c64ca0..b7ea3520 100644 --- a/cde/programs/dtinfo/tools/Imakefile +++ b/cde/programs/dtinfo/tools/Imakefile @@ -9,9 +9,9 @@ SUBDIRS=misc XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir #undef TopLevelProject #define TopLevelProject DtInfo -IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ - -DProjectTmplFile='' \ - -DProjectRulesFile='' +IMAKE_DEF_DTINFO = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/cde/programs/dtinfo/tools/misc/dfiles.c b/cde/programs/dtinfo/tools/misc/dfiles.c index 7d77f2c1..0c6cf071 100644 --- a/cde/programs/dtinfo/tools/misc/dfiles.c +++ b/cde/programs/dtinfo/tools/misc/dfiles.c @@ -40,7 +40,7 @@ char **argv; { case 'h': { - sprintf(buffer, "%s.h", libname); + snprintf(buffer, sizeof(buffer), "%s.h", libname); hfile = fopen(buffer, "w"); if (!hfile) @@ -55,7 +55,7 @@ char **argv; break; case 'd': { - sprintf(buffer, "%s.d", libname); + snprintf(buffer, sizeof(buffer), "%s.d", libname); dfile = fopen(buffer, "w"); if (!dfile) -- 2.25.1