fix: windows build error

This commit is contained in:
Alex Duan 2023-09-20 09:26:59 +08:00
parent 2fdc06e62d
commit 09d91cc116
2 changed files with 5 additions and 3 deletions

View File

@ -507,7 +507,7 @@ const char *cfgDtypeStr(ECfgDataType type) {
return "int64";
case CFG_DTYPE_FLOAT:
return "float";
case CFG_DTYPE_FLOAT:
case CFG_DTYPE_DOUBLE:
return "double";
case CFG_DTYPE_STRING:
return "string";

View File

@ -31,8 +31,8 @@ void encode_with_fse(int *type, size_t dataSeriesLength, unsigned int intervals,
// transcoding
int md = intervals / 2;
uint8_t type2code[intervals];
unsigned int diff[intervals];
uint8_t* type2code = (uint8_t *)malloc(intervals * sizeof(uint8_t));
uint32_t* diff = (uint32_t *)malloc(intervals * sizeof(uint32_t));
for (int i = md; i < intervals; i++)
{
@ -80,6 +80,8 @@ void encode_with_fse(int *type, size_t dataSeriesLength, unsigned int intervals,
exit(1);
}
free(tp_code);
free(type2code);
free(diff);
return;
}