build: Fix compiler warning and properly cast return value of pthread_self() to long

This commit is contained in:
User Decke 2014-01-04 22:23:46 +00:00
parent b9344a0f3b
commit 9f9f816a34
2 changed files with 2 additions and 2 deletions

View file

@ -307,7 +307,7 @@ void tvhlogv ( const char *file, int line,
/* Basic message */
l = 0;
if (options & TVHLOG_OPT_THREAD) {
l += snprintf(buf + l, sizeof(buf) - l, "tid %ld: ", pthread_self());
l += snprintf(buf + l, sizeof(buf) - l, "tid %ld: ", (long)pthread_self());
}
l += snprintf(buf + l, sizeof(buf) - l, "%s: ", subsys);
if (options & TVHLOG_OPT_FILELINE && severity >= LOG_DEBUG)

View file

@ -99,7 +99,7 @@ thread_wrapper ( void *p )
/* Run */
tvhdebug("thread", "created thread %ld [%s / %p(%p)]",
pthread_self(), ts->name, ts->run, ts->arg);
(long)pthread_self(), ts->name, ts->run, ts->arg);
void *r = ts->run(ts->arg);
free(ts);