Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
H5hut
src
Commits
a65e9586
Commit
a65e9586
authored
Jan 05, 2010
by
Marc Howison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed string attribute bug reported by Allen Sanderson
parent
3c6065e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
+33
-8
src/H5Part.c
src/H5Part.c
+20
-8
src/H5Part.h
src/H5Part.h
+1
-0
src/H5PartErrors.h
src/H5PartErrors.h
+12
-0
No files found.
src/H5Part.c
View file @
a65e9586
...
...
@@ -1085,16 +1085,28 @@ _H5Part_write_attrib (
herr_t
herr
;
hid_t
space_id
;
hid_t
attrib_id
;
hid_t
type
=
attrib_type
;
space_id
=
H5Screate_simple
(
1
,
&
attrib_nelem
,
NULL
);
if
(
space_id
<
0
)
return
HANDLE_H5S_CREATE_SIMPLE_ERR
(
attrib_nelem
);
if
(
type
==
H5T_STRING
)
{
type
=
H5Tcopy
(
H5T_C_S1
);
if
(
attrib_type
<
0
)
return
HANDLE_H5T_STRING_ERR
;
herr
=
H5Tset_size
(
type
,
attrib_nelem
);
if
(
herr
<
0
)
return
HANDLE_H5T_STRING_ERR
;
space_id
=
H5Screate
(
H5S_SCALAR
);
if
(
space_id
<
0
)
return
HANDLE_H5S_CREATE_SCALAR_ERR
;
}
else
{
space_id
=
H5Screate_simple
(
1
,
&
attrib_nelem
,
NULL
);
if
(
space_id
<
0
)
return
HANDLE_H5S_CREATE_SIMPLE_ERR
(
attrib_nelem
);
}
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
attrib_id
=
H5Acreate2
(
id
,
attrib_name
,
attrib_
type
,
type
,
space_id
,
H5P_DEFAULT
,
H5P_DEFAULT
);
...
...
@@ -1102,13 +1114,13 @@ _H5Part_write_attrib (
attrib_id
=
H5Acreate
(
id
,
attrib_name
,
attrib_
type
,
type
,
space_id
,
H5P_DEFAULT
);
#endif
if
(
attrib_id
<
0
)
return
HANDLE_H5A_CREATE_ERR
(
attrib_name
);
herr
=
H5Awrite
(
attrib_id
,
attrib_
type
,
attrib_value
);
herr
=
H5Awrite
(
attrib_id
,
type
,
attrib_value
);
if
(
herr
<
0
)
return
HANDLE_H5A_WRITE_ERR
(
attrib_name
);
herr
=
H5Aclose
(
attrib_id
);
...
...
@@ -1209,7 +1221,7 @@ H5PartWriteFileAttribString (
h5part_int64_t
herr
=
_H5Part_write_attrib
(
group_id
,
attrib_name
,
H5T_
NATIVE_CHAR
,
H5T_
STRING
,
attrib_value
,
strlen
(
attrib_value
)
+
1
);
if
(
herr
<
0
)
return
herr
;
...
...
@@ -1247,7 +1259,7 @@ H5PartWriteStepAttribString (
h5part_int64_t
herr
=
_H5Part_write_attrib
(
f
->
timegroup
,
name
,
H5T_
NATIVE_CHAR
,
H5T_
STRING
,
value
,
strlen
(
value
)
+
1
);
if
(
herr
<
0
)
return
herr
;
...
...
src/H5Part.h
View file @
a65e9586
...
...
@@ -50,6 +50,7 @@ extern "C" {
#define H5PART_FLOAT64 ((h5part_int64_t)H5T_NATIVE_DOUBLE)
#define H5PART_FLOAT32 ((h5part_int64_t)H5T_NATIVE_FLOAT)
#define H5PART_CHAR ((h5part_int64_t)H5T_NATIVE_CHAR)
#define H5PART_STRING ((h5part_int64_t)H5T_STRING)
/*========== File Opening/Closing ===============*/
H5PartFile
*
...
...
src/H5PartErrors.h
View file @
a65e9586
...
...
@@ -291,6 +291,12 @@
"Cannot get chunk dimensions." );
/* H5S: dataspace */
#define HANDLE_H5S_CREATE_SCALAR_ERR \
(*_err_handler) ( \
_H5Part_get_funcname(), \
H5PART_ERR_HDF5, \
"Cannot create scalar dataspace." );
#define HANDLE_H5S_CREATE_SIMPLE_ERR( n ) \
(*_err_handler) ( \
_H5Part_get_funcname(), \
...
...
@@ -322,6 +328,12 @@
"Cannot set select hyperslap region or add the specified region" );
/* H5T: type */
#define HANDLE_H5T_STRING_ERR \
(*_err_handler) ( \
_H5Part_get_funcname(), \
H5PART_ERR_HDF5, \
"Cannot create string datatype." );
#define HANDLE_H5T_CLOSE_ERR \
(*_err_handler) ( \
_H5Part_get_funcname(), \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment