11
11
12
12
// Write an array to a dataset / file
13
13
// Returns 0 on success, nonzero on error.
14
- int bsp_write_array (hid_t f , char * label , bsp_array_t array ,
14
+ int bsp_write_array (hid_t f , const char * label , bsp_array_t array ,
15
15
int compression_level ) {
16
16
if (array .type == BSP_COMPLEX_FLOAT32 || array .type == BSP_COMPLEX_FLOAT64 ) {
17
17
array = bsp_complex_array_to_fp (array );
@@ -65,7 +65,8 @@ int bsp_write_array(hid_t f, char* label, bsp_array_t array,
65
65
return 0 ;
66
66
}
67
67
68
- bsp_array_t bsp_read_array_parallel (hid_t f , char * label , int num_threads ) {
68
+ bsp_array_t bsp_read_array_parallel (hid_t f , const char * label ,
69
+ int num_threads ) {
69
70
hid_t dset = H5Dopen2 (f , label , H5P_DEFAULT );
70
71
71
72
if (dset == H5I_INVALID_HID ) {
@@ -147,7 +148,7 @@ bsp_array_t bsp_read_array_parallel(hid_t f, char* label, int num_threads) {
147
148
return array ;
148
149
}
149
150
150
- bsp_array_t bsp_read_array (hid_t f , char * label ) {
151
+ bsp_array_t bsp_read_array (hid_t f , const char * label ) {
151
152
hid_t dset = H5Dopen2 (f , label , H5P_DEFAULT );
152
153
153
154
if (dset == H5I_INVALID_HID ) {
@@ -186,7 +187,7 @@ bsp_array_t bsp_read_array(hid_t f, char* label) {
186
187
return array ;
187
188
}
188
189
189
- void bsp_write_attribute (hid_t f , char * label , char * string ) {
190
+ void bsp_write_attribute (hid_t f , const char * label , const char * string ) {
190
191
hid_t strtype = H5Tcopy (H5T_C_S1 );
191
192
H5Tset_size (strtype , strlen (string ));
192
193
H5Tset_cset (strtype , H5T_CSET_UTF8 );
@@ -202,7 +203,7 @@ void bsp_write_attribute(hid_t f, char* label, char* string) {
202
203
H5Sclose (dataspace );
203
204
}
204
205
205
- char * bsp_read_attribute (hid_t f , char * label ) {
206
+ char * bsp_read_attribute (hid_t f , const char * label ) {
206
207
hid_t attribute = H5Aopen (f , label , H5P_DEFAULT );
207
208
hid_t strtype = H5Aget_type (attribute );
208
209
0 commit comments