diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2005-11-19 20:20:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2005-11-19 20:20:00 +0000 |
commit | 8d359765c34b766d2804f480bbfbbd41e19fd6ad (patch) | |
tree | c6a2ff635156eb2a2708630136b2e80f53acf763 /Carpet/CarpetLib | |
parent | 584c098c3673efcdaac330c0161edf3cffcd468d (diff) |
CarpetLib: Replace some int by size_t
Replace some int local variables by size_t local variables. This
eliminates some compiler warnings about signed/unsigned comparisons.
darcs-hash:20051119202008-dae7b-8cf4f1bf5673b3b68164b2488f3e8c738fa55726.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/commstate.cc | 10 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/data.cc | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Carpet/CarpetLib/src/commstate.cc b/Carpet/CarpetLib/src/commstate.cc index 1bd9a2a8c..ffb58225b 100644 --- a/Carpet/CarpetLib/src/commstate.cc +++ b/Carpet/CarpetLib/src/commstate.cc @@ -31,7 +31,7 @@ comm_state::comm_state () state_get_buffer_sizes : state_post; typebufs.resize (dist::c_ndatatypes()); - for (int type = 0; type < typebufs.size(); type++) { + for (size_t type = 0; type < typebufs.size(); type++) { typebufs[type].procbufs.resize(dist::size()); } @@ -72,7 +72,7 @@ void comm_state::step () // (a clever MPI layer may take advantage of such early posting). num_posted_recvs = num_completed_recvs = 0; - for (int type = 0; type < typebufs.size(); type++) { + for (size_t type = 0; type < typebufs.size(); type++) { // skip unused datatype buffers if (not typebufs[type].in_use) { @@ -80,7 +80,7 @@ void comm_state::step () } int& datatypesize = typebufs[type].datatypesize; - for (int proc = 0; proc < typebufs[type].procbufs.size(); proc++) { + for (size_t proc = 0; proc < typebufs[type].procbufs.size(); proc++) { procbufdesc& procbuf = typebufs[type].procbufs[proc]; procbuf.sendbufbase = new char[procbuf.sendbufsize*datatypesize]; @@ -116,8 +116,8 @@ void comm_state::step () // do another comm_state loop iteration. } else { // Everything is done so release the collective communication buffers. - for (int type = 0; type < typebufs.size(); type++) { - for (int proc = 0; proc < typebufs[type].procbufs.size(); proc++) { + for (size_t type = 0; type < typebufs.size(); type++) { + for (size_t proc = 0; proc < typebufs[type].procbufs.size(); proc++) { delete[] typebufs[type].procbufs[proc].sendbufbase; delete[] typebufs[type].procbufs[proc].recvbufbase; } diff --git a/Carpet/CarpetLib/src/data.cc b/Carpet/CarpetLib/src/data.cc index c976aa267..24ae3c9fd 100644 --- a/Carpet/CarpetLib/src/data.cc +++ b/Carpet/CarpetLib/src/data.cc @@ -1702,12 +1702,11 @@ ostream& data<T>::output (ostream& os) const return os; } - template<typename T> ostream & operator << (ostream & os, const data<T> & d) { - char * space = ""; - for (size_t i = 0; i < d.vectorlength; i++) { + char const * space = ""; + for (int i = 0; i < d.vectorlength; i++) { os << space << d[i]; space = " "; } @@ -1715,6 +1714,7 @@ ostream & operator << (ostream & os, const data<T> & d) } + #define INSTANTIATE(T) \ template class data<T>; template |