提交 d6ed5fe0 编写于 作者: K kailixu

fix: timezone and qsort for windows

上级 10f5d223
......@@ -25,7 +25,7 @@ int32_t qsortHelper(const void* p1, const void* p2, const void* param) {
// todo refactor: 1) move away; 2) use merge sort instead; 3) qsort is not a stable sort actually.
void taosSort(void* base, int64_t sz, int64_t width, __compar_fn_t compar) {
#if defined(WINDOWS) || defined(_ALPINE)
#if defined(WINDOWS_STASH) || defined(_ALPINE)
void* param = compar;
taosqsort(base, sz, width, param, qsortHelper);
#else
......
......@@ -768,7 +768,7 @@ void taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8
keyValue[4] = (keyValue[4] == '+' ? '-' : '+');
keyValue[10] = 0;
sprintf(winStr, "TZ=%s:00", &(keyValue[1]));
*tsTimezone = taosStr2Int32(&keyValue[4], NULL, 10);
*tsTimezone = -taosStr2Int32(&keyValue[4], NULL, 10);
}
break;
}
......@@ -789,7 +789,7 @@ void taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8
indexStr = ppp - pp + 3;
}
sprintf(&winStr[indexStr], "%c%c%c:%c%c:00", (p[0] == '+' ? '-' : '+'), p[1], p[2], p[3], p[4]);
*tsTimezone = taosStr2Int32(p, NULL, 10);
*tsTimezone = -taosStr2Int32(p, NULL, 10);
} else {
*tsTimezone = 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册