Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
bf67bab4
Commit
bf67bab4
authored
May 08, 2014
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of compiler warnings on MacOSX
parent
93a064db
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
91 deletions
+146
-91
MQTTAsync.c
src/MQTTAsync.c
+1
-1
StackTrace.c
src/StackTrace.c
+6
-6
StackTrace.h
src/StackTrace.h
+2
-1
MQTTAsync_publish.c
src/samples/MQTTAsync_publish.c
+4
-0
MQTTAsync_subscribe.c
src/samples/MQTTAsync_subscribe.c
+4
-0
stdoutsuba.c
src/samples/stdoutsuba.c
+1
-0
test1.c
test/test1.c
+1
-1
test3.c
test/test3.c
+127
-82
No files found.
src/MQTTAsync.c
View file @
bf67bab4
...
...
@@ -2619,7 +2619,7 @@ exit:
void
MQTTAsync_setTraceLevel
(
enum
MQTTASYNC_TRACE_LEVELS
level
)
{
Log_setTraceLevel
(
level
);
Log_setTraceLevel
(
(
enum
LOG_LEVELS
)
level
);
}
...
...
src/StackTrace.c
View file @
bf67bab4
...
...
@@ -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
;
...
...
src/StackTrace.h
View file @
bf67bab4
...
...
@@ -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_ */
src/samples/MQTTAsync_publish.c
View file @
bf67bab4
...
...
@@ -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"
...
...
src/samples/MQTTAsync_subscribe.c
View file @
bf67bab4
...
...
@@ -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"
...
...
src/samples/stdoutsuba.c
View file @
bf67bab4
...
...
@@ -50,6 +50,7 @@
#else
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#endif
...
...
test/test1.c
View file @
bf67bab4
...
...
@@ -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;
...
...
test/test3.c
View file @
bf67bab4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment