mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-02 06:42:10 +00:00
Reformat the code using the uncrustify program.
This commit is contained in:
+13
-19
@@ -27,29 +27,27 @@
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static FILE* fd_log=NULL;
|
||||
static const char* FILENAME="/tmp/espeak.log";
|
||||
static FILE *fd_log = NULL;
|
||||
static const char *FILENAME = "/tmp/espeak.log";
|
||||
|
||||
void debug_init()
|
||||
{
|
||||
if((fd_log = fopen(FILENAME,"a")) != NULL)
|
||||
if ((fd_log = fopen(FILENAME, "a")) != NULL)
|
||||
setvbuf(fd_log, NULL, _IONBF, 0);
|
||||
}
|
||||
|
||||
void debug_enter(const char* text)
|
||||
void debug_enter(const char *text)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
|
||||
if (!fd_log)
|
||||
{
|
||||
if (!fd_log) {
|
||||
debug_init();
|
||||
}
|
||||
|
||||
if (fd_log)
|
||||
{
|
||||
fprintf(fd_log, "%03d.%03dms > ENTER %s\n",(int)(tv.tv_sec%1000), (int)(tv.tv_usec/1000), text);
|
||||
if (fd_log) {
|
||||
fprintf(fd_log, "%03d.%03dms > ENTER %s\n", (int)(tv.tv_sec%1000), (int)(tv.tv_usec/1000), text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,30 +56,26 @@ void debug_show(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
if (!fd_log)
|
||||
{
|
||||
if (!fd_log) {
|
||||
debug_init();
|
||||
}
|
||||
if (fd_log)
|
||||
{
|
||||
if (fd_log) {
|
||||
vfprintf(fd_log, format, args);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void debug_time(const char* text)
|
||||
void debug_time(const char *text)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
|
||||
if (!fd_log)
|
||||
{
|
||||
if (!fd_log) {
|
||||
debug_init();
|
||||
}
|
||||
if (fd_log)
|
||||
{
|
||||
fprintf(fd_log, "%03d.%03dms > %s\n",(int)(tv.tv_sec%1000), (int)(tv.tv_usec/1000), text);
|
||||
if (fd_log) {
|
||||
fprintf(fd_log, "%03d.%03dms > %s\n", (int)(tv.tv_sec%1000), (int)(tv.tv_usec/1000), text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user