-
Notifications
You must be signed in to change notification settings - Fork 2.1k
pkg : libcoap : Update libcoap version #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've allowed myself to smuggle in this little change, since #576 seemed to forgot about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make a PR on its own out of that diff, then we can fast track it.
Maybe you could add spaces in the next line, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎 (from @mehlis)
|
Here's a somewhat nicer overview of what I've changed from libcoap upstream: git clone git://github.com/authmillenon/libcoap
git log --oneline --stat origin/master...origin/riot-portgit show --oneline 0c58dfa0c58dfa Add RIOT Makefile
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f90baa1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+MODULE:=$(shell basename $(CURDIR))
+INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include
+CFLAGS += -DWITH_POSIX
+
+include $(RIOTBASE)/Makefile.basegit show --oneline 31a9bc1[martin@beutlin libcoap]<3 cat pla.
31a9bc1 Eliminate some compiler warnings and errors
diff --git a/address.h b/address.h
index 403240e..0e715f1 100644
--- a/address.h
+++ b/address.h
@@ -106,6 +106,10 @@ _coap_address_equals_impl(const coap_address_t *a,
return 0;
}
+#ifndef IN_MULTICAST
+#define IN_MULTICAST(a) (1)
+#endif
+
static inline int
_coap_is_mcast_impl(const coap_address_t *a) {
if (!a)
diff --git a/net.c b/net.c
index e90d49a..f4b3b67 100644
--- a/net.c
+++ b/net.c
@@ -45,6 +45,10 @@
#include "block.h"
#include "net.h"
+#ifndef UINT_MAX
+#define UINT_MAX ((2 << sizeof (unsigned)) - 1)
+#endif
+
#if defined(WITH_POSIX)
time_t clock_offset;
diff --git a/net.h b/net.h
index f9afd48..59c7d59 100644
--- a/net.h
+++ b/net.h
@@ -132,7 +132,7 @@ typedef struct coap_context_t {
* random value. A new message id can be created with
* coap_new_message_id().
*/
- unsigned short message_id;
+ uint16_t message_id;
/**
* The next value to be used for Observe. This field is global for
@@ -196,9 +196,11 @@ coap_context_t *coap_new_context(const coap_address_t *listen_addr);
static inline unsigned short
coap_new_message_id(coap_context_t *context) {
#ifndef WITH_CONTIKI
- return htons(++(context->message_id));
+ context->message_id += 1;
+ return htons(context->message_id);
#else /* WITH_CONTIKI */
- return uip_htons(++context->message_id);
+ context->message_id += 1;
+ return uip_htons(context->message_id);
#endif
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an IPv4 function. Since RIOT does not support that: always be true.
|
Just use sizeof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do need really this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise the compiler complains.
operation on `context->message_id` may not be undefined
|
@Kijewski Oh, I'll change that (it was getting late tonight). |
|
Fixed and rebased |
|
ACK & GO |
pkg : libcoap : Update libcoap version
|
Does this build without |
|
Propably not… |
|
Then I better hurry... |
No description provided.