From 42e891d9e7e550d222b7a70d9c45b2da4555037f Mon Sep 17 00:00:00 2001 From: Ulrich Wilkens Date: Tue, 23 Sep 2014 23:16:35 +0200 Subject: [PATCH] Resolve many build warnings This patch fixes many warnings from the beginning of the build up to and including the depend stage. Nearly all warnings should be gone even with -Wall. --- cde/.gitignore | 10 + cde/Makefile | 5 +- cde/config/cf/Imake.rules | 27 +- cde/config/cf/OpenBSD.cf | 2 + cde/config/cf/cde.tmpl | 2 +- cde/config/imake/ccimake.c | 2 +- cde/config/imake/imake.c | 82 +-- cde/config/makedepend/cppsetup.c | 6 +- cde/config/makedepend/def.h | 10 + cde/config/makedepend/ifparser.c | 14 +- cde/config/makedepend/include.c | 11 +- cde/config/makedepend/main.c | 8 +- cde/config/makedepend/parse.c | 20 +- cde/config/makedepend/pr.c | 6 +- cde/config/util/makestrs.c | 47 +- cde/lib/DtTerm/Imakefile | 2 - cde/lib/DtTerm/util/lineToData.c | 28 +- cde/lib/csa/Imakefile | 2 +- cde/lib/tt/lib/Imakefile | 2 + cde/programs/dtappbuilder/src/ab/Imakefile | 37 +- .../dtappbuilder/src/abmf/make_file.c | 270 ++++++++- .../dtappbuilder/src/libAButil/util.c | 100 ++-- .../dtappbuilder/src/libAButil/util.h | 6 +- .../dtappbuilder/src/libAButil/util_convert.c | 18 +- cde/programs/dtcm/server/Imakefile | 4 +- .../dthelp/parser/canon1/build/build.c | 5 +- .../dthelp/parser/canon1/build/buildutl.c | 8 +- .../dthelp/parser/canon1/build/eltree.c | 4 +- cde/programs/dthelp/parser/canon1/build/fsa.c | 28 +- cde/programs/dthelp/parser/canon1/build/out.c | 44 +- .../dthelp/parser/canon1/build/param.c | 12 +- .../dthelp/parser/canon1/build/proto.h | 2 +- .../dthelp/parser/canon1/build/scan.c | 10 +- .../dthelp/parser/canon1/build/sref.c | 13 +- .../dthelp/parser/canon1/eltdef/context.dat | 22 +- .../dthelp/parser/canon1/eltdef/eltdef.c | 8 +- .../dthelp/parser/canon1/eltdef/eltutil.c | 10 +- .../dthelp/parser/canon1/eltdef/entity.c | 2 +- .../dthelp/parser/canon1/eltdef/proto.h | 2 +- .../dthelp/parser/canon1/eltdef/scan.c | 6 +- .../dthelp/parser/canon1/util/basic.h | 18 + .../dthelp/parser/canon1/util/chartype.h | 512 +++++++++--------- .../dthelp/parser/canon1/util/conutil.c | 40 +- .../dthelp/parser/canon1/util/entout.c | 19 +- .../dthelp/parser/canon1/util/error.c | 4 +- .../dthelp/parser/canon1/util/fclndir.c | 10 +- .../dthelp/parser/canon1/util/malloc.c | 16 +- .../dthelp/parser/canon1/util/scanutil.c | 10 +- cde/programs/dthelp/parser/canon1/util/trie.c | 2 +- .../dthelp/parser/canon1/util/triecnt.c | 10 +- .../dthelp/parser/canon1/util/triedump.c | 6 +- .../dthelp/parser/canon1/util/wchar.c | 14 +- .../dthelp/parser/pass1/build/build.c | 5 +- .../dthelp/parser/pass1/build/buildutl.c | 8 +- .../dthelp/parser/pass1/build/eltree.c | 2 +- cde/programs/dthelp/parser/pass1/build/fsa.c | 28 +- cde/programs/dthelp/parser/pass1/build/out.c | 44 +- .../dthelp/parser/pass1/build/param.c | 12 +- .../dthelp/parser/pass1/build/proto.h | 2 +- cde/programs/dthelp/parser/pass1/build/scan.c | 10 +- cde/programs/dthelp/parser/pass1/build/sref.c | 13 +- .../dthelp/parser/pass1/eltdef/context.dat | 22 +- .../dthelp/parser/pass1/eltdef/eltdef.c | 5 +- .../dthelp/parser/pass1/eltdef/eltutil.c | 10 +- .../dthelp/parser/pass1/eltdef/entity.c | 2 +- .../dthelp/parser/pass1/eltdef/scan.c | 6 +- cde/programs/dthelp/parser/pass1/util/basic.h | 18 + .../dthelp/parser/pass1/util/chartype.h | 512 +++++++++--------- .../dthelp/parser/pass1/util/conutil.c | 40 +- .../dthelp/parser/pass1/util/entout.c | 19 +- .../dthelp/parser/pass1/util/fclndir.c | 10 +- .../dthelp/parser/pass1/util/malloc.c | 16 +- .../dthelp/parser/pass1/util/scanutil.c | 10 +- cde/programs/dthelp/parser/pass1/util/trie.c | 2 +- .../dthelp/parser/pass1/util/triecnt.c | 10 +- .../dthelp/parser/pass1/util/triedump.c | 6 +- cde/programs/dthelp/parser/pass1/util/wchar.c | 14 +- .../dthelp/parser/pass2/build/build.c | 5 +- .../dthelp/parser/pass2/build/buildutl.c | 8 +- .../dthelp/parser/pass2/build/eltree.c | 4 +- cde/programs/dthelp/parser/pass2/build/fsa.c | 28 +- cde/programs/dthelp/parser/pass2/build/out.c | 38 +- .../dthelp/parser/pass2/build/param.c | 12 +- .../dthelp/parser/pass2/build/proto.h | 2 +- cde/programs/dthelp/parser/pass2/build/scan.c | 10 +- cde/programs/dthelp/parser/pass2/build/sref.c | 13 +- .../dthelp/parser/pass2/eltdef/context.dat | 22 +- .../dthelp/parser/pass2/eltdef/eltdef.c | 8 +- .../dthelp/parser/pass2/eltdef/eltutil.c | 10 +- .../dthelp/parser/pass2/eltdef/entity.c | 2 +- .../dthelp/parser/pass2/eltdef/proto.h | 2 +- .../dthelp/parser/pass2/eltdef/scan.c | 6 +- cde/programs/dthelp/parser/pass2/util/basic.h | 18 + .../dthelp/parser/pass2/util/chartype.h | 512 +++++++++--------- cde/programs/dthelp/parser/pass2/util/cont.h | 2 +- .../dthelp/parser/pass2/util/context.c | 2 +- .../dthelp/parser/pass2/util/conutil.c | 40 +- .../dthelp/parser/pass2/util/entout.c | 19 +- cde/programs/dthelp/parser/pass2/util/error.c | 4 +- .../dthelp/parser/pass2/util/fclndir.c | 10 +- .../dthelp/parser/pass2/util/malloc.c | 16 +- .../dthelp/parser/pass2/util/scanutil.c | 10 +- cde/programs/dthelp/parser/pass2/util/trie.c | 2 +- .../dthelp/parser/pass2/util/triecnt.c | 10 +- .../dthelp/parser/pass2/util/triedump.c | 6 +- cde/programs/dthelp/parser/pass2/util/wchar.c | 14 +- cde/programs/dtinfo/DtMmdb/Imakefile | 2 - .../dtinfo/DtMmdb/btree_berkeley/bt_split.c | 4 +- .../dtinfo/DtMmdb/btree_berkeley/mpool.c | 10 +- .../dtinfo/DtMmdb/btree_berkeley/mpool.h | 2 +- cde/programs/dtinfo/DtMmdb/dynhash/data_t.C | 2 +- .../dtinfo/dtinfo/src/Agents/IcccmAgent.C | 2 +- .../dtinfo/src/Agents/NodeWindowAgentMotif.C | 2 +- .../dtinfo/dtinfo/src/Managers/TtIpcMgr.C | 4 +- cde/programs/dtinfo/dtinfo/src/cgm/Imakefile | 19 +- .../dtinfogen/infolib/etc/GraphicsTask.C | 6 +- cde/programs/dtinfo/mmdb/Imakefile | 2 - cde/programs/dtinfo/tools/misc/dfiles.c | 2 +- cde/programs/dtinfo/tools/misc/msgsets.C | 9 +- cde/programs/dtinfo/tools/misc/pmaker.c | 2 +- cde/programs/dtksh/MakeClean | 21 + cde/programs/localized/templates/header2.tmpl | 2 - cde/programs/localized/templates/msg.C.tmpl | 2 + cde/programs/nsgmls/Imakefile | 2 + cde/programs/ttsnoop/Imakefile | 36 +- 125 files changed, 1918 insertions(+), 1432 deletions(-) diff --git a/cde/.gitignore b/cde/.gitignore index 3f5f61e3..6b812a3f 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -209,7 +209,12 @@ programs/dtappbuilder/src/ab/Makefile.aix programs/dtappbuilder/src/ab/Makefile.hpux programs/dtappbuilder/src/ab/Makefile.osf1 programs/dtappbuilder/src/ab/Makefile.sunos +programs/dtappbuilder/src/ab/Makefile.unixware programs/dtappbuilder/src/ab/Makefile.uxp +programs/dtappbuilder/src/ab/Makefile.linux +programs/dtappbuilder/src/ab/Makefile.freebsd +programs/dtappbuilder/src/ab/Makefile.netbsd +programs/dtappbuilder/src/ab/Makefile.openbsd programs/dtappbuilder/src/ab/about_box.res programs/dtappbuilder/src/ab/about_box_ui.c programs/dtappbuilder/src/ab/about_box_ui.h @@ -2263,7 +2268,12 @@ programs/ttsnoop/Makefile.aix programs/ttsnoop/Makefile.hpux programs/ttsnoop/Makefile.osf1 programs/ttsnoop/Makefile.sunos +programs/ttsnoop/Makefile.unixware programs/ttsnoop/Makefile.uxp +programs/ttsnoop/Makefile.linux +programs/ttsnoop/Makefile.freebsd +programs/ttsnoop/Makefile.netbsd +programs/ttsnoop/Makefile.openbsd programs/ttsnoop/Ttsnoop programs/ttsnoop/apiTracer_stubs.C programs/ttsnoop/apiTracer_stubs.c.BAK diff --git a/cde/Makefile b/cde/Makefile index fae4a50d..b5fd7b47 100644 --- a/cde/Makefile +++ b/cde/Makefile @@ -127,7 +127,7 @@ World.doc: # This is just a sequence of bootstrapping steps we have to do. # The steps are listed as separate targets so clearmake can wink in # the Makefile.proto files. -Makefile.boot: imake.proto $(DEPENDSRC)/Makefile.proto depend.bootstrap $(IMAKESRC)/Makefile.proto imake.bootstrap +Makefile.boot: imake.proto $(DEPENDSRC)/Makefile.proto depend.bootstrap $(IMAKESRC)/Makefile.proto imake.bootstrap $(DEPENDSRC)/proto.clean imake.proto: cd $(IMAKESRC) && $(MAKE) $(FLAGS) @@ -152,6 +152,9 @@ imake.bootstrap: else exit 0; fi $(MAKE) $(MFLAGS) xmakefile +$(DEPENDSRC)/proto.clean: + cd $(DEPENDSRC) && $(RM) -r Makefile.proto + Makefile:: $(MAKE) $(MFLAGS) xmakefile diff --git a/cde/config/cf/Imake.rules b/cde/config/cf/Imake.rules index 7fd43030..78e18343 100644 --- a/cde/config/cf/Imake.rules +++ b/cde/config/cf/Imake.rules @@ -154,6 +154,7 @@ XCOMM rules: $TOG: Imake.rules /main/227 1998/02/02 12:07:57 kaleb $ * MakeLintSubdirs (dirs,target,subtarget) * LintSubdirs (dirs) * MakeLintLibSubdirs (dirs) + * MakeMakeOneSubdirs () * MakeMakeSubdirs (dirs,target) * MakefileSubdirs (dirs) * CppScriptTarget (dst,src,defs,deplist) @@ -2297,23 +2298,30 @@ MakeLintSubdirs(dirs,lintlib,lintlib) #endif /* MakeLintLibSubdirs */ +/* + * MakeMakeOneSubdirs - generate rules to recreate $(ONESUBDIR)/Makefile + * as part of the specified step in the build. This separate, explicit target + * exists so that clearmake will know what its goal is and do wink-in. + */ +#ifndef MakeMakeOneSubdirs +#define MakeMakeOneSubdirs() @@\ +$(ONESUBDIR)/Makefile: @@\ + @MakeFlagsToShellFlags(n,executeit="no"); \ @@\ + cd $(ONESUBDIR); \ @@\ + if [ "$$executeit" != "no" ]; then \ @@\ + ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\ + fi; +#endif /* MakeMakeOneSubdirs */ + + /* * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part * of the specified step in the build. If $(TOP) is set to an absolute path, * do not prepend the ../ prefix. This makes running things outside of the * source tree much easier. - * $(ONESUBDIR)/Makefile exists as a separate, explicit target so that - * clearmake will know what its goal is and do wink-in. */ #ifndef MakeMakeSubdirs #define MakeMakeSubdirs(dirs,target) @@\ -$(ONESUBDIR)/Makefile: @@\ - @MakeFlagsToShellFlags(n,executeit="no"); \ @@\ - cd $(ONESUBDIR); \ @@\ - if [ "$$executeit" != "no" ]; then \ @@\ - ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\ - fi; @@\ - @@\ target:: @@\ -@MakeFlagsToShellFlags(ik,set +e); \ @@\ MakeFlagsToShellFlags(n,executeit="no"); \ @@\ @@ -2380,6 +2388,7 @@ target:: @@\ */ #ifndef MakefileSubdirs #define MakefileSubdirs(dirs) @@\ +MakeMakeOneSubdirs() @@\ MakeMakeSubdirs(dirs,Makefiles) #endif /* MakefileSubdirs */ diff --git a/cde/config/cf/OpenBSD.cf b/cde/config/cf/OpenBSD.cf index 6a119d3a..96ac66e7 100644 --- a/cde/config/cf/OpenBSD.cf +++ b/cde/config/cf/OpenBSD.cf @@ -1048,6 +1048,8 @@ CXXDEPENDINCLUDE != echo | `CcCmd -print-prog-name=cc1plus` -v 2>&1 | \ #define LibraryCplusplusOptions -Wall -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch #endif +#define DependFileName .depend + #define ArchitectureDefines -DOPENBSD_ARCHITECTURE #define BuildLibPathVar LD_LIBRARY_PATH diff --git a/cde/config/cf/cde.tmpl b/cde/config/cf/cde.tmpl index 197c4972..e4053145 100644 --- a/cde/config/cf/cde.tmpl +++ b/cde/config/cf/cde.tmpl @@ -223,7 +223,7 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $ # if UseInstalledCDE # define DtCodeGen dtcodegen # else -# define DtCodeGen $(CLIENTENVSETUP) $(CDESRC)/dtappbuilder/src/abmf/dtcodegen +# define DtCodeGen $(CLIENTENVSETUP) $(DTCODEGENCAT) $(CDESRC)/dtappbuilder/src/abmf/dtcodegen # endif #endif diff --git a/cde/config/imake/ccimake.c b/cde/config/imake/ccimake.c index b6604a56..1a4fde60 100644 --- a/cde/config/imake/ccimake.c +++ b/cde/config/imake/ccimake.c @@ -61,7 +61,7 @@ in this Software without prior written authorization from The Open Group . int main(void) { - write(1, imake_ccflags, sizeof(imake_ccflags) - 1); + ssize_t ret = write(1, imake_ccflags, sizeof(imake_ccflags) - 1); return EXIT_SUCCESS; } diff --git a/cde/config/imake/imake.c b/cde/config/imake/imake.c index cf0063f3..1bb83351 100644 --- a/cde/config/imake/imake.c +++ b/cde/config/imake/imake.c @@ -405,13 +405,14 @@ main(int argc, char *argv[]) tmpMakefile = Makefile; else { tmpMakefile = Strdup(tmpMakefile); - mkstemp(tmpMakefile); + int ret = mkstemp(tmpMakefile); + (void) ret; } AddMakeArg("-f"); AddMakeArg( tmpMakefile ); - sprintf(makeMacro, "MAKE=%s", program); + snprintf(makeMacro, BUFSIZ, "MAKE=%s", program); AddMakeArg( makeMacro ); - sprintf(makefileMacro, "MAKEFILE=%s", Imakefile); + snprintf(makefileMacro, BUFSIZ, "MAKEFILE=%s", Imakefile); AddMakeArg( makefileMacro ); if ((tmpfd = fopen(tmpMakefile, "w+")) == NULL) @@ -709,7 +710,8 @@ optional_include(FILE *inFile, const char *defsym, const char *fname) { errno = 0; if (access(fname, R_OK) == 0) { - LogMsg(OverrideWarning, fname); + if(errno) + LogMsg(OverrideWarning, fname); return (fprintf(inFile, LocalDefineFmt, defsym, fname) < 0 || fprintf(inFile, IncludeFmt, defsym) < 0); } @@ -780,35 +782,35 @@ parse_utsname(struct utsname *name, const char *fmt, char *result, const char *m case 's': if (arg > 0) *ptr++ = ' '; - strcpy(ptr, name->sysname); + strncpy(ptr, name->sysname, SYS_NMLN); ptr += strlen(ptr); break; case 'n': if (arg > 0) *ptr++ = ' '; - strcpy(ptr, name->nodename); + strncpy(ptr, name->nodename, SYS_NMLN); ptr += strlen(ptr); break; case 'r': if (arg > 0) *ptr++ = ' '; - strcpy(ptr, name->release); + strncpy(ptr, name->release, SYS_NMLN); ptr += strlen(ptr); break; case 'v': if (arg > 0) *ptr++ = ' '; - strcpy(ptr, name->version); + strncpy(ptr, name->version, SYS_NMLN); ptr += strlen(ptr); break; case 'm': if (arg > 0) *ptr++ = ' '; - strcpy(ptr, name->machine); + strncpy(ptr, name->machine, SYS_NMLN); ptr += strlen(ptr); break; @@ -823,7 +825,8 @@ parse_utsname(struct utsname *name, const char *fmt, char *result, const char *m /* Parse the buffer. The sscanf() return value is rarely correct. */ *result = '\0'; - (void) sscanf(buf, fmt + arg + 1, result); + int ret = sscanf(buf, fmt + arg + 1, result); + (void) ret; } #endif @@ -993,7 +996,8 @@ get_libc_version(FILE *inFile) */ if (readlink (libcso, buf, PATH_MAX) >= 0) { for (ptr = buf; *ptr && !isdigit (*ptr); ptr++); - (void) sscanf (ptr, "%d.%d.%d", &libcmajor, &libcminor, &libcteeny); + int ret = sscanf (ptr, "%d.%d.%d", &libcmajor, &libcminor, &libcteeny); + (void) ret; fprintf(inFile, "#define DefaultLinuxCLibMajorVersion %d\n", libcmajor); fprintf(inFile, "#define DefaultLinuxCLibMinorVersion %d\n", libcminor); fprintf(inFile, "#define DefaultLinuxCLibTeenyVersion %d\n", libcteeny); @@ -1014,17 +1018,17 @@ get_libc_version(FILE *inFile) memset(&aout, '\0', PATH_MAX); if (!lstat(getenv("TMPDIR"), &sb) && S_ISDIR(sb.st_mode)) - strcpy(aout, getenv("TMPDIR")); + strncpy(aout, getenv("TMPDIR"), PATH_MAX); #ifdef P_tmpdir /* defined by XPG and XOPEN, but don't assume we have it */ else if (!lstat(P_tmpdir, &sb) && S_ISDIR(sb.st_mode)) - strcpy(aout, P_tmpdir); + strncpy(aout, P_tmpdir, PATH_MAX); #endif else if (!lstat("/tmp", &sb) && S_ISDIR(sb.st_mode)) - strcpy(aout, "/tmp"); + strncpy(aout, "/tmp", PATH_MAX); else abort(); - strcpy(aout+strlen(aout), "/imaketmp.XXXXXX"); + strncpy(aout+strlen(aout), "/imaketmp.XXXXXX", 16); if ((fd = mkstemp(aout)) == -1) abort (); @@ -1051,7 +1055,7 @@ get_libc_version(FILE *inFile) abort (); while (fgets (command, len, fp)) - fprintf (inFile, command); + fprintf (inFile, "%s", command); len = pclose (fp); remove (aout); @@ -1073,7 +1077,8 @@ get_ld_version(FILE *inFile) c = fgetc (ldprog); } while (c != EOF && !isdigit (c)); ungetc (c, ldprog); - (void) fscanf (ldprog, "%d.%d", &ldmajor, &ldminor); + int ret = fscanf (ldprog, "%d.%d", &ldmajor, &ldminor); + (void) ret; fprintf(inFile, "#define DefaultLinuxBinUtilsMajorVersion %d\n", ldmajor * 10 + ldminor); pclose (ldprog); @@ -1097,15 +1102,16 @@ get_sun_compiler_versions(FILE *inFile) char* vptr; struct stat sb; FILE* ccproc; + int ret; if (lstat (sunpro_cc, &sb) == 0) { - strcpy (cmd, sunpro_cc); - strcat (cmd, " -V 2>&1"); + strncpy (cmd, sunpro_cc, PATH_MAX); + strncat (cmd, " -V 2>&1", 8); if ((ccproc = popen (cmd, "r")) != NULL) { if (fgets (buf, PATH_MAX, ccproc) != NULL) { vptr = strrchr (buf, 'C'); for (; !isdigit(*vptr); vptr++); - (void) sscanf (vptr, "%d.%d", &cmajor, &cminor); + ret = sscanf (vptr, "%d.%d", &cmajor, &cminor); fprintf (inFile, "#define DefaultSunProCCompilerMajorVersion %d\n", cmajor); @@ -1118,13 +1124,13 @@ get_sun_compiler_versions(FILE *inFile) } } if (lstat (sunpro_CC, &sb) == 0) { - strcpy (cmd, sunpro_CC); - strcat (cmd, " -V 2>&1"); + strncpy (cmd, sunpro_CC, PATH_MAX); + strncat (cmd, " -V 2>&1", 8); if ((ccproc = popen (cmd, "r")) != NULL) { if (fgets (buf, PATH_MAX, ccproc) != NULL) { vptr = strrchr (buf, 'C'); for (; !isdigit(*vptr); vptr++); - (void) sscanf (vptr, "%d.%d", &cmajor, &cminor); + ret = sscanf (vptr, "%d.%d", &cmajor, &cminor); fprintf (inFile, "#define DefaultSunProCplusplusCompilerMajorVersion %d\n", cmajor); @@ -1136,6 +1142,7 @@ get_sun_compiler_versions(FILE *inFile) pclose (ccproc); } } + (void) ret; } #endif @@ -1159,12 +1166,12 @@ get_gcc_incdir(FILE *inFile) buf[0] = '\0'; for (i = 0; i < sizeof gcc_path / sizeof gcc_path[0]; i++) { if (lstat (gcc_path[i], &sb) == 0) { - strcpy (cmd, gcc_path[i]); - strcat (cmd, " --print-libgcc-file-name"); + strncpy (cmd, gcc_path[i], PATH_MAX - 25); + strncpy (cmd + strlen(cmd), " --print-libgcc-file-name", 25); if ((gccproc = popen (cmd, "r")) != NULL) { if (fgets (buf, PATH_MAX, gccproc) != NULL) { ptr = strstr (buf, "libgcc.a"); - if (ptr) strcpy (ptr, "include"); + if (ptr) strncpy (ptr, "include", 7); } (void) pclose (gccproc); break; @@ -1262,7 +1269,7 @@ cppit(const char *imakefile, const char *template, const char *masterc, FILE *ou fprintf(inFile, IncludeFmt, ImakeTmplSym) < 0 || optional_include(inFile, "IMAKE_ADMIN_MACROS", "adminmacros") || optional_include(inFile, "IMAKE_LOCAL_MACROS", "localmacros") || - fflush(inFile) || + fflush(inFile) || fclose(inFile)) LogFatal("Cannot write to %s.", masterc); /* @@ -1334,7 +1341,8 @@ CleanCppInput(char *imakefile) strcmp(ptoken, "undef")) { if (outFile == NULL) { tmpImakefile = Strdup(tmpImakefile); - mkstemp(tmpImakefile); + int ret = mkstemp(tmpImakefile); + (void) ret; outFile = fopen(tmpImakefile, "w"); if (outFile == NULL) LogFatal("Cannot open %s for write.", @@ -1413,10 +1421,10 @@ isempty(char *line) if (*pend == 'l' && pend[1] == 'i' && pend[2] == 'n' && pend[3] == 'e' && pend[4] == ' ') pend += 5; - if (isdigit(*pend)) { + if (isdigit((int)*pend)) { do { pend++; - } while (isdigit(*pend)); + } while (isdigit((int)*pend)); if (*pend == '\n' || *pend == '\0') return(TRUE); if (*pend++ == ' ' && *pend == '"') @@ -1432,7 +1440,7 @@ isempty(char *line) (pend[5] == ' ' || pend[5] == '\t' || pend[5] == '\0')) { *pend = '#'; - strcpy(pend+1, pend+5); + strncpy(pend+1, pend+5, 1); } #ifdef MAGIC_MAKE_VARS if (*pend == 'X' && pend[1] == 'V' && pend[2] == 'A' && @@ -1445,7 +1453,7 @@ isempty(char *line) pend[7] >= '0' && pend[7] <= '9') { i = pend[7] - '0'; - sprintf(varbuf, "%0.4d", xvariable); + snprintf(varbuf, 5, "%0.4d", xvariable); strncpy(pend+4, varbuf, 4); xvariables[i] = xvariable; xvariable = (xvariable + 1) % 10000; @@ -1455,7 +1463,7 @@ isempty(char *line) pend[7] <= '9') { i = pend[7] - '0'; - sprintf(varbuf, "%0.4d", xvariables[i]); + snprintf(varbuf, 5, "%0.4d", xvariables[i]); strncpy(pend+4, varbuf, 4); } } @@ -1504,7 +1512,8 @@ ReadLine(FILE *tmpfd, const char *tmpfname) if (! tmpfd) LogFatal("cannot reopen %s.", tmpfname); #else /* !SYSV */ - ftruncate(fileno(tmpfd), (off_t) 0); + int ret = ftruncate(fileno(tmpfd), (off_t) 0); + (void) ret; #endif /* !SYSV */ initialized = TRUE; fprintf (tmpfd, "# Makefile generated by imake - do not edit!\n"); @@ -1515,7 +1524,8 @@ ReadLine(FILE *tmpfd, const char *tmpfname) for (p1 = pline; p1 < end; p1++) { if (*p1 == '@' && *(p1+1) == '@' /* ignore ClearCase version-extended pathnames */ - && !(p1 != pline && !isspace(*(p1-1)) && *(p1+2) == '/')) + && !(p1 != pline && !isspace((int)*(p1-1)) + && *(p1+2) == '/')) { /* soft EOL */ *p1++ = '\0'; p1++; /* skip over second @ */ @@ -1652,6 +1662,6 @@ Strdup(const char *cp) { char *new = Emalloc(strlen(cp) + 1); - strcpy(new, cp); + strncpy(new, cp, strlen(cp) + 1); return new; } diff --git a/cde/config/makedepend/cppsetup.c b/cde/config/makedepend/cppsetup.c index 3b281641..4e983fc8 100644 --- a/cde/config/makedepend/cppsetup.c +++ b/cde/config/makedepend/cppsetup.c @@ -161,7 +161,7 @@ my_if_errors (ip, cp, expecting) int prefixlen; int i; - sprintf (prefix, "\"%s\":%d", filename, lineno); + snprintf (prefix, 300, "\"%s\":%d", filename, lineno); prefixlen = strlen(prefix); fprintf (stderr, "%s: %s", prefix, pd->line); i = cp - pd->line; @@ -224,7 +224,7 @@ my_eval_variable (ip, var, len) return 0; do { var = (*s)->s_value; - if (!isvarfirstletter(*var) || !strcmp((*s)->s_name, var)) + if (!isvarfirstletter((int)*var) || !strcmp((*s)->s_name, var)) break; s = lookup_variable (ip, var, strlen(var)); } while (s); @@ -235,7 +235,7 @@ my_eval_variable (ip, var, len) } -cppsetup(line, filep, inc) +int cppsetup(line, filep, inc) register char *line; register struct filepointer *filep; register struct inclist *inc; diff --git a/cde/config/makedepend/def.h b/cde/config/makedepend/def.h index 16782226..ed05d222 100644 --- a/cde/config/makedepend/def.h +++ b/cde/config/makedepend/def.h @@ -148,6 +148,7 @@ char *malloc(); char *realloc(); #endif +int match(); char *copy(); char *base_name(); char *our_getline(); @@ -155,8 +156,17 @@ struct symtab **slookup(); struct symtab **isdefined(); struct symtab **fdefined(); struct filepointer *getfile(); +void included_by(); struct inclist *newinclude(); +void inc_clean(); struct inclist *inc_path(); +void freefile(); +void define2(); +void define(); +int find_includes(); +void recursive_pr_include(); +void add_include(); +int cppsetup(); #if NeedVarargsPrototypes extern void fatalerr(char *, ...); diff --git a/cde/config/makedepend/ifparser.c b/cde/config/makedepend/ifparser.c index 9bec2d5a..ec5ef8c4 100644 --- a/cde/config/makedepend/ifparser.c +++ b/cde/config/makedepend/ifparser.c @@ -81,6 +81,8 @@ #include "ifparser.h" #include +#include +#include #include /**************************************************************************** @@ -89,8 +91,8 @@ #define DO(val) if (!(val)) return NULL #define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff)) -#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++ -#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') +#define SKIPSPACE(ccc) while (isspace((int)*ccc)) ccc++ +#define isvarfirstletter(ccc) (isalpha((int)ccc) || (ccc) == '_') static const char * @@ -106,7 +108,7 @@ parse_variable (g, cp, varp) *varp = cp; /* EMPTY */ - for (cp++; isalnum(*cp) || *cp == '_'; cp++) ; + for (cp++; isalnum((int)*cp) || *cp == '_'; cp++) ; return cp; } @@ -120,7 +122,7 @@ parse_number (g, cp, valp) long base = 10; SKIPSPACE (cp); - if (!isdigit(*cp)) + if (!isdigit((int)*cp)) return CALLFUNC(g, handle_error) (g, cp, "number"); *valp = 0; @@ -248,7 +250,7 @@ parse_value (g, cp, valp) return cp + 1; case 'd': - if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) { + if (strncmp (cp, "defined", 7) == 0 && !isalnum((int)cp[7])) { int paren = 0; int len; @@ -269,7 +271,7 @@ parse_value (g, cp, valp) /* fall out */ } - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { DO (cp = parse_number (g, cp, valp)); } else if (!isvarfirstletter(*cp)) return CALLFUNC(g, handle_error) (g, cp, "variable or number"); diff --git a/cde/config/makedepend/include.c b/cde/config/makedepend/include.c index 1762e5f0..6c5b1485 100644 --- a/cde/config/makedepend/include.c +++ b/cde/config/makedepend/include.c @@ -79,7 +79,7 @@ issymbolic(dir, component) struct stat st; char buf[ BUFSIZ ], **pp; - sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component); + snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", component); for (pp=notdotdot; *pp; pp++) if (strcmp(*pp, buf) == 0) return (TRUE); @@ -166,7 +166,7 @@ remove_dotdot(path) /* * copy the reconstituted path back to our pointer. */ - strcpy(path, newpath); + strncpy(path, newpath, BUFSIZ); } /* @@ -299,11 +299,12 @@ struct inclist *inc_path(file, include, dot) if (*p == '/') break; if (p == file) - strcpy(path, include); + strncpy(path, include, BUFSIZ); else { strncpy(path, file, (p-file) + 1); path[ (p-file) + 1 ] = '\0'; - strcpy(path + (p-file) + 1, include); + strncpy(path + (p-file) + 1, include, + BUFSIZ - (p-file) - 1); } remove_dotdot(path); if (stat(path, &st) == 0) { @@ -320,7 +321,7 @@ struct inclist *inc_path(file, include, dot) */ if (!found) for (pp = includedirs; *pp; pp++) { - sprintf(path, "%s/%s", *pp, include); + snprintf(path, BUFSIZ, "%s/%s", *pp, include); remove_dotdot(path); if (stat(path, &st) == 0) { ip = newinclude(path, include); diff --git a/cde/config/makedepend/main.c b/cde/config/makedepend/main.c index a28f2a54..d76625b8 100644 --- a/cde/config/makedepend/main.c +++ b/cde/config/makedepend/main.c @@ -148,7 +148,7 @@ catch (sig) struct sigaction sig_act; #endif /* USGISH */ -main(argc, argv) +int main(argc, argv) int argc; char **argv; { @@ -491,11 +491,11 @@ char *copy(str) { register char *p = (char *)malloc(strlen(str) + 1); - strcpy(p, str); + strncpy(p, str, strlen(str) + 1); return(p); } -match(str, list) +int match(str, list) register char *str, **list; { register int i; @@ -642,7 +642,7 @@ redirect(line, makefile) stat(makefile, &st); if ((fdin = fopen(makefile, "r")) == NULL) fatalerr("cannot open \"%s\"\n", makefile); - sprintf(backup, "%s.bak", makefile); + snprintf(backup, BUFSIZ, "%s.bak", makefile); unlink(backup); #ifdef WIN32 fclose(fdin); diff --git a/cde/config/makedepend/parse.c b/cde/config/makedepend/parse.c index 942d1722..4e6a4892 100644 --- a/cde/config/makedepend/parse.c +++ b/cde/config/makedepend/parse.c @@ -45,6 +45,10 @@ in this Software without prior written authorization from The Open Group. #include "def.h" +static int deftype(); +static int zero_value(); +static int merge2defines(); + extern char *directives[]; extern struct inclist maininclist; @@ -56,7 +60,7 @@ gobble(filep, file, file_red) register char *line; register int type; - while (line = our_getline(filep)) { + while ((line = our_getline(filep))) { switch(type = deftype(line, filep, file_red, file, FALSE)) { case IF: case IFFALSE: @@ -189,7 +193,7 @@ int deftype (line, filep, file_red, file, parse_it) /* * separate the name of a single symbol. */ - while (isalnum(*p) || *p == '_') + while (isalnum((int)*p) || *p == '_') *line++ = *p++; *line = '\0'; break; @@ -265,7 +269,7 @@ struct symtab **fdefined(symbol, file, srcfile) if (file->i_flags & DEFCHECKED) return(NULL); file->i_flags |= DEFCHECKED; - if (val = slookup(symbol, file)) + if ((val = slookup(symbol, file))) debug(1,("%s defined in %s as %s\n", symbol, file->i_file, (*val)->s_value)); if (val == NULL && file->i_list) @@ -294,12 +298,12 @@ struct symtab **isdefined(symbol, file, srcfile) { register struct symtab **val; - if (val = slookup(symbol, &maininclist)) { + if ((val = slookup(symbol, &maininclist))) { debug(1,("%s defined on command line\n", symbol)); if (srcfile != NULL) *srcfile = &maininclist; return(val); } - if (val = fdefined(symbol, file, srcfile)) + if ((val = fdefined(symbol, file, srcfile))) return(val); debug(1,("%s not defined in %s\n", symbol, file->i_file)); return(NULL); @@ -314,7 +318,7 @@ zero_value(exp, filep, file_red) register struct filepointer *filep; register struct inclist *file_red; { - if (cppsetup(exp, filep, file_red)) + if ((cppsetup(exp, filep, file_red))) return(IFFALSE); else return(IF); @@ -413,7 +417,7 @@ define(def, file) /* Separate symbol name and its value */ val = def; - while (isalnum(*val) || *val == '_') + while (isalnum((int)*val) || *val == '_') val++; if (*val) *val++ = '\0'; @@ -549,7 +553,7 @@ find_includes(filep, file, file_red, recursion, failOK) register int type; boolean recfailOK; - while (line = our_getline(filep)) { + while ((line = our_getline(filep))) { switch(type = deftype(line, filep, file_red, file, TRUE)) { case IF: doif: diff --git a/cde/config/makedepend/pr.c b/cde/config/makedepend/pr.c index 14e839bf..0c236185 100644 --- a/cde/config/makedepend/pr.c +++ b/cde/config/makedepend/pr.c @@ -107,13 +107,13 @@ pr(ip, file, base) len = strlen(ip->i_file)+1; if (current_len + len > width || file != lastfile) { lastfile = file; - sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix, - ip->i_file); + snprintf(buf, BUFSIZ, "\n%s%s%s: %s", objprefix, base, + objsuffix, ip->i_file); len = current_len = strlen(buf); } else { buf[0] = ' '; - strcpy(buf+1, ip->i_file); + strncpy(buf+1, ip->i_file, BUFSIZ - 1); current_len += len; } fwrite(buf, len, 1, stdout); diff --git a/cde/config/util/makestrs.c b/cde/config/util/makestrs.c index 62a1c4f3..f3618bcb 100644 --- a/cde/config/util/makestrs.c +++ b/cde/config/util/makestrs.c @@ -261,8 +261,8 @@ static void WriteHeader (tagline, phile, abi) { FILE* f; char* tmp; - Table* t; - TableEnt* te; + + static void (*headerproc[])() = { DefaultWriteHeader, ArrayperWriteHeader, IntelABIWriteHeader, IntelABIWriteHeader, @@ -284,11 +284,14 @@ static void WriteHeader (tagline, phile, abi) if (strcmp (prefixstr, "Xm") == 0) { if ((fileprotstr = malloc (strlen (phile->name) + 3)) == NULL) exit (1); - (void) sprintf (fileprotstr, "_%s_", phile->name); + (void) snprintf (fileprotstr, strlen (phile->name) + 3, + "_%s_", phile->name); } else { if ((fileprotstr = malloc (strlen (phile->name) + strlen (prefixstr) + 3)) == NULL) exit (1); - (void) sprintf (fileprotstr, "_%s%s_", prefixstr, phile->name); + (void) snprintf (fileprotstr, + strlen (phile->name) + strlen (prefixstr) + 3, + "_%s%s_", prefixstr, phile->name); } for (tmp = fileprotstr; *tmp; tmp++) if (*tmp == '.') *tmp = '_'; @@ -404,7 +407,7 @@ static void ArrayperWriteSource (abi) } (void) printf ("%s %sConst char %s%s[] = \"%s\";\n", externdefstr, conststr ? conststr : prefixstr, - te->left, te->right); + prefixstr, te->left, te->right); } } } @@ -520,7 +523,8 @@ static void DoLine(buf) exit(1); if ((phile->name = malloc (strlen (buf + strlen (file_str)) + 1)) == NULL) exit(1); - (void) strcpy (phile->name, buf + strlen (file_str) + 1); + (void) strncpy (phile->name, buf + strlen (file_str) + 1, + strlen (buf + strlen (file_str)) + 1); phile->table = NULL; phile->tablecurrent = NULL; phile->tabletail = &phile->table; @@ -539,7 +543,8 @@ static void DoLine(buf) exit(1); if ((table->name = malloc (strlen (buf + strlen (table_str)) + 1)) == NULL) exit(1); - (void) strcpy (table->name, buf + strlen (table_str) + 1); + (void) strncpy (table->name, buf + strlen (table_str) + 1, + strlen (buf + strlen (table_str)) + 1); table->tableent = NULL; table->tableentcurrent = NULL; table->tableenttail = &table->tableent; @@ -554,27 +559,32 @@ static void DoLine(buf) case X_PREFIX_TOKEN: if ((prefixstr = malloc (strlen (buf + strlen (prefix_str)) + 1)) == NULL) exit(1); - (void) strcpy (prefixstr, buf + strlen (prefix_str) + 1); + (void) strncpy (prefixstr, buf + strlen (prefix_str) + 1, + strlen (buf + strlen (prefix_str)) + 1); break; case X_FEATURE_TOKEN: if ((featurestr = malloc (strlen (buf + strlen (feature_str)) + 1)) == NULL) exit(1); - (void) strcpy (featurestr, buf + strlen (feature_str) + 1); + (void) strncpy (featurestr, buf + strlen (feature_str) + 1, + strlen (buf + strlen (feature_str)) + 1); break; case X_EXTERNREF_TOKEN: if ((externrefstr = malloc (strlen (buf + strlen (externref_str)) + 1)) == NULL) exit(1); - (void) strcpy (externrefstr, buf + strlen (externref_str) + 1); + (void) strncpy (externrefstr, buf + strlen (externref_str) + 1, + strlen (buf + strlen (externref_str)) + 1); break; case X_EXTERNDEF_TOKEN: if ((externdefstr = malloc (strlen (buf + strlen (externdef_str)) + 1)) == NULL) exit(1); - (void) strcpy (externdefstr, buf + strlen (externdef_str) + 1); + (void) strncpy (externdefstr, buf + strlen (externdef_str) + 1, + strlen (buf + strlen (externdef_str)) + 1); break; case X_CTMPL_TOKEN: if ((ctmplstr = malloc (strlen (buf + strlen (ctmpl_str)) + 1)) == NULL) exit(1); - (void) strcpy (ctmplstr, buf + strlen (ctmpl_str) + 1); + (void) strncpy (ctmplstr, buf + strlen (ctmpl_str) + 1, + strlen (buf + strlen (ctmpl_str)) + 1); break; case X_HTMPL_TOKEN: if ((filecurrent->tmpl = fopen (buf + strlen (htmpl_str) + 1, "r")) == NULL) { @@ -586,7 +596,8 @@ static void DoLine(buf) case X_CONST_TOKEN: if ((conststr = malloc (strlen (buf + strlen (const_str)) + 1)) == NULL) exit(1); - (void) strcpy (conststr, buf + strlen (const_str) + 1); + (void) strncpy (conststr, buf + strlen (const_str) + 1, + strlen (buf + strlen (const_str)) + 1); break; default: { @@ -596,13 +607,13 @@ static void DoLine(buf) int rlen; int len; - if (right = index(buf, ' ')) + if ((right = index(buf, ' '))) *right++ = 0; else right = buf + 1; if (buf[0] == 'H') { - strcpy (lbuf, prefixstr); - strcat (lbuf, right); + strncpy (lbuf, prefixstr, 1024); + strncat (lbuf, right, strlen(right)); right = lbuf; } @@ -612,10 +623,10 @@ static void DoLine(buf) if ((tableent = (TableEnt*)malloc(sizeof(TableEnt) + len)) == NULL) exit(1); tableent->left = (char *)(tableent + 1); - strcpy(tableent->left, buf); + strncpy(tableent->left, buf, llen); if (llen != len) { tableent->right = tableent->left + llen; - strcpy(tableent->right, right); + strncpy(tableent->right, right, rlen); } else { tableent->right = tableent->left + 1; } diff --git a/cde/lib/DtTerm/Imakefile b/cde/lib/DtTerm/Imakefile index f4d86a66..6646e7d6 100644 --- a/cde/lib/DtTerm/Imakefile +++ b/cde/lib/DtTerm/Imakefile @@ -84,5 +84,3 @@ OBJS = \ $(TERMVIEW_OBJS) #include - -DependTarget() diff --git a/cde/lib/DtTerm/util/lineToData.c b/cde/lib/DtTerm/util/lineToData.c index c98e340f..c1fae2d0 100644 --- a/cde/lib/DtTerm/util/lineToData.c +++ b/cde/lib/DtTerm/util/lineToData.c @@ -41,6 +41,7 @@ static char rcs_id[] = "$XConsortium: lineToData.c /main/1 1996/04/21 19:20:58 d #include "TermPrimLineFontP.h" +int getopt(int argc, char * const argv[], const char *optstring); int ParseChar(char **str); int parseCoord(char **str, char *val, signed char *offset); char * parseToken(char **str); @@ -60,20 +61,13 @@ main(argc, argv) int argc; char **argv; { - int charNum = 0; char buffer[BUFSIZ]; char *bufPtr; char orig[BUFSIZ]; register int i; register char *c; FILE *f; - FILE *tmp; - extern int getopt(); - extern int optind; extern char *optarg; - extern int opterr; - int resolution = 75; /* dots per inch */ - int points; char *prefix = "_Term"; charType *charList = (charType *) 0; @@ -99,8 +93,6 @@ char **argv; int charCount = 0; /* total number of chars in font*/ char *datafilename = "linegen.data"; - int dummyInt; - int error; while (EOF != (i = getopt(argc, argv, "p:f:"))) { switch (i) { @@ -139,7 +131,7 @@ char **argv; } /* back up buffer... */ - (void) strcpy(orig, buffer); + (void) strncpy(orig, buffer, BUFSIZ); bufPtr = buffer; @@ -734,20 +726,20 @@ vis(char val) { char buffer[BUFSIZ]; - if (isprint(val)) { + if (isprint((int)val)) { if (val == '^') { - (void) strcpy(buffer, "'^^'"); + (void) strncpy(buffer, "'^^'", BUFSIZ); } else if (val == '\\') { - (void) strcpy(buffer, "'\\\\'"); + (void) strncpy(buffer, "'\\\\'", BUFSIZ); } else if (val == '\'') { - (void) strcpy(buffer, "'\\\''"); + (void) strncpy(buffer, "'\\\''", BUFSIZ); } else { - (void) sprintf(buffer, "'%c'", val); + (void) snprintf(buffer, BUFSIZ, "'%c'", val); } - } else if (iscntrl(val)) { - (void) sprintf(buffer, "'^%c'", val); + } else if (iscntrl((int)val)) { + (void) snprintf(buffer, BUFSIZ, "'^%c'", val); } else { - (void) sprintf(buffer, "'\\%03o'", val); + (void) snprintf(buffer, BUFSIZ, "'\\%03o'", val); } return(strdup(buffer)); diff --git a/cde/lib/csa/Imakefile b/cde/lib/csa/Imakefile index 1fb1e58d..41373e5f 100644 --- a/cde/lib/csa/Imakefile +++ b/cde/lib/csa/Imakefile @@ -53,7 +53,7 @@ SRCS = agent.c agent_xdr.c api.c \ entry.c free.c hash.c \ iso8601.c laccess.c lutil.c \ match.c nametbl.c refree.c \ - reparser.y rescan.c rpccalls.c \ + reparser.c rescan.c rpccalls.c \ rtable2_clnt.c rtable2_xdr.c rtable3_clnt.c \ rtable3_xdr.c rtable4_clnt.c rtable4_xdr.c \ table.c updateattrs.c xtclient.c \ diff --git a/cde/lib/tt/lib/Imakefile b/cde/lib/tt/lib/Imakefile index 9660c370..877cb5e0 100644 --- a/cde/lib/tt/lib/Imakefile +++ b/cde/lib/tt/lib/Imakefile @@ -211,4 +211,6 @@ OBJS = $(OBJS_1) $(OBJS_2) $(OBJS_3) #include +#if defined(RsArchitecture) || defined(AlphaArchitecture) DependTarget() +#endif diff --git a/cde/programs/dtappbuilder/src/ab/Imakefile b/cde/programs/dtappbuilder/src/ab/Imakefile index 64248805..142b0779 100644 --- a/cde/programs/dtappbuilder/src/ab/Imakefile +++ b/cde/programs/dtappbuilder/src/ab/Imakefile @@ -24,7 +24,7 @@ XCOMM (c) Copyright 1996 Hitachi. * So, when 'all' is made in this directory, redo make includes/depend. * An imake hack no doubt, but it is necessary for now. */ -all:: generated_includes depend +all:: generated_includes abdepend #include "../ab.tmpl" #include "../ab.rules" @@ -174,6 +174,18 @@ SOURCES.msg = \ ../libABobjXm/libABobjXm.msg \ ../libABil/libABil.msg +AB_MAKEFILES = \ + Makefile.aix \ + Makefile.hpux \ + Makefile.sunos \ + Makefile.osf1 \ + Makefile.uxp \ + Makefile.unixware \ + Makefile.linux \ + Makefile.freebsd \ + Makefile.netbsd \ + Makefile.openbsd + #ifndef UngeneratedSource #define UngeneratedSource(macro, suffix) @@\ macro = \ @@\ @@ -240,8 +252,8 @@ Concat(x_util,suffix) UngeneratedSource(NONTGTS.c,.c) UngeneratedSource(NONTGTS.o,.o) -SRCS = $(TARGETS.c) $(TARGETS.c.stubs) $(NONTGTS.c) -OBJS = $(TARGETS.o) $(TARGETS.o.stubs) $(NONTGTS.o) +SRCS2 = $(TARGETS.c) $(TARGETS.c.stubs) $(NONTGTS.c) +OBJS2 = $(TARGETS.o) $(TARGETS.o.stubs) $(NONTGTS.o) SYS_LIBRARIES = -lm $(ICONVSYSLIB) $(DYNLIBSYSLIB) $(REGEXSYSLIB) @@ -276,7 +288,10 @@ LOCAL_LIBRARIES = ../libABil/libABil.a ../libABobjXm/libABobjXm.a \ $(TTLIB) $(UILLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XLIB) \ $(UTILLIB) -$(OBJS): $(SOURCES.h) +/* dtcodegen needs path to catalogfile */ +DTCODEGENCAT = NLSPATH=$(CDESRC)/dtappbuilder/src/abmf/dtcodegen.cat + +$(OBJS2): $(SOURCES.h) XCOMM dtcodegen wants to rewrite some files, so we make copies for it. dtbuilder.msg: dtbuilder.msg.src @@ -286,7 +301,17 @@ dtbuilder.c: dtbuilder.c.src includes:: dtbuilder.msg dtbuilder.c -ComplexProgramTarget(dtbuilder) +all:: $(PROGRAMS) + +ComplexProgramTarget_2(dtbuilder,$(LOCAL_LIBRARIES),) + +abdepend:: DependFileName + +DependFileName:: + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS2)) > $@ + +clean:: + RemoveFile(ProgramTargetName(PROGRAMS)) AbMessageCatalogTarget(dtbuilder) @@ -294,7 +319,7 @@ XCOMM Try to replace the original dtbuilder.msg.src file if necessary. all:: dtbuilder dtbuilder.cat clean:: - $(RM) $(TARGETS.h) $(TARGETS.c) .dtcodegen.log *.delta dtbuilder.c dtbuilder.msg + $(RM) $(TARGETS.h) $(TARGETS.c) $(AB_MAKEFILES) .dtcodegen.log *.delta dtbuilder.c dtbuilder.msg CppSourceFile(Dtbuilder,Dtbuilder.src,$(LOCAL_CPP_DEFINES),) diff --git a/cde/programs/dtappbuilder/src/abmf/make_file.c b/cde/programs/dtappbuilder/src/abmf/make_file.c index 2f3baf88..d57f4b75 100644 --- a/cde/programs/dtappbuilder/src/abmf/make_file.c +++ b/cde/programs/dtappbuilder/src/abmf/make_file.c @@ -101,25 +101,24 @@ static int write_os_params( static int write_aix_stuff(File makeFile, AbmfLibs libs); static int write_hpux_stuff(File makeFile, AbmfLibs libs); static int write_sunos_params(File makeFile, AbmfLibs libs); +static int write_unixware_params(File makeFile, AbmfLibs libs); static int write_uxp_params(File makeFile, AbmfLibs libs); static int write_osf1_stuff(File makeFile, AbmfLibs libs); - -#ifdef USL - /* - * USL specific changes were added ifdef USL due to time constraints - * These ifdefs should be removed in the next release - */ -static int write_unixware_params(File makeFile, AbmfLibs libs); -#endif +static int write_lnx_params(File makeFile, AbmfLibs libs); +static int write_fbsd_params(File makeFile, AbmfLibs libs); +static int write_nbsd_params(File makeFile, AbmfLibs libs); +static int write_obsd_params(File makeFile, AbmfLibs libs); static int determine_aix_libs(AbmfLibs libs, ABObj project); static int determine_hpux_libs(AbmfLibs libs, ABObj project); static int determine_sunos_libs(AbmfLibs libs, ABObj project); +static int determine_unixware_libs(AbmfLibs libs, ABObj project); static int determine_uxp_libs(AbmfLibs libs, ABObj project); static int determine_osf1_libs(AbmfLibs libs, ABObj project); -#ifdef USL -static int determine_unixware_libs(AbmfLibs libs, ABObj project); -#endif +static int determine_lnx_libs(AbmfLibs libs, ABObj project); +static int determine_fbsd_libs(AbmfLibs libs, ABObj project); +static int determine_nbsd_libs(AbmfLibs libs, ABObj project); +static int determine_obsd_libs(AbmfLibs libs, ABObj project); static int write_file_header( GenCodeInfo genCodeInfo, @@ -239,14 +238,24 @@ determine_libs(AbmfLibs libs, ABObj project, AB_OS_TYPE osType) case AB_OS_OSF1: return_value = determine_osf1_libs(libs, project); break; -#ifdef USL case AB_OS_UNIXWARE: return_value = determine_unixware_libs(libs, project); break; -#endif case AB_OS_UXP: return_value = determine_uxp_libs(libs, project); break; + case AB_OS_LNX: + return_value = determine_lnx_libs(libs, project); + break; + case AB_OS_FBSD: + return_value = determine_fbsd_libs(libs, project); + break; + case AB_OS_NBSD: + return_value = determine_nbsd_libs(libs, project); + break; + case AB_OS_OBSD: + return_value = determine_obsd_libs(libs, project); + break; } return return_value; @@ -288,13 +297,35 @@ determine_osf1_libs(AbmfLibs libs, ABObj project) return 0; } -#ifdef USL static int determine_unixware_libs(AbmfLibs libs, ABObj project) { return 0; } -#endif + +static int +determine_lnx_libs(AbmfLibs libs, ABObj project) +{ + return 0; +} + +static int +determine_fbsd_libs(AbmfLibs libs, ABObj project) +{ + return 0; +} + +static int +determine_nbsd_libs(AbmfLibs libs, ABObj project) +{ + return 0; +} + +static int +determine_obsd_libs(AbmfLibs libs, ABObj project) +{ + return 0; +} static STRING get_string_for_lib(AbmfLibDesc lib, AB_OS_TYPE osType) @@ -491,6 +522,10 @@ write_os_params( return_value = write_sunos_params(makeFile, libs); break; + case AB_OS_UNIXWARE: + return_value = write_unixware_params(makeFile, libs); + break; + case AB_OS_UXP: return_value = write_uxp_params(makeFile, libs); break; @@ -499,11 +534,21 @@ write_os_params( return_value = write_osf1_stuff(makeFile, libs); break; -#ifdef USL - case AB_OS_UNIXWARE: - return_value = write_unixware_params(makeFile, libs); + case AB_OS_LNX: + return_value = write_lnx_params(makeFile, libs); + break; + + case AB_OS_FBSD: + return_value = write_fbsd_params(makeFile, libs); + break; + + case AB_OS_NBSD: + return_value = write_nbsd_params(makeFile, libs); + break; + + case AB_OS_OBSD: + return_value = write_obsd_params(makeFile, libs); break; -#endif } return return_value; @@ -732,7 +777,6 @@ write_osf1_stuff(File makeFile, AbmfLibs libs) return 0; } -#ifdef USL static int write_unixware_params(File makeFile, AbmfLibs libs) { @@ -774,7 +818,185 @@ write_unixware_params(File makeFile, AbmfLibs libs) return 0; } -#endif /*** USL***/ +static int +write_lnx_params(File makeFile, AbmfLibs libs) +{ + STRING osName = util_os_type_to_string(AB_OS_LNX); + + abio_printf(makeFile, + "\n" +"###########################################################################\n" +"# These are the %s-dependent configuration parameters that must be\n" +"# set in order for any application to build.\n" +"###########################################################################\n", + osName); + + abio_puts(makeFile, +"\n" +".KEEP_STATE:\n" +"\n" +" RM = rm -f\n" +" INCLUDES = -I/usr/dt/include -I/X11/include\n" +"\n" +" STD_DEFINES = \n" +" ANSI_DEFINES = \n" +"\n" +" CDEBUGFLAGS = -g\n" +" COPTFLAGS = -O2\n" +" SYS_LIBRARIES = -lgen -lm\n" +" CDE_LIBPATH = /usr/dt/lib\n" +" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n" +" ALLX_LIBPATH = /X11/lib\n" +" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n" +); + write_local_libraries(makeFile, libs, AB_OS_LNX); + + abio_puts(makeFile, +"\n" +" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)" + " $(ANSI_DEFINES)\n" +" LDLIBS = $(SYS_LIBRARIES)\n" +" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n" +"\n" +); + + return 0; +} + +static int +write_fbsd_params(File makeFile, AbmfLibs libs) +{ + STRING osName = util_os_type_to_string(AB_OS_FBSD); + + abio_printf(makeFile, + "\n" +"###########################################################################\n" +"# These are the %s-dependent configuration parameters that must be\n" +"# set in order for any application to build.\n" +"###########################################################################\n", + osName); + + abio_puts(makeFile, +"\n" +".KEEP_STATE:\n" +"\n" +" RM = rm -f\n" +" INCLUDES = -I/usr/dt/include -I/X11/include\n" +"\n" +" STD_DEFINES = \n" +" ANSI_DEFINES = \n" +"\n" +" CDEBUGFLAGS = -g\n" +" COPTFLAGS = -O2\n" +" SYS_LIBRARIES = -lgen -lm\n" +" CDE_LIBPATH = /usr/dt/lib\n" +" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n" +" ALLX_LIBPATH = /X11/lib\n" +" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n" +); + write_local_libraries(makeFile, libs, AB_OS_FBSD); + + abio_puts(makeFile, +"\n" +" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)" + " $(ANSI_DEFINES)\n" +" LDLIBS = $(SYS_LIBRARIES)\n" +" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n" +"\n" +); + + return 0; +} + +static int +write_nbsd_params(File makeFile, AbmfLibs libs) +{ + STRING osName = util_os_type_to_string(AB_OS_NBSD); + + abio_printf(makeFile, + "\n" +"###########################################################################\n" +"# These are the %s-dependent configuration parameters that must be\n" +"# set in order for any application to build.\n" +"###########################################################################\n", + osName); + + abio_puts(makeFile, +"\n" +".KEEP_STATE:\n" +"\n" +" RM = rm -f\n" +" INCLUDES = -I/usr/dt/include -I/X11/include\n" +"\n" +" STD_DEFINES = \n" +" ANSI_DEFINES = \n" +"\n" +" CDEBUGFLAGS = -g\n" +" COPTFLAGS = -O2\n" +" SYS_LIBRARIES = -lgen -lm\n" +" CDE_LIBPATH = /usr/dt/lib\n" +" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n" +" ALLX_LIBPATH = /X11/lib\n" +" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n" +); + write_local_libraries(makeFile, libs, AB_OS_NBSD); + + abio_puts(makeFile, +"\n" +" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)" + " $(ANSI_DEFINES)\n" +" LDLIBS = $(SYS_LIBRARIES)\n" +" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n" +"\n" +); + + return 0; +} + +static int +write_obsd_params(File makeFile, AbmfLibs libs) +{ + STRING osName = util_os_type_to_string(AB_OS_OBSD); + + abio_printf(makeFile, + "\n" +"###########################################################################\n" +"# These are the %s-dependent configuration parameters that must be\n" +"# set in order for any application to build.\n" +"###########################################################################\n", + osName); + + abio_puts(makeFile, +"\n" +".KEEP_STATE:\n" +"\n" +" RM = rm -f\n" +" INCLUDES = -I/usr/dt/include -I/X11/include\n" +"\n" +" STD_DEFINES = \n" +" ANSI_DEFINES = \n" +"\n" +" CDEBUGFLAGS = -g\n" +" COPTFLAGS = -O2\n" +" SYS_LIBRARIES = -lgen -lm\n" +" CDE_LIBPATH = /usr/dt/lib\n" +" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n" +" ALLX_LIBPATH = /X11/lib\n" +" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n" +); + write_local_libraries(makeFile, libs, AB_OS_OBSD); + + abio_puts(makeFile, +"\n" +" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)" + " $(ANSI_DEFINES)\n" +" LDLIBS = $(SYS_LIBRARIES)\n" +" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n" +"\n" +); + + return 0; +} static int write_local_libraries( @@ -1112,8 +1334,10 @@ write_targets( " $(RM) $(CLEAN_FILES)\n" "\n" "scour:\n" -" $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) $(TARGETS.c.merged) Makefile Makefile.aix Makefile.hpux Makefile.sunos \\\n" -" Makefile.osf1\n" +" $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) $(TARGETS.c.merged) \\\n" +" Makefile Makefile.aix Makefile.hpux Makefile.sunos \\\n" +" Makefile.osf1 Makefile.uxp Makefile.unixware Makefile.linux \\\n" +" Makefile.freebsd Makefile.netbsd Makefile.openbsd\n" ); return 0; diff --git a/cde/programs/dtappbuilder/src/libAButil/util.c b/cde/programs/dtappbuilder/src/libAButil/util.c index f8a68054..e1f598b4 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util.c +++ b/cde/programs/dtappbuilder/src/libAButil/util.c @@ -249,18 +249,14 @@ util_get_os_type(void) struct utsname sysInfo; int aixIndex = -1; int hpIndex = -1; + int sunIndex = -1; + int unixwareIndex = -1; int uxpIndex = -1; int osf1Index = -1; - -#ifdef USL - /* - * These changes were made ifdef USL due to time constraint. - * ifdefs should be removed in next release - */ - int unixwareIndex = -1; -#endif - - int sunIndex = -1; + int lnxIndex = -1; + int fbsdIndex = -1; + int nbsdIndex = -1; + int obsdIndex = -1; if (osTypeDefined) { @@ -274,86 +270,80 @@ util_get_os_type(void) aixIndex = util_strcasestr(sysInfo.sysname, "aix"); hpIndex = util_strcasestr(sysInfo.sysname, "hp"); sunIndex = util_strcasestr(sysInfo.sysname, "sun"); + unixwareIndex = util_strcasestr(sysInfo.sysname, "UNIX_SV"); uxpIndex = util_strcasestr(sysInfo.sysname, "UNIX_System_V"); osf1Index = util_strcasestr(sysInfo.sysname, "osf1"); - -#ifdef USL - /* - * These changes were made ifdef USL due to time constraint. - * ifdefs should be removed in next release - */ - unixwareIndex = util_strcasestr(sysInfo.sysname, "UNIX_SV"); -#endif + lnxIndex = util_strcasestr(sysInfo.sysname, "linux"); + fbsdIndex = util_strcasestr(sysInfo.sysname, "freebsd"); + nbsdIndex = util_strcasestr(sysInfo.sysname, "netbsd"); + obsdIndex = util_strcasestr(sysInfo.sysname, "openbsd"); if (aixIndex < 0) aixIndex = INT_MAX; if (hpIndex < 0) hpIndex = INT_MAX; if (sunIndex < 0) sunIndex = INT_MAX; + if (unixwareIndex < 0) unixwareIndex = INT_MAX; if (uxpIndex < 0) uxpIndex = INT_MAX; if (osf1Index < 0) osf1Index = INT_MAX; + if (lnxIndex < 0) lnxIndex = INT_MAX; + if (fbsdIndex < 0) fbsdIndex = INT_MAX; + if (nbsdIndex < 0) nbsdIndex = INT_MAX; + if (obsdIndex < 0) obsdIndex = INT_MAX; -#ifdef USL - /* - * These changes were made ifdef USL due to time constraint. - * ifdefs should be removed in next release - */ - if (unixwareIndex < 0) unixwareIndex = INT_MAX; -#endif - -#ifndef USL +#define IS_MATCH(a,b,c,d,e,f,g,h,i,j) \ + (((a) < (b)) && ((a) < (c)) && ((a) < (d)) && ((a) < (e)) && ((a) < (f)) && \ + ((a) < (g)) && ((a) < (h)) && ((a) < (i)) && ((a) < (j))) -#define IS_MATCH(a,b,c,d,e) \ - (((a) < (b)) && ((a) < (c)) && ((a) < (d))&& ((a) < (e))) - - if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, uxpIndex)) + if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, unixwareIndex, + uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { return AB_OS_AIX; } - if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, uxpIndex)) + if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, unixwareIndex, + uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { return AB_OS_HPUX; } - if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, uxpIndex)) + if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, unixwareIndex, + uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { return AB_OS_SUNOS; } - if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, uxpIndex)) + if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, unixwareIndex, + uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { return AB_OS_OSF1; } - if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, osf1Index)) + if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, unixwareIndex, + osf1Index, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { return AB_OS_UXP; } - -#else -#define IS_MATCH(a,b,c,d,e,f) \ - (((a) < (b)) && ((a) < (c)) && ((a) < (d)) && ((a) < (e)) && ((a) < (f))) - - if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, unixwareIndex, uxpIndex)) - { - return AB_OS_AIX; - } - if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, unixwareIndex, uxpIndex)) + if (IS_MATCH(unixwareIndex, aixIndex, hpIndex, sunIndex, osf1Index, + uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex)) { - return AB_OS_HPUX; + return AB_OS_UNIXWARE; } - if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, unixwareIndex, uxpIndex)) + if (IS_MATCH(lnxIndex, aixIndex, hpIndex, sunIndex, osf1Index, + unixwareIndex, uxpIndex, fbsdIndex, nbsdIndex, obsdIndex)) { - return AB_OS_SUNOS; + return AB_OS_LNX; } - if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, unixwareIndex, uxpIndex)) + if (IS_MATCH(fbsdIndex, aixIndex, hpIndex, sunIndex, osf1Index, + unixwareIndex, uxpIndex, lnxIndex, nbsdIndex, obsdIndex)) { - return AB_OS_OSF1; + return AB_OS_FBSD; } - if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, unixwareIndex, osf1Index)) + if (IS_MATCH(nbsdIndex, aixIndex, hpIndex, sunIndex, osf1Index, + unixwareIndex, uxpIndex, lnxIndex, fbsdIndex, obsdIndex)) { - return AB_OS_UXP; + return AB_OS_NBSD; } - if (IS_MATCH(unixwareIndex, aixIndex, hpIndex, sunIndex, osf1Index, uxpIndex)) + if (IS_MATCH(obsdIndex, aixIndex, hpIndex, sunIndex, osf1Index, + unixwareIndex, uxpIndex, lnxIndex, fbsdIndex, nbsdIndex)) { - return AB_OS_UNIXWARE; + return AB_OS_OBSD; } -#endif /**USL**/ + osTypeDefined = TRUE; epilogue: diff --git a/cde/programs/dtappbuilder/src/libAButil/util.h b/cde/programs/dtappbuilder/src/libAButil/util.h index b0f68c7c..0cf3425c 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util.h +++ b/cde/programs/dtappbuilder/src/libAButil/util.h @@ -82,10 +82,12 @@ typedef enum AB_OS_AIX, AB_OS_SUNOS, AB_OS_OSF1, -#ifdef USL AB_OS_UNIXWARE, -#endif AB_OS_UXP, + AB_OS_LNX, + AB_OS_FBSD, + AB_OS_NBSD, + AB_OS_OBSD, AB_OS_TYPE_NUM_VALUES /* must be last */ } AB_OS_TYPE; diff --git a/cde/programs/dtappbuilder/src/libAButil/util_convert.c b/cde/programs/dtappbuilder/src/libAButil/util_convert.c index b0a14256..525b51f4 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util_convert.c +++ b/cde/programs/dtappbuilder/src/libAButil/util_convert.c @@ -854,16 +854,13 @@ util_os_type_to_ident(AB_OS_TYPE osType) case AB_OS_AIX: typeString = "aix"; break; case AB_OS_HPUX: typeString = "hpux"; break; case AB_OS_SUNOS: typeString = "sunos"; break; + case AB_OS_UNIXWARE: typeString = "unixware"; break; case AB_OS_UXP: typeString = "uxp"; break; case AB_OS_OSF1: typeString = "osf1"; break; - -#ifdef USL - /* - * The USL specific changes were made ifdef USL due to time constraint - * They should be removed in the next release - */ - case AB_OS_UNIXWARE: typeString = "unixware"; break; -#endif + case AB_OS_LNX: typeString = "linux"; break; + case AB_OS_FBSD: typeString = "freebsd"; break; + case AB_OS_NBSD: typeString = "netbsd"; break; + case AB_OS_OBSD: typeString = "openbsd"; break; } return typeString; @@ -883,8 +880,13 @@ util_os_type_to_string(AB_OS_TYPE osType) case AB_OS_AIX: nameString = "AIX"; break; case AB_OS_HPUX: nameString = "HP-UX"; break; case AB_OS_SUNOS: nameString = "SunOS"; break; + case AB_OS_UNIXWARE: nameString = "UnixWare"; break; case AB_OS_UXP: nameString = "UXP"; break; case AB_OS_OSF1: nameString = "OSF/1"; break; + case AB_OS_LNX: nameString = "Linux"; break; + case AB_OS_FBSD: nameString = "FreeBSD"; break; + case AB_OS_NBSD: nameString = "NetBSD"; break; + case AB_OS_OBSD: nameString = "OpenBSD"; break; } return nameString; diff --git a/cde/programs/dtcm/server/Imakefile b/cde/programs/dtcm/server/Imakefile index 81aafcc3..5722f946 100644 --- a/cde/programs/dtcm/server/Imakefile +++ b/cde/programs/dtcm/server/Imakefile @@ -50,7 +50,7 @@ EXTRA_LIBRARIES = -lsocket -lnsl -lintl #endif SRCS = \ - parser.y access.c callback.c \ + parser.c access.c callback.c \ cmscalendar.c cmsconvert.c cmsentry.c \ cmsmatch.c delete.c garbage.c \ insert.c lexit.c list.c \ @@ -91,6 +91,8 @@ NormalProgramTarget($(PROGRAM),$(OBJS),,$(LOCAL_LIBRARIES),) parser.o: parser.c +includes:: parser.c + clean:: $(RM) parser.c $(_NULLCMD_) > parser.h diff --git a/cde/programs/dthelp/parser/canon1/build/build.c b/cde/programs/dthelp/parser/canon1/build/build.c index b3b1cdf5..767aa5ba 100644 --- a/cde/programs/dthelp/parser/canon1/build/build.c +++ b/cde/programs/dthelp/parser/canon1/build/build.c @@ -41,7 +41,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include "entdef.h" /* Main procedure */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { @@ -67,8 +67,9 @@ while (TRUE) if (scantrace) printf( "m_prevcon=%d, m_token=%d, curcon=%d, scanval = %c (%d), line=%d\n", - m_prevcon, m_token, curcon, scanval, scanval, m_line) ; + m_prevcon, m_token, curcon, (char)scanval, (int)scanval, m_line) ; #include "case.c" if (m_token == ENDFILE) exit(FALSE) ; } + return 0; } diff --git a/cde/programs/dthelp/parser/canon1/build/buildutl.c b/cde/programs/dthelp/parser/canon1/build/buildutl.c index 5be8b786..f34ee09d 100644 --- a/cde/programs/dthelp/parser/canon1/build/buildutl.c +++ b/cde/programs/dthelp/parser/canon1/build/buildutl.c @@ -43,7 +43,7 @@ LOGICAL *flag; char *delim; { M_WCHAR wcbuff[129]; -size_t length; +ssize_t length; wcbuff[128] = 0; length = mbstowcs(wcbuff,delim,128); @@ -73,7 +73,7 @@ m_openchk(&m_errfile, "error", "w") ; fprintf(stderr, "MARKUP System - BUILD %s\n", M_VERSION) ; fprintf(stderr, "Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.\n") ; if (! standard) - warning("Warning: optional enhancements of SGML enabled.") ; + warning("Info: optional enhancements of SGML enabled.") ; mb_delims = mb_dlmptr; wc_delims = m_dlmptr; @@ -112,7 +112,7 @@ void ruleinit(M_NOPAR) /* Rule end processing */ void rulend(M_NOPAR) { - STATE *fsa ; + STATE *fsa = NULL ; LOGICAL canbenull ; LHS *lhsp ; LHS *discard ; @@ -153,7 +153,7 @@ void rulend(M_NOPAR) void skiptoend(M_NOPAR) { int i ; - static errlev = 0 ; + static int errlev = 0 ; if (! errlev++) { curcon = ERROR ; diff --git a/cde/programs/dthelp/parser/canon1/build/eltree.c b/cde/programs/dthelp/parser/canon1/build/eltree.c index c060204d..13a2f73c 100644 --- a/cde/programs/dthelp/parser/canon1/build/eltree.c +++ b/cde/programs/dthelp/parser/canon1/build/eltree.c @@ -42,7 +42,7 @@ ELTSTRUCT *ntrelt(p) int length ; new = (ELTSTRUCT *) m_malloc(sizeof(ELTSTRUCT), "element structure") ; - if (old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new)) { + if ((old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new))) { m_free((M_POINTER) new, "element structure") ; return(old) ; } @@ -55,7 +55,7 @@ ELTSTRUCT *ntrelt(p) w_strcpy(new->enptr, p) ; new->model = M_NULLVAL ; new->content = M_NULLVAL ; - new->inptr = new->exptr = NULL ; + new->inptr = new->exptr = 0 ; new->parptr = NULL ; new->parindex = M_NULLVAL ; new->paramcount = M_NULLVAL ; diff --git a/cde/programs/dthelp/parser/canon1/build/fsa.c b/cde/programs/dthelp/parser/canon1/build/fsa.c index f687c132..d625aac7 100644 --- a/cde/programs/dthelp/parser/canon1/build/fsa.c +++ b/cde/programs/dthelp/parser/canon1/build/fsa.c @@ -85,11 +85,11 @@ void checkand(andstart, andptr, start, root, errelt) for (pand = parc->group ; pand ; pand = pand->next) checkand(andstart, andptr, pand->start, root, errelt) ; } - else if (c = checkdfsa(andptr->start, + else if ((c = checkdfsa(andptr->start, parc->label, parc->group, parc->id, - errelt)) + errelt))) nondeterm(root, c, *errelt) ; } } @@ -112,7 +112,7 @@ int checkdfsa(from, label, and, id, errelt) if (parc->group) { if (and == parc->group) return(ANDCONFLICT) ; for (group = parc->group ; group ; group = group->next) - if (c = checkdfsa(group->start, label, and, id, errelt)) + if ((c = checkdfsa(group->start, label, and, id, errelt))) return(c) ; } else if (! and && label == parc->label && parc->id != id) { @@ -138,14 +138,14 @@ int checkrepeat(from, and, errelt) for (; and ; and = and->next) for (parc = and->start->first ; parc ; parc = parc->next) { if (parc->group) - if (c = checkrepeat(from, parc->group, errelt)) return(c) ; + if ((c = checkrepeat(from, parc->group, errelt))) return(c) ; else ; else - if (c = checkdfsa(from, + if ((c = checkdfsa(from, parc->label, M_NULLVAL, parc->id, - errelt)) + errelt))) return(c) ; else ; } @@ -239,7 +239,7 @@ void makeand(canbenull, root, optional) TREE *child ; STATELIST *start, *final ; LOGICAL groupbenull ; - ANDGROUP *andptr, *saveand, *otherand ; + ANDGROUP *andptr = NULL, *saveand = NULL, *otherand ; STATELIST *index ; ELTSTRUCT *errelt ; @@ -579,7 +579,7 @@ void repeat(root) for (a = top->starta ; a ; a = a->next) { for (final = top->allfinal ; final ; final = final->next) { if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) { + if ((c = checkrepeat(final->value, a->group, &errelt))) { wtemp = MakeWideCharString(root->occurrence == PLUS ? plus : rep); warning1("Conflict in use of %s", wtemp); m_free(wtemp, "wide character string"); @@ -588,11 +588,11 @@ void repeat(root) else ; else - if (c = checkdfsa(final->value, + if ((c = checkdfsa(final->value, a->label, a->group, a->id, - &errelt)) + &errelt))) nondeterm (root, c, errelt) ; else ; @@ -600,14 +600,14 @@ void repeat(root) for (final = top->finals ; final ; final = final->next) { if (samelabelarc(a, final->value)) continue ; if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) + if ((c = checkrepeat(final->value, a->group, &errelt))) nondeterm(root, c, errelt) ; if (a->label || a->group || ! final->value->frompcdata) { - if (c = addarc(final->value, a->to, a->label, + if ((c = addarc(final->value, a->to, a->label, a->group, TRUE, a->id, - a->minim, &errelt)) + a->minim, &errelt))) nondeterm(root, c, errelt) ; if (permitspcd(a)) final->value->datacontent = TRUE ; } @@ -697,7 +697,7 @@ void simplebranch(root, value, group, optional) states of and-groups that terminate at the start state of the new arc */ for (index = top->allfinal ; index ; index = index->next) - if (c = checkdfsa(index->value, value, group, root->eltid, &errelt)) + if ((c = checkdfsa(index->value, value, group, root->eltid, &errelt))) nondeterm(root, c, errelt) ; for (index = top->starts ; index ; index = index->next) { if (! group && ! value && index->value->frompcdata) diff --git a/cde/programs/dthelp/parser/canon1/build/out.c b/cde/programs/dthelp/parser/canon1/build/out.c index 97414f33..3bf73313 100644 --- a/cde/programs/dthelp/parser/canon1/build/out.c +++ b/cde/programs/dthelp/parser/canon1/build/out.c @@ -31,6 +31,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include #include +#include #if defined(MSDOS) #include #endif @@ -195,7 +196,7 @@ void eltreeout(M_NOPAR) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = eltp->enptr ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -211,14 +212,14 @@ void eltreeout(M_NOPAR) else fputs(",\n", dtd) ; if (! eltp->content) warning1("No content model for element %s", eltp->enptr) ; - fprintf(dtd, " %d, %d, %s, ", + fprintf(dtd, " {%d, %d, %s, ", enameindex, eltp->model ? eltp->model->count : 0, typecon(eltp->content)) ; fprintf(dtd, "%d, %d, ", eltp->inptr, eltp->exptr) ; fprintf(dtd, "%d, %d, %d", eltp->parindex, eltp->paramcount, eltp->srefptr) ; enameindex += w_strlen(eltp->enptr) + 1 ; - fprintf(dtd, ", %s, %s, %s", + fprintf(dtd, ", %s, %s, %s}", boolean(eltp->stmin), boolean(eltp->etmin), boolean(eltp->useoradd)) ; } fputs(ndif, dtd) ; @@ -259,7 +260,7 @@ void exout(M_NOPAR) if (! first) fputs(",\n", dtd) ; first = FALSE ; exindex++ ; - fprintf(dtd, " %d, %d", ex->element, ex->next ? exindex + 1 : 0) ; + fprintf(dtd, " {%d, %d}", ex->element, ex->next ? exindex + 1 : 0) ; } fputs(ndif, dtd) ; } @@ -294,7 +295,7 @@ void fsa(M_NOPAR) for (pstate = firststate ; pstate ; pstate = pstate->next) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %s, %s, %d", + fprintf(dtd, " {%s, %s, %d}", boolean(pstate->final), boolean(pstate->datacontent), pstate->first ? ++arcount : 0) ; for (parc = pstate->first ; parc ; parc = parc->next) { @@ -319,7 +320,7 @@ void fsa(M_NOPAR) for (pand = firstand ; pand ; pand = pand->nextptr) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d", + fprintf(dtd, " {%d, %d}", pand->start->count, pand->next ? pand->next->count : M_NULLVAL) ; } @@ -352,7 +353,7 @@ if (kwlen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = ptypep->keyword ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -372,7 +373,7 @@ if (deflen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = paramp->defstring ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -392,7 +393,7 @@ if (ptypelen) { if (first) first = FALSE ; else fprintf(dtd, ",\n") ; - fprintf(dtd, " %d, %d", kw, ptypep->next) ; + fprintf(dtd, " {%d, %d}", kw, ptypep->next) ; kw += w_strlen(ptypep->keyword) + 1 ; } fputs(ndif, dtd) ; @@ -412,21 +413,21 @@ if (parcount) if (first) first = FALSE ; else fputs(",\n", dtd) ; fprintf(dtd, - " %d, %s, %d, %s, ", + " {%d, %s, %d, %s, ", pnameindex, partype(paramp->type), paramp->kwlist, deftype(paramp->deftype)) ; pnameindex += w_strlen(paramp->paramname) + 1 ; if (paramp->defval) - fprintf(dtd, "&m_keyword[%d]", paramp->defval - 1) ; + fprintf(dtd, "&m_keyword[%d]}", paramp->defval - 1) ; else if (paramp->defstring) { - fprintf(dtd, "&m_defval[%d]", defindex) ; + fprintf(dtd, "&m_defval[%d]}", defindex) ; defindex += w_strlen(paramp->defstring) + 1 ; } else - fputs("NULL", dtd) ; + fputs("NULL}", dtd) ; } fputs(ndif, dtd) ; } @@ -443,7 +444,7 @@ if (pnamelen) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", *p) ; + for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", (int)*p); fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -534,10 +535,10 @@ void srefout(M_NOPAR) count++ ; if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; + fprintf(dtd, " {%d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; for (j++ ; j < sreflen ; j++) if (mapbysref[sreflen * i + j]) break ; - fprintf(dtd, "%d", j < sreflen ? count + 1 : 0) ; + fprintf(dtd, "%d}", j < sreflen ? count + 1 : 0) ; } else j++ ; fputs(ndif, dtd) ; @@ -557,7 +558,7 @@ char *mb_paramname; int indent ; int i ; -fprintf(tempfile, "\n\n", eltp->enptr) ; +fprintf(tempfile, "\n\n", (char *)eltp->enptr) ; if (eltp->parptr) { fputs(" /*\n", tempfile) ; @@ -570,7 +571,8 @@ if (eltp->parptr) { int length; char mbyte[32]; /* larger than any multibyte character */ - char *pc, c; + char *pc; + unsigned char c; length = wctomb(mbyte, *p); if (length < 0) @@ -600,8 +602,8 @@ if (eltp->parptr) mb_keyword = MakeMByteString(ptypep->keyword); fprintf(tempfile, "%s = %s", - ptypep->keyword, - ptypep->keyword) ; + (char *)ptypep->keyword, + (char *)ptypep->keyword) ; m_free(mb_keyword,"multi-byte string"); ptypep = ptypep->next ? ptypep->nextptr : (PTYPE *) NULL ; if (ptypep) @@ -640,7 +642,7 @@ void template(M_NOPAR) undefent = TRUE ; } fprintf(tempfile, "\n", - ent->name, + (char *)ent->name, enttype(ent->type) ) ; } diff --git a/cde/programs/dthelp/parser/canon1/build/param.c b/cde/programs/dthelp/parser/canon1/build/param.c index 72dcd7ee..39bc025c 100644 --- a/cde/programs/dthelp/parser/canon1/build/param.c +++ b/cde/programs/dthelp/parser/canon1/build/param.c @@ -89,7 +89,7 @@ ptypelen++ ; /* Add a parameter to the current element */ void addpar(M_NOPAR) { -PARAMETER *paramp, *last ; +PARAMETER *paramp, *last = NULL ; int length ; parcount++ ; @@ -200,6 +200,7 @@ switch (newpar->type) } break ; } + return(FALSE); } /* Normalize parameter default. Change tabs and RE's to spaces, capitalize @@ -212,7 +213,7 @@ M_WCHAR *string ; #endif /* M_PROTO */ { M_WCHAR *p, *q ; -int i ; +int i, ret ; switch (newpar->type) { @@ -238,7 +239,7 @@ switch (newpar->type) for (p = string, i = 0 ; *p ; p++, i++) if (m_whitespace(*p)) { - mbtowc(p, " ", 1); + ret = mbtowc(p, " ", 1); for (q = p + 1 ; m_whitespace(*q); q++) ; w_strcpy(p + 1, q) ; } @@ -262,10 +263,13 @@ switch (newpar->type) mbyte[1] = 0; } if ((length == 1) && (*mbyte == '\n' || *mbyte == '\t')) - mbtowc(string, " ", 1); + { + ret = mbtowc(string, " ", 1); + } } return ; } + (void) ret; } /* Called at end of parameter attribute list rule */ diff --git a/cde/programs/dthelp/parser/canon1/build/proto.h b/cde/programs/dthelp/parser/canon1/build/proto.h index 3871d423..50fdeb11 100644 --- a/cde/programs/dthelp/parser/canon1/build/proto.h +++ b/cde/programs/dthelp/parser/canon1/build/proto.h @@ -330,7 +330,7 @@ LOGICAL litproc( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/canon1/build/scan.c b/cde/programs/dthelp/parser/canon1/build/scan.c index 709babb9..76e586a3 100644 --- a/cde/programs/dthelp/parser/canon1/build/scan.c +++ b/cde/programs/dthelp/parser/canon1/build/scan.c @@ -80,9 +80,10 @@ int c; int n; M_WCHAR wsp, wnl, wtb; -mbtowc(&wsp, " ", 1); -mbtowc(&wnl, "\n", 1); -mbtowc(&wtb, "\t", 1); +int +ret = mbtowc(&wsp, " ", 1); +ret = mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wtb, "\t", 1); while (TRUE) { @@ -158,13 +159,14 @@ while (TRUE) { char mbyte[32]; /* bigger than the biggest multibyte char */ - wctomb(mbyte, c); + ret = wctomb(mbyte, c); fprintf(stderr, "\n'%s' (%d)", mbyte, c); fprintf(m_errfile, "\n'%s' (%d)", mbyte, c); m_error("Unexpected character"); } } /* End while */ + (void) ret; } /* End scan */ #include "scanutil.c" diff --git a/cde/programs/dthelp/parser/canon1/build/sref.c b/cde/programs/dthelp/parser/canon1/build/sref.c index caca76dd..bffaa873 100644 --- a/cde/programs/dthelp/parser/canon1/build/sref.c +++ b/cde/programs/dthelp/parser/canon1/build/sref.c @@ -40,7 +40,7 @@ void adddefent(mapname) M_WCHAR *mapname; { M_WCHAR *p; -int n, length; +int n; char c; if (!wc_prefix) @@ -59,8 +59,9 @@ for (n = egensuf ; n ; n /= 10) return; } c = ('0' + (n % 10)); - mbtowc(p, &c, 1); - *p++; + int ret = mbtowc(p, &c, 1); + (void) ret; + p++; } *p = M_EOS; egensuf++; @@ -80,7 +81,7 @@ M_WCHAR *name; M_ENTITY *new; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity"); -if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) +if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free((M_POINTER) new, "entity"); return(FALSE); @@ -113,7 +114,7 @@ MAP *new; LOGICAL retval; new = (MAP *) m_malloc(sizeof(MAP), "map"); -if (old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new)) +if ((old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new))) { m_free(new, "map"); curmap = old->map; @@ -153,7 +154,7 @@ int noseq = 0; /* Define the delimiter */ delim = (SREFSTRUCT *) m_malloc(sizeof(SREFSTRUCT), "short reference delimiter"); -if (prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim)) +if ((prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim))) { m_free(delim, "short reference delimiter"); delim = prevsr; diff --git a/cde/programs/dthelp/parser/canon1/eltdef/context.dat b/cde/programs/dthelp/parser/canon1/eltdef/context.dat index ecd05446..06b28ee2 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/context.dat +++ b/cde/programs/dthelp/parser/canon1/eltdef/context.dat @@ -626,7 +626,7 @@ name pcchain:pcchain { *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ; (*nextchain)->next = NULL ; - if ((*nextchain)->elt = m_packedlook(m_entree, name)) + if (((*nextchain)->elt = m_packedlook(m_entree, name))) (*nextchain)->elt++ ; else m_err1("Undefined element: %s", name) ; @@ -660,61 +660,61 @@ text } } globdef:globdef { - fprintf(globdef, "%c", textchar) ; + fprintf(globdef, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */ } globdec:globdec { - fprintf(globdec, "%c", textchar) ; + fprintf(globdec, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniss:iniss, inss:inss { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inies:inies, ines:ines { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inisc:inisc, insc:insc { - fprintf(sfile, "%c", textchar) ; + fprintf(sfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniec:iniec, inec:inec { - fprintf(efile, "%c", textchar) ; + fprintf(efile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */ } initc:initc, intc:intc { - fprintf(tfile, "%c", textchar) ; + fprintf(tfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inipc:inipc, inpc:inpc { - fprintf(pfile, "%c", textchar) ; + fprintf(pfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inistc:inistc, instc:instc { - fprintf(stfile, "%c", textchar) ; + fprintf(stfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inentc:inentc { - fprintf(entfile, "%c", textchar) ; + fprintf(entfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } diff --git a/cde/programs/dthelp/parser/canon1/eltdef/eltdef.c b/cde/programs/dthelp/parser/canon1/eltdef/eltdef.c index 94e79122..306d9187 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/eltdef.c +++ b/cde/programs/dthelp/parser/canon1/eltdef/eltdef.c @@ -49,13 +49,13 @@ This product and information is proprietary of Tandem Computers Incorporated. #include "entity.h" /* Main program */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { int m_token ; - if (argc > 2) + if (argc > 2) { if (*argv[2] == '-') { if (strchr(argv[2], 'a')) m_malftrace = TRUE ; if (strchr(argv[2], 'A')) m_malftrace = TRUE ; @@ -70,6 +70,7 @@ void main(argc, argv) fprintf(stderr, "****Starting with MARKUP 2.0, ELTDEF no longer writes a statistics file" ) ; + } if (argc < 2) { fprintf(stderr, "**** Specify interface file ****\n") ; exit(TRUE) ; @@ -84,7 +85,7 @@ void main(argc, argv) if (scantrace) printf( "Main: m_prevcon=%d,m_token=%d,curcon=%d,textchar='%c'(%d), line=%d\n", - m_prevcon, m_token, curcon, textchar, textchar, m_line) ; + m_prevcon, m_token, curcon, (char)textchar, (int)textchar, m_line) ; #include "case.c" if (m_token == ENDFILE) break ; if (! curcon) { @@ -93,4 +94,5 @@ void main(argc, argv) } } done() ; + return 0; } diff --git a/cde/programs/dthelp/parser/canon1/eltdef/eltutil.c b/cde/programs/dthelp/parser/canon1/eltdef/eltutil.c index 5b5a4d9d..652b0b1d 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/eltutil.c +++ b/cde/programs/dthelp/parser/canon1/eltdef/eltutil.c @@ -106,7 +106,7 @@ void cvalue(M_NOPAR) PARVAL *new; new = (PARVAL *) m_malloc(sizeof(PARVAL), "parameter value"); - if (pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new)) + if ((pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new))) m_free(new, "parameter value"); else { new->line = 0; @@ -467,7 +467,7 @@ for ( ; p ; p = p->next) iffile); fprintf(pvalh, "#define %s \"", mb_cname); m_free(mb_cname,"multi-byte string"); - if (q = ((PARVAL *) p->data)->value) + if ((q = ((PARVAL *) p->data)->value)) for ( ; *q ; q++) { char mbq[32]; /* larger than largest possible mbyte char */ @@ -498,7 +498,7 @@ for ( ; p ; p = p->next) void skiptoend(M_NOPAR) { int i; - static errlev = 0; + static int errlev = 0; CVARSTRUCT *cvarp, *dvarp; for (cvarp = cvarlist ; cvarp ;) { @@ -615,7 +615,7 @@ void startelement(M_NOPAR) m_free(discard, "C variable"); } cvarlist = NULL; - if (openelt = m_packedlook(m_entree, name)) { + if ((openelt = m_packedlook(m_entree, name))) { if (processed[openelt - 1]) warning1("Warning: Element %s already processed", name); processed[openelt - 1] = TRUE; @@ -670,7 +670,7 @@ if (m_partype(cvarlist->param + m_element[openelt - 1].parptr, p)) { M_WCHAR *w_buffer; - sprintf(buffer, "%d", pval->line); + snprintf(buffer, 5, "%d", pval->line); w_buffer = MakeWideCharString(buffer); m_err5("Can't #define %s to %s. %s #define'd to %s on line %s", pval->cname, diff --git a/cde/programs/dthelp/parser/canon1/eltdef/entity.c b/cde/programs/dthelp/parser/canon1/eltdef/entity.c index 4aa5cd1f..b343f39b 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/entity.c +++ b/cde/programs/dthelp/parser/canon1/eltdef/entity.c @@ -40,7 +40,7 @@ void addent(M_NOPAR) M_ENTITY *new ; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ; - if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) { + if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free(new, "entity") ; if (! entity->wheredef) return ; if (entity->wheredef == M_DBUILD) { diff --git a/cde/programs/dthelp/parser/canon1/eltdef/proto.h b/cde/programs/dthelp/parser/canon1/eltdef/proto.h index 38037820..e6c45020 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/proto.h +++ b/cde/programs/dthelp/parser/canon1/eltdef/proto.h @@ -226,7 +226,7 @@ LOGICAL litproc( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/canon1/eltdef/scan.c b/cde/programs/dthelp/parser/canon1/eltdef/scan.c index 038d6677..fb028198 100644 --- a/cde/programs/dthelp/parser/canon1/eltdef/scan.c +++ b/cde/programs/dthelp/parser/canon1/eltdef/scan.c @@ -53,7 +53,8 @@ M_WCHAR *p, wus; int c, cttype; LOGICAL cname; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; cname = (LOGICAL) (curcon == INPARAM || curcon == INVALUE); *(p = name) = (M_WCHAR) first; @@ -92,7 +93,8 @@ int n; static char unexp[] = "c"; M_WCHAR wus; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; while (TRUE) { diff --git a/cde/programs/dthelp/parser/canon1/util/basic.h b/cde/programs/dthelp/parser/canon1/util/basic.h index f505123b..d00fa50f 100644 --- a/cde/programs/dthelp/parser/canon1/util/basic.h +++ b/cde/programs/dthelp/parser/canon1/util/basic.h @@ -112,3 +112,21 @@ void *m_malloc( int size, char *msg #endif ) ; + +void m_free( +#if defined(M_PROTO) + void *block, char *msg +#endif + ) ; + +void m_err2( +#if defined(M_PROTO) + const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2 +#endif + ) ; + +int mb_getwc( +#if defined(M_PROTO) + void *m_ptr +#endif + ) ; diff --git a/cde/programs/dthelp/parser/canon1/util/chartype.h b/cde/programs/dthelp/parser/canon1/util/chartype.h index 71a9024d..be26c0c5 100644 --- a/cde/programs/dthelp/parser/canon1/util/chartype.h +++ b/cde/programs/dthelp/parser/canon1/util/chartype.h @@ -29,262 +29,262 @@ by HP Tag are marked "(invalid)". */ M_CHARTYPE m_ctarray[M_CHARSETLEN] = { /* Char Name Type, Upper, Lower */ -/* 0: ^@ NUL */ M_NONNAME, 0, 0, -/* 1: ^A SOH */ M_NONNAME, 1, 1, -/* 2: ^B STX */ M_NONNAME, 2, 2, -/* 3: ^C ETX */ M_NONNAME, 3, 3, -/* 4: ^D EOT */ M_NONNAME, 4, 4, -/* 5: ^E ENQ */ M_NONNAME, 5, 5, -/* 6: ^F ACK */ M_NONNAME, 6, 6, -/* 7: ^G BEL */ M_NONNAME, 7, 7, -/* 8: ^H BS */ M_NONNAME, 8, 8, -/* 9: ^I HT */ M_NONNAME, 9, 9, -/* 10: ^J LF */ M_NONNAME, 10, 10, -/* 11: ^K VT */ M_NONNAME, 11, 11, -/* 12: ^L FF */ M_NONNAME, 12, 12, -/* 13: ^M CR */ M_NONNAME, 13, 13, -/* 14: ^N SO */ M_NONNAME, 14, 14, -/* 15: ^O SI */ M_NONNAME, 15, 15, -/* 16: ^P DLE */ M_NONNAME, 16, 16, -/* 17: ^Q DC1 */ M_NONNAME, 17, 17, -/* 18: ^R DC2 */ M_NONNAME, 18, 18, -/* 19: ^S DC3 */ M_NONNAME, 19, 19, -/* 20: ^T DC4 */ M_NONNAME, 20, 20, -/* 21: ^U NAK */ M_NONNAME, 21, 21, -/* 22: ^V SYN */ M_NONNAME, 22, 22, -/* 23: ^W ETB */ M_NONNAME, 23, 23, -/* 24: ^X CAN */ M_NONNAME, 24, 24, -/* 25: ^Y EM */ M_NONNAME, 25, 25, -/* 26: ^Z SUB */ M_NONNAME, 26, 26, -/* 27: ^[ ESC */ M_NONNAME, 27, 27, -/* 28: ^\ FS */ M_NONNAME, 28, 28, -/* 29: ^] GS */ M_NONNAME, 29, 29, -/* 30: ^^ RS */ M_NONNAME, 30, 30, -/* 31: ^_ US */ M_NONNAME, 31, 31, -/* 32: SP */ M_NONNAME, 32, 32, -/* 33: ! */ M_NONNAME, 33, 33, -/* 34: " */ M_NONNAME, 34, 34, -/* 35: # */ M_NONNAME, 35, 35, -/* 36: $ */ M_NONNAME, 36, 36, -/* 37: % */ M_NONNAME, 37, 37, -/* 38: & */ M_NONNAME, 38, 38, -/* 39: ' */ M_NONNAME, 39, 39, -/* 40: ( */ M_NONNAME, 40, 40, -/* 41: ) */ M_NONNAME, 41, 41, -/* 42: * */ M_NONNAME, 42, 42, -/* 43: + */ M_NAMECHAR, 43, 43, -/* 44: , */ M_NONNAME, 44, 44, -/* 45: - */ M_NAMECHAR, 45, 45, -/* 46: . */ M_NAMECHAR, 46, 46, -/* 47: / */ M_NONNAME, 47, 47, -/* 48: 0 */ M_DIGIT, 48, 48, -/* 49: 1 */ M_DIGIT, 49, 49, -/* 50: 2 */ M_DIGIT, 50, 50, -/* 51: 3 */ M_DIGIT, 51, 51, -/* 52: 4 */ M_DIGIT, 52, 52, -/* 53: 5 */ M_DIGIT, 53, 53, -/* 54: 6 */ M_DIGIT, 54, 54, -/* 55: 7 */ M_DIGIT, 55, 55, -/* 56: 8 */ M_DIGIT, 56, 56, -/* 57: 9 */ M_DIGIT, 57, 57, -/* 58: : */ M_NONNAME, 58, 58, -/* 59: ; */ M_NONNAME, 59, 59, -/* 60: < */ M_NONNAME, 60, 60, -/* 61: = */ M_NONNAME, 61, 61, -/* 62: > */ M_NONNAME, 62, 62, -/* 63: ? */ M_NONNAME, 63, 63, -/* 64: @ */ M_NONNAME, 64, 64, -/* 65: A */ M_NMSTART, 65, 97, -/* 66: B */ M_NMSTART, 66, 98, -/* 67: C */ M_NMSTART, 67, 99, -/* 68: D */ M_NMSTART, 68, 100, -/* 69: E */ M_NMSTART, 69, 101, -/* 70: F */ M_NMSTART, 70, 102, -/* 71: G */ M_NMSTART, 71, 103, -/* 72: H */ M_NMSTART, 72, 104, -/* 73: I */ M_NMSTART, 73, 105, -/* 74: J */ M_NMSTART, 74, 106, -/* 75: K */ M_NMSTART, 75, 107, -/* 76: L */ M_NMSTART, 76, 108, -/* 77: M */ M_NMSTART, 77, 109, -/* 78: N */ M_NMSTART, 78, 110, -/* 79: O */ M_NMSTART, 79, 111, -/* 80: P */ M_NMSTART, 80, 112, -/* 81: Q */ M_NMSTART, 81, 113, -/* 82: R */ M_NMSTART, 82, 114, -/* 83: S */ M_NMSTART, 83, 115, -/* 84: T */ M_NMSTART, 84, 116, -/* 85: U */ M_NMSTART, 85, 117, -/* 86: V */ M_NMSTART, 86, 118, -/* 87: W */ M_NMSTART, 87, 119, -/* 88: X */ M_NMSTART, 88, 120, -/* 89: Y */ M_NMSTART, 89, 121, -/* 90: Z */ M_NMSTART, 90, 122, -/* 91: [ */ M_NONNAME, 91, 91, -/* 92: \\ */ M_NONNAME, 92, 92, -/* 93: ] */ M_NONNAME, 93, 93, -/* 94: ^ */ M_NONNAME, 94, 94, -/* 95: _ */ M_NONNAME, 95, 95, -/* 96: ` */ M_NONNAME, 96, 96, -/* 97: a */ M_NMSTART, 65, 97, -/* 98: b */ M_NMSTART, 66, 98, -/* 99: c */ M_NMSTART, 67, 99, -/* 100: d */ M_NMSTART, 68, 100, -/* 101: e */ M_NMSTART, 69, 101, -/* 102: f */ M_NMSTART, 70, 102, -/* 103: g */ M_NMSTART, 71, 103, -/* 104: h */ M_NMSTART, 72, 104, -/* 105: i */ M_NMSTART, 73, 105, -/* 106: j */ M_NMSTART, 74, 106, -/* 107: k */ M_NMSTART, 75, 107, -/* 108: l */ M_NMSTART, 76, 108, -/* 109: m */ M_NMSTART, 77, 109, -/* 110: n */ M_NMSTART, 78, 110, -/* 111: o */ M_NMSTART, 79, 111, -/* 112: p */ M_NMSTART, 80, 112, -/* 113: q */ M_NMSTART, 81, 113, -/* 114: r */ M_NMSTART, 82, 114, -/* 115: s */ M_NMSTART, 83, 115, -/* 116: t */ M_NMSTART, 84, 116, -/* 117: u */ M_NMSTART, 85, 117, -/* 118: v */ M_NMSTART, 86, 118, -/* 119: w */ M_NMSTART, 87, 119, -/* 120: x */ M_NMSTART, 88, 120, -/* 121: y */ M_NMSTART, 89, 121, -/* 122: z */ M_NMSTART, 90, 122, -/* 123: { */ M_NONNAME, 123, 123, -/* 124: | */ M_NONNAME, 124, 124, -/* 125: } */ M_NONNAME, 125, 125, -/* 126: ~ */ M_NONNAME, 126, 126, -/* 127: DEL */ M_NONNAME, 127, 127, -/* 128: undefined */ M_NONNAME, 128, 128, -/* 129: undefined */ M_NONNAME, 129, 129, -/* 130: undefined */ M_NONNAME, 130, 130, -/* 131: undefined */ M_NONNAME, 131, 131, -/* 132: undefined */ M_NONNAME, 132, 132, -/* 133: undefined */ M_NONNAME, 133, 133, -/* 134: undefined */ M_NONNAME, 134, 134, -/* 135: undefined */ M_NONNAME, 135, 135, -/* 136: undefined */ M_NONNAME, 136, 136, -/* 137: undefined */ M_NONNAME, 137, 137, -/* 138: undefined */ M_NONNAME, 138, 138, -/* 139: undefined */ M_NONNAME, 139, 139, -/* 140: undefined */ M_NONNAME, 140, 140, -/* 141: undefined */ M_NONNAME, 141, 141, -/* 142: undefined */ M_NONNAME, 142, 142, -/* 143: undefined */ M_NONNAME, 143, 143, -/* 144: undefined */ M_NONNAME, 144, 144, -/* 145: undefined */ M_NONNAME, 145, 145, -/* 146: undefined */ M_NONNAME, 146, 146, -/* 147: undefined */ M_NONNAME, 147, 147, -/* 148: undefined */ M_NONNAME, 148, 148, -/* 149: undefined */ M_NONNAME, 149, 149, -/* 150: undefined */ M_NONNAME, 150, 150, -/* 151: undefined */ M_NONNAME, 151, 151, -/* 152: undefined */ M_NONNAME, 152, 152, -/* 153: undefined */ M_NONNAME, 153, 153, -/* 154: undefined */ M_NONNAME, 154, 154, -/* 155: undefined */ M_NONNAME, 155, 155, -/* 156: undefined */ M_NONNAME, 156, 156, -/* 157: undefined */ M_NONNAME, 157, 157, -/* 158: undefined */ M_NONNAME, 158, 158, -/* 159: undefined */ M_NONNAME, 159, 159, -/* 160: undefined */ M_NONNAME, 160, 160, -/* 161: A grave */ M_NMSTART, 161, 200, -/* 162: A circumflex */ M_NMSTART, 162, 192, -/* 163: E grave */ M_NMSTART, 163, 201, -/* 164: E circumflex */ M_NMSTART, 164, 193, -/* 165: E dieresis */ M_NMSTART, 165, 205, -/* 166: I circumflex */ M_NMSTART, 166, 209, -/* 167: I dieresis */ M_NMSTART, 167, 221, -/* 168: acute accent */ M_NONNAME, 168, 168, -/* 169: grave accent */ M_NONNAME, 169, 169, -/* 170: circumflex */ M_NONNAME, 170, 170, -/* 171: dieresis */ M_NONNAME, 171, 171, -/* 172: tilde */ M_NONNAME, 172, 172, -/* 173: U grave */ M_NMSTART, 173, 203, -/* 174: U circumflex */ M_NMSTART, 174, 195, -/* 175: Italian Lira (invalid) */ M_NONNAME, 175, 175, -/* 176: overbar (invalid) */ M_NONNAME, 176, 176, -/* 177: Y acute */ M_NMSTART, 177, 178, -/* 178: y acute */ M_NMSTART, 177, 178, -/* 179: degree (invalid) */ M_NONNAME, 179, 179, -/* 180: C cedilla */ M_NMSTART, 180, 181, -/* 181: c cedilla */ M_NMSTART, 180, 181, -/* 182: N tilde */ M_NMSTART, 182, 183, -/* 183: n tilde */ M_NMSTART, 182, 183, -/* 184: inverted exclamation mark */ M_NONNAME, 184, 184, -/* 185: inverted question mark */ M_NONNAME, 185, 185, -/* 186: currency sign (invalid) */ M_NONNAME, 186, 186, -/* 187: pound sterling (invalid) */ M_NONNAME, 187, 187, -/* 188: Yen */ M_NONNAME, 188, 188, -/* 189: Section sign (invalid) */ M_NONNAME, 189, 189, -/* 190: florin (invalid) */ M_NONNAME, 190, 190, -/* 191: Cent sign (invalid) */ M_NONNAME, 191, 191, -/* 192: a circumflex */ M_NMSTART, 162, 192, -/* 193: e circumflex */ M_NMSTART, 164, 193, -/* 194: o circumflex */ M_NMSTART, 223, 194, -/* 195: u circumflex */ M_NMSTART, 174, 195, -/* 196: a acute */ M_NMSTART, 224, 196, -/* 197: e acute */ M_NMSTART, 220, 197, -/* 198: o acute */ M_NMSTART, 231, 198, -/* 199: u acute */ M_NMSTART, 237, 199, -/* 200: a grave */ M_NMSTART, 161, 200, -/* 201: e grave */ M_NMSTART, 163, 201, -/* 202: o grave */ M_NMSTART, 232, 202, -/* 203: u grave */ M_NMSTART, 173, 203, -/* 204: a dieresis */ M_NMSTART, 216, 204, -/* 205: e dieresis */ M_NMSTART, 165, 205, -/* 206: o dieresis */ M_NMSTART, 218, 206, -/* 207: u dieresis */ M_NMSTART, 219, 207, -/* 208: A angstrom */ M_NMSTART, 208, 212, -/* 209: i circumflex */ M_NMSTART, 166, 209, -/* 210: O slash */ M_NMSTART, 210, 214, -/* 211: AE ligature */ M_NMSTART, 211, 215, -/* 212: a angstrom */ M_NMSTART, 208, 212, -/* 213: i acute */ M_NMSTART, 229, 213, -/* 214: o slash */ M_NMSTART, 210, 214, -/* 215: ae ligature */ M_NMSTART, 211, 215, -/* 216: A dieresis */ M_NMSTART, 216, 204, -/* 217: i grave */ M_NMSTART, 230, 217, -/* 218: O dieresis */ M_NMSTART, 218, 206, -/* 219: U dieresis */ M_NMSTART, 219, 207, -/* 220: E acute */ M_NMSTART, 220, 197, -/* 221: i dieresis */ M_NMSTART, 167, 221, -/* 222: SS ligature */ M_NMSTART, 222, 222, -/* 223: O circumflex */ M_NMSTART, 223, 194, -/* 224: A acute */ M_NMSTART, 224, 196, -/* 225: A tilde */ M_NMSTART, 225, 226, -/* 226: a tilde */ M_NMSTART, 225, 226, -/* 227: Eth (invalid) */ M_NMSTART, 227, 228, -/* 228: eth (invalid) */ M_NMSTART, 227, 228, -/* 229: I acute */ M_NMSTART, 229, 213, -/* 230: I grave */ M_NMSTART, 230, 217, -/* 231: O acute */ M_NMSTART, 231, 198, -/* 232: O grave */ M_NMSTART, 232, 202, -/* 233: O tilde */ M_NMSTART, 233, 234, -/* 234: o tilde */ M_NMSTART, 233, 234, -/* 235: S caron */ M_NMSTART, 235, 236, -/* 236: s caron */ M_NMSTART, 235, 236, -/* 237: U acute */ M_NMSTART, 237, 199, -/* 238: Y dieresis */ M_NMSTART, 238, 239, -/* 239: y dieresis */ M_NMSTART, 238, 239, -/* 240: Thorn (invalid) */ M_NMSTART, 240, 241, -/* 241: thorn (invalid) */ M_NMSTART, 240, 241, -/* 242: undefined */ M_NONNAME, 242, 242, -/* 243: mu (invalid) */ M_NONNAME, 243, 243, -/* 244: paragraph sign (invalid) */ M_NONNAME, 244, 244, -/* 245: fraction 3/4 (invalid) */ M_NONNAME, 245, 245, -/* 246: long dash (invalid) */ M_NONNAME, 246, 246, -/* 247: fraction 1/4 (invalid) */ M_NONNAME, 247, 247, -/* 248: fraction 1/2 (invalid) */ M_NONNAME, 248, 248, -/* 249: Female ordinal (invalid) */ M_NONNAME, 249, 249, -/* 250: Male ordinal (invalid) */ M_NONNAME, 250, 250, -/* 251: French double open quote(invalid) */ M_NONNAME, 251, 251, -/* 252: Solid square (invalid) */ M_NONNAME, 252, 252, -/* 253: French double close quote(invalid) */ M_NONNAME, 253, 253, -/* 254: Plus over minus sign(invalid)*/ M_NONNAME, 254, 254, -/* 255: undefined */ M_NONNAME, 255, 255, +/* 0: ^@ NUL */ {M_NONNAME, 0, 0}, +/* 1: ^A SOH */ {M_NONNAME, 1, 1}, +/* 2: ^B STX */ {M_NONNAME, 2, 2}, +/* 3: ^C ETX */ {M_NONNAME, 3, 3}, +/* 4: ^D EOT */ {M_NONNAME, 4, 4}, +/* 5: ^E ENQ */ {M_NONNAME, 5, 5}, +/* 6: ^F ACK */ {M_NONNAME, 6, 6}, +/* 7: ^G BEL */ {M_NONNAME, 7, 7}, +/* 8: ^H BS */ {M_NONNAME, 8, 8}, +/* 9: ^I HT */ {M_NONNAME, 9, 9}, +/* 10: ^J LF */ {M_NONNAME, 10, 10}, +/* 11: ^K VT */ {M_NONNAME, 11, 11}, +/* 12: ^L FF */ {M_NONNAME, 12, 12}, +/* 13: ^M CR */ {M_NONNAME, 13, 13}, +/* 14: ^N SO */ {M_NONNAME, 14, 14}, +/* 15: ^O SI */ {M_NONNAME, 15, 15}, +/* 16: ^P DLE */ {M_NONNAME, 16, 16}, +/* 17: ^Q DC1 */ {M_NONNAME, 17, 17}, +/* 18: ^R DC2 */ {M_NONNAME, 18, 18}, +/* 19: ^S DC3 */ {M_NONNAME, 19, 19}, +/* 20: ^T DC4 */ {M_NONNAME, 20, 20}, +/* 21: ^U NAK */ {M_NONNAME, 21, 21}, +/* 22: ^V SYN */ {M_NONNAME, 22, 22}, +/* 23: ^W ETB */ {M_NONNAME, 23, 23}, +/* 24: ^X CAN */ {M_NONNAME, 24, 24}, +/* 25: ^Y EM */ {M_NONNAME, 25, 25}, +/* 26: ^Z SUB */ {M_NONNAME, 26, 26}, +/* 27: ^[ ESC */ {M_NONNAME, 27, 27}, +/* 28: ^\ FS */ {M_NONNAME, 28, 28}, +/* 29: ^] GS */ {M_NONNAME, 29, 29}, +/* 30: ^^ RS */ {M_NONNAME, 30, 30}, +/* 31: ^_ US */ {M_NONNAME, 31, 31}, +/* 32: SP */ {M_NONNAME, 32, 32}, +/* 33: ! */ {M_NONNAME, 33, 33}, +/* 34: " */ {M_NONNAME, 34, 34}, +/* 35: # */ {M_NONNAME, 35, 35}, +/* 36: $ */ {M_NONNAME, 36, 36}, +/* 37: % */ {M_NONNAME, 37, 37}, +/* 38: & */ {M_NONNAME, 38, 38}, +/* 39: ' */ {M_NONNAME, 39, 39}, +/* 40: ( */ {M_NONNAME, 40, 40}, +/* 41: ) */ {M_NONNAME, 41, 41}, +/* 42: * */ {M_NONNAME, 42, 42}, +/* 43: + */ {M_NAMECHAR, 43, 43}, +/* 44: , */ {M_NONNAME, 44, 44}, +/* 45: - */ {M_NAMECHAR, 45, 45}, +/* 46: . */ {M_NAMECHAR, 46, 46}, +/* 47: / */ {M_NONNAME, 47, 47}, +/* 48: 0 */ {M_DIGIT, 48, 48}, +/* 49: 1 */ {M_DIGIT, 49, 49}, +/* 50: 2 */ {M_DIGIT, 50, 50}, +/* 51: 3 */ {M_DIGIT, 51, 51}, +/* 52: 4 */ {M_DIGIT, 52, 52}, +/* 53: 5 */ {M_DIGIT, 53, 53}, +/* 54: 6 */ {M_DIGIT, 54, 54}, +/* 55: 7 */ {M_DIGIT, 55, 55}, +/* 56: 8 */ {M_DIGIT, 56, 56}, +/* 57: 9 */ {M_DIGIT, 57, 57}, +/* 58: : */ {M_NONNAME, 58, 58}, +/* 59: ; */ {M_NONNAME, 59, 59}, +/* 60: < */ {M_NONNAME, 60, 60}, +/* 61: = */ {M_NONNAME, 61, 61}, +/* 62: > */ {M_NONNAME, 62, 62}, +/* 63: ? */ {M_NONNAME, 63, 63}, +/* 64: @ */ {M_NONNAME, 64, 64}, +/* 65: A */ {M_NMSTART, 65, 97}, +/* 66: B */ {M_NMSTART, 66, 98}, +/* 67: C */ {M_NMSTART, 67, 99}, +/* 68: D */ {M_NMSTART, 68, 100}, +/* 69: E */ {M_NMSTART, 69, 101}, +/* 70: F */ {M_NMSTART, 70, 102}, +/* 71: G */ {M_NMSTART, 71, 103}, +/* 72: H */ {M_NMSTART, 72, 104}, +/* 73: I */ {M_NMSTART, 73, 105}, +/* 74: J */ {M_NMSTART, 74, 106}, +/* 75: K */ {M_NMSTART, 75, 107}, +/* 76: L */ {M_NMSTART, 76, 108}, +/* 77: M */ {M_NMSTART, 77, 109}, +/* 78: N */ {M_NMSTART, 78, 110}, +/* 79: O */ {M_NMSTART, 79, 111}, +/* 80: P */ {M_NMSTART, 80, 112}, +/* 81: Q */ {M_NMSTART, 81, 113}, +/* 82: R */ {M_NMSTART, 82, 114}, +/* 83: S */ {M_NMSTART, 83, 115}, +/* 84: T */ {M_NMSTART, 84, 116}, +/* 85: U */ {M_NMSTART, 85, 117}, +/* 86: V */ {M_NMSTART, 86, 118}, +/* 87: W */ {M_NMSTART, 87, 119}, +/* 88: X */ {M_NMSTART, 88, 120}, +/* 89: Y */ {M_NMSTART, 89, 121}, +/* 90: Z */ {M_NMSTART, 90, 122}, +/* 91: [ */ {M_NONNAME, 91, 91}, +/* 92: \\ */ {M_NONNAME, 92, 92}, +/* 93: ] */ {M_NONNAME, 93, 93}, +/* 94: ^ */ {M_NONNAME, 94, 94}, +/* 95: _ */ {M_NONNAME, 95, 95}, +/* 96: ` */ {M_NONNAME, 96, 96}, +/* 97: a */ {M_NMSTART, 65, 97}, +/* 98: b */ {M_NMSTART, 66, 98}, +/* 99: c */ {M_NMSTART, 67, 99}, +/* 100: d */ {M_NMSTART, 68, 100}, +/* 101: e */ {M_NMSTART, 69, 101}, +/* 102: f */ {M_NMSTART, 70, 102}, +/* 103: g */ {M_NMSTART, 71, 103}, +/* 104: h */ {M_NMSTART, 72, 104}, +/* 105: i */ {M_NMSTART, 73, 105}, +/* 106: j */ {M_NMSTART, 74, 106}, +/* 107: k */ {M_NMSTART, 75, 107}, +/* 108: l */ {M_NMSTART, 76, 108}, +/* 109: m */ {M_NMSTART, 77, 109}, +/* 110: n */ {M_NMSTART, 78, 110}, +/* 111: o */ {M_NMSTART, 79, 111}, +/* 112: p */ {M_NMSTART, 80, 112}, +/* 113: q */ {M_NMSTART, 81, 113}, +/* 114: r */ {M_NMSTART, 82, 114}, +/* 115: s */ {M_NMSTART, 83, 115}, +/* 116: t */ {M_NMSTART, 84, 116}, +/* 117: u */ {M_NMSTART, 85, 117}, +/* 118: v */ {M_NMSTART, 86, 118}, +/* 119: w */ {M_NMSTART, 87, 119}, +/* 120: x */ {M_NMSTART, 88, 120}, +/* 121: y */ {M_NMSTART, 89, 121}, +/* 122: z */ {M_NMSTART, 90, 122}, +/* 123: { */ {M_NONNAME, 123, 123}, +/* 124: | */ {M_NONNAME, 124, 124}, +/* 125: } */ {M_NONNAME, 125, 125}, +/* 126: ~ */ {M_NONNAME, 126, 126}, +/* 127: DEL */ {M_NONNAME, 127, 127}, +/* 128: undefined */ {M_NONNAME, 128, 128}, +/* 129: undefined */ {M_NONNAME, 129, 129}, +/* 130: undefined */ {M_NONNAME, 130, 130}, +/* 131: undefined */ {M_NONNAME, 131, 131}, +/* 132: undefined */ {M_NONNAME, 132, 132}, +/* 133: undefined */ {M_NONNAME, 133, 133}, +/* 134: undefined */ {M_NONNAME, 134, 134}, +/* 135: undefined */ {M_NONNAME, 135, 135}, +/* 136: undefined */ {M_NONNAME, 136, 136}, +/* 137: undefined */ {M_NONNAME, 137, 137}, +/* 138: undefined */ {M_NONNAME, 138, 138}, +/* 139: undefined */ {M_NONNAME, 139, 139}, +/* 140: undefined */ {M_NONNAME, 140, 140}, +/* 141: undefined */ {M_NONNAME, 141, 141}, +/* 142: undefined */ {M_NONNAME, 142, 142}, +/* 143: undefined */ {M_NONNAME, 143, 143}, +/* 144: undefined */ {M_NONNAME, 144, 144}, +/* 145: undefined */ {M_NONNAME, 145, 145}, +/* 146: undefined */ {M_NONNAME, 146, 146}, +/* 147: undefined */ {M_NONNAME, 147, 147}, +/* 148: undefined */ {M_NONNAME, 148, 148}, +/* 149: undefined */ {M_NONNAME, 149, 149}, +/* 150: undefined */ {M_NONNAME, 150, 150}, +/* 151: undefined */ {M_NONNAME, 151, 151}, +/* 152: undefined */ {M_NONNAME, 152, 152}, +/* 153: undefined */ {M_NONNAME, 153, 153}, +/* 154: undefined */ {M_NONNAME, 154, 154}, +/* 155: undefined */ {M_NONNAME, 155, 155}, +/* 156: undefined */ {M_NONNAME, 156, 156}, +/* 157: undefined */ {M_NONNAME, 157, 157}, +/* 158: undefined */ {M_NONNAME, 158, 158}, +/* 159: undefined */ {M_NONNAME, 159, 159}, +/* 160: undefined */ {M_NONNAME, 160, 160}, +/* 161: A grave */ {M_NMSTART, 161, 200}, +/* 162: A circumflex */ {M_NMSTART, 162, 192}, +/* 163: E grave */ {M_NMSTART, 163, 201}, +/* 164: E circumflex */ {M_NMSTART, 164, 193}, +/* 165: E dieresis */ {M_NMSTART, 165, 205}, +/* 166: I circumflex */ {M_NMSTART, 166, 209}, +/* 167: I dieresis */ {M_NMSTART, 167, 221}, +/* 168: acute accent */ {M_NONNAME, 168, 168}, +/* 169: grave accent */ {M_NONNAME, 169, 169}, +/* 170: circumflex */ {M_NONNAME, 170, 170}, +/* 171: dieresis */ {M_NONNAME, 171, 171}, +/* 172: tilde */ {M_NONNAME, 172, 172}, +/* 173: U grave */ {M_NMSTART, 173, 203}, +/* 174: U circumflex */ {M_NMSTART, 174, 195}, +/* 175: Italian Lira (invalid) */ {M_NONNAME, 175, 175}, +/* 176: overbar (invalid) */ {M_NONNAME, 176, 176}, +/* 177: Y acute */ {M_NMSTART, 177, 178}, +/* 178: y acute */ {M_NMSTART, 177, 178}, +/* 179: degree (invalid) */ {M_NONNAME, 179, 179}, +/* 180: C cedilla */ {M_NMSTART, 180, 181}, +/* 181: c cedilla */ {M_NMSTART, 180, 181}, +/* 182: N tilde */ {M_NMSTART, 182, 183}, +/* 183: n tilde */ {M_NMSTART, 182, 183}, +/* 184: inverted exclamation mark */ {M_NONNAME, 184, 184}, +/* 185: inverted question mark */ {M_NONNAME, 185, 185}, +/* 186: currency sign (invalid) */ {M_NONNAME, 186, 186}, +/* 187: pound sterling (invalid) */ {M_NONNAME, 187, 187}, +/* 188: Yen */ {M_NONNAME, 188, 188}, +/* 189: Section sign (invalid) */ {M_NONNAME, 189, 189}, +/* 190: florin (invalid) */ {M_NONNAME, 190, 190}, +/* 191: Cent sign (invalid) */ {M_NONNAME, 191, 191}, +/* 192: a circumflex */ {M_NMSTART, 162, 192}, +/* 193: e circumflex */ {M_NMSTART, 164, 193}, +/* 194: o circumflex */ {M_NMSTART, 223, 194}, +/* 195: u circumflex */ {M_NMSTART, 174, 195}, +/* 196: a acute */ {M_NMSTART, 224, 196}, +/* 197: e acute */ {M_NMSTART, 220, 197}, +/* 198: o acute */ {M_NMSTART, 231, 198}, +/* 199: u acute */ {M_NMSTART, 237, 199}, +/* 200: a grave */ {M_NMSTART, 161, 200}, +/* 201: e grave */ {M_NMSTART, 163, 201}, +/* 202: o grave */ {M_NMSTART, 232, 202}, +/* 203: u grave */ {M_NMSTART, 173, 203}, +/* 204: a dieresis */ {M_NMSTART, 216, 204}, +/* 205: e dieresis */ {M_NMSTART, 165, 205}, +/* 206: o dieresis */ {M_NMSTART, 218, 206}, +/* 207: u dieresis */ {M_NMSTART, 219, 207}, +/* 208: A angstrom */ {M_NMSTART, 208, 212}, +/* 209: i circumflex */ {M_NMSTART, 166, 209}, +/* 210: O slash */ {M_NMSTART, 210, 214}, +/* 211: AE ligature */ {M_NMSTART, 211, 215}, +/* 212: a angstrom */ {M_NMSTART, 208, 212}, +/* 213: i acute */ {M_NMSTART, 229, 213}, +/* 214: o slash */ {M_NMSTART, 210, 214}, +/* 215: ae ligature */ {M_NMSTART, 211, 215}, +/* 216: A dieresis */ {M_NMSTART, 216, 204}, +/* 217: i grave */ {M_NMSTART, 230, 217}, +/* 218: O dieresis */ {M_NMSTART, 218, 206}, +/* 219: U dieresis */ {M_NMSTART, 219, 207}, +/* 220: E acute */ {M_NMSTART, 220, 197}, +/* 221: i dieresis */ {M_NMSTART, 167, 221}, +/* 222: SS ligature */ {M_NMSTART, 222, 222}, +/* 223: O circumflex */ {M_NMSTART, 223, 194}, +/* 224: A acute */ {M_NMSTART, 224, 196}, +/* 225: A tilde */ {M_NMSTART, 225, 226}, +/* 226: a tilde */ {M_NMSTART, 225, 226}, +/* 227: Eth (invalid) */ {M_NMSTART, 227, 228}, +/* 228: eth (invalid) */ {M_NMSTART, 227, 228}, +/* 229: I acute */ {M_NMSTART, 229, 213}, +/* 230: I grave */ {M_NMSTART, 230, 217}, +/* 231: O acute */ {M_NMSTART, 231, 198}, +/* 232: O grave */ {M_NMSTART, 232, 202}, +/* 233: O tilde */ {M_NMSTART, 233, 234}, +/* 234: o tilde */ {M_NMSTART, 233, 234}, +/* 235: S caron */ {M_NMSTART, 235, 236}, +/* 236: s caron */ {M_NMSTART, 235, 236}, +/* 237: U acute */ {M_NMSTART, 237, 199}, +/* 238: Y dieresis */ {M_NMSTART, 238, 239}, +/* 239: y dieresis */ {M_NMSTART, 238, 239}, +/* 240: Thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 241: thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 242: undefined */ {M_NONNAME, 242, 242}, +/* 243: mu (invalid) */ {M_NONNAME, 243, 243}, +/* 244: paragraph sign (invalid) */ {M_NONNAME, 244, 244}, +/* 245: fraction 3/4 (invalid) */ {M_NONNAME, 245, 245}, +/* 246: long dash (invalid) */ {M_NONNAME, 246, 246}, +/* 247: fraction 1/4 (invalid) */ {M_NONNAME, 247, 247}, +/* 248: fraction 1/2 (invalid) */ {M_NONNAME, 248, 248}, +/* 249: Female ordinal (invalid) */ {M_NONNAME, 249, 249}, +/* 250: Male ordinal (invalid) */ {M_NONNAME, 250, 250}, +/* 251: French double open quote(invalid) */ {M_NONNAME, 251, 251}, +/* 252: Solid square (invalid) */ {M_NONNAME, 252, 252}, +/* 253: French double close quote(invalid) */ {M_NONNAME, 253, 253}, +/* 254: Plus over minus sign(invalid)*/ {M_NONNAME, 254, 254}, +/* 255: undefined */ {M_NONNAME, 255, 255}, } ; diff --git a/cde/programs/dthelp/parser/canon1/util/conutil.c b/cde/programs/dthelp/parser/canon1/util/conutil.c index e4b562a8..71ae5ad1 100644 --- a/cde/programs/dthelp/parser/canon1/util/conutil.c +++ b/cde/programs/dthelp/parser/canon1/util/conutil.c @@ -127,11 +127,13 @@ M_WCHAR wlb = 0, wcm, wnl, wsl, wst; if (!wlb) { - mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ - mbtowc(&wcm, ",", 1); - mbtowc(&wnl, "\n", 1); - mbtowc(&wsl, "/", 1); - mbtowc(&wst, "*", 1); + int + ret = mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ + ret = mbtowc(&wcm, ",", 1); + ret = mbtowc(&wnl, "\n", 1); + ret = mbtowc(&wsl, "/", 1); + ret = mbtowc(&wst, "*", 1); + (void) ret; } while (m_whitespace((M_WCHAR) (c = readchar(FALSE)))); @@ -226,7 +228,8 @@ M_WCHAR wcl; char unexp[32]; /* arbitraily large */ int length; -mbtowc(&wcl, ":", 1); +int ret = mbtowc(&wcl, ":", 1); +(void) ret; while (TRUE) { @@ -252,9 +255,11 @@ char *mb_name; if (!wsm) { - mbtowc(&wsm, ";", 1); - mbtowc(&wcl, ":", 1); - mbtowc(&wcm, ",", 1); + int + ret = mbtowc(&wsm, ";", 1); + ret = mbtowc(&wcl, ":", 1); + ret = mbtowc(&wcm, ",", 1); + (void) ret; } while (TRUE) @@ -333,7 +338,7 @@ c = readchar(TRUE)) *p++ = (M_WCHAR) c; } *p = M_EOS; -if (dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie)) +if ((dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie))) { withdelim = TRUE; curdelim = dstruct->count - 1; @@ -451,7 +456,8 @@ int i; M_WCHAR wnl; char *mb_dname, *mb_dstring; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; loading = TRUE; while ((c = getc(ddat)) != EOF) @@ -526,13 +532,13 @@ while ((c = getc(ddat)) != EOF) fprintf(delim, "M_DELIMEXTERN char %s[%d] M_DELIMINIT(\"", mb_dname, - strlen(mb_dstring) + 1); + (int)strlen(mb_dstring) + 1); for (p = dstring ; *p ; p++) { char *pc; char mb_p[32]; /* arbitrarily large */ - int length, i; + int length; length = wctomb(mb_p, *p); mb_p[length] = 0; @@ -629,7 +635,7 @@ void prtctxt(column, value) if (! first) fprintf(delim, ",\n"); first = FALSE; - fprintf(delim, " %d, %d", column, value); + fprintf(delim, " {%d, %d}", column, value); nonzero++; } @@ -645,7 +651,8 @@ int readchar(cap) int c; M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; c = mb_getwc(cdat); /* use mb_getwc so we read multi-byte chars */ if (cap && c != EOF) c = m_upper(c); @@ -667,7 +674,8 @@ int c; { M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; ungetc(c, cdat); if (c == wnl) m_line--; diff --git a/cde/programs/dthelp/parser/canon1/util/entout.c b/cde/programs/dthelp/parser/canon1/util/entout.c index 7b136b66..4e99a31b 100644 --- a/cde/programs/dthelp/parser/canon1/util/entout.c +++ b/cde/programs/dthelp/parser/canon1/util/entout.c @@ -72,8 +72,8 @@ void entout(fname) int nameindex ; LOGICAL start ; - strcpy(efilename, fname) ; - strcpy(&efilename[strlen(efilename)], ".h") ; + strncpy(efilename, fname, ENTFILENAME) ; + strncpy(&efilename[strlen(efilename)], ".h", 2) ; m_openchk(&entfile, efilename, "w") ; fprintf(entfile, "#include \"entdef.h\"\n") ; @@ -101,7 +101,7 @@ void entout(fname) if (start) fputs(",\n", entfile) ; start = TRUE ; for (p = ent->content ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; fputs(" 0", entfile) ; } fprintf(entfile, "}\n#endif\n") ; @@ -112,7 +112,7 @@ void entout(fname) fputs("#if defined(M_ENTDEF)\n = {\n", entfile) ; for (ent = firstent ; ent ; ent = ent->next) { for (p = ent->name ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; if (ent != lastent) fputs(" 0,\n", entfile) ; else fputs(" 0\n", entfile) ; } @@ -130,7 +130,7 @@ void entout(fname) fprintf(entfile, "#if defined(M_ENTDEF)\n = {\n") ; for (ent = firstent, conindex = 0, nameindex = 0 ; ent ; ent = ent->next) { - fprintf(entfile, " %s, %s, ", + fprintf(entfile, " {%s, %s, ", typetype(ent->type), typewhere(ent->wheredef)) ; if (ent->content) { @@ -143,10 +143,10 @@ void entout(fname) #if defined(BUILDEXTERN) fprintf(entfile, ", %d", ent->index) ; if (ent != lastent) - fprintf(entfile, ", &m_entities[%d], 0", ent->index) ; - else fputs(", NULL, 0", entfile) ; + fprintf(entfile, ", &m_entities[%d], 0}", ent->index) ; + else fputs(", NULL, 0}", entfile) ; #else - fprintf(entfile, ", %d", ent->codeindex) ; + fprintf(entfile, ", %d}", ent->codeindex) ; #endif if (ent != lastent) fprintf(entfile, ", \n") ; else fprintf(entfile, "}\n#endif\n") ; @@ -159,7 +159,7 @@ void entout(fname) "M_ENTEXTERN M_TRIE m_enttrie[%d]\n", count) ; if (m_enttrie->data) { count = 0 ; - fputs("#if defined(M_ENTDEF)\n = {\n 0, NULL, &m_enttrie[1]", entfile) ; + fputs("#if defined(M_ENTDEF)\n = {\n {0, NULL, &m_enttrie[1]}", entfile) ; m_dumptrie(entfile, m_enttrie->data, "m_enttrie", &count, entptr) ; fprintf(entfile, "}\n#endif\n") ; } @@ -225,6 +225,7 @@ char *typewhere(n) case M_DELTDEF: return(xdeltdef) ; case FALSE: return("0") ; } + return("0"); } diff --git a/cde/programs/dthelp/parser/canon1/util/error.c b/cde/programs/dthelp/parser/canon1/util/error.c index 1c88acaa..98b13461 100644 --- a/cde/programs/dthelp/parser/canon1/util/error.c +++ b/cde/programs/dthelp/parser/canon1/util/error.c @@ -306,8 +306,8 @@ void esuffix(M_NOPAR) void msgline(text) char *text ; { - fprintf(stderr, text) ; - fprintf(m_errfile, text) ; + fprintf(stderr, "%s", text) ; + fprintf(m_errfile, "%s", text) ; } /* Print something to both stderr and m_errfile */ diff --git a/cde/programs/dthelp/parser/canon1/util/fclndir.c b/cde/programs/dthelp/parser/canon1/util/fclndir.c index ea7b99b4..8bc8f59e 100644 --- a/cde/programs/dthelp/parser/canon1/util/fclndir.c +++ b/cde/programs/dthelp/parser/canon1/util/fclndir.c @@ -130,17 +130,19 @@ void copyfile(pfile1,pfile2) { int ret; char *pcmd; + int slen; /* malloc space for the system command: two filenames, plus a command, spaces, and the terminating null */ - pcmd = (char *) malloc(strlen(pfile1) + strlen(pfile2) + 8); + slen = strlen(pfile1) + strlen(pfile2) + 8; + pcmd = (char *) malloc(slen); #if defined(MSDOS) - ret = sprintf(pcmd,"copy %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "copy %s %s",pfile1,pfile2); #else - ret = sprintf(pcmd,"cp %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "cp %s %s",pfile1,pfile2); #endif ret = system(pcmd); - ret = sprintf(pcmd,"touch %s",pfile2); + ret = snprintf(pcmd, slen, "touch %s",pfile2); ret = system(pcmd); } diff --git a/cde/programs/dthelp/parser/canon1/util/malloc.c b/cde/programs/dthelp/parser/canon1/util/malloc.c index c633fa0b..8475803c 100644 --- a/cde/programs/dthelp/parser/canon1/util/malloc.c +++ b/cde/programs/dthelp/parser/canon1/util/malloc.c @@ -96,11 +96,11 @@ void m_free(block, msg) free(block) ; if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) block >> 16), (unsigned int) block, msg) ; #else - sprintf(buffer, " %9p", block, msg) ; + snprintf(buffer, 32, " %9p", block) ; #endif m_trace(buffer) ; m_trace("- Freed ") ; @@ -171,14 +171,14 @@ void *m_malloc(size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; @@ -212,14 +212,14 @@ void *m_realloc(ptr, size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Re-allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; diff --git a/cde/programs/dthelp/parser/canon1/util/scanutil.c b/cde/programs/dthelp/parser/canon1/util/scanutil.c index 66b44872..8e4c2867 100644 --- a/cde/programs/dthelp/parser/canon1/util/scanutil.c +++ b/cde/programs/dthelp/parser/canon1/util/scanutil.c @@ -33,7 +33,7 @@ int getachar(M_NOPAR) int c; M_WCHAR wc,wnl; char mbyte[32]; /* bigger than any possible multibyte char */ -int length; +int length, ret; if (toundo) wc = (M_WCHAR) savechar[--toundo]; else @@ -58,10 +58,11 @@ else return(EOF); } } - mbtowc(&wc,mbyte,length); + ret = mbtowc(&wc,mbyte,length); } -mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (wc == wnl) m_line++; if (wc == 65535) @@ -246,7 +247,8 @@ if (toundo >= SAVECHAR) savechar[toundo++] = c; if (toundo > maxundo) maxundo = toundo; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (c == wnl) m_line--; } diff --git a/cde/programs/dthelp/parser/canon1/util/trie.c b/cde/programs/dthelp/parser/canon1/util/trie.c index 02b241e2..71e8b444 100644 --- a/cde/programs/dthelp/parser/canon1/util/trie.c +++ b/cde/programs/dthelp/parser/canon1/util/trie.c @@ -149,7 +149,7 @@ void *m_ntrtrie(p, xtrie, dataval) M_TRIE *currentnode ; void *n ; - if (n = m_lookfortrie(p, xtrie)) return(n) ; + if ((n = m_lookfortrie(p, xtrie))) return(n) ; currentnode = xtrie ; for ( ; *p ; p++) m_entercharintrie(¤tnode, m_ctupper(*p)) ; diff --git a/cde/programs/dthelp/parser/canon1/util/triecnt.c b/cde/programs/dthelp/parser/canon1/util/triecnt.c index 0949cf0f..08017267 100644 --- a/cde/programs/dthelp/parser/canon1/util/triecnt.c +++ b/cde/programs/dthelp/parser/canon1/util/triecnt.c @@ -88,12 +88,12 @@ void dumpnode(first, file, trieptr, count, proc) /* generate a child */ if (*first) *first = FALSE ; else fprintf(file, ",\n") ; - fprintf(file, " ") ; + fprintf(file, " {") ; if (p->next) fprintf(file, "TRUE, ") ; else fprintf(file, "FALSE, ") ; - fprintf(file, "%d", p->symbol) ; - if (p->symbol) fprintf(file, ", %d", *count) ; - else (*proc)(file, p->data) ; + fprintf(file, "%d", (int)p->symbol) ; + if (p->symbol) fprintf(file, ", %d}", *count) ; + else { (*proc)(file, p->data) ; fprintf(file, "}") ; } /* count the children of the child*/ if (p->symbol) countdown(p, count) ; @@ -110,5 +110,5 @@ void printval(file, value) FILE *file ; void *value ; { - fprintf(file, ", %d", (int) value) ; + fprintf(file, ", %ld", (long) value) ; } diff --git a/cde/programs/dthelp/parser/canon1/util/triedump.c b/cde/programs/dthelp/parser/canon1/util/triedump.c index 72ed1883..4b6671c8 100644 --- a/cde/programs/dthelp/parser/canon1/util/triedump.c +++ b/cde/programs/dthelp/parser/canon1/util/triedump.c @@ -62,14 +62,14 @@ void m_dumptrie(file, xtrie, extname, count, proc) for (p = xtrie ; p ; p = p->next) { (*count)++ ; - fprintf(file, ",\n %d, ", p-> symbol) ; + fprintf(file, ",\n {%d, ", (int)p-> symbol) ; if (p->next) fprintf(file, "&%s[%d], ", extname, *count + 1) ; else fputs("NULL, ", file) ; if (p->symbol) { - fprintf(file, "&%s[%d]", extname, firstson) ; + fprintf(file, "&%s[%d]}", extname, firstson) ; countdown(p, &firstson) ; } - else (*proc) (p->data) ; + else { (*proc) (p->data) ; fprintf(file, "}") ; } } for (p = xtrie ; p ; p = p->next) diff --git a/cde/programs/dthelp/parser/canon1/util/wchar.c b/cde/programs/dthelp/parser/canon1/util/wchar.c index 08c9a0c1..2057643b 100644 --- a/cde/programs/dthelp/parser/canon1/util/wchar.c +++ b/cde/programs/dthelp/parser/canon1/util/wchar.c @@ -72,7 +72,7 @@ M_WCHAR *string1start; string1start = string1; -while (*string1++ = *string2++); +while ((*string1++ = *string2++)); return string1start; } @@ -205,7 +205,7 @@ length = (length + sizeof(M_WCHAR) - 1) / sizeof(M_WCHAR); mb_string = (char *) m_malloc(length, "multi-byte string"); length = 0; -while (wc = *wc_string++) +while ((wc = *wc_string++)) { if ((retVal = wctomb(&mb_string[length], wc)) > 0) length += retVal; @@ -226,7 +226,6 @@ char *mb_string; { M_WCHAR *wc_string, *wc_stringStart; int length, incr; -char c; if (!mb_string) mb_string = ""; @@ -244,8 +243,9 @@ while (mb_string[length]) badOne[0] = mb_string[length]; badOne[1] = 0; - sprintf(buffer, "0x%x", mb_string[length]); - m_err2("invalid multibyte character found: '%c' (%s)", badOne, buffer); + snprintf(buffer, 32, "0x%x", mb_string[length]); + m_err2("invalid multibyte character found: '%c' (%s)", + (M_WCHAR *)badOne, (M_WCHAR *)buffer); incr = 1; } length += incr; @@ -263,7 +263,6 @@ void *m_ptr; { int c; M_WCHAR wc; -char badch[2]; char mbyte[32]; /* make this bigger than any possible multi-byte char */ int length; @@ -288,7 +287,8 @@ while (1) return(EOF); } } -mbtowc(&wc,mbyte,length); +int ret = mbtowc(&wc,mbyte,length); +(void) ret; return((int) wc); } diff --git a/cde/programs/dthelp/parser/pass1/build/build.c b/cde/programs/dthelp/parser/pass1/build/build.c index 5c2239b2..73474fbf 100644 --- a/cde/programs/dthelp/parser/pass1/build/build.c +++ b/cde/programs/dthelp/parser/pass1/build/build.c @@ -41,7 +41,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include "entdef.h" /* Main procedure */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { @@ -67,8 +67,9 @@ while (TRUE) if (scantrace) printf( "m_prevcon=%d, m_token=%d, curcon=%d, scanval = %c (%d), line=%d\n", - m_prevcon, m_token, curcon, scanval, scanval, m_line) ; + m_prevcon, m_token, curcon, (char)scanval, (int)scanval, m_line) ; #include "case.c" if (m_token == ENDFILE) exit(FALSE) ; } + return 0; } diff --git a/cde/programs/dthelp/parser/pass1/build/buildutl.c b/cde/programs/dthelp/parser/pass1/build/buildutl.c index cd071e2e..02e03d2d 100644 --- a/cde/programs/dthelp/parser/pass1/build/buildutl.c +++ b/cde/programs/dthelp/parser/pass1/build/buildutl.c @@ -43,7 +43,7 @@ LOGICAL *flag; char *delim; { M_WCHAR wcbuff[129]; -size_t length; +ssize_t length; wcbuff[128] = 0; length = mbstowcs(wcbuff,delim,128); @@ -73,7 +73,7 @@ m_openchk(&m_errfile, "error", "w") ; fprintf(stderr, "MARKUP System - BUILD %s\n", M_VERSION) ; fprintf(stderr, "Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.\n") ; if (! standard) - warning("Warning: optional enhancements of SGML enabled.") ; + warning("Info: optional enhancements of SGML enabled.") ; mb_delims = mb_dlmptr; wc_delims = m_dlmptr; @@ -112,7 +112,7 @@ void ruleinit(M_NOPAR) /* Rule end processing */ void rulend(M_NOPAR) { - STATE *fsa ; + STATE *fsa = NULL ; LOGICAL canbenull ; LHS *lhsp ; LHS *discard ; @@ -153,7 +153,7 @@ void rulend(M_NOPAR) void skiptoend(M_NOPAR) { int i ; - static errlev = 0 ; + static int errlev = 0 ; if (! errlev++) { curcon = ERROR ; diff --git a/cde/programs/dthelp/parser/pass1/build/eltree.c b/cde/programs/dthelp/parser/pass1/build/eltree.c index 7a76deff..109dd966 100644 --- a/cde/programs/dthelp/parser/pass1/build/eltree.c +++ b/cde/programs/dthelp/parser/pass1/build/eltree.c @@ -42,7 +42,7 @@ ELTSTRUCT *ntrelt(p) int length ; new = (ELTSTRUCT *) m_malloc(sizeof(ELTSTRUCT), "element structure") ; - if (old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new)) { + if ((old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new))) { m_free((M_POINTER) new, "element structure") ; return(old) ; } diff --git a/cde/programs/dthelp/parser/pass1/build/fsa.c b/cde/programs/dthelp/parser/pass1/build/fsa.c index 0e9b519e..07483ff4 100644 --- a/cde/programs/dthelp/parser/pass1/build/fsa.c +++ b/cde/programs/dthelp/parser/pass1/build/fsa.c @@ -85,11 +85,11 @@ void checkand(andstart, andptr, start, root, errelt) for (pand = parc->group ; pand ; pand = pand->next) checkand(andstart, andptr, pand->start, root, errelt) ; } - else if (c = checkdfsa(andptr->start, + else if ((c = checkdfsa(andptr->start, parc->label, parc->group, parc->id, - errelt)) + errelt))) nondeterm(root, c, *errelt) ; } } @@ -112,7 +112,7 @@ int checkdfsa(from, label, and, id, errelt) if (parc->group) { if (and == parc->group) return(ANDCONFLICT) ; for (group = parc->group ; group ; group = group->next) - if (c = checkdfsa(group->start, label, and, id, errelt)) + if ((c = checkdfsa(group->start, label, and, id, errelt))) return(c) ; } else if (! and && label == parc->label && parc->id != id) { @@ -138,14 +138,14 @@ int checkrepeat(from, and, errelt) for (; and ; and = and->next) for (parc = and->start->first ; parc ; parc = parc->next) { if (parc->group) - if (c = checkrepeat(from, parc->group, errelt)) return(c) ; + if ((c = checkrepeat(from, parc->group, errelt))) return(c) ; else ; else - if (c = checkdfsa(from, + if ((c = checkdfsa(from, parc->label, M_NULLVAL, parc->id, - errelt)) + errelt))) return(c) ; else ; } @@ -239,7 +239,7 @@ void makeand(canbenull, root, optional) TREE *child ; STATELIST *start, *final ; LOGICAL groupbenull ; - ANDGROUP *andptr, *saveand, *otherand ; + ANDGROUP *andptr = NULL, *saveand = NULL, *otherand ; STATELIST *index ; ELTSTRUCT *errelt ; @@ -579,7 +579,7 @@ void repeat(root) for (a = top->starta ; a ; a = a->next) { for (final = top->allfinal ; final ; final = final->next) { if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) { + if ((c = checkrepeat(final->value, a->group, &errelt))) { wtemp = MakeWideCharString(root->occurrence == PLUS ? plus : rep); warning1("Conflict in use of %s", wtemp); m_free(wtemp, "wide character string"); @@ -588,11 +588,11 @@ void repeat(root) else ; else - if (c = checkdfsa(final->value, + if ((c = checkdfsa(final->value, a->label, a->group, a->id, - &errelt)) + &errelt))) nondeterm (root, c, errelt) ; else ; @@ -600,14 +600,14 @@ void repeat(root) for (final = top->finals ; final ; final = final->next) { if (samelabelarc(a, final->value)) continue ; if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) + if ((c = checkrepeat(final->value, a->group, &errelt))) nondeterm(root, c, errelt) ; if (a->label || a->group || ! final->value->frompcdata) { - if (c = addarc(final->value, a->to, a->label, + if ((c = addarc(final->value, a->to, a->label, a->group, TRUE, a->id, - a->minim, &errelt)) + a->minim, &errelt))) nondeterm(root, c, errelt) ; if (permitspcd(a)) final->value->datacontent = TRUE ; } @@ -697,7 +697,7 @@ void simplebranch(root, value, group, optional) states of and-groups that terminate at the start state of the new arc */ for (index = top->allfinal ; index ; index = index->next) - if (c = checkdfsa(index->value, value, group, root->eltid, &errelt)) + if ((c = checkdfsa(index->value, value, group, root->eltid, &errelt))) nondeterm(root, c, errelt) ; for (index = top->starts ; index ; index = index->next) { if (! group && ! value && index->value->frompcdata) diff --git a/cde/programs/dthelp/parser/pass1/build/out.c b/cde/programs/dthelp/parser/pass1/build/out.c index 7b4b3ebc..cb89f984 100644 --- a/cde/programs/dthelp/parser/pass1/build/out.c +++ b/cde/programs/dthelp/parser/pass1/build/out.c @@ -31,6 +31,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include #include +#include #if defined(MSDOS) #include #endif @@ -195,7 +196,7 @@ void eltreeout(M_NOPAR) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = eltp->enptr ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -211,14 +212,14 @@ void eltreeout(M_NOPAR) else fputs(",\n", dtd) ; if (! eltp->content) warning1("No content model for element %s", eltp->enptr) ; - fprintf(dtd, " %d, %d, %s, ", + fprintf(dtd, " {%d, %d, %s, ", enameindex, eltp->model ? eltp->model->count : 0, typecon(eltp->content)) ; fprintf(dtd, "%d, %d, ", eltp->inptr, eltp->exptr) ; fprintf(dtd, "%d, %d, %d", eltp->parindex, eltp->paramcount, eltp->srefptr) ; enameindex += w_strlen(eltp->enptr) + 1 ; - fprintf(dtd, ", %s, %s, %s", + fprintf(dtd, ", %s, %s, %s}", boolean(eltp->stmin), boolean(eltp->etmin), boolean(eltp->useoradd)) ; } fputs(ndif, dtd) ; @@ -259,7 +260,7 @@ void exout(M_NOPAR) if (! first) fputs(",\n", dtd) ; first = FALSE ; exindex++ ; - fprintf(dtd, " %d, %d", ex->element, ex->next ? exindex + 1 : 0) ; + fprintf(dtd, " {%d, %d}", ex->element, ex->next ? exindex + 1 : 0) ; } fputs(ndif, dtd) ; } @@ -294,7 +295,7 @@ void fsa(M_NOPAR) for (pstate = firststate ; pstate ; pstate = pstate->next) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %s, %s, %d", + fprintf(dtd, " {%s, %s, %d}", boolean(pstate->final), boolean(pstate->datacontent), pstate->first ? ++arcount : 0) ; for (parc = pstate->first ; parc ; parc = parc->next) { @@ -319,7 +320,7 @@ void fsa(M_NOPAR) for (pand = firstand ; pand ; pand = pand->nextptr) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d", + fprintf(dtd, " {%d, %d}", pand->start->count, pand->next ? pand->next->count : M_NULLVAL) ; } @@ -352,7 +353,7 @@ if (kwlen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = ptypep->keyword ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -372,7 +373,7 @@ if (deflen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = paramp->defstring ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -392,7 +393,7 @@ if (ptypelen) { if (first) first = FALSE ; else fprintf(dtd, ",\n") ; - fprintf(dtd, " %d, %d", kw, ptypep->next) ; + fprintf(dtd, " {%d, %d}", kw, ptypep->next) ; kw += w_strlen(ptypep->keyword) + 1 ; } fputs(ndif, dtd) ; @@ -412,21 +413,21 @@ if (parcount) if (first) first = FALSE ; else fputs(",\n", dtd) ; fprintf(dtd, - " %d, %s, %d, %s, ", + " {%d, %s, %d, %s, ", pnameindex, partype(paramp->type), paramp->kwlist, deftype(paramp->deftype)) ; pnameindex += w_strlen(paramp->paramname) + 1 ; if (paramp->defval) - fprintf(dtd, "&m_keyword[%d]", paramp->defval - 1) ; + fprintf(dtd, "&m_keyword[%d]}", paramp->defval - 1) ; else if (paramp->defstring) { - fprintf(dtd, "&m_defval[%d]", defindex) ; + fprintf(dtd, "&m_defval[%d]}", defindex) ; defindex += w_strlen(paramp->defstring) + 1 ; } else - fputs("NULL", dtd) ; + fputs("NULL}", dtd) ; } fputs(ndif, dtd) ; } @@ -443,7 +444,7 @@ if (pnamelen) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", *p) ; + for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", (int)*p); fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -534,10 +535,10 @@ void srefout(M_NOPAR) count++ ; if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; + fprintf(dtd, " {%d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; for (j++ ; j < sreflen ; j++) if (mapbysref[sreflen * i + j]) break ; - fprintf(dtd, "%d", j < sreflen ? count + 1 : 0) ; + fprintf(dtd, "%d}", j < sreflen ? count + 1 : 0) ; } else j++ ; fputs(ndif, dtd) ; @@ -557,7 +558,7 @@ char *mb_paramname; int indent ; int i ; -fprintf(tempfile, "\n\n", eltp->enptr) ; +fprintf(tempfile, "\n\n", (char *)eltp->enptr) ; if (eltp->parptr) { fputs(" /*\n", tempfile) ; @@ -570,7 +571,8 @@ if (eltp->parptr) { int length; char mbyte[32]; /* larger than any multibyte character */ - char *pc, c; + char *pc; + unsigned char c; length = wctomb(mbyte, *p); if (length < 0) @@ -600,8 +602,8 @@ if (eltp->parptr) mb_keyword = MakeMByteString(ptypep->keyword); fprintf(tempfile, "%s = %s", - ptypep->keyword, - ptypep->keyword) ; + (char *)ptypep->keyword, + (char *)ptypep->keyword) ; m_free(mb_keyword,"multi-byte string"); ptypep = ptypep->next ? ptypep->nextptr : (PTYPE *) NULL ; if (ptypep) @@ -640,7 +642,7 @@ void template(M_NOPAR) undefent = TRUE ; } fprintf(tempfile, "\n", - ent->name, + (char *)ent->name, enttype(ent->type) ) ; } diff --git a/cde/programs/dthelp/parser/pass1/build/param.c b/cde/programs/dthelp/parser/pass1/build/param.c index f7250f3e..828c0002 100644 --- a/cde/programs/dthelp/parser/pass1/build/param.c +++ b/cde/programs/dthelp/parser/pass1/build/param.c @@ -89,7 +89,7 @@ ptypelen++ ; /* Add a parameter to the current element */ void addpar(M_NOPAR) { -PARAMETER *paramp, *last ; +PARAMETER *paramp, *last = NULL ; int length ; parcount++ ; @@ -200,6 +200,7 @@ switch (newpar->type) } break ; } + return(FALSE); } /* Normalize parameter default. Change tabs and RE's to spaces, capitalize @@ -212,7 +213,7 @@ M_WCHAR *string ; #endif /* M_PROTO */ { M_WCHAR *p, *q ; -int i ; +int i, ret ; switch (newpar->type) { @@ -238,7 +239,7 @@ switch (newpar->type) for (p = string, i = 0 ; *p ; p++, i++) if (m_whitespace(*p)) { - mbtowc(p, " ", 1); + ret = mbtowc(p, " ", 1); for (q = p + 1 ; m_whitespace(*q); q++) ; w_strcpy(p + 1, q) ; } @@ -262,10 +263,13 @@ switch (newpar->type) mbyte[1] = 0; } if ((length == 1) && (*mbyte == '\n' || *mbyte == '\t')) - mbtowc(string, " ", 1); + { + ret = mbtowc(string, " ", 1); + } } return ; } + (void) ret; } /* Called at end of parameter attribute list rule */ diff --git a/cde/programs/dthelp/parser/pass1/build/proto.h b/cde/programs/dthelp/parser/pass1/build/proto.h index 1234fcd5..8ce8fc09 100644 --- a/cde/programs/dthelp/parser/pass1/build/proto.h +++ b/cde/programs/dthelp/parser/pass1/build/proto.h @@ -330,7 +330,7 @@ LOGICAL litproc( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/pass1/build/scan.c b/cde/programs/dthelp/parser/pass1/build/scan.c index 082869a4..48baaea0 100644 --- a/cde/programs/dthelp/parser/pass1/build/scan.c +++ b/cde/programs/dthelp/parser/pass1/build/scan.c @@ -80,9 +80,10 @@ int c; int n; M_WCHAR wsp, wnl, wtb; -mbtowc(&wsp, " ", 1); -mbtowc(&wnl, "\n", 1); -mbtowc(&wtb, "\t", 1); +int +ret = mbtowc(&wsp, " ", 1); +ret = mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wtb, "\t", 1); while (TRUE) { @@ -158,13 +159,14 @@ while (TRUE) { char mbyte[32]; /* bigger than the biggest multibyte char */ - wctomb(mbyte, c); + ret = wctomb(mbyte, c); fprintf(stderr, "\n'%s' (%d)", mbyte, c); fprintf(m_errfile, "\n'%s' (%d)", mbyte, c); m_error("Unexpected character"); } } /* End while */ + (void) ret; } /* End scan */ #include "scanutil.c" diff --git a/cde/programs/dthelp/parser/pass1/build/sref.c b/cde/programs/dthelp/parser/pass1/build/sref.c index 1e7a6779..9a88b355 100644 --- a/cde/programs/dthelp/parser/pass1/build/sref.c +++ b/cde/programs/dthelp/parser/pass1/build/sref.c @@ -40,7 +40,7 @@ void adddefent(mapname) M_WCHAR *mapname; { M_WCHAR *p; -int n, length; +int n; char c; if (!wc_prefix) @@ -59,8 +59,9 @@ for (n = egensuf ; n ; n /= 10) return; } c = ('0' + (n % 10)); - mbtowc(p, &c, 1); - *p++; + int ret = mbtowc(p, &c, 1); + (void) ret; + p++; } *p = M_EOS; egensuf++; @@ -80,7 +81,7 @@ M_WCHAR *name; M_ENTITY *new; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity"); -if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) +if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free((M_POINTER) new, "entity"); return(FALSE); @@ -113,7 +114,7 @@ MAP *new; LOGICAL retval; new = (MAP *) m_malloc(sizeof(MAP), "map"); -if (old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new)) +if ((old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new))) { m_free(new, "map"); curmap = old->map; @@ -153,7 +154,7 @@ int noseq = 0; /* Define the delimiter */ delim = (SREFSTRUCT *) m_malloc(sizeof(SREFSTRUCT), "short reference delimiter"); -if (prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim)) +if ((prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim))) { m_free(delim, "short reference delimiter"); delim = prevsr; diff --git a/cde/programs/dthelp/parser/pass1/eltdef/context.dat b/cde/programs/dthelp/parser/pass1/eltdef/context.dat index 8aec496b..e9f76f65 100644 --- a/cde/programs/dthelp/parser/pass1/eltdef/context.dat +++ b/cde/programs/dthelp/parser/pass1/eltdef/context.dat @@ -626,7 +626,7 @@ name pcchain:pcchain { *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ; (*nextchain)->next = NULL ; - if ((*nextchain)->elt = m_packedlook(m_entree, name)) + if (((*nextchain)->elt = m_packedlook(m_entree, name))) (*nextchain)->elt++ ; else m_err1("Undefined element: %s", name) ; @@ -660,61 +660,61 @@ text } } globdef:globdef { - fprintf(globdef, "%c", textchar) ; + fprintf(globdef, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */ } globdec:globdec { - fprintf(globdec, "%c", textchar) ; + fprintf(globdec, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniss:iniss, inss:inss { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inies:inies, ines:ines { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inisc:inisc, insc:insc { - fprintf(sfile, "%c", textchar) ; + fprintf(sfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniec:iniec, inec:inec { - fprintf(efile, "%c", textchar) ; + fprintf(efile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */ } initc:initc, intc:intc { - fprintf(tfile, "%c", textchar) ; + fprintf(tfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inipc:inipc, inpc:inpc { - fprintf(pfile, "%c", textchar) ; + fprintf(pfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inistc:inistc, instc:instc { - fprintf(stfile, "%c", textchar) ; + fprintf(stfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inentc:inentc { - fprintf(entfile, "%c", textchar) ; + fprintf(entfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } diff --git a/cde/programs/dthelp/parser/pass1/eltdef/eltdef.c b/cde/programs/dthelp/parser/pass1/eltdef/eltdef.c index 1d7b4d98..af49e3ba 100644 --- a/cde/programs/dthelp/parser/pass1/eltdef/eltdef.c +++ b/cde/programs/dthelp/parser/pass1/eltdef/eltdef.c @@ -55,7 +55,7 @@ int main(argc, argv) { int m_token ; - if (argc > 2) + if (argc > 2) { if (*argv[2] == '-') { if (strchr(argv[2], 'a')) m_malftrace = TRUE ; if (strchr(argv[2], 'A')) m_malftrace = TRUE ; @@ -70,6 +70,7 @@ int main(argc, argv) fprintf(stderr, "****Starting with MARKUP 2.0, ELTDEF no longer writes a statistics file" ) ; + } if (argc < 2) { fprintf(stderr, "**** Specify interface file ****\n") ; exit(TRUE) ; @@ -84,7 +85,7 @@ int main(argc, argv) if (scantrace) printf( "Main: m_prevcon=%d,m_token=%d,curcon=%d,textchar='%c'(%d), line=%d\n", - m_prevcon, m_token, curcon, textchar, textchar, m_line) ; + m_prevcon, m_token, curcon, (char)textchar, (int)textchar, m_line) ; #include "case.c" if (m_token == ENDFILE) break ; if (! curcon) { diff --git a/cde/programs/dthelp/parser/pass1/eltdef/eltutil.c b/cde/programs/dthelp/parser/pass1/eltdef/eltutil.c index 4dfd87f8..9ce3778e 100644 --- a/cde/programs/dthelp/parser/pass1/eltdef/eltutil.c +++ b/cde/programs/dthelp/parser/pass1/eltdef/eltutil.c @@ -106,7 +106,7 @@ void cvalue(M_NOPAR) PARVAL *new; new = (PARVAL *) m_malloc(sizeof(PARVAL), "parameter value"); - if (pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new)) + if ((pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new))) m_free(new, "parameter value"); else { new->line = 0; @@ -467,7 +467,7 @@ for ( ; p ; p = p->next) iffile); fprintf(pvalh, "#define %s \"", mb_cname); m_free(mb_cname,"multi-byte string"); - if (q = ((PARVAL *) p->data)->value) + if ((q = ((PARVAL *) p->data)->value)) for ( ; *q ; q++) { char mbq[32]; /* larger than largest possible mbyte char */ @@ -498,7 +498,7 @@ for ( ; p ; p = p->next) void skiptoend(M_NOPAR) { int i; - static errlev = 0; + static int errlev = 0; CVARSTRUCT *cvarp, *dvarp; for (cvarp = cvarlist ; cvarp ;) { @@ -615,7 +615,7 @@ void startelement(M_NOPAR) m_free(discard, "C variable"); } cvarlist = NULL; - if (openelt = m_packedlook(m_entree, name)) { + if ((openelt = m_packedlook(m_entree, name))) { if (processed[openelt - 1]) warning1("Warning: Element %s already processed", name); processed[openelt - 1] = TRUE; @@ -670,7 +670,7 @@ if (m_partype(cvarlist->param + m_element[openelt - 1].parptr, p)) { M_WCHAR *w_buffer; - sprintf(buffer, "%d", pval->line); + snprintf(buffer, 5, "%d", pval->line); w_buffer = MakeWideCharString(buffer); m_err5("Can't #define %s to %s. %s #define'd to %s on line %s", pval->cname, diff --git a/cde/programs/dthelp/parser/pass1/eltdef/entity.c b/cde/programs/dthelp/parser/pass1/eltdef/entity.c index 4d43047d..63a3919b 100644 --- a/cde/programs/dthelp/parser/pass1/eltdef/entity.c +++ b/cde/programs/dthelp/parser/pass1/eltdef/entity.c @@ -40,7 +40,7 @@ void addent(M_NOPAR) M_ENTITY *new ; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ; - if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) { + if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free(new, "entity") ; if (! entity->wheredef) return ; if (entity->wheredef == M_DBUILD) { diff --git a/cde/programs/dthelp/parser/pass1/eltdef/scan.c b/cde/programs/dthelp/parser/pass1/eltdef/scan.c index 3c351465..7e0c57cb 100644 --- a/cde/programs/dthelp/parser/pass1/eltdef/scan.c +++ b/cde/programs/dthelp/parser/pass1/eltdef/scan.c @@ -53,7 +53,8 @@ M_WCHAR *p, wus; int c, cttype; LOGICAL cname; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; cname = (LOGICAL) (curcon == INPARAM || curcon == INVALUE); *(p = name) = (M_WCHAR) first; @@ -92,7 +93,8 @@ int n; static char unexp[] = "c"; M_WCHAR wus; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; while (TRUE) { diff --git a/cde/programs/dthelp/parser/pass1/util/basic.h b/cde/programs/dthelp/parser/pass1/util/basic.h index 301422a5..8f42d835 100644 --- a/cde/programs/dthelp/parser/pass1/util/basic.h +++ b/cde/programs/dthelp/parser/pass1/util/basic.h @@ -112,3 +112,21 @@ void *m_malloc( int size, char *msg #endif ) ; + +void m_free( +#if defined(M_PROTO) + void *block, char *msg +#endif + ) ; + +void m_err2( +#if defined(M_PROTO) + const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2 +#endif + ) ; + +int mb_getwc( +#if defined(M_PROTO) + void *m_ptr +#endif + ) ; diff --git a/cde/programs/dthelp/parser/pass1/util/chartype.h b/cde/programs/dthelp/parser/pass1/util/chartype.h index db513eb9..71255a4c 100644 --- a/cde/programs/dthelp/parser/pass1/util/chartype.h +++ b/cde/programs/dthelp/parser/pass1/util/chartype.h @@ -29,262 +29,262 @@ by HP Tag are marked "(invalid)". */ M_CHARTYPE m_ctarray[M_CHARSETLEN] = { /* Char Name Type, Upper, Lower */ -/* 0: ^@ NUL */ M_NONNAME, 0, 0, -/* 1: ^A SOH */ M_NONNAME, 1, 1, -/* 2: ^B STX */ M_NONNAME, 2, 2, -/* 3: ^C ETX */ M_NONNAME, 3, 3, -/* 4: ^D EOT */ M_NONNAME, 4, 4, -/* 5: ^E ENQ */ M_NONNAME, 5, 5, -/* 6: ^F ACK */ M_NONNAME, 6, 6, -/* 7: ^G BEL */ M_NONNAME, 7, 7, -/* 8: ^H BS */ M_NONNAME, 8, 8, -/* 9: ^I HT */ M_NONNAME, 9, 9, -/* 10: ^J LF */ M_NONNAME, 10, 10, -/* 11: ^K VT */ M_NONNAME, 11, 11, -/* 12: ^L FF */ M_NONNAME, 12, 12, -/* 13: ^M CR */ M_NONNAME, 13, 13, -/* 14: ^N SO */ M_NONNAME, 14, 14, -/* 15: ^O SI */ M_NONNAME, 15, 15, -/* 16: ^P DLE */ M_NONNAME, 16, 16, -/* 17: ^Q DC1 */ M_NONNAME, 17, 17, -/* 18: ^R DC2 */ M_NONNAME, 18, 18, -/* 19: ^S DC3 */ M_NONNAME, 19, 19, -/* 20: ^T DC4 */ M_NONNAME, 20, 20, -/* 21: ^U NAK */ M_NONNAME, 21, 21, -/* 22: ^V SYN */ M_NONNAME, 22, 22, -/* 23: ^W ETB */ M_NONNAME, 23, 23, -/* 24: ^X CAN */ M_NONNAME, 24, 24, -/* 25: ^Y EM */ M_NONNAME, 25, 25, -/* 26: ^Z SUB */ M_NONNAME, 26, 26, -/* 27: ^[ ESC */ M_NONNAME, 27, 27, -/* 28: ^\ FS */ M_NONNAME, 28, 28, -/* 29: ^] GS */ M_NONNAME, 29, 29, -/* 30: ^^ RS */ M_NONNAME, 30, 30, -/* 31: ^_ US */ M_NONNAME, 31, 31, -/* 32: SP */ M_NONNAME, 32, 32, -/* 33: ! */ M_NONNAME, 33, 33, -/* 34: " */ M_NONNAME, 34, 34, -/* 35: # */ M_NONNAME, 35, 35, -/* 36: $ */ M_NONNAME, 36, 36, -/* 37: % */ M_NONNAME, 37, 37, -/* 38: & */ M_NONNAME, 38, 38, -/* 39: ' */ M_NONNAME, 39, 39, -/* 40: ( */ M_NONNAME, 40, 40, -/* 41: ) */ M_NONNAME, 41, 41, -/* 42: * */ M_NONNAME, 42, 42, -/* 43: + */ M_NAMECHAR, 43, 43, -/* 44: , */ M_NONNAME, 44, 44, -/* 45: - */ M_NAMECHAR, 45, 45, -/* 46: . */ M_NAMECHAR, 46, 46, -/* 47: / */ M_NONNAME, 47, 47, -/* 48: 0 */ M_DIGIT, 48, 48, -/* 49: 1 */ M_DIGIT, 49, 49, -/* 50: 2 */ M_DIGIT, 50, 50, -/* 51: 3 */ M_DIGIT, 51, 51, -/* 52: 4 */ M_DIGIT, 52, 52, -/* 53: 5 */ M_DIGIT, 53, 53, -/* 54: 6 */ M_DIGIT, 54, 54, -/* 55: 7 */ M_DIGIT, 55, 55, -/* 56: 8 */ M_DIGIT, 56, 56, -/* 57: 9 */ M_DIGIT, 57, 57, -/* 58: : */ M_NONNAME, 58, 58, -/* 59: ; */ M_NONNAME, 59, 59, -/* 60: < */ M_NONNAME, 60, 60, -/* 61: = */ M_NONNAME, 61, 61, -/* 62: > */ M_NONNAME, 62, 62, -/* 63: ? */ M_NONNAME, 63, 63, -/* 64: @ */ M_NONNAME, 64, 64, -/* 65: A */ M_NMSTART, 65, 97, -/* 66: B */ M_NMSTART, 66, 98, -/* 67: C */ M_NMSTART, 67, 99, -/* 68: D */ M_NMSTART, 68, 100, -/* 69: E */ M_NMSTART, 69, 101, -/* 70: F */ M_NMSTART, 70, 102, -/* 71: G */ M_NMSTART, 71, 103, -/* 72: H */ M_NMSTART, 72, 104, -/* 73: I */ M_NMSTART, 73, 105, -/* 74: J */ M_NMSTART, 74, 106, -/* 75: K */ M_NMSTART, 75, 107, -/* 76: L */ M_NMSTART, 76, 108, -/* 77: M */ M_NMSTART, 77, 109, -/* 78: N */ M_NMSTART, 78, 110, -/* 79: O */ M_NMSTART, 79, 111, -/* 80: P */ M_NMSTART, 80, 112, -/* 81: Q */ M_NMSTART, 81, 113, -/* 82: R */ M_NMSTART, 82, 114, -/* 83: S */ M_NMSTART, 83, 115, -/* 84: T */ M_NMSTART, 84, 116, -/* 85: U */ M_NMSTART, 85, 117, -/* 86: V */ M_NMSTART, 86, 118, -/* 87: W */ M_NMSTART, 87, 119, -/* 88: X */ M_NMSTART, 88, 120, -/* 89: Y */ M_NMSTART, 89, 121, -/* 90: Z */ M_NMSTART, 90, 122, -/* 91: [ */ M_NONNAME, 91, 91, -/* 92: \\ */ M_NONNAME, 92, 92, -/* 93: ] */ M_NONNAME, 93, 93, -/* 94: ^ */ M_NONNAME, 94, 94, -/* 95: _ */ M_NONNAME, 95, 95, -/* 96: ` */ M_NONNAME, 96, 96, -/* 97: a */ M_NMSTART, 65, 97, -/* 98: b */ M_NMSTART, 66, 98, -/* 99: c */ M_NMSTART, 67, 99, -/* 100: d */ M_NMSTART, 68, 100, -/* 101: e */ M_NMSTART, 69, 101, -/* 102: f */ M_NMSTART, 70, 102, -/* 103: g */ M_NMSTART, 71, 103, -/* 104: h */ M_NMSTART, 72, 104, -/* 105: i */ M_NMSTART, 73, 105, -/* 106: j */ M_NMSTART, 74, 106, -/* 107: k */ M_NMSTART, 75, 107, -/* 108: l */ M_NMSTART, 76, 108, -/* 109: m */ M_NMSTART, 77, 109, -/* 110: n */ M_NMSTART, 78, 110, -/* 111: o */ M_NMSTART, 79, 111, -/* 112: p */ M_NMSTART, 80, 112, -/* 113: q */ M_NMSTART, 81, 113, -/* 114: r */ M_NMSTART, 82, 114, -/* 115: s */ M_NMSTART, 83, 115, -/* 116: t */ M_NMSTART, 84, 116, -/* 117: u */ M_NMSTART, 85, 117, -/* 118: v */ M_NMSTART, 86, 118, -/* 119: w */ M_NMSTART, 87, 119, -/* 120: x */ M_NMSTART, 88, 120, -/* 121: y */ M_NMSTART, 89, 121, -/* 122: z */ M_NMSTART, 90, 122, -/* 123: { */ M_NONNAME, 123, 123, -/* 124: | */ M_NONNAME, 124, 124, -/* 125: } */ M_NONNAME, 125, 125, -/* 126: ~ */ M_NONNAME, 126, 126, -/* 127: DEL */ M_NONNAME, 127, 127, -/* 128: undefined */ M_NONNAME, 128, 128, -/* 129: undefined */ M_NONNAME, 129, 129, -/* 130: undefined */ M_NONNAME, 130, 130, -/* 131: undefined */ M_NONNAME, 131, 131, -/* 132: undefined */ M_NONNAME, 132, 132, -/* 133: undefined */ M_NONNAME, 133, 133, -/* 134: undefined */ M_NONNAME, 134, 134, -/* 135: undefined */ M_NONNAME, 135, 135, -/* 136: undefined */ M_NONNAME, 136, 136, -/* 137: undefined */ M_NONNAME, 137, 137, -/* 138: undefined */ M_NONNAME, 138, 138, -/* 139: undefined */ M_NONNAME, 139, 139, -/* 140: undefined */ M_NONNAME, 140, 140, -/* 141: undefined */ M_NONNAME, 141, 141, -/* 142: undefined */ M_NONNAME, 142, 142, -/* 143: undefined */ M_NONNAME, 143, 143, -/* 144: undefined */ M_NONNAME, 144, 144, -/* 145: undefined */ M_NONNAME, 145, 145, -/* 146: undefined */ M_NONNAME, 146, 146, -/* 147: undefined */ M_NONNAME, 147, 147, -/* 148: undefined */ M_NONNAME, 148, 148, -/* 149: undefined */ M_NONNAME, 149, 149, -/* 150: undefined */ M_NONNAME, 150, 150, -/* 151: undefined */ M_NONNAME, 151, 151, -/* 152: undefined */ M_NONNAME, 152, 152, -/* 153: undefined */ M_NONNAME, 153, 153, -/* 154: undefined */ M_NONNAME, 154, 154, -/* 155: undefined */ M_NONNAME, 155, 155, -/* 156: undefined */ M_NONNAME, 156, 156, -/* 157: undefined */ M_NONNAME, 157, 157, -/* 158: undefined */ M_NONNAME, 158, 158, -/* 159: undefined */ M_NONNAME, 159, 159, -/* 160: undefined */ M_NONNAME, 160, 160, -/* 161: A grave */ M_NMSTART, 161, 200, -/* 162: A circumflex */ M_NMSTART, 162, 192, -/* 163: E grave */ M_NMSTART, 163, 201, -/* 164: E circumflex */ M_NMSTART, 164, 193, -/* 165: E dieresis */ M_NMSTART, 165, 205, -/* 166: I circumflex */ M_NMSTART, 166, 209, -/* 167: I dieresis */ M_NMSTART, 167, 221, -/* 168: acute accent */ M_NONNAME, 168, 168, -/* 169: grave accent */ M_NONNAME, 169, 169, -/* 170: circumflex */ M_NONNAME, 170, 170, -/* 171: dieresis */ M_NONNAME, 171, 171, -/* 172: tilde */ M_NONNAME, 172, 172, -/* 173: U grave */ M_NMSTART, 173, 203, -/* 174: U circumflex */ M_NMSTART, 174, 195, -/* 175: Italian Lira (invalid) */ M_NONNAME, 175, 175, -/* 176: overbar (invalid) */ M_NONNAME, 176, 176, -/* 177: Y acute */ M_NMSTART, 177, 178, -/* 178: y acute */ M_NMSTART, 177, 178, -/* 179: degree (invalid) */ M_NONNAME, 179, 179, -/* 180: C cedilla */ M_NMSTART, 180, 181, -/* 181: c cedilla */ M_NMSTART, 180, 181, -/* 182: N tilde */ M_NMSTART, 182, 183, -/* 183: n tilde */ M_NMSTART, 182, 183, -/* 184: inverted exclamation mark */ M_NONNAME, 184, 184, -/* 185: inverted question mark */ M_NONNAME, 185, 185, -/* 186: currency sign (invalid) */ M_NONNAME, 186, 186, -/* 187: pound sterling (invalid) */ M_NONNAME, 187, 187, -/* 188: Yen */ M_NONNAME, 188, 188, -/* 189: Section sign (invalid) */ M_NONNAME, 189, 189, -/* 190: florin (invalid) */ M_NONNAME, 190, 190, -/* 191: Cent sign (invalid) */ M_NONNAME, 191, 191, -/* 192: a circumflex */ M_NMSTART, 162, 192, -/* 193: e circumflex */ M_NMSTART, 164, 193, -/* 194: o circumflex */ M_NMSTART, 223, 194, -/* 195: u circumflex */ M_NMSTART, 174, 195, -/* 196: a acute */ M_NMSTART, 224, 196, -/* 197: e acute */ M_NMSTART, 220, 197, -/* 198: o acute */ M_NMSTART, 231, 198, -/* 199: u acute */ M_NMSTART, 237, 199, -/* 200: a grave */ M_NMSTART, 161, 200, -/* 201: e grave */ M_NMSTART, 163, 201, -/* 202: o grave */ M_NMSTART, 232, 202, -/* 203: u grave */ M_NMSTART, 173, 203, -/* 204: a dieresis */ M_NMSTART, 216, 204, -/* 205: e dieresis */ M_NMSTART, 165, 205, -/* 206: o dieresis */ M_NMSTART, 218, 206, -/* 207: u dieresis */ M_NMSTART, 219, 207, -/* 208: A angstrom */ M_NMSTART, 208, 212, -/* 209: i circumflex */ M_NMSTART, 166, 209, -/* 210: O slash */ M_NMSTART, 210, 214, -/* 211: AE ligature */ M_NMSTART, 211, 215, -/* 212: a angstrom */ M_NMSTART, 208, 212, -/* 213: i acute */ M_NMSTART, 229, 213, -/* 214: o slash */ M_NMSTART, 210, 214, -/* 215: ae ligature */ M_NMSTART, 211, 215, -/* 216: A dieresis */ M_NMSTART, 216, 204, -/* 217: i grave */ M_NMSTART, 230, 217, -/* 218: O dieresis */ M_NMSTART, 218, 206, -/* 219: U dieresis */ M_NMSTART, 219, 207, -/* 220: E acute */ M_NMSTART, 220, 197, -/* 221: i dieresis */ M_NMSTART, 167, 221, -/* 222: SS ligature */ M_NMSTART, 222, 222, -/* 223: O circumflex */ M_NMSTART, 223, 194, -/* 224: A acute */ M_NMSTART, 224, 196, -/* 225: A tilde */ M_NMSTART, 225, 226, -/* 226: a tilde */ M_NMSTART, 225, 226, -/* 227: Eth (invalid) */ M_NMSTART, 227, 228, -/* 228: eth (invalid) */ M_NMSTART, 227, 228, -/* 229: I acute */ M_NMSTART, 229, 213, -/* 230: I grave */ M_NMSTART, 230, 217, -/* 231: O acute */ M_NMSTART, 231, 198, -/* 232: O grave */ M_NMSTART, 232, 202, -/* 233: O tilde */ M_NMSTART, 233, 234, -/* 234: o tilde */ M_NMSTART, 233, 234, -/* 235: S caron */ M_NMSTART, 235, 236, -/* 236: s caron */ M_NMSTART, 235, 236, -/* 237: U acute */ M_NMSTART, 237, 199, -/* 238: Y dieresis */ M_NMSTART, 238, 239, -/* 239: y dieresis */ M_NMSTART, 238, 239, -/* 240: Thorn (invalid) */ M_NMSTART, 240, 241, -/* 241: thorn (invalid) */ M_NMSTART, 240, 241, -/* 242: undefined */ M_NONNAME, 242, 242, -/* 243: mu (invalid) */ M_NONNAME, 243, 243, -/* 244: paragraph sign (invalid) */ M_NONNAME, 244, 244, -/* 245: fraction 3/4 (invalid) */ M_NONNAME, 245, 245, -/* 246: long dash (invalid) */ M_NONNAME, 246, 246, -/* 247: fraction 1/4 (invalid) */ M_NONNAME, 247, 247, -/* 248: fraction 1/2 (invalid) */ M_NONNAME, 248, 248, -/* 249: Female ordinal (invalid) */ M_NONNAME, 249, 249, -/* 250: Male ordinal (invalid) */ M_NONNAME, 250, 250, -/* 251: French double open quote(invalid) */ M_NONNAME, 251, 251, -/* 252: Solid square (invalid) */ M_NONNAME, 252, 252, -/* 253: French double close quote(invalid) */ M_NONNAME, 253, 253, -/* 254: Plus over minus sign(invalid)*/ M_NONNAME, 254, 254, -/* 255: undefined */ M_NONNAME, 255, 255, +/* 0: ^@ NUL */ {M_NONNAME, 0, 0}, +/* 1: ^A SOH */ {M_NONNAME, 1, 1}, +/* 2: ^B STX */ {M_NONNAME, 2, 2}, +/* 3: ^C ETX */ {M_NONNAME, 3, 3}, +/* 4: ^D EOT */ {M_NONNAME, 4, 4}, +/* 5: ^E ENQ */ {M_NONNAME, 5, 5}, +/* 6: ^F ACK */ {M_NONNAME, 6, 6}, +/* 7: ^G BEL */ {M_NONNAME, 7, 7}, +/* 8: ^H BS */ {M_NONNAME, 8, 8}, +/* 9: ^I HT */ {M_NONNAME, 9, 9}, +/* 10: ^J LF */ {M_NONNAME, 10, 10}, +/* 11: ^K VT */ {M_NONNAME, 11, 11}, +/* 12: ^L FF */ {M_NONNAME, 12, 12}, +/* 13: ^M CR */ {M_NONNAME, 13, 13}, +/* 14: ^N SO */ {M_NONNAME, 14, 14}, +/* 15: ^O SI */ {M_NONNAME, 15, 15}, +/* 16: ^P DLE */ {M_NONNAME, 16, 16}, +/* 17: ^Q DC1 */ {M_NONNAME, 17, 17}, +/* 18: ^R DC2 */ {M_NONNAME, 18, 18}, +/* 19: ^S DC3 */ {M_NONNAME, 19, 19}, +/* 20: ^T DC4 */ {M_NONNAME, 20, 20}, +/* 21: ^U NAK */ {M_NONNAME, 21, 21}, +/* 22: ^V SYN */ {M_NONNAME, 22, 22}, +/* 23: ^W ETB */ {M_NONNAME, 23, 23}, +/* 24: ^X CAN */ {M_NONNAME, 24, 24}, +/* 25: ^Y EM */ {M_NONNAME, 25, 25}, +/* 26: ^Z SUB */ {M_NONNAME, 26, 26}, +/* 27: ^[ ESC */ {M_NONNAME, 27, 27}, +/* 28: ^\ FS */ {M_NONNAME, 28, 28}, +/* 29: ^] GS */ {M_NONNAME, 29, 29}, +/* 30: ^^ RS */ {M_NONNAME, 30, 30}, +/* 31: ^_ US */ {M_NONNAME, 31, 31}, +/* 32: SP */ {M_NONNAME, 32, 32}, +/* 33: ! */ {M_NONNAME, 33, 33}, +/* 34: " */ {M_NONNAME, 34, 34}, +/* 35: # */ {M_NONNAME, 35, 35}, +/* 36: $ */ {M_NONNAME, 36, 36}, +/* 37: % */ {M_NONNAME, 37, 37}, +/* 38: & */ {M_NONNAME, 38, 38}, +/* 39: ' */ {M_NONNAME, 39, 39}, +/* 40: ( */ {M_NONNAME, 40, 40}, +/* 41: ) */ {M_NONNAME, 41, 41}, +/* 42: * */ {M_NONNAME, 42, 42}, +/* 43: + */ {M_NAMECHAR, 43, 43}, +/* 44: , */ {M_NONNAME, 44, 44}, +/* 45: - */ {M_NAMECHAR, 45, 45}, +/* 46: . */ {M_NAMECHAR, 46, 46}, +/* 47: / */ {M_NONNAME, 47, 47}, +/* 48: 0 */ {M_DIGIT, 48, 48}, +/* 49: 1 */ {M_DIGIT, 49, 49}, +/* 50: 2 */ {M_DIGIT, 50, 50}, +/* 51: 3 */ {M_DIGIT, 51, 51}, +/* 52: 4 */ {M_DIGIT, 52, 52}, +/* 53: 5 */ {M_DIGIT, 53, 53}, +/* 54: 6 */ {M_DIGIT, 54, 54}, +/* 55: 7 */ {M_DIGIT, 55, 55}, +/* 56: 8 */ {M_DIGIT, 56, 56}, +/* 57: 9 */ {M_DIGIT, 57, 57}, +/* 58: : */ {M_NONNAME, 58, 58}, +/* 59: ; */ {M_NONNAME, 59, 59}, +/* 60: < */ {M_NONNAME, 60, 60}, +/* 61: = */ {M_NONNAME, 61, 61}, +/* 62: > */ {M_NONNAME, 62, 62}, +/* 63: ? */ {M_NONNAME, 63, 63}, +/* 64: @ */ {M_NONNAME, 64, 64}, +/* 65: A */ {M_NMSTART, 65, 97}, +/* 66: B */ {M_NMSTART, 66, 98}, +/* 67: C */ {M_NMSTART, 67, 99}, +/* 68: D */ {M_NMSTART, 68, 100}, +/* 69: E */ {M_NMSTART, 69, 101}, +/* 70: F */ {M_NMSTART, 70, 102}, +/* 71: G */ {M_NMSTART, 71, 103}, +/* 72: H */ {M_NMSTART, 72, 104}, +/* 73: I */ {M_NMSTART, 73, 105}, +/* 74: J */ {M_NMSTART, 74, 106}, +/* 75: K */ {M_NMSTART, 75, 107}, +/* 76: L */ {M_NMSTART, 76, 108}, +/* 77: M */ {M_NMSTART, 77, 109}, +/* 78: N */ {M_NMSTART, 78, 110}, +/* 79: O */ {M_NMSTART, 79, 111}, +/* 80: P */ {M_NMSTART, 80, 112}, +/* 81: Q */ {M_NMSTART, 81, 113}, +/* 82: R */ {M_NMSTART, 82, 114}, +/* 83: S */ {M_NMSTART, 83, 115}, +/* 84: T */ {M_NMSTART, 84, 116}, +/* 85: U */ {M_NMSTART, 85, 117}, +/* 86: V */ {M_NMSTART, 86, 118}, +/* 87: W */ {M_NMSTART, 87, 119}, +/* 88: X */ {M_NMSTART, 88, 120}, +/* 89: Y */ {M_NMSTART, 89, 121}, +/* 90: Z */ {M_NMSTART, 90, 122}, +/* 91: [ */ {M_NONNAME, 91, 91}, +/* 92: \\ */ {M_NONNAME, 92, 92}, +/* 93: ] */ {M_NONNAME, 93, 93}, +/* 94: ^ */ {M_NONNAME, 94, 94}, +/* 95: _ */ {M_NONNAME, 95, 95}, +/* 96: ` */ {M_NONNAME, 96, 96}, +/* 97: a */ {M_NMSTART, 65, 97}, +/* 98: b */ {M_NMSTART, 66, 98}, +/* 99: c */ {M_NMSTART, 67, 99}, +/* 100: d */ {M_NMSTART, 68, 100}, +/* 101: e */ {M_NMSTART, 69, 101}, +/* 102: f */ {M_NMSTART, 70, 102}, +/* 103: g */ {M_NMSTART, 71, 103}, +/* 104: h */ {M_NMSTART, 72, 104}, +/* 105: i */ {M_NMSTART, 73, 105}, +/* 106: j */ {M_NMSTART, 74, 106}, +/* 107: k */ {M_NMSTART, 75, 107}, +/* 108: l */ {M_NMSTART, 76, 108}, +/* 109: m */ {M_NMSTART, 77, 109}, +/* 110: n */ {M_NMSTART, 78, 110}, +/* 111: o */ {M_NMSTART, 79, 111}, +/* 112: p */ {M_NMSTART, 80, 112}, +/* 113: q */ {M_NMSTART, 81, 113}, +/* 114: r */ {M_NMSTART, 82, 114}, +/* 115: s */ {M_NMSTART, 83, 115}, +/* 116: t */ {M_NMSTART, 84, 116}, +/* 117: u */ {M_NMSTART, 85, 117}, +/* 118: v */ {M_NMSTART, 86, 118}, +/* 119: w */ {M_NMSTART, 87, 119}, +/* 120: x */ {M_NMSTART, 88, 120}, +/* 121: y */ {M_NMSTART, 89, 121}, +/* 122: z */ {M_NMSTART, 90, 122}, +/* 123: { */ {M_NONNAME, 123, 123}, +/* 124: | */ {M_NONNAME, 124, 124}, +/* 125: } */ {M_NONNAME, 125, 125}, +/* 126: ~ */ {M_NONNAME, 126, 126}, +/* 127: DEL */ {M_NONNAME, 127, 127}, +/* 128: undefined */ {M_NONNAME, 128, 128}, +/* 129: undefined */ {M_NONNAME, 129, 129}, +/* 130: undefined */ {M_NONNAME, 130, 130}, +/* 131: undefined */ {M_NONNAME, 131, 131}, +/* 132: undefined */ {M_NONNAME, 132, 132}, +/* 133: undefined */ {M_NONNAME, 133, 133}, +/* 134: undefined */ {M_NONNAME, 134, 134}, +/* 135: undefined */ {M_NONNAME, 135, 135}, +/* 136: undefined */ {M_NONNAME, 136, 136}, +/* 137: undefined */ {M_NONNAME, 137, 137}, +/* 138: undefined */ {M_NONNAME, 138, 138}, +/* 139: undefined */ {M_NONNAME, 139, 139}, +/* 140: undefined */ {M_NONNAME, 140, 140}, +/* 141: undefined */ {M_NONNAME, 141, 141}, +/* 142: undefined */ {M_NONNAME, 142, 142}, +/* 143: undefined */ {M_NONNAME, 143, 143}, +/* 144: undefined */ {M_NONNAME, 144, 144}, +/* 145: undefined */ {M_NONNAME, 145, 145}, +/* 146: undefined */ {M_NONNAME, 146, 146}, +/* 147: undefined */ {M_NONNAME, 147, 147}, +/* 148: undefined */ {M_NONNAME, 148, 148}, +/* 149: undefined */ {M_NONNAME, 149, 149}, +/* 150: undefined */ {M_NONNAME, 150, 150}, +/* 151: undefined */ {M_NONNAME, 151, 151}, +/* 152: undefined */ {M_NONNAME, 152, 152}, +/* 153: undefined */ {M_NONNAME, 153, 153}, +/* 154: undefined */ {M_NONNAME, 154, 154}, +/* 155: undefined */ {M_NONNAME, 155, 155}, +/* 156: undefined */ {M_NONNAME, 156, 156}, +/* 157: undefined */ {M_NONNAME, 157, 157}, +/* 158: undefined */ {M_NONNAME, 158, 158}, +/* 159: undefined */ {M_NONNAME, 159, 159}, +/* 160: undefined */ {M_NONNAME, 160, 160}, +/* 161: A grave */ {M_NMSTART, 161, 200}, +/* 162: A circumflex */ {M_NMSTART, 162, 192}, +/* 163: E grave */ {M_NMSTART, 163, 201}, +/* 164: E circumflex */ {M_NMSTART, 164, 193}, +/* 165: E dieresis */ {M_NMSTART, 165, 205}, +/* 166: I circumflex */ {M_NMSTART, 166, 209}, +/* 167: I dieresis */ {M_NMSTART, 167, 221}, +/* 168: acute accent */ {M_NONNAME, 168, 168}, +/* 169: grave accent */ {M_NONNAME, 169, 169}, +/* 170: circumflex */ {M_NONNAME, 170, 170}, +/* 171: dieresis */ {M_NONNAME, 171, 171}, +/* 172: tilde */ {M_NONNAME, 172, 172}, +/* 173: U grave */ {M_NMSTART, 173, 203}, +/* 174: U circumflex */ {M_NMSTART, 174, 195}, +/* 175: Italian Lira (invalid) */ {M_NONNAME, 175, 175}, +/* 176: overbar (invalid) */ {M_NONNAME, 176, 176}, +/* 177: Y acute */ {M_NMSTART, 177, 178}, +/* 178: y acute */ {M_NMSTART, 177, 178}, +/* 179: degree (invalid) */ {M_NONNAME, 179, 179}, +/* 180: C cedilla */ {M_NMSTART, 180, 181}, +/* 181: c cedilla */ {M_NMSTART, 180, 181}, +/* 182: N tilde */ {M_NMSTART, 182, 183}, +/* 183: n tilde */ {M_NMSTART, 182, 183}, +/* 184: inverted exclamation mark */ {M_NONNAME, 184, 184}, +/* 185: inverted question mark */ {M_NONNAME, 185, 185}, +/* 186: currency sign (invalid) */ {M_NONNAME, 186, 186}, +/* 187: pound sterling (invalid) */ {M_NONNAME, 187, 187}, +/* 188: Yen */ {M_NONNAME, 188, 188}, +/* 189: Section sign (invalid) */ {M_NONNAME, 189, 189}, +/* 190: florin (invalid) */ {M_NONNAME, 190, 190}, +/* 191: Cent sign (invalid) */ {M_NONNAME, 191, 191}, +/* 192: a circumflex */ {M_NMSTART, 162, 192}, +/* 193: e circumflex */ {M_NMSTART, 164, 193}, +/* 194: o circumflex */ {M_NMSTART, 223, 194}, +/* 195: u circumflex */ {M_NMSTART, 174, 195}, +/* 196: a acute */ {M_NMSTART, 224, 196}, +/* 197: e acute */ {M_NMSTART, 220, 197}, +/* 198: o acute */ {M_NMSTART, 231, 198}, +/* 199: u acute */ {M_NMSTART, 237, 199}, +/* 200: a grave */ {M_NMSTART, 161, 200}, +/* 201: e grave */ {M_NMSTART, 163, 201}, +/* 202: o grave */ {M_NMSTART, 232, 202}, +/* 203: u grave */ {M_NMSTART, 173, 203}, +/* 204: a dieresis */ {M_NMSTART, 216, 204}, +/* 205: e dieresis */ {M_NMSTART, 165, 205}, +/* 206: o dieresis */ {M_NMSTART, 218, 206}, +/* 207: u dieresis */ {M_NMSTART, 219, 207}, +/* 208: A angstrom */ {M_NMSTART, 208, 212}, +/* 209: i circumflex */ {M_NMSTART, 166, 209}, +/* 210: O slash */ {M_NMSTART, 210, 214}, +/* 211: AE ligature */ {M_NMSTART, 211, 215}, +/* 212: a angstrom */ {M_NMSTART, 208, 212}, +/* 213: i acute */ {M_NMSTART, 229, 213}, +/* 214: o slash */ {M_NMSTART, 210, 214}, +/* 215: ae ligature */ {M_NMSTART, 211, 215}, +/* 216: A dieresis */ {M_NMSTART, 216, 204}, +/* 217: i grave */ {M_NMSTART, 230, 217}, +/* 218: O dieresis */ {M_NMSTART, 218, 206}, +/* 219: U dieresis */ {M_NMSTART, 219, 207}, +/* 220: E acute */ {M_NMSTART, 220, 197}, +/* 221: i dieresis */ {M_NMSTART, 167, 221}, +/* 222: SS ligature */ {M_NMSTART, 222, 222}, +/* 223: O circumflex */ {M_NMSTART, 223, 194}, +/* 224: A acute */ {M_NMSTART, 224, 196}, +/* 225: A tilde */ {M_NMSTART, 225, 226}, +/* 226: a tilde */ {M_NMSTART, 225, 226}, +/* 227: Eth (invalid) */ {M_NMSTART, 227, 228}, +/* 228: eth (invalid) */ {M_NMSTART, 227, 228}, +/* 229: I acute */ {M_NMSTART, 229, 213}, +/* 230: I grave */ {M_NMSTART, 230, 217}, +/* 231: O acute */ {M_NMSTART, 231, 198}, +/* 232: O grave */ {M_NMSTART, 232, 202}, +/* 233: O tilde */ {M_NMSTART, 233, 234}, +/* 234: o tilde */ {M_NMSTART, 233, 234}, +/* 235: S caron */ {M_NMSTART, 235, 236}, +/* 236: s caron */ {M_NMSTART, 235, 236}, +/* 237: U acute */ {M_NMSTART, 237, 199}, +/* 238: Y dieresis */ {M_NMSTART, 238, 239}, +/* 239: y dieresis */ {M_NMSTART, 238, 239}, +/* 240: Thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 241: thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 242: undefined */ {M_NONNAME, 242, 242}, +/* 243: mu (invalid) */ {M_NONNAME, 243, 243}, +/* 244: paragraph sign (invalid) */ {M_NONNAME, 244, 244}, +/* 245: fraction 3/4 (invalid) */ {M_NONNAME, 245, 245}, +/* 246: long dash (invalid) */ {M_NONNAME, 246, 246}, +/* 247: fraction 1/4 (invalid) */ {M_NONNAME, 247, 247}, +/* 248: fraction 1/2 (invalid) */ {M_NONNAME, 248, 248}, +/* 249: Female ordinal (invalid) */ {M_NONNAME, 249, 249}, +/* 250: Male ordinal (invalid) */ {M_NONNAME, 250, 250}, +/* 251: French double open quote(invalid) */ {M_NONNAME, 251, 251}, +/* 252: Solid square (invalid) */ {M_NONNAME, 252, 252}, +/* 253: French double close quote(invalid) */ {M_NONNAME, 253, 253}, +/* 254: Plus over minus sign(invalid)*/ {M_NONNAME, 254, 254}, +/* 255: undefined */ {M_NONNAME, 255, 255}, } ; diff --git a/cde/programs/dthelp/parser/pass1/util/conutil.c b/cde/programs/dthelp/parser/pass1/util/conutil.c index c4a69a7e..736e669a 100644 --- a/cde/programs/dthelp/parser/pass1/util/conutil.c +++ b/cde/programs/dthelp/parser/pass1/util/conutil.c @@ -127,11 +127,13 @@ M_WCHAR wlb = 0, wcm, wnl, wsl, wst; if (!wlb) { - mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ - mbtowc(&wcm, ",", 1); - mbtowc(&wnl, "\n", 1); - mbtowc(&wsl, "/", 1); - mbtowc(&wst, "*", 1); + int + ret = mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ + ret = mbtowc(&wcm, ",", 1); + ret = mbtowc(&wnl, "\n", 1); + ret = mbtowc(&wsl, "/", 1); + ret = mbtowc(&wst, "*", 1); + (void) ret; } while (m_whitespace((M_WCHAR) (c = readchar(FALSE)))); @@ -226,7 +228,8 @@ M_WCHAR wcl; char unexp[32]; /* arbitraily large */ int length; -mbtowc(&wcl, ":", 1); +int ret = mbtowc(&wcl, ":", 1); +(void) ret; while (TRUE) { @@ -252,9 +255,11 @@ char *mb_name; if (!wsm) { - mbtowc(&wsm, ";", 1); - mbtowc(&wcl, ":", 1); - mbtowc(&wcm, ",", 1); + int + ret = mbtowc(&wsm, ";", 1); + ret = mbtowc(&wcl, ":", 1); + ret = mbtowc(&wcm, ",", 1); + (void) ret; } while (TRUE) @@ -333,7 +338,7 @@ c = readchar(TRUE)) *p++ = (M_WCHAR) c; } *p = M_EOS; -if (dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie)) +if ((dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie))) { withdelim = TRUE; curdelim = dstruct->count - 1; @@ -451,7 +456,8 @@ int i; M_WCHAR wnl; char *mb_dname, *mb_dstring; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; loading = TRUE; while ((c = getc(ddat)) != EOF) @@ -526,13 +532,13 @@ while ((c = getc(ddat)) != EOF) fprintf(delim, "M_DELIMEXTERN char %s[%d] M_DELIMINIT(\"", mb_dname, - strlen(mb_dstring) + 1); + (int)strlen(mb_dstring) + 1); for (p = dstring ; *p ; p++) { char *pc; char mb_p[32]; /* arbitrarily large */ - int length, i; + int length; length = wctomb(mb_p, *p); mb_p[length] = 0; @@ -629,7 +635,7 @@ void prtctxt(column, value) if (! first) fprintf(delim, ",\n"); first = FALSE; - fprintf(delim, " %d, %d", column, value); + fprintf(delim, " {%d, %d}", column, value); nonzero++; } @@ -645,7 +651,8 @@ int readchar(cap) int c; M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; c = mb_getwc(cdat); /* use mb_getwc so we read multi-byte chars */ if (cap && c != EOF) c = m_upper(c); @@ -667,7 +674,8 @@ int c; { M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; ungetc(c, cdat); if (c == wnl) m_line--; diff --git a/cde/programs/dthelp/parser/pass1/util/entout.c b/cde/programs/dthelp/parser/pass1/util/entout.c index 59bea76e..82461864 100644 --- a/cde/programs/dthelp/parser/pass1/util/entout.c +++ b/cde/programs/dthelp/parser/pass1/util/entout.c @@ -72,8 +72,8 @@ void entout(fname) int nameindex ; LOGICAL start ; - strcpy(efilename, fname) ; - strcpy(&efilename[strlen(efilename)], ".h") ; + strncpy(efilename, fname, ENTFILENAME) ; + strncpy(&efilename[strlen(efilename)], ".h", 2) ; m_openchk(&entfile, efilename, "w") ; fprintf(entfile, "#include \"entdef.h\"\n") ; @@ -101,7 +101,7 @@ void entout(fname) if (start) fputs(",\n", entfile) ; start = TRUE ; for (p = ent->content ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; fputs(" 0", entfile) ; } fprintf(entfile, "}\n#endif\n") ; @@ -112,7 +112,7 @@ void entout(fname) fputs("#if defined(M_ENTDEF)\n = {\n", entfile) ; for (ent = firstent ; ent ; ent = ent->next) { for (p = ent->name ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; if (ent != lastent) fputs(" 0,\n", entfile) ; else fputs(" 0\n", entfile) ; } @@ -130,7 +130,7 @@ void entout(fname) fprintf(entfile, "#if defined(M_ENTDEF)\n = {\n") ; for (ent = firstent, conindex = 0, nameindex = 0 ; ent ; ent = ent->next) { - fprintf(entfile, " %s, %s, ", + fprintf(entfile, " {%s, %s, ", typetype(ent->type), typewhere(ent->wheredef)) ; if (ent->content) { @@ -143,10 +143,10 @@ void entout(fname) #if defined(BUILDEXTERN) fprintf(entfile, ", %d", ent->index) ; if (ent != lastent) - fprintf(entfile, ", &m_entities[%d], 0", ent->index) ; - else fputs(", NULL, 0", entfile) ; + fprintf(entfile, ", &m_entities[%d], 0}", ent->index) ; + else fputs(", NULL, 0}", entfile) ; #else - fprintf(entfile, ", %d", ent->codeindex) ; + fprintf(entfile, ", %d}", ent->codeindex) ; #endif if (ent != lastent) fprintf(entfile, ", \n") ; else fprintf(entfile, "}\n#endif\n") ; @@ -159,7 +159,7 @@ void entout(fname) "M_ENTEXTERN M_TRIE m_enttrie[%d]\n", count) ; if (m_enttrie->data) { count = 0 ; - fputs("#if defined(M_ENTDEF)\n = {\n 0, NULL, &m_enttrie[1]", entfile) ; + fputs("#if defined(M_ENTDEF)\n = {\n {0, NULL, &m_enttrie[1]}", entfile) ; m_dumptrie(entfile, m_enttrie->data, "m_enttrie", &count, entptr) ; fprintf(entfile, "}\n#endif\n") ; } @@ -225,6 +225,7 @@ char *typewhere(n) case M_DELTDEF: return(xdeltdef) ; case FALSE: return("0") ; } + return("0"); } diff --git a/cde/programs/dthelp/parser/pass1/util/fclndir.c b/cde/programs/dthelp/parser/pass1/util/fclndir.c index f3935c7d..8edc6c6a 100644 --- a/cde/programs/dthelp/parser/pass1/util/fclndir.c +++ b/cde/programs/dthelp/parser/pass1/util/fclndir.c @@ -130,17 +130,19 @@ void copyfile(pfile1,pfile2) { int ret; char *pcmd; + int slen; /* malloc space for the system command: two filenames, plus a command, spaces, and the terminating null */ - pcmd = (char *) malloc(strlen(pfile1) + strlen(pfile2) + 8); + slen = strlen(pfile1) + strlen(pfile2) + 8; + pcmd = (char *) malloc(slen); #if defined(MSDOS) - ret = sprintf(pcmd,"copy %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "copy %s %s",pfile1,pfile2); #else - ret = sprintf(pcmd,"cp %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "cp %s %s",pfile1,pfile2); #endif ret = system(pcmd); - ret = sprintf(pcmd,"touch %s",pfile2); + ret = snprintf(pcmd, slen, "touch %s",pfile2); ret = system(pcmd); } diff --git a/cde/programs/dthelp/parser/pass1/util/malloc.c b/cde/programs/dthelp/parser/pass1/util/malloc.c index c8690b8f..7a6ed78e 100644 --- a/cde/programs/dthelp/parser/pass1/util/malloc.c +++ b/cde/programs/dthelp/parser/pass1/util/malloc.c @@ -96,11 +96,11 @@ void m_free(block, msg) free(block) ; if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) block >> 16), (unsigned int) block, msg) ; #else - sprintf(buffer, " %9p", block, msg) ; + snprintf(buffer, 32, " %9p", block) ; #endif m_trace(buffer) ; m_trace("- Freed ") ; @@ -171,14 +171,14 @@ void *m_malloc(size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; @@ -212,14 +212,14 @@ void *m_realloc(ptr, size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Re-allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; diff --git a/cde/programs/dthelp/parser/pass1/util/scanutil.c b/cde/programs/dthelp/parser/pass1/util/scanutil.c index d01d27e1..adc003fc 100644 --- a/cde/programs/dthelp/parser/pass1/util/scanutil.c +++ b/cde/programs/dthelp/parser/pass1/util/scanutil.c @@ -33,7 +33,7 @@ int getachar(M_NOPAR) int c; M_WCHAR wc,wnl; char mbyte[32]; /* bigger than any possible multibyte char */ -int length; +int length, ret; if (toundo) wc = (M_WCHAR) savechar[--toundo]; else @@ -58,10 +58,11 @@ else return(EOF); } } - mbtowc(&wc,mbyte,length); + ret = mbtowc(&wc,mbyte,length); } -mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (wc == wnl) m_line++; if (wc == 65535) @@ -246,7 +247,8 @@ if (toundo >= SAVECHAR) savechar[toundo++] = c; if (toundo > maxundo) maxundo = toundo; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (c == wnl) m_line--; } diff --git a/cde/programs/dthelp/parser/pass1/util/trie.c b/cde/programs/dthelp/parser/pass1/util/trie.c index b5c13037..30583f72 100644 --- a/cde/programs/dthelp/parser/pass1/util/trie.c +++ b/cde/programs/dthelp/parser/pass1/util/trie.c @@ -149,7 +149,7 @@ void *m_ntrtrie(p, xtrie, dataval) M_TRIE *currentnode ; void *n ; - if (n = m_lookfortrie(p, xtrie)) return(n) ; + if ((n = m_lookfortrie(p, xtrie))) return(n) ; currentnode = xtrie ; for ( ; *p ; p++) m_entercharintrie(¤tnode, m_ctupper(*p)) ; diff --git a/cde/programs/dthelp/parser/pass1/util/triecnt.c b/cde/programs/dthelp/parser/pass1/util/triecnt.c index 493f3863..7e377cee 100644 --- a/cde/programs/dthelp/parser/pass1/util/triecnt.c +++ b/cde/programs/dthelp/parser/pass1/util/triecnt.c @@ -88,12 +88,12 @@ void dumpnode(first, file, trieptr, count, proc) /* generate a child */ if (*first) *first = FALSE ; else fprintf(file, ",\n") ; - fprintf(file, " ") ; + fprintf(file, " {") ; if (p->next) fprintf(file, "TRUE, ") ; else fprintf(file, "FALSE, ") ; - fprintf(file, "%d", p->symbol) ; - if (p->symbol) fprintf(file, ", %d", *count) ; - else (*proc)(file, p->data) ; + fprintf(file, "%d", (int)p->symbol) ; + if (p->symbol) fprintf(file, ", %d}", *count) ; + else { (*proc)(file, p->data) ; fprintf(file, "}") ; } /* count the children of the child*/ if (p->symbol) countdown(p, count) ; @@ -110,5 +110,5 @@ void printval(file, value) FILE *file ; void *value ; { - fprintf(file, ", %d", (int) value) ; + fprintf(file, ", %ld", (long) value) ; } diff --git a/cde/programs/dthelp/parser/pass1/util/triedump.c b/cde/programs/dthelp/parser/pass1/util/triedump.c index d0c86d05..77c6a50f 100644 --- a/cde/programs/dthelp/parser/pass1/util/triedump.c +++ b/cde/programs/dthelp/parser/pass1/util/triedump.c @@ -62,14 +62,14 @@ void m_dumptrie(file, xtrie, extname, count, proc) for (p = xtrie ; p ; p = p->next) { (*count)++ ; - fprintf(file, ",\n %d, ", p-> symbol) ; + fprintf(file, ",\n {%d, ", (int)p-> symbol) ; if (p->next) fprintf(file, "&%s[%d], ", extname, *count + 1) ; else fputs("NULL, ", file) ; if (p->symbol) { - fprintf(file, "&%s[%d]", extname, firstson) ; + fprintf(file, "&%s[%d]}", extname, firstson) ; countdown(p, &firstson) ; } - else (*proc) (p->data) ; + else { (*proc) (p->data) ; fprintf(file, "}") ; } } for (p = xtrie ; p ; p = p->next) diff --git a/cde/programs/dthelp/parser/pass1/util/wchar.c b/cde/programs/dthelp/parser/pass1/util/wchar.c index d4b73b5d..4423b44f 100644 --- a/cde/programs/dthelp/parser/pass1/util/wchar.c +++ b/cde/programs/dthelp/parser/pass1/util/wchar.c @@ -72,7 +72,7 @@ M_WCHAR *string1start; string1start = string1; -while (*string1++ = *string2++); +while ((*string1++ = *string2++)); return string1start; } @@ -205,7 +205,7 @@ length = (length + sizeof(M_WCHAR) - 1) / sizeof(M_WCHAR); mb_string = (char *) m_malloc(length, "multi-byte string"); length = 0; -while (wc = *wc_string++) +while ((wc = *wc_string++)) { if ((retVal = wctomb(&mb_string[length], wc)) > 0) length += retVal; @@ -226,7 +226,6 @@ char *mb_string; { M_WCHAR *wc_string, *wc_stringStart; int length, incr; -char c; if (!mb_string) mb_string = ""; @@ -244,8 +243,9 @@ while (mb_string[length]) badOne[0] = mb_string[length]; badOne[1] = 0; - sprintf(buffer, "0x%x", mb_string[length]); - m_err2("invalid multibyte character found: '%c' (%s)", badOne, buffer); + snprintf(buffer, 32, "0x%x", mb_string[length]); + m_err2("invalid multibyte character found: '%c' (%s)", + (M_WCHAR *)badOne, (M_WCHAR *)buffer); incr = 1; } length += incr; @@ -263,7 +263,6 @@ void *m_ptr; { int c; M_WCHAR wc; -char badch[2]; char mbyte[32]; /* make this bigger than any possible multi-byte char */ int length; @@ -288,7 +287,8 @@ while (1) return(EOF); } } -mbtowc(&wc,mbyte,length); +int ret = mbtowc(&wc,mbyte,length); +(void) ret; return((int) wc); } diff --git a/cde/programs/dthelp/parser/pass2/build/build.c b/cde/programs/dthelp/parser/pass2/build/build.c index 5b3d30cc..97cbb35c 100644 --- a/cde/programs/dthelp/parser/pass2/build/build.c +++ b/cde/programs/dthelp/parser/pass2/build/build.c @@ -41,7 +41,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include "entdef.h" /* Main procedure */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { @@ -67,8 +67,9 @@ while (TRUE) if (scantrace) printf( "m_prevcon=%d, m_token=%d, curcon=%d, scanval = %c (%d), line=%d\n", - m_prevcon, m_token, curcon, scanval, scanval, m_line) ; + m_prevcon, m_token, curcon, (char)scanval, (int)scanval, m_line) ; #include "case.c" if (m_token == ENDFILE) exit(FALSE) ; } + return 0; } diff --git a/cde/programs/dthelp/parser/pass2/build/buildutl.c b/cde/programs/dthelp/parser/pass2/build/buildutl.c index a2f89913..7842c59d 100644 --- a/cde/programs/dthelp/parser/pass2/build/buildutl.c +++ b/cde/programs/dthelp/parser/pass2/build/buildutl.c @@ -43,7 +43,7 @@ LOGICAL *flag; char *delim; { M_WCHAR wcbuff[129]; -size_t length; +ssize_t length; wcbuff[128] = 0; length = mbstowcs(wcbuff,delim,128); @@ -73,7 +73,7 @@ m_openchk(&m_errfile, "error", "w") ; fprintf(stderr, "MARKUP System - BUILD %s\n", M_VERSION) ; fprintf(stderr, "Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.\n") ; if (! standard) - warning("Warning: optional enhancements of SGML enabled.") ; + warning("Info: optional enhancements of SGML enabled.") ; mb_delims = mb_dlmptr; wc_delims = m_dlmptr; @@ -112,7 +112,7 @@ void ruleinit(M_NOPAR) /* Rule end processing */ void rulend(M_NOPAR) { - STATE *fsa ; + STATE *fsa = NULL ; LOGICAL canbenull ; LHS *lhsp ; LHS *discard ; @@ -153,7 +153,7 @@ void rulend(M_NOPAR) void skiptoend(M_NOPAR) { int i ; - static errlev = 0 ; + static int errlev = 0 ; if (! errlev++) { curcon = ERROR ; diff --git a/cde/programs/dthelp/parser/pass2/build/eltree.c b/cde/programs/dthelp/parser/pass2/build/eltree.c index 4ad7f287..bd76591c 100644 --- a/cde/programs/dthelp/parser/pass2/build/eltree.c +++ b/cde/programs/dthelp/parser/pass2/build/eltree.c @@ -42,7 +42,7 @@ ELTSTRUCT *ntrelt(p) int length ; new = (ELTSTRUCT *) m_malloc(sizeof(ELTSTRUCT), "element structure") ; - if (old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new)) { + if ((old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new))) { m_free((M_POINTER) new, "element structure") ; return(old) ; } @@ -55,7 +55,7 @@ ELTSTRUCT *ntrelt(p) w_strcpy(new->enptr, p) ; new->model = M_NULLVAL ; new->content = M_NULLVAL ; - new->inptr = new->exptr = NULL ; + new->inptr = new->exptr = 0 ; new->parptr = NULL ; new->parindex = M_NULLVAL ; new->paramcount = M_NULLVAL ; diff --git a/cde/programs/dthelp/parser/pass2/build/fsa.c b/cde/programs/dthelp/parser/pass2/build/fsa.c index b87b8a26..3847ed85 100644 --- a/cde/programs/dthelp/parser/pass2/build/fsa.c +++ b/cde/programs/dthelp/parser/pass2/build/fsa.c @@ -85,11 +85,11 @@ void checkand(andstart, andptr, start, root, errelt) for (pand = parc->group ; pand ; pand = pand->next) checkand(andstart, andptr, pand->start, root, errelt) ; } - else if (c = checkdfsa(andptr->start, + else if ((c = checkdfsa(andptr->start, parc->label, parc->group, parc->id, - errelt)) + errelt))) nondeterm(root, c, *errelt) ; } } @@ -112,7 +112,7 @@ int checkdfsa(from, label, and, id, errelt) if (parc->group) { if (and == parc->group) return(ANDCONFLICT) ; for (group = parc->group ; group ; group = group->next) - if (c = checkdfsa(group->start, label, and, id, errelt)) + if ((c = checkdfsa(group->start, label, and, id, errelt))) return(c) ; } else if (! and && label == parc->label && parc->id != id) { @@ -138,14 +138,14 @@ int checkrepeat(from, and, errelt) for (; and ; and = and->next) for (parc = and->start->first ; parc ; parc = parc->next) { if (parc->group) - if (c = checkrepeat(from, parc->group, errelt)) return(c) ; + if ((c = checkrepeat(from, parc->group, errelt))) return(c) ; else ; else - if (c = checkdfsa(from, + if ((c = checkdfsa(from, parc->label, M_NULLVAL, parc->id, - errelt)) + errelt))) return(c) ; else ; } @@ -239,7 +239,7 @@ void makeand(canbenull, root, optional) TREE *child ; STATELIST *start, *final ; LOGICAL groupbenull ; - ANDGROUP *andptr, *saveand, *otherand ; + ANDGROUP *andptr = NULL, *saveand = NULL, *otherand ; STATELIST *index ; ELTSTRUCT *errelt ; @@ -579,7 +579,7 @@ void repeat(root) for (a = top->starta ; a ; a = a->next) { for (final = top->allfinal ; final ; final = final->next) { if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) { + if ((c = checkrepeat(final->value, a->group, &errelt))) { wtemp = MakeWideCharString(root->occurrence == PLUS ? plus : rep); warning1("Conflict in use of %s", wtemp); m_free(wtemp, "wide character string"); @@ -588,11 +588,11 @@ void repeat(root) else ; else - if (c = checkdfsa(final->value, + if ((c = checkdfsa(final->value, a->label, a->group, a->id, - &errelt)) + &errelt))) nondeterm (root, c, errelt) ; else ; @@ -600,14 +600,14 @@ void repeat(root) for (final = top->finals ; final ; final = final->next) { if (samelabelarc(a, final->value)) continue ; if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) + if ((c = checkrepeat(final->value, a->group, &errelt))) nondeterm(root, c, errelt) ; if (a->label || a->group || ! final->value->frompcdata) { - if (c = addarc(final->value, a->to, a->label, + if ((c = addarc(final->value, a->to, a->label, a->group, TRUE, a->id, - a->minim, &errelt)) + a->minim, &errelt))) nondeterm(root, c, errelt) ; if (permitspcd(a)) final->value->datacontent = TRUE ; } @@ -697,7 +697,7 @@ void simplebranch(root, value, group, optional) states of and-groups that terminate at the start state of the new arc */ for (index = top->allfinal ; index ; index = index->next) - if (c = checkdfsa(index->value, value, group, root->eltid, &errelt)) + if ((c = checkdfsa(index->value, value, group, root->eltid, &errelt))) nondeterm(root, c, errelt) ; for (index = top->starts ; index ; index = index->next) { if (! group && ! value && index->value->frompcdata) diff --git a/cde/programs/dthelp/parser/pass2/build/out.c b/cde/programs/dthelp/parser/pass2/build/out.c index 673277d7..98c35caf 100644 --- a/cde/programs/dthelp/parser/pass2/build/out.c +++ b/cde/programs/dthelp/parser/pass2/build/out.c @@ -31,6 +31,7 @@ This product and information is proprietary of Tandem Computers Incorporated. #include #include +#include #if defined(MSDOS) #include #endif @@ -195,7 +196,7 @@ void eltreeout(M_NOPAR) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = eltp->enptr ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -211,14 +212,14 @@ void eltreeout(M_NOPAR) else fputs(",\n", dtd) ; if (! eltp->content) warning1("No content model for element %s", eltp->enptr) ; - fprintf(dtd, " %d, %d, %s, ", + fprintf(dtd, " {%d, %d, %s, ", enameindex, eltp->model ? eltp->model->count : 0, typecon(eltp->content)) ; fprintf(dtd, "%d, %d, ", eltp->inptr, eltp->exptr) ; fprintf(dtd, "%d, %d, %d", eltp->parindex, eltp->paramcount, eltp->srefptr) ; enameindex += w_strlen(eltp->enptr) + 1 ; - fprintf(dtd, ", %s, %s, %s", + fprintf(dtd, ", %s, %s, %s}", boolean(eltp->stmin), boolean(eltp->etmin), boolean(eltp->useoradd)) ; } fputs(ndif, dtd) ; @@ -259,7 +260,7 @@ void exout(M_NOPAR) if (! first) fputs(",\n", dtd) ; first = FALSE ; exindex++ ; - fprintf(dtd, " %d, %d", ex->element, ex->next ? exindex + 1 : 0) ; + fprintf(dtd, " {%d, %d}", ex->element, ex->next ? exindex + 1 : 0) ; } fputs(ndif, dtd) ; } @@ -294,7 +295,7 @@ void fsa(M_NOPAR) for (pstate = firststate ; pstate ; pstate = pstate->next) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %s, %s, %d", + fprintf(dtd, " {%s, %s, %d}", boolean(pstate->final), boolean(pstate->datacontent), pstate->first ? ++arcount : 0) ; for (parc = pstate->first ; parc ; parc = parc->next) { @@ -319,7 +320,7 @@ void fsa(M_NOPAR) for (pand = firstand ; pand ; pand = pand->nextptr) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d", + fprintf(dtd, " {%d, %d}", pand->start->count, pand->next ? pand->next->count : M_NULLVAL) ; } @@ -352,7 +353,7 @@ if (kwlen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = ptypep->keyword ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -372,7 +373,7 @@ if (deflen) if (first) first = FALSE ; else fputs(",\n", dtd) ; for (p = paramp->defstring ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; + fprintf(dtd, " %d,\n", (int)*p) ; fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -392,7 +393,7 @@ if (ptypelen) { if (first) first = FALSE ; else fprintf(dtd, ",\n") ; - fprintf(dtd, " %d, %d", kw, ptypep->next) ; + fprintf(dtd, " {%d, %d}", kw, ptypep->next) ; kw += w_strlen(ptypep->keyword) + 1 ; } fputs(ndif, dtd) ; @@ -412,21 +413,21 @@ if (parcount) if (first) first = FALSE ; else fputs(",\n", dtd) ; fprintf(dtd, - " %d, %s, %d, %s, ", + " {%d, %s, %d, %s, ", pnameindex, partype(paramp->type), paramp->kwlist, deftype(paramp->deftype) ); pnameindex += w_strlen(paramp->paramname) + 1 ; if (paramp->defval) - fprintf(dtd, "&m_keyword[%d]", paramp->defval - 1) ; + fprintf(dtd, "&m_keyword[%d]}", paramp->defval - 1) ; else if (paramp->defstring) { - fprintf(dtd, "&m_defval[%d]", defindex) ; + fprintf(dtd, "&m_defval[%d]}", defindex) ; defindex += w_strlen(paramp->defstring) + 1 ; } else - fputs("NULL", dtd) ; + fputs("NULL}", dtd) ; } fputs(ndif, dtd) ; } @@ -443,7 +444,7 @@ if (pnamelen) { if (first) first = FALSE ; else fputs(",\n", dtd) ; - for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", *p) ; + for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", (int)*p); fputs(" 0", dtd) ; } fputs(ndif, dtd) ; @@ -534,10 +535,10 @@ void srefout(M_NOPAR) count++ ; if (first) first = FALSE ; else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; + fprintf(dtd, " {%d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; for (j++ ; j < sreflen ; j++) if (mapbysref[sreflen * i + j]) break ; - fprintf(dtd, "%d", j < sreflen ? count + 1 : 0) ; + fprintf(dtd, "%d}", j < sreflen ? count + 1 : 0) ; } else j++ ; fputs(ndif, dtd) ; @@ -573,7 +574,8 @@ if (eltp->parptr) { int length; char mbyte[32]; /* larger than any multibyte character */ - char *pc, c; + char *pc; + unsigned char c; length = wctomb(mbyte, *p); if (length < 0) @@ -645,7 +647,7 @@ void template(M_NOPAR) } mb_name = MakeMByteString(ent->name); - fprintf(tempfile, "\n", mb_name, ent->type) ; + fprintf(tempfile, "\n", mb_name, ent->type); m_free(mb_name, "wide character ent->name"); } } diff --git a/cde/programs/dthelp/parser/pass2/build/param.c b/cde/programs/dthelp/parser/pass2/build/param.c index 1bcbd9de..1e3bfb8d 100644 --- a/cde/programs/dthelp/parser/pass2/build/param.c +++ b/cde/programs/dthelp/parser/pass2/build/param.c @@ -89,7 +89,7 @@ ptypelen++ ; /* Add a parameter to the current element */ void addpar(M_NOPAR) { -PARAMETER *paramp, *last ; +PARAMETER *paramp, *last = NULL ; int length ; parcount++ ; @@ -200,6 +200,7 @@ switch (newpar->type) } break ; } + return(FALSE); } /* Normalize parameter default. Change tabs and RE's to spaces, capitalize @@ -212,7 +213,7 @@ M_WCHAR *string ; #endif /* M_PROTO */ { M_WCHAR *p, *q ; -int i ; +int i, ret ; switch (newpar->type) { @@ -238,7 +239,7 @@ switch (newpar->type) for (p = string, i = 0 ; *p ; p++, i++) if (m_whitespace(*p)) { - mbtowc(p, " ", 1); + ret = mbtowc(p, " ", 1); for (q = p + 1 ; m_whitespace(*q); q++) ; w_strcpy(p + 1, q) ; } @@ -262,10 +263,13 @@ switch (newpar->type) mbyte[1] = 0; } if ((length == 1) && (*mbyte == '\n' || *mbyte == '\t')) - mbtowc(string, " ", 1); + { + ret = mbtowc(string, " ", 1); + } } return ; } + (void) ret; } /* Called at end of parameter attribute list rule */ diff --git a/cde/programs/dthelp/parser/pass2/build/proto.h b/cde/programs/dthelp/parser/pass2/build/proto.h index a8e858c9..c1bb9e89 100644 --- a/cde/programs/dthelp/parser/pass2/build/proto.h +++ b/cde/programs/dthelp/parser/pass2/build/proto.h @@ -330,7 +330,7 @@ LOGICAL litproc( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/pass2/build/scan.c b/cde/programs/dthelp/parser/pass2/build/scan.c index 1a180083..f0a33ed6 100644 --- a/cde/programs/dthelp/parser/pass2/build/scan.c +++ b/cde/programs/dthelp/parser/pass2/build/scan.c @@ -80,9 +80,10 @@ int c; int n; M_WCHAR wsp, wnl, wtb; -mbtowc(&wsp, " ", 1); -mbtowc(&wnl, "\n", 1); -mbtowc(&wtb, "\t", 1); +int +ret = mbtowc(&wsp, " ", 1); +ret = mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wtb, "\t", 1); while (TRUE) { @@ -158,13 +159,14 @@ while (TRUE) { char mbyte[32]; /* bigger than the biggest multibyte char */ - wctomb(mbyte, c); + ret = wctomb(mbyte, c); fprintf(stderr, "\n'%s' (%d)", mbyte, c); fprintf(m_errfile, "\n'%s' (%d)", mbyte, c); m_error("Unexpected character"); } } /* End while */ + (void) ret; } /* End scan */ #include "scanutil.c" diff --git a/cde/programs/dthelp/parser/pass2/build/sref.c b/cde/programs/dthelp/parser/pass2/build/sref.c index 76ca9e32..45fe325c 100644 --- a/cde/programs/dthelp/parser/pass2/build/sref.c +++ b/cde/programs/dthelp/parser/pass2/build/sref.c @@ -40,7 +40,7 @@ void adddefent(mapname) M_WCHAR *mapname; { M_WCHAR *p; -int n, length; +int n; char c; if (!wc_prefix) @@ -59,8 +59,9 @@ for (n = egensuf ; n ; n /= 10) return; } c = ('0' + (n % 10)); - mbtowc(p, &c, 1); - *p++; + int ret = mbtowc(p, &c, 1); + (void) ret; + p++; } *p = M_EOS; egensuf++; @@ -80,7 +81,7 @@ M_WCHAR *name; M_ENTITY *new; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity"); -if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) +if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free((M_POINTER) new, "entity"); return(FALSE); @@ -113,7 +114,7 @@ MAP *new; LOGICAL retval; new = (MAP *) m_malloc(sizeof(MAP), "map"); -if (old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new)) +if ((old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new))) { m_free(new, "map"); curmap = old->map; @@ -153,7 +154,7 @@ int noseq = 0; /* Define the delimiter */ delim = (SREFSTRUCT *) m_malloc(sizeof(SREFSTRUCT), "short reference delimiter"); -if (prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim)) +if ((prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim))) { m_free(delim, "short reference delimiter"); delim = prevsr; diff --git a/cde/programs/dthelp/parser/pass2/eltdef/context.dat b/cde/programs/dthelp/parser/pass2/eltdef/context.dat index edce875a..c95c2b3f 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/context.dat +++ b/cde/programs/dthelp/parser/pass2/eltdef/context.dat @@ -626,7 +626,7 @@ name pcchain:pcchain { *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ; (*nextchain)->next = NULL ; - if ((*nextchain)->elt = m_packedlook(m_entree, name)) + if (((*nextchain)->elt = m_packedlook(m_entree, name))) (*nextchain)->elt++ ; else m_err1("Undefined element: %s", name) ; @@ -660,61 +660,61 @@ text } } globdef:globdef { - fprintf(globdef, "%c", textchar) ; + fprintf(globdef, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */ } globdec:globdec { - fprintf(globdec, "%c", textchar) ; + fprintf(globdec, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniss:iniss, inss:inss { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inies:inies, ines:ines { if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; + fprintf(string, " %d", (int)textchar) ; stringstart = FALSE ; stringcnt++ ; } inisc:inisc, insc:insc { - fprintf(sfile, "%c", textchar) ; + fprintf(sfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } iniec:iniec, inec:inec { - fprintf(efile, "%c", textchar) ; + fprintf(efile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */ } initc:initc, intc:intc { - fprintf(tfile, "%c", textchar) ; + fprintf(tfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inipc:inipc, inpc:inpc { - fprintf(pfile, "%c", textchar) ; + fprintf(pfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inistc:inistc, instc:instc { - fprintf(stfile, "%c", textchar) ; + fprintf(stfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } inentc:inentc { - fprintf(entfile, "%c", textchar) ; + fprintf(entfile, "%c", (char)textchar) ; /* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n", m_line, iffile) ; */ } diff --git a/cde/programs/dthelp/parser/pass2/eltdef/eltdef.c b/cde/programs/dthelp/parser/pass2/eltdef/eltdef.c index 5fdb8c26..20d28ec1 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/eltdef.c +++ b/cde/programs/dthelp/parser/pass2/eltdef/eltdef.c @@ -49,13 +49,13 @@ This product and information is proprietary of Tandem Computers Incorporated. #include "entity.h" /* Main program */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { int m_token ; - if (argc > 2) + if (argc > 2) { if (*argv[2] == '-') { if (strchr(argv[2], 'a')) m_malftrace = TRUE ; if (strchr(argv[2], 'A')) m_malftrace = TRUE ; @@ -70,6 +70,7 @@ void main(argc, argv) fprintf(stderr, "****Starting with MARKUP 2.0, ELTDEF no longer writes a statistics file" ) ; + } if (argc < 2) { fprintf(stderr, "**** Specify interface file ****\n") ; exit(TRUE) ; @@ -84,7 +85,7 @@ void main(argc, argv) if (scantrace) printf( "Main: m_prevcon=%d,m_token=%d,curcon=%d,textchar='%c'(%d), line=%d\n", - m_prevcon, m_token, curcon, textchar, textchar, m_line) ; + m_prevcon, m_token, curcon, (char)textchar, (int)textchar, m_line) ; #include "case.c" if (m_token == ENDFILE) break ; if (! curcon) { @@ -93,4 +94,5 @@ void main(argc, argv) } } done() ; + return 0; } diff --git a/cde/programs/dthelp/parser/pass2/eltdef/eltutil.c b/cde/programs/dthelp/parser/pass2/eltdef/eltutil.c index fc052f8d..754e6460 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/eltutil.c +++ b/cde/programs/dthelp/parser/pass2/eltdef/eltutil.c @@ -106,7 +106,7 @@ void cvalue(M_NOPAR) PARVAL *new; new = (PARVAL *) m_malloc(sizeof(PARVAL), "parameter value"); - if (pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new)) + if ((pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new))) m_free(new, "parameter value"); else { new->line = 0; @@ -467,7 +467,7 @@ for ( ; p ; p = p->next) iffile); fprintf(pvalh, "#define %s \"", mb_cname); m_free(mb_cname,"multi-byte string"); - if (q = ((PARVAL *) p->data)->value) + if ((q = ((PARVAL *) p->data)->value)) for ( ; *q ; q++) { char mbq[32]; /* larger than largest possible mbyte char */ @@ -498,7 +498,7 @@ for ( ; p ; p = p->next) void skiptoend(M_NOPAR) { int i; - static errlev = 0; + static int errlev = 0; CVARSTRUCT *cvarp, *dvarp; for (cvarp = cvarlist ; cvarp ;) { @@ -615,7 +615,7 @@ void startelement(M_NOPAR) m_free(discard, "C variable"); } cvarlist = NULL; - if (openelt = m_packedlook(m_entree, name)) { + if ((openelt = m_packedlook(m_entree, name))) { if (processed[openelt - 1]) warning1("Warning: Element %s already processed", name); processed[openelt - 1] = TRUE; @@ -670,7 +670,7 @@ if (m_partype(cvarlist->param + m_element[openelt - 1].parptr, p)) { M_WCHAR *w_buffer; - sprintf(buffer, "%d", pval->line); + snprintf(buffer, 5, "%d", pval->line); w_buffer = MakeWideCharString(buffer); m_err5("Can't #define %s to %s. %s #define'd to %s on line %s", pval->cname, diff --git a/cde/programs/dthelp/parser/pass2/eltdef/entity.c b/cde/programs/dthelp/parser/pass2/eltdef/entity.c index f1bee6e2..49c74e7e 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/entity.c +++ b/cde/programs/dthelp/parser/pass2/eltdef/entity.c @@ -40,7 +40,7 @@ void addent(M_NOPAR) M_ENTITY *new ; new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ; - if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) { + if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) { m_free(new, "entity") ; if (! entity->wheredef) return ; if (entity->wheredef == M_DBUILD) { diff --git a/cde/programs/dthelp/parser/pass2/eltdef/proto.h b/cde/programs/dthelp/parser/pass2/eltdef/proto.h index 581c6e83..01a905c8 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/proto.h +++ b/cde/programs/dthelp/parser/pass2/eltdef/proto.h @@ -226,7 +226,7 @@ LOGICAL litproc( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/pass2/eltdef/scan.c b/cde/programs/dthelp/parser/pass2/eltdef/scan.c index d5d754ff..572a39d5 100644 --- a/cde/programs/dthelp/parser/pass2/eltdef/scan.c +++ b/cde/programs/dthelp/parser/pass2/eltdef/scan.c @@ -53,7 +53,8 @@ M_WCHAR *p, wus; int c, cttype; LOGICAL cname; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; cname = (LOGICAL) (curcon == INPARAM || curcon == INVALUE); *(p = name) = (M_WCHAR) first; @@ -92,7 +93,8 @@ int n; static char unexp[] = "c"; M_WCHAR wus; -mbtowc(&wus, "_", 1); +int ret = mbtowc(&wus, "_", 1); +(void) ret; while (TRUE) { diff --git a/cde/programs/dthelp/parser/pass2/util/basic.h b/cde/programs/dthelp/parser/pass2/util/basic.h index 38c93edc..d5160edb 100644 --- a/cde/programs/dthelp/parser/pass2/util/basic.h +++ b/cde/programs/dthelp/parser/pass2/util/basic.h @@ -118,3 +118,21 @@ void *m_malloc( int size, char *msg #endif ) ; + +void m_free( +#if defined(M_PROTO) + void *block, char *msg +#endif + ) ; + +void m_err2( +#if defined(M_PROTO) + const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2 +#endif + ) ; + +int mb_getwc( +#if defined(M_PROTO) + void *m_ptr +#endif + ) ; diff --git a/cde/programs/dthelp/parser/pass2/util/chartype.h b/cde/programs/dthelp/parser/pass2/util/chartype.h index 8e21aa7a..4be390cf 100644 --- a/cde/programs/dthelp/parser/pass2/util/chartype.h +++ b/cde/programs/dthelp/parser/pass2/util/chartype.h @@ -29,262 +29,262 @@ by HP Tag are marked "(invalid)". */ M_CHARTYPE m_ctarray[M_CHARSETLEN] = { /* Char Name Type, Upper, Lower */ -/* 0: ^@ NUL */ M_NONNAME, 0, 0, -/* 1: ^A SOH */ M_NONNAME, 1, 1, -/* 2: ^B STX */ M_NONNAME, 2, 2, -/* 3: ^C ETX */ M_NONNAME, 3, 3, -/* 4: ^D EOT */ M_NONNAME, 4, 4, -/* 5: ^E ENQ */ M_NONNAME, 5, 5, -/* 6: ^F ACK */ M_NONNAME, 6, 6, -/* 7: ^G BEL */ M_NONNAME, 7, 7, -/* 8: ^H BS */ M_NONNAME, 8, 8, -/* 9: ^I HT */ M_NONNAME, 9, 9, -/* 10: ^J LF */ M_NONNAME, 10, 10, -/* 11: ^K VT */ M_NONNAME, 11, 11, -/* 12: ^L FF */ M_NONNAME, 12, 12, -/* 13: ^M CR */ M_NONNAME, 13, 13, -/* 14: ^N SO */ M_NONNAME, 14, 14, -/* 15: ^O SI */ M_NONNAME, 15, 15, -/* 16: ^P DLE */ M_NONNAME, 16, 16, -/* 17: ^Q DC1 */ M_NONNAME, 17, 17, -/* 18: ^R DC2 */ M_NONNAME, 18, 18, -/* 19: ^S DC3 */ M_NONNAME, 19, 19, -/* 20: ^T DC4 */ M_NONNAME, 20, 20, -/* 21: ^U NAK */ M_NONNAME, 21, 21, -/* 22: ^V SYN */ M_NONNAME, 22, 22, -/* 23: ^W ETB */ M_NONNAME, 23, 23, -/* 24: ^X CAN */ M_NONNAME, 24, 24, -/* 25: ^Y EM */ M_NONNAME, 25, 25, -/* 26: ^Z SUB */ M_NONNAME, 26, 26, -/* 27: ^[ ESC */ M_NONNAME, 27, 27, -/* 28: ^\ FS */ M_NONNAME, 28, 28, -/* 29: ^] GS */ M_NONNAME, 29, 29, -/* 30: ^^ RS */ M_NONNAME, 30, 30, -/* 31: ^_ US */ M_NONNAME, 31, 31, -/* 32: SP */ M_NONNAME, 32, 32, -/* 33: ! */ M_NONNAME, 33, 33, -/* 34: " */ M_NONNAME, 34, 34, -/* 35: # */ M_NONNAME, 35, 35, -/* 36: $ */ M_NONNAME, 36, 36, -/* 37: % */ M_NONNAME, 37, 37, -/* 38: & */ M_NONNAME, 38, 38, -/* 39: ' */ M_NONNAME, 39, 39, -/* 40: ( */ M_NONNAME, 40, 40, -/* 41: ) */ M_NONNAME, 41, 41, -/* 42: * */ M_NONNAME, 42, 42, -/* 43: + */ M_NAMECHAR, 43, 43, -/* 44: , */ M_NONNAME, 44, 44, -/* 45: - */ M_NAMECHAR, 45, 45, -/* 46: . */ M_NAMECHAR, 46, 46, -/* 47: / */ M_NONNAME, 47, 47, -/* 48: 0 */ M_DIGIT, 48, 48, -/* 49: 1 */ M_DIGIT, 49, 49, -/* 50: 2 */ M_DIGIT, 50, 50, -/* 51: 3 */ M_DIGIT, 51, 51, -/* 52: 4 */ M_DIGIT, 52, 52, -/* 53: 5 */ M_DIGIT, 53, 53, -/* 54: 6 */ M_DIGIT, 54, 54, -/* 55: 7 */ M_DIGIT, 55, 55, -/* 56: 8 */ M_DIGIT, 56, 56, -/* 57: 9 */ M_DIGIT, 57, 57, -/* 58: : */ M_NONNAME, 58, 58, -/* 59: ; */ M_NONNAME, 59, 59, -/* 60: < */ M_NONNAME, 60, 60, -/* 61: = */ M_NONNAME, 61, 61, -/* 62: > */ M_NONNAME, 62, 62, -/* 63: ? */ M_NONNAME, 63, 63, -/* 64: @ */ M_NONNAME, 64, 64, -/* 65: A */ M_NMSTART, 65, 97, -/* 66: B */ M_NMSTART, 66, 98, -/* 67: C */ M_NMSTART, 67, 99, -/* 68: D */ M_NMSTART, 68, 100, -/* 69: E */ M_NMSTART, 69, 101, -/* 70: F */ M_NMSTART, 70, 102, -/* 71: G */ M_NMSTART, 71, 103, -/* 72: H */ M_NMSTART, 72, 104, -/* 73: I */ M_NMSTART, 73, 105, -/* 74: J */ M_NMSTART, 74, 106, -/* 75: K */ M_NMSTART, 75, 107, -/* 76: L */ M_NMSTART, 76, 108, -/* 77: M */ M_NMSTART, 77, 109, -/* 78: N */ M_NMSTART, 78, 110, -/* 79: O */ M_NMSTART, 79, 111, -/* 80: P */ M_NMSTART, 80, 112, -/* 81: Q */ M_NMSTART, 81, 113, -/* 82: R */ M_NMSTART, 82, 114, -/* 83: S */ M_NMSTART, 83, 115, -/* 84: T */ M_NMSTART, 84, 116, -/* 85: U */ M_NMSTART, 85, 117, -/* 86: V */ M_NMSTART, 86, 118, -/* 87: W */ M_NMSTART, 87, 119, -/* 88: X */ M_NMSTART, 88, 120, -/* 89: Y */ M_NMSTART, 89, 121, -/* 90: Z */ M_NMSTART, 90, 122, -/* 91: [ */ M_NONNAME, 91, 91, -/* 92: \\ */ M_NONNAME, 92, 92, -/* 93: ] */ M_NONNAME, 93, 93, -/* 94: ^ */ M_NONNAME, 94, 94, -/* 95: _ */ M_NONNAME, 95, 95, -/* 96: ` */ M_NONNAME, 96, 96, -/* 97: a */ M_NMSTART, 65, 97, -/* 98: b */ M_NMSTART, 66, 98, -/* 99: c */ M_NMSTART, 67, 99, -/* 100: d */ M_NMSTART, 68, 100, -/* 101: e */ M_NMSTART, 69, 101, -/* 102: f */ M_NMSTART, 70, 102, -/* 103: g */ M_NMSTART, 71, 103, -/* 104: h */ M_NMSTART, 72, 104, -/* 105: i */ M_NMSTART, 73, 105, -/* 106: j */ M_NMSTART, 74, 106, -/* 107: k */ M_NMSTART, 75, 107, -/* 108: l */ M_NMSTART, 76, 108, -/* 109: m */ M_NMSTART, 77, 109, -/* 110: n */ M_NMSTART, 78, 110, -/* 111: o */ M_NMSTART, 79, 111, -/* 112: p */ M_NMSTART, 80, 112, -/* 113: q */ M_NMSTART, 81, 113, -/* 114: r */ M_NMSTART, 82, 114, -/* 115: s */ M_NMSTART, 83, 115, -/* 116: t */ M_NMSTART, 84, 116, -/* 117: u */ M_NMSTART, 85, 117, -/* 118: v */ M_NMSTART, 86, 118, -/* 119: w */ M_NMSTART, 87, 119, -/* 120: x */ M_NMSTART, 88, 120, -/* 121: y */ M_NMSTART, 89, 121, -/* 122: z */ M_NMSTART, 90, 122, -/* 123: { */ M_NONNAME, 123, 123, -/* 124: | */ M_NONNAME, 124, 124, -/* 125: } */ M_NONNAME, 125, 125, -/* 126: ~ */ M_NONNAME, 126, 126, -/* 127: DEL */ M_NONNAME, 127, 127, -/* 128: undefined */ M_NONNAME, 128, 128, -/* 129: undefined */ M_NONNAME, 129, 129, -/* 130: undefined */ M_NONNAME, 130, 130, -/* 131: undefined */ M_NONNAME, 131, 131, -/* 132: undefined */ M_NONNAME, 132, 132, -/* 133: undefined */ M_NONNAME, 133, 133, -/* 134: undefined */ M_NONNAME, 134, 134, -/* 135: undefined */ M_NONNAME, 135, 135, -/* 136: undefined */ M_NONNAME, 136, 136, -/* 137: undefined */ M_NONNAME, 137, 137, -/* 138: undefined */ M_NONNAME, 138, 138, -/* 139: undefined */ M_NONNAME, 139, 139, -/* 140: undefined */ M_NONNAME, 140, 140, -/* 141: undefined */ M_NONNAME, 141, 141, -/* 142: undefined */ M_NONNAME, 142, 142, -/* 143: undefined */ M_NONNAME, 143, 143, -/* 144: undefined */ M_NONNAME, 144, 144, -/* 145: undefined */ M_NONNAME, 145, 145, -/* 146: undefined */ M_NONNAME, 146, 146, -/* 147: undefined */ M_NONNAME, 147, 147, -/* 148: undefined */ M_NONNAME, 148, 148, -/* 149: undefined */ M_NONNAME, 149, 149, -/* 150: undefined */ M_NONNAME, 150, 150, -/* 151: undefined */ M_NONNAME, 151, 151, -/* 152: undefined */ M_NONNAME, 152, 152, -/* 153: undefined */ M_NONNAME, 153, 153, -/* 154: undefined */ M_NONNAME, 154, 154, -/* 155: undefined */ M_NONNAME, 155, 155, -/* 156: undefined */ M_NONNAME, 156, 156, -/* 157: undefined */ M_NONNAME, 157, 157, -/* 158: undefined */ M_NONNAME, 158, 158, -/* 159: undefined */ M_NONNAME, 159, 159, -/* 160: undefined */ M_NONNAME, 160, 160, -/* 161: A grave */ M_NMSTART, 161, 200, -/* 162: A circumflex */ M_NMSTART, 162, 192, -/* 163: E grave */ M_NMSTART, 163, 201, -/* 164: E circumflex */ M_NMSTART, 164, 193, -/* 165: E dieresis */ M_NMSTART, 165, 205, -/* 166: I circumflex */ M_NMSTART, 166, 209, -/* 167: I dieresis */ M_NMSTART, 167, 221, -/* 168: acute accent */ M_NONNAME, 168, 168, -/* 169: grave accent */ M_NONNAME, 169, 169, -/* 170: circumflex */ M_NONNAME, 170, 170, -/* 171: dieresis */ M_NONNAME, 171, 171, -/* 172: tilde */ M_NONNAME, 172, 172, -/* 173: U grave */ M_NMSTART, 173, 203, -/* 174: U circumflex */ M_NMSTART, 174, 195, -/* 175: Italian Lira (invalid) */ M_NONNAME, 175, 175, -/* 176: overbar (invalid) */ M_NONNAME, 176, 176, -/* 177: Y acute */ M_NMSTART, 177, 178, -/* 178: y acute */ M_NMSTART, 177, 178, -/* 179: degree (invalid) */ M_NONNAME, 179, 179, -/* 180: C cedilla */ M_NMSTART, 180, 181, -/* 181: c cedilla */ M_NMSTART, 180, 181, -/* 182: N tilde */ M_NMSTART, 182, 183, -/* 183: n tilde */ M_NMSTART, 182, 183, -/* 184: inverted exclamation mark */ M_NONNAME, 184, 184, -/* 185: inverted question mark */ M_NONNAME, 185, 185, -/* 186: currency sign (invalid) */ M_NONNAME, 186, 186, -/* 187: pound sterling (invalid) */ M_NONNAME, 187, 187, -/* 188: Yen */ M_NONNAME, 188, 188, -/* 189: Section sign (invalid) */ M_NONNAME, 189, 189, -/* 190: florin (invalid) */ M_NONNAME, 190, 190, -/* 191: Cent sign (invalid) */ M_NONNAME, 191, 191, -/* 192: a circumflex */ M_NMSTART, 162, 192, -/* 193: e circumflex */ M_NMSTART, 164, 193, -/* 194: o circumflex */ M_NMSTART, 223, 194, -/* 195: u circumflex */ M_NMSTART, 174, 195, -/* 196: a acute */ M_NMSTART, 224, 196, -/* 197: e acute */ M_NMSTART, 220, 197, -/* 198: o acute */ M_NMSTART, 231, 198, -/* 199: u acute */ M_NMSTART, 237, 199, -/* 200: a grave */ M_NMSTART, 161, 200, -/* 201: e grave */ M_NMSTART, 163, 201, -/* 202: o grave */ M_NMSTART, 232, 202, -/* 203: u grave */ M_NMSTART, 173, 203, -/* 204: a dieresis */ M_NMSTART, 216, 204, -/* 205: e dieresis */ M_NMSTART, 165, 205, -/* 206: o dieresis */ M_NMSTART, 218, 206, -/* 207: u dieresis */ M_NMSTART, 219, 207, -/* 208: A angstrom */ M_NMSTART, 208, 212, -/* 209: i circumflex */ M_NMSTART, 166, 209, -/* 210: O slash */ M_NMSTART, 210, 214, -/* 211: AE ligature */ M_NMSTART, 211, 215, -/* 212: a angstrom */ M_NMSTART, 208, 212, -/* 213: i acute */ M_NMSTART, 229, 213, -/* 214: o slash */ M_NMSTART, 210, 214, -/* 215: ae ligature */ M_NMSTART, 211, 215, -/* 216: A dieresis */ M_NMSTART, 216, 204, -/* 217: i grave */ M_NMSTART, 230, 217, -/* 218: O dieresis */ M_NMSTART, 218, 206, -/* 219: U dieresis */ M_NMSTART, 219, 207, -/* 220: E acute */ M_NMSTART, 220, 197, -/* 221: i dieresis */ M_NMSTART, 167, 221, -/* 222: SS ligature */ M_NMSTART, 222, 222, -/* 223: O circumflex */ M_NMSTART, 223, 194, -/* 224: A acute */ M_NMSTART, 224, 196, -/* 225: A tilde */ M_NMSTART, 225, 226, -/* 226: a tilde */ M_NMSTART, 225, 226, -/* 227: Eth (invalid) */ M_NMSTART, 227, 228, -/* 228: eth (invalid) */ M_NMSTART, 227, 228, -/* 229: I acute */ M_NMSTART, 229, 213, -/* 230: I grave */ M_NMSTART, 230, 217, -/* 231: O acute */ M_NMSTART, 231, 198, -/* 232: O grave */ M_NMSTART, 232, 202, -/* 233: O tilde */ M_NMSTART, 233, 234, -/* 234: o tilde */ M_NMSTART, 233, 234, -/* 235: S caron */ M_NMSTART, 235, 236, -/* 236: s caron */ M_NMSTART, 235, 236, -/* 237: U acute */ M_NMSTART, 237, 199, -/* 238: Y dieresis */ M_NMSTART, 238, 239, -/* 239: y dieresis */ M_NMSTART, 238, 239, -/* 240: Thorn (invalid) */ M_NMSTART, 240, 241, -/* 241: thorn (invalid) */ M_NMSTART, 240, 241, -/* 242: undefined */ M_NONNAME, 242, 242, -/* 243: mu (invalid) */ M_NONNAME, 243, 243, -/* 244: paragraph sign (invalid) */ M_NONNAME, 244, 244, -/* 245: fraction 3/4 (invalid) */ M_NONNAME, 245, 245, -/* 246: long dash (invalid) */ M_NONNAME, 246, 246, -/* 247: fraction 1/4 (invalid) */ M_NONNAME, 247, 247, -/* 248: fraction 1/2 (invalid) */ M_NONNAME, 248, 248, -/* 249: Female ordinal (invalid) */ M_NONNAME, 249, 249, -/* 250: Male ordinal (invalid) */ M_NONNAME, 250, 250, -/* 251: French double open quote(invalid) */ M_NONNAME, 251, 251, -/* 252: Solid square (invalid) */ M_NONNAME, 252, 252, -/* 253: French double close quote(invalid) */ M_NONNAME, 253, 253, -/* 254: Plus over minus sign(invalid)*/ M_NONNAME, 254, 254, -/* 255: undefined */ M_NONNAME, 255, 255, +/* 0: ^@ NUL */ {M_NONNAME, 0, 0}, +/* 1: ^A SOH */ {M_NONNAME, 1, 1}, +/* 2: ^B STX */ {M_NONNAME, 2, 2}, +/* 3: ^C ETX */ {M_NONNAME, 3, 3}, +/* 4: ^D EOT */ {M_NONNAME, 4, 4}, +/* 5: ^E ENQ */ {M_NONNAME, 5, 5}, +/* 6: ^F ACK */ {M_NONNAME, 6, 6}, +/* 7: ^G BEL */ {M_NONNAME, 7, 7}, +/* 8: ^H BS */ {M_NONNAME, 8, 8}, +/* 9: ^I HT */ {M_NONNAME, 9, 9}, +/* 10: ^J LF */ {M_NONNAME, 10, 10}, +/* 11: ^K VT */ {M_NONNAME, 11, 11}, +/* 12: ^L FF */ {M_NONNAME, 12, 12}, +/* 13: ^M CR */ {M_NONNAME, 13, 13}, +/* 14: ^N SO */ {M_NONNAME, 14, 14}, +/* 15: ^O SI */ {M_NONNAME, 15, 15}, +/* 16: ^P DLE */ {M_NONNAME, 16, 16}, +/* 17: ^Q DC1 */ {M_NONNAME, 17, 17}, +/* 18: ^R DC2 */ {M_NONNAME, 18, 18}, +/* 19: ^S DC3 */ {M_NONNAME, 19, 19}, +/* 20: ^T DC4 */ {M_NONNAME, 20, 20}, +/* 21: ^U NAK */ {M_NONNAME, 21, 21}, +/* 22: ^V SYN */ {M_NONNAME, 22, 22}, +/* 23: ^W ETB */ {M_NONNAME, 23, 23}, +/* 24: ^X CAN */ {M_NONNAME, 24, 24}, +/* 25: ^Y EM */ {M_NONNAME, 25, 25}, +/* 26: ^Z SUB */ {M_NONNAME, 26, 26}, +/* 27: ^[ ESC */ {M_NONNAME, 27, 27}, +/* 28: ^\ FS */ {M_NONNAME, 28, 28}, +/* 29: ^] GS */ {M_NONNAME, 29, 29}, +/* 30: ^^ RS */ {M_NONNAME, 30, 30}, +/* 31: ^_ US */ {M_NONNAME, 31, 31}, +/* 32: SP */ {M_NONNAME, 32, 32}, +/* 33: ! */ {M_NONNAME, 33, 33}, +/* 34: " */ {M_NONNAME, 34, 34}, +/* 35: # */ {M_NONNAME, 35, 35}, +/* 36: $ */ {M_NONNAME, 36, 36}, +/* 37: % */ {M_NONNAME, 37, 37}, +/* 38: & */ {M_NONNAME, 38, 38}, +/* 39: ' */ {M_NONNAME, 39, 39}, +/* 40: ( */ {M_NONNAME, 40, 40}, +/* 41: ) */ {M_NONNAME, 41, 41}, +/* 42: * */ {M_NONNAME, 42, 42}, +/* 43: + */ {M_NAMECHAR, 43, 43}, +/* 44: , */ {M_NONNAME, 44, 44}, +/* 45: - */ {M_NAMECHAR, 45, 45}, +/* 46: . */ {M_NAMECHAR, 46, 46}, +/* 47: / */ {M_NONNAME, 47, 47}, +/* 48: 0 */ {M_DIGIT, 48, 48}, +/* 49: 1 */ {M_DIGIT, 49, 49}, +/* 50: 2 */ {M_DIGIT, 50, 50}, +/* 51: 3 */ {M_DIGIT, 51, 51}, +/* 52: 4 */ {M_DIGIT, 52, 52}, +/* 53: 5 */ {M_DIGIT, 53, 53}, +/* 54: 6 */ {M_DIGIT, 54, 54}, +/* 55: 7 */ {M_DIGIT, 55, 55}, +/* 56: 8 */ {M_DIGIT, 56, 56}, +/* 57: 9 */ {M_DIGIT, 57, 57}, +/* 58: : */ {M_NONNAME, 58, 58}, +/* 59: ; */ {M_NONNAME, 59, 59}, +/* 60: < */ {M_NONNAME, 60, 60}, +/* 61: = */ {M_NONNAME, 61, 61}, +/* 62: > */ {M_NONNAME, 62, 62}, +/* 63: ? */ {M_NONNAME, 63, 63}, +/* 64: @ */ {M_NONNAME, 64, 64}, +/* 65: A */ {M_NMSTART, 65, 97}, +/* 66: B */ {M_NMSTART, 66, 98}, +/* 67: C */ {M_NMSTART, 67, 99}, +/* 68: D */ {M_NMSTART, 68, 100}, +/* 69: E */ {M_NMSTART, 69, 101}, +/* 70: F */ {M_NMSTART, 70, 102}, +/* 71: G */ {M_NMSTART, 71, 103}, +/* 72: H */ {M_NMSTART, 72, 104}, +/* 73: I */ {M_NMSTART, 73, 105}, +/* 74: J */ {M_NMSTART, 74, 106}, +/* 75: K */ {M_NMSTART, 75, 107}, +/* 76: L */ {M_NMSTART, 76, 108}, +/* 77: M */ {M_NMSTART, 77, 109}, +/* 78: N */ {M_NMSTART, 78, 110}, +/* 79: O */ {M_NMSTART, 79, 111}, +/* 80: P */ {M_NMSTART, 80, 112}, +/* 81: Q */ {M_NMSTART, 81, 113}, +/* 82: R */ {M_NMSTART, 82, 114}, +/* 83: S */ {M_NMSTART, 83, 115}, +/* 84: T */ {M_NMSTART, 84, 116}, +/* 85: U */ {M_NMSTART, 85, 117}, +/* 86: V */ {M_NMSTART, 86, 118}, +/* 87: W */ {M_NMSTART, 87, 119}, +/* 88: X */ {M_NMSTART, 88, 120}, +/* 89: Y */ {M_NMSTART, 89, 121}, +/* 90: Z */ {M_NMSTART, 90, 122}, +/* 91: [ */ {M_NONNAME, 91, 91}, +/* 92: \\ */ {M_NONNAME, 92, 92}, +/* 93: ] */ {M_NONNAME, 93, 93}, +/* 94: ^ */ {M_NONNAME, 94, 94}, +/* 95: _ */ {M_NONNAME, 95, 95}, +/* 96: ` */ {M_NONNAME, 96, 96}, +/* 97: a */ {M_NMSTART, 65, 97}, +/* 98: b */ {M_NMSTART, 66, 98}, +/* 99: c */ {M_NMSTART, 67, 99}, +/* 100: d */ {M_NMSTART, 68, 100}, +/* 101: e */ {M_NMSTART, 69, 101}, +/* 102: f */ {M_NMSTART, 70, 102}, +/* 103: g */ {M_NMSTART, 71, 103}, +/* 104: h */ {M_NMSTART, 72, 104}, +/* 105: i */ {M_NMSTART, 73, 105}, +/* 106: j */ {M_NMSTART, 74, 106}, +/* 107: k */ {M_NMSTART, 75, 107}, +/* 108: l */ {M_NMSTART, 76, 108}, +/* 109: m */ {M_NMSTART, 77, 109}, +/* 110: n */ {M_NMSTART, 78, 110}, +/* 111: o */ {M_NMSTART, 79, 111}, +/* 112: p */ {M_NMSTART, 80, 112}, +/* 113: q */ {M_NMSTART, 81, 113}, +/* 114: r */ {M_NMSTART, 82, 114}, +/* 115: s */ {M_NMSTART, 83, 115}, +/* 116: t */ {M_NMSTART, 84, 116}, +/* 117: u */ {M_NMSTART, 85, 117}, +/* 118: v */ {M_NMSTART, 86, 118}, +/* 119: w */ {M_NMSTART, 87, 119}, +/* 120: x */ {M_NMSTART, 88, 120}, +/* 121: y */ {M_NMSTART, 89, 121}, +/* 122: z */ {M_NMSTART, 90, 122}, +/* 123: { */ {M_NONNAME, 123, 123}, +/* 124: | */ {M_NONNAME, 124, 124}, +/* 125: } */ {M_NONNAME, 125, 125}, +/* 126: ~ */ {M_NONNAME, 126, 126}, +/* 127: DEL */ {M_NONNAME, 127, 127}, +/* 128: undefined */ {M_NONNAME, 128, 128}, +/* 129: undefined */ {M_NONNAME, 129, 129}, +/* 130: undefined */ {M_NONNAME, 130, 130}, +/* 131: undefined */ {M_NONNAME, 131, 131}, +/* 132: undefined */ {M_NONNAME, 132, 132}, +/* 133: undefined */ {M_NONNAME, 133, 133}, +/* 134: undefined */ {M_NONNAME, 134, 134}, +/* 135: undefined */ {M_NONNAME, 135, 135}, +/* 136: undefined */ {M_NONNAME, 136, 136}, +/* 137: undefined */ {M_NONNAME, 137, 137}, +/* 138: undefined */ {M_NONNAME, 138, 138}, +/* 139: undefined */ {M_NONNAME, 139, 139}, +/* 140: undefined */ {M_NONNAME, 140, 140}, +/* 141: undefined */ {M_NONNAME, 141, 141}, +/* 142: undefined */ {M_NONNAME, 142, 142}, +/* 143: undefined */ {M_NONNAME, 143, 143}, +/* 144: undefined */ {M_NONNAME, 144, 144}, +/* 145: undefined */ {M_NONNAME, 145, 145}, +/* 146: undefined */ {M_NONNAME, 146, 146}, +/* 147: undefined */ {M_NONNAME, 147, 147}, +/* 148: undefined */ {M_NONNAME, 148, 148}, +/* 149: undefined */ {M_NONNAME, 149, 149}, +/* 150: undefined */ {M_NONNAME, 150, 150}, +/* 151: undefined */ {M_NONNAME, 151, 151}, +/* 152: undefined */ {M_NONNAME, 152, 152}, +/* 153: undefined */ {M_NONNAME, 153, 153}, +/* 154: undefined */ {M_NONNAME, 154, 154}, +/* 155: undefined */ {M_NONNAME, 155, 155}, +/* 156: undefined */ {M_NONNAME, 156, 156}, +/* 157: undefined */ {M_NONNAME, 157, 157}, +/* 158: undefined */ {M_NONNAME, 158, 158}, +/* 159: undefined */ {M_NONNAME, 159, 159}, +/* 160: undefined */ {M_NONNAME, 160, 160}, +/* 161: A grave */ {M_NMSTART, 161, 200}, +/* 162: A circumflex */ {M_NMSTART, 162, 192}, +/* 163: E grave */ {M_NMSTART, 163, 201}, +/* 164: E circumflex */ {M_NMSTART, 164, 193}, +/* 165: E dieresis */ {M_NMSTART, 165, 205}, +/* 166: I circumflex */ {M_NMSTART, 166, 209}, +/* 167: I dieresis */ {M_NMSTART, 167, 221}, +/* 168: acute accent */ {M_NONNAME, 168, 168}, +/* 169: grave accent */ {M_NONNAME, 169, 169}, +/* 170: circumflex */ {M_NONNAME, 170, 170}, +/* 171: dieresis */ {M_NONNAME, 171, 171}, +/* 172: tilde */ {M_NONNAME, 172, 172}, +/* 173: U grave */ {M_NMSTART, 173, 203}, +/* 174: U circumflex */ {M_NMSTART, 174, 195}, +/* 175: Italian Lira (invalid) */ {M_NONNAME, 175, 175}, +/* 176: overbar (invalid) */ {M_NONNAME, 176, 176}, +/* 177: Y acute */ {M_NMSTART, 177, 178}, +/* 178: y acute */ {M_NMSTART, 177, 178}, +/* 179: degree (invalid) */ {M_NONNAME, 179, 179}, +/* 180: C cedilla */ {M_NMSTART, 180, 181}, +/* 181: c cedilla */ {M_NMSTART, 180, 181}, +/* 182: N tilde */ {M_NMSTART, 182, 183}, +/* 183: n tilde */ {M_NMSTART, 182, 183}, +/* 184: inverted exclamation mark */ {M_NONNAME, 184, 184}, +/* 185: inverted question mark */ {M_NONNAME, 185, 185}, +/* 186: currency sign (invalid) */ {M_NONNAME, 186, 186}, +/* 187: pound sterling (invalid) */ {M_NONNAME, 187, 187}, +/* 188: Yen */ {M_NONNAME, 188, 188}, +/* 189: Section sign (invalid) */ {M_NONNAME, 189, 189}, +/* 190: florin (invalid) */ {M_NONNAME, 190, 190}, +/* 191: Cent sign (invalid) */ {M_NONNAME, 191, 191}, +/* 192: a circumflex */ {M_NMSTART, 162, 192}, +/* 193: e circumflex */ {M_NMSTART, 164, 193}, +/* 194: o circumflex */ {M_NMSTART, 223, 194}, +/* 195: u circumflex */ {M_NMSTART, 174, 195}, +/* 196: a acute */ {M_NMSTART, 224, 196}, +/* 197: e acute */ {M_NMSTART, 220, 197}, +/* 198: o acute */ {M_NMSTART, 231, 198}, +/* 199: u acute */ {M_NMSTART, 237, 199}, +/* 200: a grave */ {M_NMSTART, 161, 200}, +/* 201: e grave */ {M_NMSTART, 163, 201}, +/* 202: o grave */ {M_NMSTART, 232, 202}, +/* 203: u grave */ {M_NMSTART, 173, 203}, +/* 204: a dieresis */ {M_NMSTART, 216, 204}, +/* 205: e dieresis */ {M_NMSTART, 165, 205}, +/* 206: o dieresis */ {M_NMSTART, 218, 206}, +/* 207: u dieresis */ {M_NMSTART, 219, 207}, +/* 208: A angstrom */ {M_NMSTART, 208, 212}, +/* 209: i circumflex */ {M_NMSTART, 166, 209}, +/* 210: O slash */ {M_NMSTART, 210, 214}, +/* 211: AE ligature */ {M_NMSTART, 211, 215}, +/* 212: a angstrom */ {M_NMSTART, 208, 212}, +/* 213: i acute */ {M_NMSTART, 229, 213}, +/* 214: o slash */ {M_NMSTART, 210, 214}, +/* 215: ae ligature */ {M_NMSTART, 211, 215}, +/* 216: A dieresis */ {M_NMSTART, 216, 204}, +/* 217: i grave */ {M_NMSTART, 230, 217}, +/* 218: O dieresis */ {M_NMSTART, 218, 206}, +/* 219: U dieresis */ {M_NMSTART, 219, 207}, +/* 220: E acute */ {M_NMSTART, 220, 197}, +/* 221: i dieresis */ {M_NMSTART, 167, 221}, +/* 222: SS ligature */ {M_NMSTART, 222, 222}, +/* 223: O circumflex */ {M_NMSTART, 223, 194}, +/* 224: A acute */ {M_NMSTART, 224, 196}, +/* 225: A tilde */ {M_NMSTART, 225, 226}, +/* 226: a tilde */ {M_NMSTART, 225, 226}, +/* 227: Eth (invalid) */ {M_NMSTART, 227, 228}, +/* 228: eth (invalid) */ {M_NMSTART, 227, 228}, +/* 229: I acute */ {M_NMSTART, 229, 213}, +/* 230: I grave */ {M_NMSTART, 230, 217}, +/* 231: O acute */ {M_NMSTART, 231, 198}, +/* 232: O grave */ {M_NMSTART, 232, 202}, +/* 233: O tilde */ {M_NMSTART, 233, 234}, +/* 234: o tilde */ {M_NMSTART, 233, 234}, +/* 235: S caron */ {M_NMSTART, 235, 236}, +/* 236: s caron */ {M_NMSTART, 235, 236}, +/* 237: U acute */ {M_NMSTART, 237, 199}, +/* 238: Y dieresis */ {M_NMSTART, 238, 239}, +/* 239: y dieresis */ {M_NMSTART, 238, 239}, +/* 240: Thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 241: thorn (invalid) */ {M_NMSTART, 240, 241}, +/* 242: undefined */ {M_NONNAME, 242, 242}, +/* 243: mu (invalid) */ {M_NONNAME, 243, 243}, +/* 244: paragraph sign (invalid) */ {M_NONNAME, 244, 244}, +/* 245: fraction 3/4 (invalid) */ {M_NONNAME, 245, 245}, +/* 246: long dash (invalid) */ {M_NONNAME, 246, 246}, +/* 247: fraction 1/4 (invalid) */ {M_NONNAME, 247, 247}, +/* 248: fraction 1/2 (invalid) */ {M_NONNAME, 248, 248}, +/* 249: Female ordinal (invalid) */ {M_NONNAME, 249, 249}, +/* 250: Male ordinal (invalid) */ {M_NONNAME, 250, 250}, +/* 251: French double open quote(invalid) */ {M_NONNAME, 251, 251}, +/* 252: Solid square (invalid) */ {M_NONNAME, 252, 252}, +/* 253: French double close quote(invalid) */ {M_NONNAME, 253, 253}, +/* 254: Plus over minus sign(invalid)*/ {M_NONNAME, 254, 254}, +/* 255: undefined */ {M_NONNAME, 255, 255}, } ; diff --git a/cde/programs/dthelp/parser/pass2/util/cont.h b/cde/programs/dthelp/parser/pass2/util/cont.h index ac6cc656..cc1fd941 100644 --- a/cde/programs/dthelp/parser/pass2/util/cont.h +++ b/cde/programs/dthelp/parser/pass2/util/cont.h @@ -127,7 +127,7 @@ int m_lower( #endif ) ; -void main( +int main( #if defined(M_PROTO) int argc, char **argv #endif diff --git a/cde/programs/dthelp/parser/pass2/util/context.c b/cde/programs/dthelp/parser/pass2/util/context.c index a59f93be..bb0224f7 100644 --- a/cde/programs/dthelp/parser/pass2/util/context.c +++ b/cde/programs/dthelp/parser/pass2/util/context.c @@ -169,7 +169,7 @@ delim.h. #include "cont.h" /* Main procedure */ -void main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { diff --git a/cde/programs/dthelp/parser/pass2/util/conutil.c b/cde/programs/dthelp/parser/pass2/util/conutil.c index 9a8a6f9f..faaa908e 100644 --- a/cde/programs/dthelp/parser/pass2/util/conutil.c +++ b/cde/programs/dthelp/parser/pass2/util/conutil.c @@ -127,11 +127,13 @@ M_WCHAR wlb = 0, wcm, wnl, wsl, wst; if (!wlb) { - mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ - mbtowc(&wcm, ",", 1); - mbtowc(&wnl, "\n", 1); - mbtowc(&wsl, "/", 1); - mbtowc(&wst, "*", 1); + int + ret = mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ + ret = mbtowc(&wcm, ",", 1); + ret = mbtowc(&wnl, "\n", 1); + ret = mbtowc(&wsl, "/", 1); + ret = mbtowc(&wst, "*", 1); + (void) ret; } while (m_whitespace((M_WCHAR) (c = readchar(FALSE)))); @@ -226,7 +228,8 @@ M_WCHAR wcl; char unexp[32]; /* arbitraily large */ int length; -mbtowc(&wcl, ":", 1); +int ret = mbtowc(&wcl, ":", 1); +(void) ret; while (TRUE) { @@ -252,9 +255,11 @@ char *mb_name; if (!wsm) { - mbtowc(&wsm, ";", 1); - mbtowc(&wcl, ":", 1); - mbtowc(&wcm, ",", 1); + int + ret = mbtowc(&wsm, ";", 1); + ret = mbtowc(&wcl, ":", 1); + ret = mbtowc(&wcm, ",", 1); + (void) ret; } while (TRUE) @@ -333,7 +338,7 @@ c = readchar(TRUE)) *p++ = (M_WCHAR) c; } *p = M_EOS; -if (dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie)) +if ((dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie))) { withdelim = TRUE; curdelim = dstruct->count - 1; @@ -451,7 +456,8 @@ int i; M_WCHAR wnl; char *mb_dname, *mb_dstring; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; loading = TRUE; while ((c = getc(ddat)) != EOF) @@ -526,13 +532,13 @@ while ((c = getc(ddat)) != EOF) fprintf(delim, "M_DELIMEXTERN char %s[%d] M_DELIMINIT(\"", mb_dname, - strlen(mb_dstring) + 1); + (int)strlen(mb_dstring) + 1); for (p = dstring ; *p ; p++) { char *pc; char mb_p[32]; /* arbitrarily large */ - int length, i; + int length; length = wctomb(mb_p, *p); mb_p[length] = 0; @@ -629,7 +635,7 @@ void prtctxt(column, value) if (! first) fprintf(delim, ",\n"); first = FALSE; - fprintf(delim, " %d, %d", column, value); + fprintf(delim, " {%d, %d}", column, value); nonzero++; } @@ -645,7 +651,8 @@ int readchar(cap) int c; M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; c = mb_getwc(cdat); /* use mb_getwc so we read multi-byte chars */ if (cap && c != EOF) c = m_upper(c); @@ -667,7 +674,8 @@ int c; { M_WCHAR wnl; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; ungetc(c, cdat); if (c == wnl) m_line--; diff --git a/cde/programs/dthelp/parser/pass2/util/entout.c b/cde/programs/dthelp/parser/pass2/util/entout.c index 5cd465c0..3f3420b7 100644 --- a/cde/programs/dthelp/parser/pass2/util/entout.c +++ b/cde/programs/dthelp/parser/pass2/util/entout.c @@ -72,8 +72,8 @@ void entout(fname) int nameindex ; LOGICAL start ; - strcpy(efilename, fname) ; - strcpy(&efilename[strlen(efilename)], ".h") ; + strncpy(efilename, fname, ENTFILENAME) ; + strncpy(&efilename[strlen(efilename)], ".h", 2) ; m_openchk(&entfile, efilename, "w") ; fprintf(entfile, "#include \"entdef.h\"\n") ; @@ -101,7 +101,7 @@ void entout(fname) if (start) fputs(",\n", entfile) ; start = TRUE ; for (p = ent->content ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; fputs(" 0", entfile) ; } fprintf(entfile, "}\n#endif\n") ; @@ -112,7 +112,7 @@ void entout(fname) fputs("#if defined(M_ENTDEF)\n = {\n", entfile) ; for (ent = firstent ; ent ; ent = ent->next) { for (p = ent->name ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; + fprintf(entfile, " %d,\n", (int)*p) ; if (ent != lastent) fputs(" 0,\n", entfile) ; else fputs(" 0\n", entfile) ; } @@ -130,7 +130,7 @@ void entout(fname) fprintf(entfile, "#if defined(M_ENTDEF)\n = {\n") ; for (ent = firstent, conindex = 0, nameindex = 0 ; ent ; ent = ent->next) { - fprintf(entfile, " %s, %s, ", + fprintf(entfile, " {%s, %s, ", typetype(ent->type), typewhere(ent->wheredef)) ; if (ent->content) { @@ -143,10 +143,10 @@ void entout(fname) #if defined(BUILDEXTERN) fprintf(entfile, ", %d", ent->index) ; if (ent != lastent) - fprintf(entfile, ", &m_entities[%d], 0", ent->index) ; - else fputs(", NULL, 0", entfile) ; + fprintf(entfile, ", &m_entities[%d], 0}", ent->index) ; + else fputs(", NULL, 0}", entfile) ; #else - fprintf(entfile, ", %d", ent->codeindex) ; + fprintf(entfile, ", %d}", ent->codeindex) ; #endif if (ent != lastent) fprintf(entfile, ", \n") ; else fprintf(entfile, "}\n#endif\n") ; @@ -159,7 +159,7 @@ void entout(fname) "M_ENTEXTERN M_TRIE m_enttrie[%d]\n", count) ; if (m_enttrie->data) { count = 0 ; - fputs("#if defined(M_ENTDEF)\n = {\n 0, NULL, &m_enttrie[1]", entfile) ; + fputs("#if defined(M_ENTDEF)\n = {\n {0, NULL, &m_enttrie[1]}", entfile) ; m_dumptrie(entfile, m_enttrie->data, "m_enttrie", &count, entptr) ; fprintf(entfile, "}\n#endif\n") ; } @@ -225,6 +225,7 @@ char *typewhere(n) case M_DELTDEF: return(xdeltdef) ; case FALSE: return("0") ; } + return("0"); } diff --git a/cde/programs/dthelp/parser/pass2/util/error.c b/cde/programs/dthelp/parser/pass2/util/error.c index dff085fa..136f4740 100644 --- a/cde/programs/dthelp/parser/pass2/util/error.c +++ b/cde/programs/dthelp/parser/pass2/util/error.c @@ -306,8 +306,8 @@ void esuffix(M_NOPAR) void msgline(text) char *text ; { - fprintf(stderr, text) ; - fprintf(m_errfile, text) ; + fprintf(stderr, "%s", text) ; + fprintf(m_errfile, "%s", text) ; } /* Print something to both stderr and m_errfile */ diff --git a/cde/programs/dthelp/parser/pass2/util/fclndir.c b/cde/programs/dthelp/parser/pass2/util/fclndir.c index fd715f56..92ea423f 100644 --- a/cde/programs/dthelp/parser/pass2/util/fclndir.c +++ b/cde/programs/dthelp/parser/pass2/util/fclndir.c @@ -130,17 +130,19 @@ void copyfile(pfile1,pfile2) { int ret; char *pcmd; + int slen; /* malloc space for the system command: two filenames, plus a command, spaces, and the terminating null */ - pcmd = (char *) malloc(strlen(pfile1) + strlen(pfile2) + 8); + slen = strlen(pfile1) + strlen(pfile2) + 8; + pcmd = (char *) malloc(slen); #if defined(MSDOS) - ret = sprintf(pcmd,"copy %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "copy %s %s",pfile1,pfile2); #else - ret = sprintf(pcmd,"cp %s %s",pfile1,pfile2); + ret = snprintf(pcmd, slen, "cp %s %s",pfile1,pfile2); #endif ret = system(pcmd); - ret = sprintf(pcmd,"touch %s",pfile2); + ret = snprintf(pcmd, slen, "touch %s",pfile2); ret = system(pcmd); } diff --git a/cde/programs/dthelp/parser/pass2/util/malloc.c b/cde/programs/dthelp/parser/pass2/util/malloc.c index a7be1550..7898856c 100644 --- a/cde/programs/dthelp/parser/pass2/util/malloc.c +++ b/cde/programs/dthelp/parser/pass2/util/malloc.c @@ -96,11 +96,11 @@ void m_free(block, msg) free(block) ; if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) block >> 16), (unsigned int) block, msg) ; #else - sprintf(buffer, " %9p", block, msg) ; + snprintf(buffer, 32, " %9p", block) ; #endif m_trace(buffer) ; m_trace("- Freed ") ; @@ -171,14 +171,14 @@ void *m_malloc(size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; @@ -212,14 +212,14 @@ void *m_realloc(ptr, size, msg) } if (m_malftrace) { #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) - sprintf(buffer, "%5x:%5x", + snprintf(buffer, 32, "%5x:%5x", (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; #else - sprintf(buffer, " %9p", p) ; + snprintf(buffer, 32, " %9p", p) ; #endif m_trace(buffer) ; m_trace("- Re-allocated ") ; - sprintf(buffer, "%6d", size) ; + snprintf(buffer, 32, "%6d", size) ; m_trace(buffer) ; m_trace(" bytes for ") ; m_trace(msg) ; diff --git a/cde/programs/dthelp/parser/pass2/util/scanutil.c b/cde/programs/dthelp/parser/pass2/util/scanutil.c index 1a048d76..42f14857 100644 --- a/cde/programs/dthelp/parser/pass2/util/scanutil.c +++ b/cde/programs/dthelp/parser/pass2/util/scanutil.c @@ -33,7 +33,7 @@ int getachar(M_NOPAR) int c; M_WCHAR wc,wnl; char mbyte[32]; /* bigger than any possible multibyte char */ -int length; +int length, ret; if (toundo) wc = (M_WCHAR) savechar[--toundo]; else @@ -58,10 +58,11 @@ else return(EOF); } } - mbtowc(&wc,mbyte,length); + ret = mbtowc(&wc,mbyte,length); } -mbtowc(&wnl, "\n", 1); +ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (wc == wnl) m_line++; if (wc == 65535) @@ -246,7 +247,8 @@ if (toundo >= SAVECHAR) savechar[toundo++] = c; if (toundo > maxundo) maxundo = toundo; -mbtowc(&wnl, "\n", 1); +int ret = mbtowc(&wnl, "\n", 1); +(void) ret; if (c == wnl) m_line--; } diff --git a/cde/programs/dthelp/parser/pass2/util/trie.c b/cde/programs/dthelp/parser/pass2/util/trie.c index 5cb2f901..ac1fd101 100644 --- a/cde/programs/dthelp/parser/pass2/util/trie.c +++ b/cde/programs/dthelp/parser/pass2/util/trie.c @@ -149,7 +149,7 @@ void *m_ntrtrie(p, xtrie, dataval) M_TRIE *currentnode ; void *n ; - if (n = m_lookfortrie(p, xtrie)) return(n) ; + if ((n = m_lookfortrie(p, xtrie))) return(n) ; currentnode = xtrie ; for ( ; *p ; p++) m_entercharintrie(¤tnode, m_ctupper(*p)) ; diff --git a/cde/programs/dthelp/parser/pass2/util/triecnt.c b/cde/programs/dthelp/parser/pass2/util/triecnt.c index 32989102..cd17e2da 100644 --- a/cde/programs/dthelp/parser/pass2/util/triecnt.c +++ b/cde/programs/dthelp/parser/pass2/util/triecnt.c @@ -88,12 +88,12 @@ void dumpnode(first, file, trieptr, count, proc) /* generate a child */ if (*first) *first = FALSE ; else fprintf(file, ",\n") ; - fprintf(file, " ") ; + fprintf(file, " {") ; if (p->next) fprintf(file, "TRUE, ") ; else fprintf(file, "FALSE, ") ; - fprintf(file, "%d", p->symbol) ; - if (p->symbol) fprintf(file, ", %d", *count) ; - else (*proc)(file, p->data) ; + fprintf(file, "%d", (int)p->symbol) ; + if (p->symbol) fprintf(file, ", %d}", *count) ; + else { (*proc)(file, p->data) ; fprintf(file, "}") ; } /* count the children of the child*/ if (p->symbol) countdown(p, count) ; @@ -110,5 +110,5 @@ void printval(file, value) FILE *file ; void *value ; { - fprintf(file, ", %d", (int) value) ; + fprintf(file, ", %ld", (long) value) ; } diff --git a/cde/programs/dthelp/parser/pass2/util/triedump.c b/cde/programs/dthelp/parser/pass2/util/triedump.c index 1edfe189..98978b7a 100644 --- a/cde/programs/dthelp/parser/pass2/util/triedump.c +++ b/cde/programs/dthelp/parser/pass2/util/triedump.c @@ -62,14 +62,14 @@ void m_dumptrie(file, xtrie, extname, count, proc) for (p = xtrie ; p ; p = p->next) { (*count)++ ; - fprintf(file, ",\n %d, ", p-> symbol) ; + fprintf(file, ",\n {%d, ", (int)p-> symbol) ; if (p->next) fprintf(file, "&%s[%d], ", extname, *count + 1) ; else fputs("NULL, ", file) ; if (p->symbol) { - fprintf(file, "&%s[%d]", extname, firstson) ; + fprintf(file, "&%s[%d]}", extname, firstson) ; countdown(p, &firstson) ; } - else (*proc) (p->data) ; + else { (*proc) (p->data) ; fprintf(file, "}") ; } } for (p = xtrie ; p ; p = p->next) diff --git a/cde/programs/dthelp/parser/pass2/util/wchar.c b/cde/programs/dthelp/parser/pass2/util/wchar.c index 33d4648d..f8dd0df3 100644 --- a/cde/programs/dthelp/parser/pass2/util/wchar.c +++ b/cde/programs/dthelp/parser/pass2/util/wchar.c @@ -103,7 +103,7 @@ M_WCHAR *string1start; string1start = string1; -while (*string1++ = *string2++); +while ((*string1++ = *string2++)); return string1start; } @@ -236,7 +236,7 @@ length = (length + sizeof(M_WCHAR) - 1) / sizeof(M_WCHAR); mb_string = (char *) m_malloc(length, "multi-byte string"); length = 0; -while (wc = *wc_string++) +while ((wc = *wc_string++)) { if ((retVal = wctomb(&mb_string[length], wc)) > 0) length += retVal; @@ -257,7 +257,6 @@ char *mb_string; { M_WCHAR *wc_string, *wc_stringStart; int length, incr; -char c; if (!mb_string) mb_string = ""; @@ -275,8 +274,9 @@ while (mb_string[length]) badOne[0] = mb_string[length]; badOne[1] = 0; - sprintf(buffer, "0x%x", mb_string[length]); - m_err2("invalid multibyte character found: '%c' (%s)", badOne, buffer); + snprintf(buffer, 32, "0x%x", mb_string[length]); + m_err2("invalid multibyte character found: '%c' (%s)", + (M_WCHAR *)badOne, (M_WCHAR *)buffer); incr = 1; } length += incr; @@ -294,7 +294,6 @@ void *m_ptr; { int c; M_WCHAR wc; -char badch[2]; char mbyte[32]; /* make this bigger than any possible multi-byte char */ int length; @@ -319,7 +318,8 @@ while (1) return(EOF); } } -mbtowc(&wc,mbyte,length); +int ret = mbtowc(&wc,mbyte,length); +(void) ret; return((int) wc); } diff --git a/cde/programs/dtinfo/DtMmdb/Imakefile b/cde/programs/dtinfo/DtMmdb/Imakefile index bab0bf03..8bae5433 100644 --- a/cde/programs/dtinfo/DtMmdb/Imakefile +++ b/cde/programs/dtinfo/DtMmdb/Imakefile @@ -231,5 +231,3 @@ DYNAMIC = XCOMM Variables to switch on debug mode temporarily XCOMM CDEBUGFLAGS = -g -DDEBUG XCOMM CXXDEBUGFLAGS = -g -DDEBUG - -DependTarget() diff --git a/cde/programs/dtinfo/DtMmdb/btree_berkeley/bt_split.c b/cde/programs/dtinfo/DtMmdb/btree_berkeley/bt_split.c index ae6a3452..373e6ad7 100644 --- a/cde/programs/dtinfo/DtMmdb/btree_berkeley/bt_split.c +++ b/cde/programs/dtinfo/DtMmdb/btree_berkeley/bt_split.c @@ -270,7 +270,7 @@ __bt_split(t, sp, key, data, flags, ilen, skip) rchild->pgno, bl->flags & P_BIGKEY); memmove(dest, bl->bytes, nksize ? nksize : bl->ksize); if (bl->flags & P_BIGKEY && - bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) + bt_preserve(t, *(char *)bl->bytes) == RET_ERROR) goto err1; break; case P_RINTERNAL: @@ -590,7 +590,7 @@ bt_broot(t, h, l, r) * so it isn't deleted when the leaf copy of the key is deleted. */ if (bl->flags & P_BIGKEY && - bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) + bt_preserve(t, *(char *)bl->bytes) == RET_ERROR) return (RET_ERROR); break; case P_BINTERNAL: diff --git a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.c b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.c index 6bac74f1..5429af3f 100644 --- a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.c +++ b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.c @@ -114,8 +114,8 @@ mpool_open(key, fd, pagesize, maxcache) if ((mp = malloc(sizeof(MPOOL))) == NULL) return (NULL); - mp->free.cnext = mp->free.cprev = (BKT *)&mp->free; - mp->lru.cnext = mp->lru.cprev = (BKT *)&mp->lru; + mp->free.cnext = mp->free.cprev = (BKT *)(void *)&mp->free; + mp->lru.cnext = mp->lru.cprev = (BKT *)(void *)&mp->lru; for (entry = 0; entry < HASHSIZE; ++entry) mp->hashtable[entry].hnext = mp->hashtable[entry].hprev = mp->hashtable[entry].cnext = mp->hashtable[entry].cprev = @@ -322,7 +322,7 @@ mpool_close(mp) BKT *b, *next; /* Free up any space allocated to the lru pages. */ - for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = next) { + for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = next) { next = b->cprev; free(b); } @@ -345,7 +345,7 @@ mpool_sync(mp) { BKT *b; - for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev) + for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = b->cprev) if (b->flags & MPOOL_DIRTY && mpool_write(mp, b) == RET_ERROR) return (RET_ERROR); return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS); @@ -375,7 +375,7 @@ mpool_bkt(mp) * any lists. If we don't find anything we grow the cache anyway. * The cache never shrinks. */ - for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev) + for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = b->cprev) if (!(b->flags & MPOOL_PINNED)) { if (b->flags & MPOOL_DIRTY && mpool_write(mp, b) == RET_ERROR) diff --git a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.h b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.h index b1185b8c..e21ded25 100644 --- a/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.h +++ b/cde/programs/dtinfo/DtMmdb/btree_berkeley/mpool.h @@ -137,7 +137,7 @@ typedef struct MPOOL { } #define inschain(bp, dp) { \ (bp)->cnext = (dp)->cnext; \ - (bp)->cprev = (struct BKT *)(dp); \ + (bp)->cprev = (struct BKT *)(void *)(dp); \ (dp)->cnext->cprev = (bp); \ (dp)->cnext = (bp); \ } diff --git a/cde/programs/dtinfo/DtMmdb/dynhash/data_t.C b/cde/programs/dtinfo/DtMmdb/dynhash/data_t.C index 125b5825..6957ac1f 100644 --- a/cde/programs/dtinfo/DtMmdb/dynhash/data_t.C +++ b/cde/programs/dtinfo/DtMmdb/dynhash/data_t.C @@ -277,7 +277,7 @@ Boolean data_t::binaryIn(buffer& buf) break; } - buf.get(*(long*)&dt); + buf.get(*(char*)&dt); return true; } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C index 84cd2f5b..5676eea7 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C @@ -475,7 +475,7 @@ IcccmAgent::convert_handler(Widget w, Atom selection, Atom target, unsigned long xmu_length; XmuConvertStandardSelection(w, req->time, &selection, &target, &type_return, - (caddr_t*)&xmu_targets, &xmu_length, + (caddr_t*)(void*)&xmu_targets, &xmu_length, &format_return); assert( type_return == XA_ATOM ); assert( format_return == sizeof(Atom) * 8 ); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C index 1bb1371b..e114dc09 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C @@ -3041,7 +3041,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) { char *name; _DtCanvasGetSelection(f_help_dsp_area->canvas, - _DtCvSELECTED_TEXT, ((_DtCvPointer *)&name)); + _DtCvSELECTED_TEXT, ((_DtCvPointer *)(void*)&name)); #ifdef BOOKMARK_DEBUG cerr << "Bookmark Name: [" << name << "]" << endl; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C index 7cc27d7d..c12aa51a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C @@ -850,7 +850,7 @@ locale_of_desktop() 1L, 1L, False, _DT_SM_WINDOW_INFO, &type, &format, &nitems, &after, - (unsigned char **)&sm_prop_window) ; + (unsigned char **)(void*)&sm_prop_window) ; #ifdef DEBUG // property.smWindow = (unsigned long) smGD.topLevelWindow; @@ -870,7 +870,7 @@ locale_of_desktop() 0L, (long)8, False, XA_STRING, &type, &format, &nitems, &after, - (unsigned char **)&dt_locale) ; + (unsigned char **)(void*)&dt_locale) ; #ifdef DEBUG printf( "desktop's locale is %s\n", dt_locale ) ; diff --git a/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile b/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile index 4ee78585..ff396985 100644 --- a/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile @@ -45,29 +45,30 @@ EXTRA_INCLUDES=-I/X11/include OBJS1= cgmcmds.o \ cgmcommon.o \ cgmio.o \ - cgmtext.o \ - getcgm.o + cgmtext.o SRCS1= cgmcmds.c \ cgmcommon.c \ cgmio.c \ - cgmtext.c \ - getcgm.c + cgmtext.c + +SRCS2= getcgm.c +OBJS2= getcgm.o NormalCplusplusObjectRule() NormalLibraryObjectRule() -NormalLibraryTarget(cgm, $(OBJS1)) +NormalLibraryTarget2(cgm, $(OBJS1), $(OBJS2)) AllTarget($(PROGRAMS)) -SRCS2 = testcgm.c -OBJS2 = testcgm.o +SRCS3 = testcgm.c +OBJS3 = testcgm.o -ComplexProgramTarget_2($(PROGRAMS),$(LOCAL_LIBRARIES),$(SYS_LIBRARIES)) +ComplexProgramTarget_3($(PROGRAMS),$(LOCAL_LIBRARIES),$(SYS_LIBRARIES)) -DependTarget3($(SRCS1),$(SRCS2),NullParameter) +DependTarget3($(SRCS1),$(SRCS2),$(SRCS3)) clean:: RemoveFiles($(PROGRAMS)) diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/GraphicsTask.C b/cde/programs/dtinfo/dtinfogen/infolib/etc/GraphicsTask.C index 1cf78def..8a19f62e 100644 --- a/cde/programs/dtinfo/dtinfogen/infolib/etc/GraphicsTask.C +++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/GraphicsTask.C @@ -56,7 +56,11 @@ extern void get_type (); const int GR_ENCODING_TEXT = 1; //------------------------------------------------------------------------- +#if __GNUC__ == 4 && __GNUC_MINOR__ == 4 +GR_TYPE __attribute__((optimize("O0"))) +#else GR_TYPE +#endif GraphicsTask::graphics_type( const char *gname ) { @@ -90,7 +94,7 @@ GraphicsTask::graphics_type( const char *gname ) form("cannot reopen graphics file %s\n", gname))); } - hdrptr = (XWDFileHeader *)header; + hdrptr = (XWDFileHeader *)(void*)header; // Initialize the structure for (CARD32 ndx = 0; ndx < sz_XWDheader; ndx++) { header[ndx] = (CARD32) 0; diff --git a/cde/programs/dtinfo/mmdb/Imakefile b/cde/programs/dtinfo/mmdb/Imakefile index cb51595f..235fb7a1 100644 --- a/cde/programs/dtinfo/mmdb/Imakefile +++ b/cde/programs/dtinfo/mmdb/Imakefile @@ -251,5 +251,3 @@ clean:: $(RM) libMMDBTemplates.a ptclean #endif - -DependTarget() diff --git a/cde/programs/dtinfo/tools/misc/dfiles.c b/cde/programs/dtinfo/tools/misc/dfiles.c index 0c6cf071..507b8eed 100644 --- a/cde/programs/dtinfo/tools/misc/dfiles.c +++ b/cde/programs/dtinfo/tools/misc/dfiles.c @@ -24,7 +24,7 @@ #include #include -main(argc, argv) +int main(argc, argv) int argc ; char **argv; { diff --git a/cde/programs/dtinfo/tools/misc/msgsets.C b/cde/programs/dtinfo/tools/misc/msgsets.C index 669484f1..7b1418e4 100644 --- a/cde/programs/dtinfo/tools/misc/msgsets.C +++ b/cde/programs/dtinfo/tools/misc/msgsets.C @@ -400,7 +400,9 @@ static int yy_did_buffer_switch_on_eof; static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); +#if 0 static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr )); +#endif void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); @@ -410,11 +412,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 { @@ -876,7 +880,7 @@ register yy_state_type yy_current_state; return ( yy_is_jam ? 0 : yy_current_state ); } - +#if 0 #ifdef YY_USE_PROTOS static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp ) #else @@ -920,8 +924,10 @@ register YY_CHAR *yy_bp; */ YY_DO_BEFORE_ACTION; /* set up yytext again */ } +#endif +#if 0 #ifdef __cplusplus static int yyinput() #else @@ -988,6 +994,7 @@ static int input() return ( c ); } +#endif #ifdef YY_USE_PROTOS diff --git a/cde/programs/dtinfo/tools/misc/pmaker.c b/cde/programs/dtinfo/tools/misc/pmaker.c index 293db2e7..b1ac1f0c 100644 --- a/cde/programs/dtinfo/tools/misc/pmaker.c +++ b/cde/programs/dtinfo/tools/misc/pmaker.c @@ -24,7 +24,7 @@ #include #include -main(argc, argv) +int main(argc, argv) int argc ; char **argv ; { diff --git a/cde/programs/dtksh/MakeClean b/cde/programs/dtksh/MakeClean index e41abd2c..22929970 100755 --- a/cde/programs/dtksh/MakeClean +++ b/cde/programs/dtksh/MakeClean @@ -70,6 +70,8 @@ rm -f ksh93/ship/shipslog/!t_gryphon_gsf echo "rm ksh93/src/cmd/ksh93/FEATURE/*" rm -f ksh93/src/cmd/ksh93/FEATURE/* +echo "mkdir ksh93/src/cmd/ksh93/FEATURE" +mkdir -p ksh93/src/cmd/ksh93/FEATURE echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/options" cp /dev/null ksh93/src/cmd/ksh93/FEATURE/options echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/setjmp" @@ -79,6 +81,25 @@ cp /dev/null ksh93/src/cmd/ksh93/FEATURE/sigfeatures echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/dynamic" cp /dev/null ksh93/src/cmd/ksh93/FEATURE/dynamic +echo "mkdir ksh93/include/ast" +mkdir -p ksh93/include/ast +echo "cp /dev/null ksh93/include/ast/ast.h" +cp /dev/null ksh93/include/ast/ast.h +echo "cp /dev/null ksh93/include/ast/cmd.h" +cp /dev/null ksh93/include/ast/cmd.h +echo "cp /dev/null ksh93/include/ast/error.h" +cp /dev/null ksh93/include/ast/error.h +echo "cp /dev/null ksh93/include/ast/hash.h" +cp /dev/null ksh93/include/ast/hash.h +echo "cp /dev/null ksh93/include/ast/option.h" +cp /dev/null ksh93/include/ast/option.h +echo "cp /dev/null ksh93/include/ast/sfio.h" +cp /dev/null ksh93/include/ast/sfio.h +echo "cp /dev/null ksh93/include/ast/sig.h" +cp /dev/null ksh93/include/ast/sig.h +echo "cp /dev/null ksh93/include/ast/stak.h" +cp /dev/null ksh93/include/ast/stak.h + echo "rm ksh93/src/cmd/pax/FEATURE/*" rm -f ksh93/src/cmd/pax/FEATURE/* diff --git a/cde/programs/localized/templates/header2.tmpl b/cde/programs/localized/templates/header2.tmpl index 0dbdf20e..9128f8f6 100644 --- a/cde/programs/localized/templates/header2.tmpl +++ b/cde/programs/localized/templates/header2.tmpl @@ -91,5 +91,3 @@ includes:: @@\ MAKEMESSCAT = $(KORNSHELL) $(CDESRC)/localized/util/makeMessCat SYM2NUM_CMD = $(KORNSHELL) $(CDESRC)/dtprintinfo/sym2num - -MsgCatRule() diff --git a/cde/programs/localized/templates/msg.C.tmpl b/cde/programs/localized/templates/msg.C.tmpl index cea9b183..453cf195 100644 --- a/cde/programs/localized/templates/msg.C.tmpl +++ b/cde/programs/localized/templates/msg.C.tmpl @@ -113,6 +113,8 @@ LinkFile(libAButil.msg,$(CDESRC)/dtappbuilder/src/libAButil/libAButil.msg) LinkFile(libdtcm.msg,$(CDESRC)/dtcm/libDtCmP/libdtcm.msg) LinkFile(libDtMail.msg,$(CDESRC)/dtmail/libDtMail/Common/libDtMail.msg) +MsgCatRule() + clean:: for i in *.msg; do \ [ -z $$i ] && continue; \ diff --git a/cde/programs/nsgmls/Imakefile b/cde/programs/nsgmls/Imakefile index ac90c078..206d546e 100644 --- a/cde/programs/nsgmls/Imakefile +++ b/cde/programs/nsgmls/Imakefile @@ -447,6 +447,8 @@ SpecialCplusplusObjectRule(nsgmls_inst,nsgmls_inst,$(CXXTEMPLATEFLAGS)) SpecialCplusplusObjectRule(parser_inst,parser_inst,$(CXXTEMPLATEFLAGS)) SpecialCplusplusObjectRule(xentmgr_inst,xentmgr_inst,$(CXXTEMPLATEFLAGS)) +includes:: $(GENERATED_SRCS) + NormalCplusplusObjectRule() ComplexCplusplusProgramTarget($(PROGRAMS)) diff --git a/cde/programs/ttsnoop/Imakefile b/cde/programs/ttsnoop/Imakefile index 16fe4b47..b95c7e04 100644 --- a/cde/programs/ttsnoop/Imakefile +++ b/cde/programs/ttsnoop/Imakefile @@ -11,6 +11,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB) DEPLIBS = $(DEPDTTERMLIB) DepDtClientLibs $(DEPUTILLIB) LOCAL_LIBRARIES = $(DTTERMLIB) DtClientLibs $(UTILLIB) SYS_LIBRARIES = DtClientSysLibs DtClientExtraLibs +DTCODEGENCAT = NLSPATH=$(CDESRC)/dtappbuilder/src/abmf/dtcodegen.cat XCOMM ########################################################################## @@ -57,11 +58,11 @@ TARGETS.C.merged = \ ttChooser_stubs.C ttsnoop.C \ ttsnoop_stubs.C -SRCS.h = $(TARGETS.h.merged) $(TARGETS.h) tt_c++.h DtTt.h +SRCS2.h = $(TARGETS.h.merged) $(TARGETS.h) tt_c++.h DtTt.h -SRCS = $(TARGETS.C.merged) $(TARGETS.c) tt_c++.C DtTt.C +SRCS2 = $(TARGETS.C.merged) $(TARGETS.c) tt_c++.C DtTt.C -OBJS = \ +OBJS2 = \ DtTt.o apiTracer_stubs.o \ apiTracer_ui.o argChooser_stubs.o \ argChooser_ui.o callbackChooser_stubs.o \ @@ -75,6 +76,17 @@ OBJS = \ tt_c++.o ttsnoop.o \ ttsnoop_stubs.o ttsnoop_ui.o +AB_MAKEFILES = \ + Makefile.aix \ + Makefile.hpux \ + Makefile.sunos \ + Makefile.osf1 \ + Makefile.uxp \ + Makefile.unixware \ + Makefile.linux \ + Makefile.freebsd \ + Makefile.netbsd \ + Makefile.openbsd XCOMM ### XCOMM ### This is basically a kludge since dtappbuilder is not being @@ -85,7 +97,7 @@ XCOMM ### includes:: $(TARGETS.h) $(TARGETS.c) XCOMM ### localincludes:: $(TARGETS.h) $(TARGETS.c) XCOMM ### -all:: targets +all:: targets ttdepend targets:: $(TARGETS.h) $(TARGETS.c) @@ -99,7 +111,17 @@ depend:: NormalCplusplusObjectRule() -ComplexCplusplusProgramTarget($(PROGRAMS)) +all:: $(PROGRAMS) + +ComplexCplusplusProgramTarget_2($(PROGRAMS),$(LOCAL_LIBRARIES),) + +ttdepend:: DependFileName + +DependFileName:: + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS2)) > $@ + +clean:: + RemoveFile(ProgramTargetName(PROGRAMS)) XCOMM ##################################################################### @@ -198,11 +220,11 @@ CodeGenTarget(argChooser) CodeGenTarget(callbackChooser) CLEAN_FILES = core .dtcodegen.log *.BAK *.delta *.patched \ - $(PROGRAMS) $(OBJS) $(TARGETS.c) $(TARGETS.h) \ + $(PROGRAMS) $(OBJS2) $(TARGETS.c) $(TARGETS.h) \ $(TARGETS.c.temp) $(TARGETS.C.merged) Ttsnoop clean:: - $(RM) $(CLEAN_FILES) + $(RM) $(CLEAN_FILES) $(AB_MAKEFILES) scour: $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) Makefile Makefile.aix Makefile.hpux Makefile.sunos -- 2.25.1