enh: compatibility between getFileNamePrefix and tsdbTFileName
This commit is contained in:
parent
6fbf251978
commit
01f45b2a99
|
@ -112,7 +112,10 @@ static char* getFileNamePrefix(STsdb *pTsdb, SDiskID did, int32_t fid, uint64_t
|
||||||
p += titoa(TD_VID(pTsdb->pVnode), 10, p);
|
p += titoa(TD_VID(pTsdb->pVnode), 10, p);
|
||||||
*(p++) = 'f';
|
*(p++) = 'f';
|
||||||
|
|
||||||
p += titoa(fid, 10, p);
|
if (fid < 0) {
|
||||||
|
*(p++) = '-';
|
||||||
|
}
|
||||||
|
p += titoa((fid < 0) ? -fid : fid, 10, p);
|
||||||
|
|
||||||
memcpy(p, "ver", 3);
|
memcpy(p, "ver", 3);
|
||||||
p += 3;
|
p += 3;
|
||||||
|
|
|
@ -351,10 +351,10 @@ int32_t titoa(uint64_t val, size_t radix, char str[]) {
|
||||||
|
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
uint64_t v = val;
|
uint64_t v = val;
|
||||||
while(v > 0) {
|
do {
|
||||||
buf[i++] = s[v % radix];
|
buf[i++] = s[v % radix];
|
||||||
v /= radix;
|
v /= radix;
|
||||||
}
|
} while (v > 0);
|
||||||
|
|
||||||
// reverse order
|
// reverse order
|
||||||
for(int32_t j = 0; j < i; ++j) {
|
for(int32_t j = 0; j < i; ++j) {
|
||||||
|
|
Loading…
Reference in New Issue