fixed some non-explicit conversions, so that make distcheck runs on mac yosemite

master
Marc Wäckerlin 10 years ago
parent 72ff6afad7
commit e12d8fb906
  1. 12
      ChangeLog
  2. 2
      doc/makefile.am
  3. 6
      src/mrw/auto.hxx
  4. 8
      test/auto_test.cxx
  5. 1
      test/exec_test.cxx
  6. 2
      test/stdext_test.cxx

@ -1,3 +1,15 @@
2015-05-05 18:43 marc
* configure.ac: need to do a minor update due to least modulo 256
2015-05-05 17:43 marc
* test/makefile.am: fixed dependency in bug
2015-05-04 12:54 marc
* ChangeLog, configure.ac: Mac sh has no echo -n
2015-05-04 12:11 marc 2015-05-04 12:11 marc
* configure.ac: on Mac, LEAST cannot be larger than 255 * configure.ac: on Mac, LEAST cannot be larger than 255

@ -29,7 +29,7 @@ endif
# mv latex/refman.pdf @PACKAGE_NAME@-@PACKAGE_VERSION@.pdf # mv latex/refman.pdf @PACKAGE_NAME@-@PACKAGE_VERSION@.pdf
CLEANFILES = doxygen.errors @PACKAGE_NAME@-@PACKAGE_VERSION@.pdf CLEANFILES = doxygen.errors @PACKAGE_NAME@-@PACKAGE_VERSION@.pdf
DISTCLEANFILES = @PACKAGE_NAME@.doxytag DISTCLEANFILES = @PACKAGE_NAME@.doxytag debug.txt
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
distclean-local: distclean-local:

@ -82,7 +82,7 @@ namespace mrw {
typedef mrw::AutoResource<bfd*, int(*)(bfd*), &bfd_close, int> AutoBfd; typedef mrw::AutoResource<bfd*, int(*)(bfd*), &bfd_close, int> AutoBfd;
template<class T> class Auto { template<class T> class Auto {
public: public:
typedef mrw::AutoResource<T, void(*)(void*), &free, int, 0> Free; typedef mrw::AutoResource<T, void(*)(void*), &free, T, (T)0> Free;
}; };
@endcode @endcode
@param RESOURCE_TYPE type of the resource to manage @param RESOURCE_TYPE type of the resource to manage
@ -97,7 +97,7 @@ namespace mrw {
typename FUNCTION_PTR, typename FUNCTION_PTR,
FUNCTION_PTR FREE_FUNCTION, FUNCTION_PTR FREE_FUNCTION,
typename INITIAL_VALUE_TYPE = RESOURCE_TYPE, typename INITIAL_VALUE_TYPE = RESOURCE_TYPE,
INITIAL_VALUE_TYPE INITIAL_VALUE = 0, INITIAL_VALUE_TYPE INITIAL_VALUE = (INITIAL_VALUE_TYPE)0,
typename FREE_TYPE = RESOURCE_TYPE> typename FREE_TYPE = RESOURCE_TYPE>
class AutoResource { class AutoResource {
public: public:
@ -436,7 +436,7 @@ namespace mrw {
*/ */
template<class T> class Auto { template<class T> class Auto {
public: public:
typedef mrw::AutoResource<T, void(*)(void*), &free, int, 0, void*> Free; typedef mrw::AutoResource<T, void(*)(void*), &free, T, (T)0, void*> Free;
private: private:
/** @internal /** @internal
work around compiler warning: work around compiler warning:

@ -51,14 +51,14 @@ public:
CPPUNIT_ASSERT_EQUAL(-1, (mrw::AutoFile::Type)a); // init as -1 CPPUNIT_ASSERT_EQUAL(-1, (mrw::AutoFile::Type)a); // init as -1
i = a = open((std::string(mrw::ifelse(getenv("srcdir"), ".")) i = a = open((std::string(mrw::ifelse(getenv("srcdir"), "."))
+"/test.dat").c_str(), O_RDONLY); +"/test.dat").c_str(), O_RDONLY);
CPPUNIT_ASSERT(i==a && a>0); // file is now open CPPUNIT_ASSERT(i==(int)a && (int)a>0); // file is now open
mrw::AutoFile b(a); mrw::AutoFile b(a);
CPPUNIT_ASSERT(a==-1 && i==b); // b has taken ownership CPPUNIT_ASSERT((int)a==-1 && i==(int)b); // b has taken ownership
CPPUNIT_ASSERT(read(b, &c, 1)==1 && c=='H'); // file is good CPPUNIT_ASSERT(read(b, &c, 1)==1 && c=='H'); // file is good
mrw::AutoFile cc(i); mrw::AutoFile cc(i);
CPPUNIT_ASSERT(i==b && b==cc); // ooops, two owner! CPPUNIT_ASSERT(i==(int)b && (int)b==(int)cc); // ooops, two owner!
cc.release(); cc.release();
CPPUNIT_ASSERT(i==b && cc==-1); // it's ok now CPPUNIT_ASSERT(i==(int)b && (int)cc==-1); // it's ok now
b = open("test.dat", O_RDONLY); b = open("test.dat", O_RDONLY);
//close(i); //close(i);
CPPUNIT_ASSERT_EQUAL((ssize_t)-1, read(i, &c, 1)); // old file is closed CPPUNIT_ASSERT_EQUAL((ssize_t)-1, read(i, &c, 1)); // old file is closed

@ -39,7 +39,6 @@
*/ */
#include <mrw/exec.hxx> #include <mrw/exec.hxx>
#include <mrw/stacktrace.hxx>
#include <mrw/stdext.hxx> #include <mrw/stdext.hxx>
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h> #include <cppunit/ui/text/TestRunner.h>

@ -28,7 +28,6 @@
#include <mrw/map.hxx> #include <mrw/map.hxx>
#include <mrw/multiset.hxx> #include <mrw/multiset.hxx>
#include <mrw/multimap.hxx> #include <mrw/multimap.hxx>
#include <mrw/stacktrace.hxx>
#include <mrw/stdext.hxx> #include <mrw/stdext.hxx>
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h> #include <cppunit/ui/text/TestRunner.h>
@ -154,7 +153,6 @@ class StdExtTest: public CppUnit::TestFixture {
try { try {
s<<1<<2<<3<<4<<5<<6<<7<<8<<8; s<<1<<2<<3<<4<<5<<6<<7<<8<<8;
} catch (mrw::invalid_argument& e) { } catch (mrw::invalid_argument& e) {
mrw::StackTrace::createSymtable();
exc=true; exc=true;
} }
CPPUNIT_ASSERT(exc); CPPUNIT_ASSERT(exc);

Loading…
Cancel
Save