From 24cb148e112a238d75b87f6d8dc5e41c18ce00f5 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 6 Jan 2015 12:40:31 +0000 Subject: [PATCH] #1004. Reviewed all include directives in src/*.cpp and samples/*.cpp fixed svn_version.sh again! change to test/build-test.py for MacOS-X/Xcode 6. --- include/exiv2/exiv2.hpp | 2 ++ include/exiv2/http.hpp | 2 -- samples/conntest.cpp | 11 +---------- samples/httptest.cpp | 3 ++- samples/metacopy.cpp | 10 +++++----- samples/metacopy.hpp | 2 -- samples/path-test.cpp | 5 ++++- samples/remotetest.cpp | 1 + samples/tiffaddpath-test.cpp | 3 +++ samples/werror-test.cpp | 3 ++- src/Makefile | 7 ++++--- {include/exiv2 => src}/exiv2app.hpp | 0 src/http.cpp | 1 + src/svn_version.sh | 5 +++-- src/utils.cpp | 4 ++-- {include/exiv2 => src}/utils.hpp | 0 test/build-test.py | 4 ++-- 17 files changed, 32 insertions(+), 31 deletions(-) rename {include/exiv2 => src}/exiv2app.hpp (100%) rename {include/exiv2 => src}/utils.hpp (100%) diff --git a/include/exiv2/exiv2.hpp b/include/exiv2/exiv2.hpp index 01884b5b..3d42f48a 100644 --- a/include/exiv2/exiv2.hpp +++ b/include/exiv2/exiv2.hpp @@ -43,6 +43,7 @@ #include "exif.hpp" #include "futils.hpp" #include "gifimage.hpp" +#include "http.hpp" #include "image.hpp" #include "iptc.hpp" #include "jp2image.hpp" @@ -57,6 +58,7 @@ #include "psdimage.hpp" #include "rafimage.hpp" #include "rw2image.hpp" +#include "ssh.hpp" #include "tags.hpp" #include "tgaimage.hpp" #include "tiffimage.hpp" diff --git a/include/exiv2/http.hpp b/include/exiv2/http.hpp index b004d06a..2492ad4c 100644 --- a/include/exiv2/http.hpp +++ b/include/exiv2/http.hpp @@ -5,8 +5,6 @@ #include #include -#include "exiv2.hpp" - namespace Exiv2 { typedef std::map dict_t; typedef dict_t::iterator dict_i; diff --git a/samples/conntest.cpp b/samples/conntest.cpp index 3a1282d7..777f1da5 100644 --- a/samples/conntest.cpp +++ b/samples/conntest.cpp @@ -2,16 +2,7 @@ // con-test.cpp // Tester application for testing the http/https/ftp/ssh/sftp connection -#include "config.h" - -#include "exiv2/futils.hpp" -#include "http.hpp" -#if EXV_USE_CURL == 1 -#include -#endif -#if EXV_USE_SSH == 1 -#include "ssh.hpp" -#endif +#include #include #include diff --git a/samples/httptest.cpp b/samples/httptest.cpp index deae7d51..defbc281 100644 --- a/samples/httptest.cpp +++ b/samples/httptest.cpp @@ -4,7 +4,8 @@ This application is to test http.cpp. It provides the function to GET|HEAD|PUT the file via http protocol. */ -#include "http.hpp" +#include + #include #include using namespace std; diff --git a/samples/metacopy.cpp b/samples/metacopy.cpp index 90c3c590..318647f2 100644 --- a/samples/metacopy.cpp +++ b/samples/metacopy.cpp @@ -28,15 +28,15 @@ */ // ***************************************************************************** // included header files -#include "image.hpp" -#include "iptc.hpp" -#include "exif.hpp" -#include "types.hpp" -#include "metacopy.hpp" +#include + #include #include #include +#include "utils.hpp" +#include "metacopy.hpp" + // ***************************************************************************** // Main int main(int argc, char* const argv[]) diff --git a/samples/metacopy.hpp b/samples/metacopy.hpp index 4394839c..64c4ed6e 100644 --- a/samples/metacopy.hpp +++ b/samples/metacopy.hpp @@ -28,8 +28,6 @@ #ifndef METACOPY_HPP_ #define METACOPY_HPP_ -#include "utils.hpp" - class Params : public Util::Getopt { private: std::string optstring_; diff --git a/samples/path-test.cpp b/samples/path-test.cpp index 41dad6f9..3001e432 100644 --- a/samples/path-test.cpp +++ b/samples/path-test.cpp @@ -1,12 +1,15 @@ // ***************************************************************** -*- C++ -*- // path-test.cpp, $Rev$ -#include "utils.hpp" +#include + #include #include #include #include +#include "utils.hpp" + int main(int argc, char* const argv[]) { if (argc != 2) { diff --git a/samples/remotetest.cpp b/samples/remotetest.cpp index d3ee44b1..54a7cec1 100644 --- a/samples/remotetest.cpp +++ b/samples/remotetest.cpp @@ -5,6 +5,7 @@ // and reset the metadata back to the original status. #include + #include #include #include diff --git a/samples/tiffaddpath-test.cpp b/samples/tiffaddpath-test.cpp index 548af041..b284ce3c 100644 --- a/samples/tiffaddpath-test.cpp +++ b/samples/tiffaddpath-test.cpp @@ -2,6 +2,9 @@ // tiffaddpath-test.cpp, $Rev$ // Test driver to test adding new tags to a TIFF composite structure + +#include + #include "tiffcomposite_int.hpp" #include "makernote2_int.hpp" #include "tiffimage_int.hpp" diff --git a/samples/werror-test.cpp b/samples/werror-test.cpp index d282b875..db6c4a31 100644 --- a/samples/werror-test.cpp +++ b/samples/werror-test.cpp @@ -2,9 +2,10 @@ // werror-test.cpp, $Rev$ // Simple tests for the wide-string error class WError -#include #include +#include + int main() { try { diff --git a/src/Makefile b/src/Makefile index 1e2f57e5..34cd4c89 100644 --- a/src/Makefile +++ b/src/Makefile @@ -84,7 +84,6 @@ CCSRC = asfvideo.cpp \ fujimn.cpp \ gifimage.cpp \ http.cpp \ - ssh.cpp \ image.cpp \ iptc.cpp \ jp2image.cpp \ @@ -113,6 +112,7 @@ CCSRC += preview.cpp \ riffvideo.cpp \ rw2image.cpp \ samsungmn.cpp \ + ssh.cpp \ sigmamn.cpp \ sonymn.cpp \ tags.cpp \ @@ -133,8 +133,9 @@ endif # Source files for the Exiv2 application EXIV2MAIN = exiv2.cpp -EXIV2SRC = actions.cpp \ - utils.cpp +EXIV2SRC = actions.cpp \ + utils.cpp + # C source files for the Exiv2 application ifndef HAVE_TIMEGM EXIVCSRC = localtime.c diff --git a/include/exiv2/exiv2app.hpp b/src/exiv2app.hpp similarity index 100% rename from include/exiv2/exiv2app.hpp rename to src/exiv2app.hpp diff --git a/src/http.cpp b/src/http.cpp index 0b9a0068..b3f64d1e 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -27,6 +27,7 @@ #include "config.h" #include "http.hpp" +#include "futils.hpp" #include #include diff --git a/src/svn_version.sh b/src/svn_version.sh index df91144b..4b6021dc 100755 --- a/src/svn_version.sh +++ b/src/svn_version.sh @@ -6,12 +6,13 @@ svn_version_h=svn_version.h svn_version=$(svn info .. 2>/dev/null) +s=$? ## # from Jenkins, svn is almost always a disaster because # Jenkins SVN Jenkins is 1.7 and the build machine is normally at least 1.8 -if [ $? == 0 ]; then - svn_version=$(echo $svn_version | grep ^Revision | cut -f 2 -d' ') +if [ "$s" == "0" ]; then + svn_version=$(svn info .. | grep ^Revision | cut -f 2 -d' ') if [ -z "$svn_version" ]; then svn_version=0 ; fi else svn_version=0 diff --git a/src/utils.cpp b/src/utils.cpp index 4945b237..ef6250c6 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -34,8 +34,6 @@ EXIV2_RCSID("@(#) $Id$") #include "utils.hpp" // + standard includes -#include -#include #if defined(_MSC_VER) # include "getopt_win32.h" # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) @@ -45,6 +43,8 @@ EXIV2_RCSID("@(#) $Id$") # include // for getopt(), stat() #endif +#include +#include #include #include #include diff --git a/include/exiv2/utils.hpp b/src/utils.hpp similarity index 100% rename from include/exiv2/utils.hpp rename to src/utils.hpp diff --git a/test/build-test.py b/test/build-test.py index f856a28e..1a9ef197 100755 --- a/test/build-test.py +++ b/test/build-test.py @@ -73,12 +73,12 @@ def expect(dict,expects): ## def apple(dict): expects= [ 'libSystem.B.dylib' - , 'libexpat.1.dylib' + , 'libexpat.1.dylib' , 'libz.1.dylib' , 'libiconv.2.dylib' - , 'libstdc++.6.dylib' , 'libdyld.dylib' , 'libc++.1.dylib' + # , 'libstdc++.6.dylib' # I suspect this is only with GCC (Xcode4 and earlier) ] ; # which version of MacOS-X ?