Fine. Fix windows.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4262 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-04-19 23:06:37 +00:00
parent 956ea0df56
commit b00d75ab7c

View File

@ -887,7 +887,7 @@ static JSValue _tf_task_getHitches(JSContext* context, JSValueConst this_val, in
tf_task_t* task = JS_GetContextOpaque(context); tf_task_t* task = JS_GetContextOpaque(context);
tf_trace_begin(task->_trace, __func__); tf_trace_begin(task->_trace, __func__);
JSValue result = JS_NewObject(context); JSValue result = JS_NewObject(context);
for (int i = 0; i < _countof(task->hitches); i++) for (int i = 0; i < (int)_countof(task->hitches); i++)
{ {
if (*task->hitches[i].name) if (*task->hitches[i].name)
{ {
@ -1607,13 +1607,13 @@ static void _tf_task_trace_to_parent(tf_trace_t* trace, const char* buffer, size
static void _tf_task_record_hitch(const char* name, uint64_t duration_ns, void* user_data) static void _tf_task_record_hitch(const char* name, uint64_t duration_ns, void* user_data)
{ {
tf_task_t* task = user_data; tf_task_t* task = user_data;
for (int i = 0; i < _countof(task->hitches); i++) for (int i = 0; i < (int)_countof(task->hitches); i++)
{ {
if (duration_ns > task->hitches[i].duration_ns) if (duration_ns > task->hitches[i].duration_ns)
{ {
if (i + 1 < _countof(task->hitches)) if (i + 1 < (int)_countof(task->hitches))
{ {
memmove(task->hitches + i + 1, task->hitches + i, sizeof(hitch_t) * (_countof(task->hitches) - i - 1)); memmove(task->hitches + i + 1, task->hitches + i, sizeof(hitch_t) * ((int)_countof(task->hitches) - i - 1));
} }
snprintf(task->hitches[i].name, sizeof(task->hitches[i].name), "%s", name); snprintf(task->hitches[i].name, sizeof(task->hitches[i].name), "%s", name);
task->hitches[i].duration_ns = duration_ns; task->hitches[i].duration_ns = duration_ns;