Commit bf67bab4 authored by Ian Craggs's avatar Ian Craggs

Get rid of compiler warnings on MacOSX

parent 93a064db
......@@ -2619,7 +2619,7 @@ exit:
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
{
Log_setTraceLevel(level);
Log_setTraceLevel((enum LOG_LEVELS)level);
}
......
......@@ -104,7 +104,7 @@ void StackTrace_entry(const char* name, int line, int trace_level)
if (!setStack(1))
goto exit;
if (trace_level != -1)
Log_stackTrace(trace_level, 9, cur_thread->id, cur_thread->current_depth, name, line, NULL);
Log_stackTrace(trace_level, 9, (int)cur_thread->id, cur_thread->current_depth, name, line, NULL);
strncpy(cur_thread->callstack[cur_thread->current_depth].name, name, sizeof(cur_thread->callstack[0].name)-1);
cur_thread->callstack[(cur_thread->current_depth)++].line = line;
if (cur_thread->current_depth > cur_thread->maxdepth)
......@@ -128,9 +128,9 @@ void StackTrace_exit(const char* name, int line, void* rc, int trace_level)
if (trace_level != -1)
{
if (rc == NULL)
Log_stackTrace(trace_level, 10, cur_thread->id, cur_thread->current_depth, name, line, NULL);
Log_stackTrace(trace_level, 10, (int)cur_thread->id, cur_thread->current_depth, name, line, NULL);
else
Log_stackTrace(trace_level, 11, cur_thread->id, cur_thread->current_depth, name, line, (int*)rc);
Log_stackTrace(trace_level, 11, (int)cur_thread->id, cur_thread->current_depth, name, line, (int*)rc);
}
exit:
Thread_unlock_mutex(stack_mutex);
......@@ -152,14 +152,14 @@ void StackTrace_printStack(FILE* dest)
{
int i = cur_thread->current_depth - 1;
fprintf(file, "=========== Start of stack trace for thread %lu ==========\n", cur_thread->id);
fprintf(file, "=========== Start of stack trace for thread %lu ==========\n", (unsigned long)cur_thread->id);
if (i >= 0)
{
fprintf(file, "%s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
while (--i >= 0)
fprintf(file, " at %s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
}
fprintf(file, "=========== End of stack trace for thread %lu ==========\n\n", cur_thread->id);
fprintf(file, "=========== End of stack trace for thread %lu ==========\n\n", (unsigned long)cur_thread->id);
}
}
if (file != stdout && file != stderr && file != NULL)
......@@ -167,7 +167,7 @@ void StackTrace_printStack(FILE* dest)
}
char* StackTrace_get(unsigned long threadid)
char* StackTrace_get(thread_id_type threadid)
{
int bufsize = 256;
char* buf = NULL;
......
......@@ -19,6 +19,7 @@
#include <stdio.h>
#include "Log.h"
#include "Thread.h"
#if defined(NOSTACKTRACE)
#define FUNC_ENTRY
......@@ -65,6 +66,6 @@ void StackTrace_entry(const char* name, int line, int trace);
void StackTrace_exit(const char* name, int line, void* return_value, int trace);
void StackTrace_printStack(FILE* dest);
char* StackTrace_get(unsigned long);
char* StackTrace_get(thread_id_type);
#endif /* STACKTRACE_H_ */
......@@ -19,6 +19,10 @@
#include "string.h"
#include "MQTTAsync.h"
#if !defined(WIN32)
#include <unistd.h>
#endif
#define ADDRESS "tcp://m2m.eclipse.org:1883"
#define CLIENTID "ExampleClientPub"
#define TOPIC "MQTT Examples"
......
......@@ -19,6 +19,10 @@
#include "string.h"
#include "MQTTAsync.h"
#if !defined(WIN32)
#include <unistd.h>
#endif
#define ADDRESS "tcp://localhost:1883"
#define CLIENTID "ExampleClientSub"
#define TOPIC "MQTT Examples"
......
......@@ -50,6 +50,7 @@
#else
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#endif
......
......@@ -606,7 +606,7 @@ int test3(struct Options options)
/* authorization failure (RC = 5) */
opts.username = "Admin";
opts.password = "Admin";
/*opts.will = &wopts; /* "Admin" not authorized to publish to Will topic by default
/*opts.will = &wopts; "Admin" not authorized to publish to Will topic by default
opts.will->message = "will message";
opts.will->qos = 1;
opts.will->retained = 0;
......
This diff is collapsed.
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