From: Enblend <enb...@li...> - 2013-02-24 06:26:41
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/d9ba5991935b changeset: 910:d9ba5991935b user: Chris <cs...@us...> date: Sun Feb 24 07:12:39 2013 +0100 description: Touchup dynamic loading. diffstat: VERSION | 2 +- doc/enblend.info | Bin doc/enfuse.info | Bin doc/versenblend.texi | 6 +++--- doc/versenfuse.texi | 4 ++-- src/dynamic_loader.h | 16 ++++++++-------- src/enfuse.cc | 27 +++++++++++---------------- src/exposure_weight_base.h | 5 ++--- 8 files changed, 27 insertions(+), 33 deletions(-) diffs (147 lines): diff -r 29df601fc0a7 -r d9ba5991935b VERSION --- a/VERSION Sat Feb 23 09:34:39 2013 +0100 +++ b/VERSION Sun Feb 24 07:12:39 2013 +0100 @@ -1,1 +1,1 @@ -4.2-90afb7be97b1+ +4.2-29df601fc0a7 diff -r 29df601fc0a7 -r d9ba5991935b doc/enblend.info Binary file doc/enblend.info has changed diff -r 29df601fc0a7 -r d9ba5991935b doc/enfuse.info Binary file doc/enfuse.info has changed diff -r 29df601fc0a7 -r d9ba5991935b doc/versenblend.texi --- a/doc/versenblend.texi Sat Feb 23 09:34:39 2013 +0100 +++ b/doc/versenblend.texi Sun Feb 24 07:12:39 2013 +0100 @@ -1,4 +1,4 @@ -@set UPDATED 22 February 2013 +@set UPDATED 24 February 2013 @set UPDATED-MONTH February 2013 -@set EDITION 4.2-a0baf2635ac8 -@set VERSION 4.2-a0baf2635ac8 +@set EDITION 4.2-29df601fc0a7 +@set VERSION 4.2-29df601fc0a7 diff -r 29df601fc0a7 -r d9ba5991935b doc/versenfuse.texi --- a/doc/versenfuse.texi Sat Feb 23 09:34:39 2013 +0100 +++ b/doc/versenfuse.texi Sun Feb 24 07:12:39 2013 +0100 @@ -1,4 +1,4 @@ @set UPDATED 22 February 2013 @set UPDATED-MONTH February 2013 -@set EDITION 4.2-a0baf2635ac8 -@set VERSION 4.2-a0baf2635ac8 +@set EDITION 4.2-29df601fc0a7 +@set VERSION 4.2-29df601fc0a7 diff -r 29df601fc0a7 -r d9ba5991935b src/dynamic_loader.h --- a/src/dynamic_loader.h Sat Feb 23 09:34:39 2013 +0100 +++ b/src/dynamic_loader.h Sun Feb 24 07:12:39 2013 +0100 @@ -179,7 +179,7 @@ typedef GLibDynamicLoaderImplementation ActualDynamicLoaderImplementation; -#elif defined WIN32 +#elif defined(WIN32) #define HAVE_DYNAMICLOADER_IMPL #include <Windows.h> @@ -240,26 +240,26 @@ static const std::string GetLastErrorString() { LPTSTR lpMsgBuf; - DWORD lastError=GetLastError(); + DWORD lastError = GetLastError(); std::string errorMsg; - if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, lastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL)>0) + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, lastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL) > 0) { errorMsg=lpMsgBuf; - //remove trailing white spaces + // remove leading and trailing white spaces boost::trim(errorMsg); LocalFree(lpMsgBuf); } else { - errorMsg="Unknown error"; - }; + errorMsg = "Unknown error"; + } // add numeric error code errorMsg.append(" (Code: "); errorMsg.append(boost::lexical_cast<std::string>(lastError)); errorMsg.append(")"); return errorMsg; - }; + } HINSTANCE handle_; }; // class WinDynamicLoaderImplementation diff -r 29df601fc0a7 -r d9ba5991935b src/enfuse.cc --- a/src/enfuse.cc Sat Feb 23 09:34:39 2013 +0100 +++ b/src/enfuse.cc Sun Feb 24 07:12:39 2013 +0100 @@ -261,18 +261,13 @@ std::cout << "enfuse " << VERSION << "\n\n"; if (Verbose >= VERBOSE_VERSION_REPORTING) { - std::cout << "Extra feature: dynamic linking support: "; - try { - if (DynamicLoader("").resolve0("bar") == NULL) { - std::cout << "no"; - } else { - std::cout << "yes"; - } - } - catch (ActualDynamicLoaderImplementation::error&) { - std::cout << "yes"; - } - std::cout << "\n"; + std::cout << "Extra feature: dynamic linking support: " << +#ifdef HAVE_DYNAMICLOADER_IMPL + "yes" << +#else + "no" << +#endif + "\n"; std::cout << "Extra feature: dmalloc support: " << @@ -1479,10 +1474,10 @@ } else { ExposureWeightFunctionName = token; #ifdef WIN32 - //special handling for absolute filenames under Windows - if(ExposureWeightFunctionName.length()==1) { - char sep=strlen(optarg)>2 ? optarg[1] : 0; - if(sep==':') { + // special handling of absolute filenames under Windows + if (ExposureWeightFunctionName.length() == 1U) { + const char sep = strlen(optarg) > 2 ? optarg[1] : 0; + if (sep == ':') { token = enblend::strtoken_r(NULL, PATH_OPTION_DELIMITERS, &save_ptr); if(token == NULL || *token == 0) { std::cerr << command << ": option \"--exposure-weight-function\" requires a valid filename" << std::endl; diff -r 29df601fc0a7 -r d9ba5991935b src/exposure_weight_base.h --- a/src/exposure_weight_base.h Sat Feb 23 09:34:39 2013 +0100 +++ b/src/exposure_weight_base.h Sun Feb 24 07:12:39 2013 +0100 @@ -10,12 +10,12 @@ #include <stdexcept> #include <string> #include <vector> -#include <iostream> + // The full width at half of the maximum of the Gauss-curve we use for // exposure weighting is // FWHM = 2 * sqrt(2 * log(2)) -// For compatability in the sake of least surprise of the user, all +// For compatibility in the sake of least surprise of the user, all // other exposure weight functions rescale their native FWHM to match // the Gauss-curve. #define FWHM_GAUSSIAN 2.3548200450309493820231386529193992755 @@ -36,7 +36,6 @@ virtual void initialize(double y_optimum, double width_parameter, const argument_list_t& argument_list) { - std::cout << "+ ExposureWeight::initialize\n"; y_optimum_ = y_optimum; width_ = width_parameter; arguments_ = argument_list; |