Commit c44afab4 authored by Simon Morlat's avatar Simon Morlat

fix warnings and errors

parent b079a624
......@@ -51,8 +51,8 @@
#ifdef _WIN32
extern void OutputDebugStringPrintf(const char *fmt, ...);
#define fprintf(file, fmt, ...) OutputDebugStringPrintf(fmt, ##__VA_ARGS__)
extern void OutputDebugStringPrintf(FILE *file, const char *fmt, ...);
#define fprintf(file, fmt, ...) OutputDebugStringPrintf(file, fmt, ##__VA_ARGS__)
#elif defined(ANDROID)
extern void AndroidPrintf(FILE *file, const char *fmt, ...);
#define fprintf(file, fmt, ...) AndroidPrintf(file, fmt, ##__VA_ARGS__)
......
......@@ -86,8 +86,8 @@
#include "CUnit_intl.h"
#ifdef _WIN32
extern void OutputDebugStringPrintf(const char *fmt, ...);
#define fprintf(file, fmt, ...) OutputDebugStringPrintf(fmt, ##__VA_ARGS__)
extern void OutputDebugStringPrintf(FILE *file, const char *fmt, ...);
#define fprintf(file, fmt, ...) OutputDebugStringPrintf(file, fmt, ##__VA_ARGS__)
#elif defined(ANDROID)
extern void AndroidPrintf(FILE *file, const char *fmt, ...);
#define fprintf(file, fmt, ...) AndroidPrintf(file, fmt, ##__VA_ARGS__)
......@@ -96,7 +96,6 @@ extern void otherPrintf(FILE *file, const char *fmt, ...);
#define fprintf(file, fmt, ...) otherPrintf(file, fmt, ##__VA_ARGS__)
#endif
/*=================================================================
* Global/Static Definitions
*=================================================================*/
......@@ -577,7 +576,7 @@ CU_EXPORT char * CU_get_run_results_string(void)
{
CU_pRunSummary pRunSummary = &f_run_summary;
CU_pTestRegistry pRegistry = CU_get_registry();
size_t width[9];
int width[9];
size_t len;
char *result;
......
......@@ -60,16 +60,16 @@ extern cunit_trace_handler_t CU_trace_handler;
#include <winsock2.h>
void OutputDebugStringPrintf(const char *fmt, ...) {
char msg[512];
void OutputDebugStringPrintf(FILE *file, const char *fmt, ...) {
va_list args;
int len;
va_start(args, fmt);
if (CU_trace_handler) {
CU_trace_handler(1, fmt, args);
} else {
#ifdef _MSC_VER
char msg[512];
int len;
len = vsnprintf(msg, sizeof(msg), fmt, args);
if (len > 0) {
#ifndef _UNICODE
......@@ -79,9 +79,11 @@ void OutputDebugStringPrintf(const char *fmt, ...) {
mbstowcs(tmp, msg, len);
OutputDebugString(tmp);
free(tmp);
#endif
#endif
}
#else
fprintf(file, fmt, args);
#endif
}
va_end(args);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment