From 3347aa9a534c3c34fc88331e75bb54d30d7c2954 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 18 Dec 2014 11:51:25 +0100 Subject: [PATCH] Fix const string return values so that wrapper generators know that these strings do not need to be dealloced. --- coreapi/content.c | 2 +- coreapi/content.h | 2 +- coreapi/linphonecore.c | 2 +- coreapi/linphonecore.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coreapi/content.c b/coreapi/content.c index 74d04ebb7..332789d2a 100644 --- a/coreapi/content.c +++ b/coreapi/content.c @@ -115,7 +115,7 @@ void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, s ((char *)content->lcp.data)[size] = '\0'; } -char * linphone_content_get_string_buffer(const LinphoneContent *content) { +const char * linphone_content_get_string_buffer(const LinphoneContent *content) { return (char *)content->lcp.data; } diff --git a/coreapi/content.h b/coreapi/content.h index 400f5f5fb..e3e0166ce 100644 --- a/coreapi/content.h +++ b/coreapi/content.h @@ -165,7 +165,7 @@ LINPHONE_PUBLIC void linphone_content_set_buffer(LinphoneContent *content, const * @param[in] content LinphoneContent object * @return The string content data buffer. */ -LINPHONE_PUBLIC char * linphone_content_get_string_buffer(const LinphoneContent *content); +LINPHONE_PUBLIC const char * linphone_content_get_string_buffer(const LinphoneContent *content); /** * Set the string content data buffer. diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6dc8aef36..152128a2c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7074,7 +7074,7 @@ int linphone_payload_type_get_normal_bitrate(const LinphonePayloadType *pt) { return pt->normal_bitrate; } -char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt) { +const char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt) { return pt->mime_type; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 155170338..63ee7f7e0 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -257,7 +257,7 @@ LINPHONE_PUBLIC int linphone_payload_type_get_normal_bitrate(const LinphonePaylo * @param[in] pt LinphonePayloadType object * @return The mime type. */ -LINPHONE_PUBLIC char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt); +LINPHONE_PUBLIC const char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt); /** * Get the number of channels.