RFA: Fix Utilities Typos and Prevent Warnings
Jeffrey Oldham
oldham at codesourcery.com
Thu Mar 15 06:59:43 UTC 2001
Are the attached changes to the src/Utilities Pooma directory
acceptable? I compiled them using gcc mainline on a sequential Linux
computer.
ElementProperties.h:
* Add a missing include directive.
Inform.h:
* Permit use of std::ios_base::fmtflags for current gcc versions.
RefCountedBlockPtr.h:
* Add a missing include directive.
tests/delete_test1.cpp:
* Add a static_cast for conversion from float to int to avoid a
compiler warning.
* Add a static_cast around iterator.
tests/find_most_common_test1.cpp:
* Change which overloaded check function to use to permit
compilation.
(I will be away for the next four days.)
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
? LINUXgcc
? Utilities.patch
? Utilities.ChangeLog
? tests/LINUXgcc
Index: ElementProperties.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/ElementProperties.h,v
retrieving revision 1.13
diff -c -p -r1.13 ElementProperties.h
*** ElementProperties.h 2000/04/27 18:30:38 1.13
--- ElementProperties.h 2001/03/15 06:57:32
***************
*** 54,60 ****
--- 54,64 ----
// - specializations for basic C++ data types.
//-----------------------------------------------------------------------------
+ //-----------------------------------------------------------------------------
+ // Include Files
+ //-----------------------------------------------------------------------------
+ #include "Utilities/PAssert.h"
//-----------------------------------------------------------------------------
//
Index: Inform.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/Inform.h,v
retrieving revision 1.27
diff -c -p -r1.27 Inform.h
*** Inform.h 2000/06/14 16:40:09 1.27
--- Inform.h 2001/03/15 06:57:32
*************** public:
*** 275,281 ****
void print() { flush(); }
void output() { flush(); }
! #if defined(__MWERKS__) && __MWERKS__ >= 0x2301
typedef std::ios_base::fmtflags FmtFlags_t;
#else
typedef long FmtFlags_t;
--- 275,281 ----
void print() { flush(); }
void output() { flush(); }
! #if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) || __GLIBCPP__ >= 20001129
typedef std::ios_base::fmtflags FmtFlags_t;
#else
typedef long FmtFlags_t;
Index: RefCountedBlockPtr.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/RefCountedBlockPtr.h,v
retrieving revision 1.56
diff -c -p -r1.56 RefCountedBlockPtr.h
*** RefCountedBlockPtr.h 2000/07/14 17:46:37 1.56
--- RefCountedBlockPtr.h 2001/03/15 06:57:33
***************
*** 51,56 ****
--- 51,57 ----
#include <stddef.h>
#include <new>
+ #include <iterator>
#include "Utilities/ElementProperties.h"
#include "Utilities/RefCounted.h"
Index: tests/delete_test1.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/tests/delete_test1.cpp,v
retrieving revision 1.6
diff -c -p -r1.6 delete_test1.cpp
*** tests/delete_test1.cpp 2000/06/27 20:06:37 1.6
--- tests/delete_test1.cpp 2001/03/15 06:57:33
*************** void test(Pooma::Tester &t,
*** 120,126 ****
{
const int size = num_elements;
const int trials = num_trials;
! const int inc_size = 2.0 / delete_fraction;
const bool verbose = t.verbose() && print_results;
using std::endl;
--- 120,126 ----
{
const int size = num_elements;
const int trials = num_trials;
! const int inc_size = static_cast<int>(2.0 / delete_fraction);
const bool verbose = t.verbose() && print_results;
using std::endl;
*************** void test(Pooma::Tester &t,
*** 220,226 ****
end = a.end();
while (pos != end)
{
! Ret_t status = result_set.insert(*pos++);
t.check(status.second);
}
}
--- 220,226 ----
end = a.end();
while (pos != end)
{
! Ret_t status = result_set.insert(static_cast<std::set<int>::key_type>(*pos++));
t.check(status.second);
}
}
Index: tests/find_most_common_test1.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/tests/find_most_common_test1.cpp,v
retrieving revision 1.1
diff -c -p -r1.1 find_most_common_test1.cpp
*** tests/find_most_common_test1.cpp 2000/03/31 16:56:37 1.1
--- tests/find_most_common_test1.cpp 2001/03/15 06:57:33
*************** void test(Pooma::Tester &t, int numEleme
*** 94,100 ****
Pooma::Algorithms::find_most_common(v.begin(), v.end());
if (numElements == 0)
! t.check("zero length", mc, v.end());
else
{
int cmc, nmc = -1;
--- 94,100 ----
Pooma::Algorithms::find_most_common(v.begin(), v.end());
if (numElements == 0)
! t.check ("zero length", mc == v.end());
else
{
int cmc, nmc = -1;
More information about the pooma-dev
mailing list