2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-03-25 17:00:45 +08:00

[svn-r3114] Purpose: Fix

Description:
	Dec CC compiler doesn't support some new c++ features.
	Some typos caused compilation erros on Dec Alpha.

Solution:
        - Added macro BOOL_NOTDEFINED to define bool type on Dec
          Alpha (gondolin) since its compiler doesn't support bool.
	- Added macro NO_STATIC_CAST to prevent the use of the new
	  c++ feature static_cast since Dec CC compiler doesn't support.
	- Added const to parameters of some functions to match the
	  functions' declaration and definition.  Typos errors and
	  Dec CC complained.

Platform:
	Solaris (arabica).  Also tried to build on Dec Alpha but still
	not linked due to some missing compiler flags; its compilation
	went fine though.
This commit is contained in:
Binh-Minh Ribler 2000-12-11 23:40:09 -05:00
parent 3dcc29ec41
commit 84fadb9f74
12 changed files with 39 additions and 14 deletions

@ -80,6 +80,7 @@ size_t CompType::getMemberOffset( int member_num ) const
int CompType::getMemberDims( int member_num, size_t* dims, int* perm ) const
{
throw DataTypeIException( "Error: getMemberDims is no longer supported." );
return (-1);
}
// Gets the type class of the specified member.

@ -14,7 +14,7 @@ class CompType : public DataType {
CompType();
// Creates a compound datatype using an existing id
CompType( hid_t existing_id );
CompType( const hid_t existing_id );
// Copy constructor - makes a copy of original object
CompType( const CompType& original );

@ -102,6 +102,7 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
//{
//throw DataSetIException();
//}
return(-1);
}
// Reclaims VL datatype memory buffers.

@ -16,7 +16,7 @@ class EnumType : public DataType {
EnumType();
// Creates an enumeration datatype using an existing id
EnumType( hid_t existing_id );
EnumType( const hid_t existing_id );
// Copy constructor: makes a copy of the original EnumType object.
EnumType( const EnumType& original );

@ -11,7 +11,7 @@ class FloatType : public AtomType {
FloatType();
// Creates a floating-point datatype using an existing id
FloatType( hid_t existing_id );
FloatType( const hid_t existing_id );
// Creates a floating-point type using a predefined type
FloatType( const PredType& pred_type );

@ -20,7 +20,7 @@ IdComponent::IdComponent() : id( 0 )
// Constructor that takes an HDF5 object id. It creates an instance
// of IdComponent to hold the HDF5 id
IdComponent::IdComponent( hid_t h5_id ) : id( h5_id )
IdComponent::IdComponent( const hid_t h5_id ) : id( h5_id )
{
// starts counting object references
ref_count = new RefCounter;
@ -82,7 +82,7 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
its identifier, its reference counter will be deleted. A new
reference counter is created for the new HDF5 object id.
*/
void IdComponent::setId( hid_t new_id )
void IdComponent::setId( const hid_t new_id )
{
// reset the identifier of this object, call appropriate H5Xclose
resetIdComponent( this );

@ -12,14 +12,14 @@ class IdComponent {
public:
// Parent classes must reset the current IdComponent copy
// before setting new id to control reference count
void setId( hid_t new_id );
void setId( const hid_t new_id );
// Pure virtual function so appropriate close function can
// be called by subclasses' for the corresponding object
virtual void p_close() const = 0;
// Creates an object to hold an HDF5 identifier
IdComponent( hid_t h5_id );
IdComponent( const hid_t h5_id );
// Copy constructor: makes copy of the original IdComponent object.
IdComponent( const IdComponent& original );

@ -11,7 +11,7 @@ class IntType : public AtomType {
IntType();
// Creates a integer datatype using an existing id
IntType( hid_t existing_id );
IntType( const hid_t existing_id );
// Creates a integer type using a predefined type
IntType( const PredType& pred_type );

@ -22,7 +22,11 @@ namespace H5 {
extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data )
{
string s_attr_name = string( attr_name );
#ifdef NO_STATIC_CAST
UserData4Aiterate* myData = (UserData4Aiterate *) op_data;
#else
UserData4Aiterate* myData = static_cast <UserData4Aiterate *> (op_data);
#endif
myData->op( *myData->object, s_attr_name, myData->opData );
return 0;
}
@ -32,7 +36,7 @@ extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_
H5Object::H5Object() : IdComponent() {}
// Constructs an object from an existing HDF5 id
H5Object::H5Object( hid_t object_id ) : IdComponent( object_id ) {}
H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {}
// Copy constructor: makes a copy of the original H5Object instance
H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {}
@ -85,7 +89,7 @@ Attribute H5Object::openAttribute( const string& name ) const
}
// Opens an attribute given its index.
Attribute H5Object::openAttribute( unsigned int idx ) const
Attribute H5Object::openAttribute( const unsigned int idx ) const
{
hid_t attr_id = H5Aopen_idx( id, idx );
if( attr_id > 0 )

@ -181,7 +181,8 @@ void PredType::commit( H5Object& loc, const string& name )
bool PredType::committed()
{
throw DataTypeIException( "Attempting to check for commit status on a predefined datatype. This operation is invalid" );
throw DataTypeIException( "Error: Attempting to check for commit status on a predefined datatype." );
return (-1);
}
// Destructor: calls ~AtomType immediately

@ -1,10 +1,28 @@
#ifndef _H5RefCounter_H
#define _H5RefCounter_H
//#ifndef _H5RefCounter_H
//#define _H5RefCounter_H
#ifndef _MY_RefCounter
#define _MY_RefCounter
#ifndef H5_NO_NAMESPACE
namespace H5 {
#endif
// define bool type for platforms that don't support bool yet
// Note: it is added here because most of the C++ library source
// files include this header file
#ifdef BOOL_NOTDEFINED
#ifdef false
#undef false
#endif
#ifdef true
#undef true
#endif
typedef int bool;
const bool false = 0;
const bool true = 1;
#endif
class RefCounter {
public:
// Creates a reference counter to be used by an HDF5 object

@ -14,7 +14,7 @@ class StrType : public AtomType {
StrType( const PredType& pred_type );
// Creates a string datatype using an existing id
StrType( hid_t existing_id );
StrType( const hid_t existing_id );
// Copy constructor - makes a copy of the original object
StrType( const StrType& original );