mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
- libdvbsub: fix compiler warning: ‘int ftime(timeb*)’ is deprecated
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#include <sys/timeb.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
@@ -34,17 +34,15 @@ FILE* Debug::set_file(char* file)
|
|||||||
void Debug::print(int level, const char *fmt, ...)
|
void Debug::print(int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list argp;
|
va_list argp;
|
||||||
struct timeb tp;
|
struct timeval tv;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char tbuf[20];
|
char tbuf[20];
|
||||||
int len;
|
int len;
|
||||||
struct tm tv;
|
|
||||||
|
|
||||||
if (level < level_) {
|
if (level < level_) {
|
||||||
ftime(&tp);
|
gettimeofday(&tv, NULL);
|
||||||
localtime_r (&tp.time, &tv);
|
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&tv.tv_sec));
|
||||||
strftime (tbuf, 14, "%H:%M:%S", &tv);
|
len = sprintf(buf, "[ %s.%03ld ] ", tbuf, tv.tv_usec / 1000);
|
||||||
len = sprintf(buf, "[ %s.%03d ] ", tbuf, tp.millitm);
|
|
||||||
|
|
||||||
va_start(argp, fmt);
|
va_start(argp, fmt);
|
||||||
//vfprintf(fp_, fmt, argp);
|
//vfprintf(fp_, fmt, argp);
|
||||||
|
Reference in New Issue
Block a user