From 88fd1492afba7c103e2bedbaac0d69fb9bf3cf66 Mon Sep 17 00:00:00 2001 From: Kevin Rosenberg Date: Mon, 17 Sep 2007 13:59:58 -0600 Subject: [PATCH] Fix C++ warnings, better cleaning in makefiles Sep 17, 2007 Version 4.5.5 * better cleaning in makefiles * use "const char" variables for string literals --- ChangeLog | 4 ++++ Makefile.am | 4 ++++ Makefile.in | 11 ++++++++--- debian/changelog | 8 +++++++- debian/rules | 1 + helical/Makefile.am | 4 +--- helical/Makefile.in | 2 +- include/ezplot.h | 4 ++-- include/pol.h | 6 +++--- libctgraphics/ezset.cpp | 2 +- libctgraphics/pol.cpp | 4 ++-- libctsim/phantom.cpp | 2 +- src/ctsim.xpm | 2 +- src/splash.xpm | 2 +- tools/Makefile.am | 3 +-- tools/Makefile.in | 6 +++--- 16 files changed, 41 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbdd961..50587b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sep 17, 2007 Version 4.5.5 + * better cleaning in makefiles + * use "const char" variables for string literals + Sep 10, 2007 Version 4.5.4 * configure.ac: Fix builds with multiple versions of wx-config -- thanks to Steve White diff --git a/Makefile.am b/Makefile.am index bf03d3d..5be74c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,10 @@ SUBDIRS=man libctsupport libctsim html cgi-bin include $(EXTRA_DIRS1) $(EXTRA_D EXTRA_DIST=acsite.m4 make.bat msvc/ctsim.dsw msvc/ctsimtext/ctsimtext.dsp msvc/libctsim/libctsim.dsp msvc/ctsim/ctsim.dsp +CLEANFILES=docs/html/\* config.status configure.in +clean-local: + rm -rf docs/html + #install-data-hook: # test -d $(datadir) || mkdir -p $(datadir) && chmod 0755 $(datadir) # install -g root -o root -m 0644 docs/ctsim.htb $(datadir) diff --git a/Makefile.in b/Makefile.in index c2edfa8..b10273c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -178,6 +178,8 @@ wxlibs = @wxlibs@ SUBDIRS = man libctsupport libctsim html cgi-bin include $(EXTRA_DIRS1) $(EXTRA_DIRS2) $(EXTRA_DIRS3) tools helical EXTRA_DIST = acsite.m4 make.bat msvc/ctsim.dsw msvc/ctsimtext/ctsimtext.dsp msvc/libctsim/libctsim.dsp msvc/ctsim/ctsim.dsp + +CLEANFILES = docs/html/\* config.status configure.in subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -507,6 +509,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) @@ -516,7 +519,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic mostlyclean-am +clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -564,8 +567,8 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-recursive ctags ctags-recursive dist \ - dist-all dist-gzip distcheck distclean distclean-generic \ + clean-generic clean-local clean-recursive ctags ctags-recursive \ + dist dist-all dist-gzip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am dvi-recursive info \ info-am info-recursive install install-am install-data \ @@ -580,6 +583,8 @@ uninstall-info: uninstall-info-recursive ps-recursive tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-info-recursive uninstall-recursive +clean-local: + rm -rf docs/html #install-data-hook: # test -d $(datadir) || mkdir -p $(datadir) && chmod 0755 $(datadir) diff --git a/debian/changelog b/debian/changelog index dda10e3..f5552bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ +ctsim (4.5.5-1) unstable; urgency=low + + * Better cleaning in makefiles to fix double building (closes:442534) + + -- Kevin M. Rosenberg Mon, 17 Sep 2007 13:11:14 -0600 + ctsim (4.5.4-1) unstable; urgency=low - * New upstrea + * New upstream -- Kevin M. Rosenberg Mon, 10 Sep 2007 02:18:54 -0600 diff --git a/debian/rules b/debian/rules index 164c1eb..7be880d 100755 --- a/debian/rules +++ b/debian/rules @@ -63,6 +63,7 @@ clean: # Ensure up-to-date versions of config.sub and config.guess -test -r /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub config.sub -test -r /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess config.guess + -test -r Makefile && $(MAKE) clean dh_clean install: DH_OPTIONS= diff --git a/helical/Makefile.am b/helical/Makefile.am index 955d29c..608170c 100644 --- a/helical/Makefile.am +++ b/helical/Makefile.am @@ -1,3 +1 @@ -CLEANFILES=\*.pgm \*.if \*~ \*.pj \.*~ \#\*\# \#\*~ - - +CLEANFILES=sample-helical.sh \*.pgm \*.if \*~ \*.pj \.*~ \#\*\# \#\*~ diff --git a/helical/Makefile.in b/helical/Makefile.in index d7d848d..7a351ec 100644 --- a/helical/Makefile.in +++ b/helical/Makefile.in @@ -166,7 +166,7 @@ webenabled = @webenabled@ wxcflags = @wxcflags@ wxconfig = @wxconfig@ wxlibs = @wxlibs@ -CLEANFILES = \*.pgm \*.if \*~ \*.pj \.*~ \#\*\# \#\*~ +CLEANFILES = sample-helical.sh \*.pgm \*.if \*~ \*.pj \.*~ \#\*\# \#\*~ subdir = helical ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/include/ezplot.h b/include/ezplot.h index af9d585..bb29dd2 100644 --- a/include/ezplot.h +++ b/include/ezplot.h @@ -96,7 +96,7 @@ enum { struct KeywordCodeTable { - char* keyword; + const char* keyword; int code; }; @@ -327,7 +327,7 @@ private: bool ezcmd (const char* const comm); bool do_cmd(int lx); - void bad_option(char *opt); + void bad_option(const char *opt); void initPlotSettings(); void initKeywords (); diff --git a/include/pol.h b/include/pol.h index 7b75fda..e492e75 100644 --- a/include/pol.h +++ b/include/pol.h @@ -46,7 +46,7 @@ class POL { void addSkipWord (const char* const w); void addSkipChar (int c); void addKeyword (const char* const str, int code); - bool readWord (char *search, int nlet); + bool readWord (const char *search, int nlet); bool readUserToken (char *str, int *code); bool readString (char *str); bool readInteger (int *n, int typecode, bool boundcode, int bb1, int bb2); @@ -54,7 +54,7 @@ class POL { bool skipTokens (); void reader (); bool readText (char *str, int lim); - void usefile (int source, char *fn); + void usefile (int source, const char *fn); void closefile (); int lookchar (); int inchar (); @@ -146,7 +146,7 @@ private: bool m_bNewlineIsEOC; struct KeywordCodeList { - char *keyword; + const char *keyword; int code; }; diff --git a/libctgraphics/ezset.cpp b/libctgraphics/ezset.cpp index 872d4e9..efef8c1 100644 --- a/libctgraphics/ezset.cpp +++ b/libctgraphics/ezset.cpp @@ -384,7 +384,7 @@ EZPlot::do_cmd (int lx) void -EZPlot::bad_option (char *opt) +EZPlot::bad_option (const char *opt) { sys_error (ERR_WARNING, "INVALID option: %s", opt); } diff --git a/libctgraphics/pol.cpp b/libctgraphics/pol.cpp index f433e5f..78202f5 100644 --- a/libctgraphics/pol.cpp +++ b/libctgraphics/pol.cpp @@ -135,7 +135,7 @@ POL::addKeyword (const char* const str, int code) */ bool -POL::readWord (char *search, int nlet) +POL::readWord (const char *search, int nlet) { tok (&token); if (m_bTrace) @@ -821,7 +821,7 @@ POL::type (int c) */ void -POL::usefile (int source, char *fn) +POL::usefile (int source, const char *fn) { FILE *fp; diff --git a/libctsim/phantom.cpp b/libctsim/phantom.cpp index 48123fa..f9bb1db 100644 --- a/libctsim/phantom.cpp +++ b/libctsim/phantom.cpp @@ -611,7 +611,7 @@ PhantomElement::convertNameToType (const char* const typeName) const char* const PhantomElement::convertTypeToName (PhmElemType iType) { - static char* pszType = "Unknown"; + static const char* pszType = "Unknown"; if (iType == PELEM_RECTANGLE) pszType = "rectangle"; diff --git a/src/ctsim.xpm b/src/ctsim.xpm index 34f5e90..7175102 100644 --- a/src/ctsim.xpm +++ b/src/ctsim.xpm @@ -1,4 +1,4 @@ -static char *ctsim16_xpm[] = { +static const char *ctsim16_xpm[] = { /* width height ncolors chars_per_pixel */ "16 16 130 2", /* colors */ diff --git a/src/splash.xpm b/src/splash.xpm index 0759cc1..596c174 100644 --- a/src/splash.xpm +++ b/src/splash.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char *splash[] = { +static const char *splash[] = { /* width height ncolors chars_per_pixel */ "500 500 38 1", /* colors */ diff --git a/tools/Makefile.am b/tools/Makefile.am index 510bc55..49b82a9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -26,8 +26,7 @@ ctsimtext_SOURCES = ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if ctsimtext_LDADD=@ctlibs@ ctsimtext_DEPENDENCIES=$(SOURCE_DEPEND) -realclean: - rm -f *.pgm *.if *~ *.pj +CLEANFILES=\*.pgm \*.if \*~ \*.pj sample-ctsim.sh ctsimtext_lam_SOURCES = ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if.cpp phm2pj.cpp pj2if.cpp pjinfo.cpp pjrec.cpp nographics.cpp mpiworld.cpp phm2helix.cpp pjHinterp.cpp linogram.cpp ctsimtext_lam_LDADD=@ctlamlibs@ diff --git a/tools/Makefile.in b/tools/Makefile.in index d503edd..99e3f4f 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -177,6 +177,8 @@ ctsimtext_SOURCES = ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if ctsimtext_LDADD = @ctlibs@ ctsimtext_DEPENDENCIES = $(SOURCE_DEPEND) +CLEANFILES = \*.pgm \*.if \*~ \*.pj sample-ctsim.sh + ctsimtext_lam_SOURCES = ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if.cpp phm2pj.cpp pj2if.cpp pjinfo.cpp pjrec.cpp nographics.cpp mpiworld.cpp phm2helix.cpp pjHinterp.cpp linogram.cpp ctsimtext_lam_LDADD = @ctlamlibs@ @@ -424,6 +426,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) @@ -506,9 +509,6 @@ install-exec-hook: ln -sf ctsimtext $(bindir)/pjHinterp ln -sf ctsimtext $(bindir)/linogram -realclean: - rm -f *.pgm *.if *~ *.pj - @USE_LAM_TRUE@ctsimtext-lam$(EXEEXT): ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if.cpp phm2pj.cpp pj2if.cpp pjinfo.cpp pjrec.cpp mpiworld.cpp linogram.cpp ../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a @USE_LAM_TRUE@ $(CC_LAM) @DEFS@ @lamdefs@ $(CFLAGS) $(INCLUDES) -DHAVE_MPI -DNO_MAIN ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if.cpp phm2pj.cpp pj2if.cpp pjinfo.cpp pjrec.cpp -o ctsimtext-lam $(LDFLAGS) $(LAM_EXTRA_SRC) @ctlibs@ # Tell versions [3.59,3.63) of GNU make to not export all variables. -- 2.34.1