7
7
8
8
// Write an array to a dataset / file
9
9
// Returns 0 on success, nonzero on error.
10
- int bsp_write_array (hid_t f , char * label , bsp_array_t array ,
10
+ int bsp_write_array (hid_t f , const char * label , bsp_array_t array ,
11
11
int compression_level ) {
12
12
if (array .type == BSP_COMPLEX_FLOAT32 || array .type == BSP_COMPLEX_FLOAT64 ) {
13
13
array = bsp_complex_array_to_fp (array );
@@ -61,7 +61,7 @@ int bsp_write_array(hid_t f, char* label, bsp_array_t array,
61
61
return 0 ;
62
62
}
63
63
64
- bsp_array_t bsp_read_array (hid_t f , char * label ) {
64
+ bsp_array_t bsp_read_array (hid_t f , const char * label ) {
65
65
hid_t dset = H5Dopen2 (f , label , H5P_DEFAULT );
66
66
67
67
if (dset == H5I_INVALID_HID ) {
@@ -100,7 +100,7 @@ bsp_array_t bsp_read_array(hid_t f, char* label) {
100
100
return array ;
101
101
}
102
102
103
- void bsp_write_attribute (hid_t f , char * label , char * string ) {
103
+ void bsp_write_attribute (hid_t f , const char * label , const char * string ) {
104
104
hid_t strtype = H5Tcopy (H5T_C_S1 );
105
105
H5Tset_size (strtype , strlen (string ));
106
106
H5Tset_cset (strtype , H5T_CSET_UTF8 );
@@ -116,7 +116,7 @@ void bsp_write_attribute(hid_t f, char* label, char* string) {
116
116
H5Sclose (dataspace );
117
117
}
118
118
119
- char * bsp_read_attribute (hid_t f , char * label ) {
119
+ char * bsp_read_attribute (hid_t f , const char * label ) {
120
120
hid_t attribute = H5Aopen (f , label , H5P_DEFAULT );
121
121
hid_t strtype = H5Aget_type (attribute );
122
122
0 commit comments