mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-04 08:55:40 +03:00
pdu.[hc]: make argument of coap_new_pdu() const
As the session object passed to coap_new_pdu() is not modified it should be const.
This commit is contained in:
1 parent
48b1eff004
commit
76daa297cd
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -385,7 +385,7 @@ void coap_pdu_clear(coap_pdu_t *pdu, size_t size);
|
||||
/**
|
||||
* Creates a new CoAP PDU.
|
||||
*/
|
||||
coap_pdu_t *coap_new_pdu(struct coap_session_t *session);
|
||||
coap_pdu_t *coap_new_pdu(const struct coap_session_t *session);
|
||||
|
||||
/**
|
||||
* Dispose of an CoAP PDU and frees associated storage.
|
||||
|
||||
@@ -128,7 +128,7 @@ coap_pdu_init(uint8_t type, uint8_t code, uint16_t tid, size_t size) {
|
||||
}
|
||||
|
||||
coap_pdu_t *
|
||||
coap_new_pdu(struct coap_session_t *session) {
|
||||
coap_new_pdu(const struct coap_session_t *session) {
|
||||
coap_pdu_t *pdu = coap_pdu_init(0, 0, 0, coap_session_max_pdu_size(session));
|
||||
#ifndef NDEBUG
|
||||
if (!pdu)
|
||||
|
||||
Reference in new issue
Block a user