Skip to content

Commit fa31059

Browse files
authored
Merge pull request #113 from davidbrochart/format_config
Fix format configuration
2 parents 0607a2c + f6ba5c5 commit fa31059

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/xtensor-io/xio_binary.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ namespace xt
143143

144144
struct xio_binary_config
145145
{
146-
const char* name;
147-
const char* version;
146+
std::string name;
147+
std::string version;
148148
bool big_endian;
149149

150150
xio_binary_config()

include/xtensor-io/xio_blosc.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ namespace xt
187187

188188
struct xio_blosc_config
189189
{
190-
const char* name;
191-
const char* version;
190+
std::string name;
191+
std::string version;
192192
bool big_endian;
193193
int clevel;
194194
int shuffle;
195-
const char* cname;
196-
const std::size_t blocksize;
195+
std::string cname;
196+
std::size_t blocksize;
197197

198198
xio_blosc_config()
199199
: name("blosc")
@@ -220,7 +220,7 @@ namespace xt
220220
{
221221
clevel = j["clevel"];
222222
shuffle = j["shuffle"];
223-
cname = j["cname"];
223+
cname = std::string(j["cname"]);
224224
blocksize = j["blocksize"];
225225
}
226226

@@ -249,7 +249,7 @@ namespace xt
249249
template <class E>
250250
void dump_file(std::ostream& stream, const xexpression<E> &e, const xio_blosc_config& config)
251251
{
252-
dump_blosc(stream, e, config.big_endian, config.clevel, config.shuffle, config.cname, config.blocksize);
252+
dump_blosc(stream, e, config.big_endian, config.clevel, config.shuffle, config.cname.c_str(), config.blocksize);
253253
}
254254
} // namespace xt
255255

include/xtensor-io/xio_gzip.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ namespace xt
214214

215215
struct xio_gzip_config
216216
{
217-
const char* name;
218-
const char* version;
217+
std::string name;
218+
std::string version;
219219
bool big_endian;
220220
int level;
221221

0 commit comments

Comments
 (0)