Import Geant4 10.2.0 source tree
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
#ifndef tools_rroot_rbuf
|
||||
#define tools_rroot_rbuf
|
||||
|
||||
#include "../pointer"
|
||||
#include "../stype"
|
||||
#include "../long_out"
|
||||
#include "../charp_out"
|
||||
|
||||
#ifdef TOOLS_MEM
|
||||
#include "../mem"
|
||||
@@ -225,9 +226,9 @@ public:
|
||||
}
|
||||
if((m_pos+nchars)>m_eob) {
|
||||
m_out << s_class() << "::read(string) :"
|
||||
<< " try to access out of buffer " << long2s(nchars) << " bytes "
|
||||
<< " (pos=" << char_p2s(m_pos)
|
||||
<< ", eob=" << char_p2s(m_eob) << ")." << std::endl;
|
||||
<< " try to access out of buffer " << long_out(nchars) << " bytes "
|
||||
<< " (pos=" << charp_out(m_pos)
|
||||
<< ", eob=" << charp_out(m_eob) << ")." << std::endl;
|
||||
a_x.clear();
|
||||
return false;
|
||||
}
|
||||
@@ -292,9 +293,9 @@ public:
|
||||
uint32 l = a_n * sizeof(T);
|
||||
if(!check_eob(l)) {
|
||||
m_out << s_class() << "::read_fast_array :"
|
||||
<< " try to access out of buffer " << long2s(l) << " bytes "
|
||||
<< " (pos=" << char_p2s(m_pos)
|
||||
<< ", eob=" << char_p2s(m_eob) << ")." << std::endl;
|
||||
<< " try to access out of buffer " << long_out(l) << " bytes "
|
||||
<< " (pos=" << charp_out(m_pos)
|
||||
<< ", eob=" << charp_out(m_eob) << ")." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -348,11 +349,10 @@ public:
|
||||
|
||||
template <class T>
|
||||
bool read_array(std::vector<T>& a_v) {
|
||||
a_v.clear();
|
||||
T* buffer = 0;
|
||||
uint32 n;
|
||||
if(!read_array(0,buffer,n)) return false;
|
||||
if(!buffer) return true;
|
||||
if(!read_array(0,buffer,n)) {a_v.clear();return false;}
|
||||
if(!buffer) {a_v.clear();return true;}
|
||||
a_v.resize(n);
|
||||
for(uint32 index=0;index<n;index++) {
|
||||
a_v[index] = buffer[index];
|
||||
@@ -388,13 +388,14 @@ protected:
|
||||
if((m_pos+sizeof(T))>m_eob) {
|
||||
a_x = T();
|
||||
m_out << s_class() << " : " << stype(T()) << " : "
|
||||
<< " try to access out of buffer " << long2s(sizeof(T)) << " bytes"
|
||||
<< " (pos=" << char_p2s(m_pos)
|
||||
<< ", eob=" << char_p2s(m_eob) << ")." << std::endl;
|
||||
<< " try to access out of buffer " << long_out(sizeof(T)) << " bytes"
|
||||
<< " (pos=" << charp_out(m_pos)
|
||||
<< ", eob=" << charp_out(m_eob) << ")." << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
std::ostream& m_out;
|
||||
bool m_byte_swap;
|
||||
|
||||
Reference in New Issue
Block a user