From 6e8ba9561dff2585c5078a01c4d6db0f790ba1fb Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 16 Mar 2006 16:29:23 -0500 Subject: [svn-r12109] Purpose: Backward compatibility support Description: Added H5E_NONE_MAJOR and H5E_NONE_MINOR as a major and minor error message. Their messages are "no error", but because the old library had them, they're added in for backward compatibility. Platforms tested: fuss - simple change. --- src/H5Edefin.h | 4 ++++ src/H5Einit.h | 12 ++++++++++++ src/H5Epubgen.h | 6 ++++++ src/H5Eterm.h | 8 ++++++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/H5Edefin.h b/src/H5Edefin.h index a41ec77..89ea64a 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -47,6 +47,7 @@ hid_t H5E_ARGS_g = FAIL; /* Invalid arguments to routine */ hid_t H5E_ERROR_g = FAIL; /* Error API */ hid_t H5E_PLINE_g = FAIL; /* Data filters */ hid_t H5E_CACHE_g = FAIL; /* Object cache */ +hid_t H5E_NONE_MAJOR_g = FAIL; /* No error, only for backward compatibility */ /* Minor error IDs */ @@ -181,4 +182,7 @@ hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ +/* No error, for backward compatibility */ +hid_t H5E_NONE_MINOR_g = FAIL; + #endif /* H5Edefin_H */ diff --git a/src/H5Einit.h b/src/H5Einit.h index 2c216da..0b7610f 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -158,6 +158,11 @@ if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_NONE_MAJOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /*********************/ /* Minor error codes */ @@ -675,4 +680,11 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +/* No error, only for backward compatibility */ +assert(H5E_NONE_MINOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + #endif /* H5Einit_H */ diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 28b2822..3cfdb04 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -50,6 +50,7 @@ #define H5E_ERROR (H5OPEN H5E_ERROR_g) #define H5E_PLINE (H5OPEN H5E_PLINE_g) #define H5E_CACHE (H5OPEN H5E_CACHE_g) +#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ @@ -77,6 +78,7 @@ H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ +H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ /*********************/ /* Minor error codes */ @@ -308,4 +310,8 @@ H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ +/* No error, only for backward compatibility */ +#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) +H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error, only for backward compatibility */ + #endif /* H5Epubgen_H */ diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 64f63c8..cc70893 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -47,7 +47,8 @@ H5E_TST_g= H5E_ARGS_g= H5E_ERROR_g= H5E_PLINE_g= -H5E_CACHE_g= (-1); +H5E_CACHE_g= +H5E_NONE_MAJOR_g=(-1); /* Reset minor error IDs */ @@ -181,6 +182,9 @@ H5E_BADVALUE_g= /* Datatype conversion errors */ H5E_CANTCONVERT_g= -H5E_BADSIZE_g= (-1); +H5E_BADSIZE_g= + +/* No error, only for backward compatibility */ +H5E_NONE_MINOR_g= (-1); #endif /* H5Eterm_H */ -- cgit v0.12