aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-10 19:02:58 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-10 19:02:58 +0000
commitc6eff55cd49c222ad1de8622d2a38783e26d8866 (patch)
tree614c389abdf87ed2a13594a970b68eb3673b1588 /include/asterisk
parent88005277340f96478d5e95bb914681cb23d1247a (diff)
Return the useless casts that ensure this file is C++ clean. (issue #8602 reported by mikma)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@50397 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/strings.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index c91ecaec3..d45a7cd22 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -32,6 +32,8 @@
#include "asterisk/utils.h"
#include "asterisk/threadstorage.h"
+/* You may see casts in this header that may seem useless but they ensure this file is C++ clean */
+
static force_inline int ast_strlen_zero(const char *s)
{
return (!s || (*s == '\0'));
@@ -333,7 +335,7 @@ struct ast_str * attribute_malloc ast_str_create(size_t init_len),
{
struct ast_str *buf;
- buf = ast_calloc(1, sizeof(*buf) + init_len);
+ buf = (struct ast_str *)ast_calloc(1, sizeof(*buf) + init_len);
if (buf == NULL)
return NULL;
@@ -373,7 +375,7 @@ int ast_str_make_space(struct ast_str **buf, size_t new_len),
return 0; /* success */
if ((*buf)->ts == DS_ALLOCA || (*buf)->ts == DS_STATIC)
return -1; /* cannot extend */
- *buf = ast_realloc(*buf, new_len + sizeof(struct ast_str));
+ *buf = (struct ast_str *)ast_realloc(*buf, new_len + sizeof(struct ast_str));
if (*buf == NULL) /* XXX watch out, we leak memory here */
return -1;
if ((*buf)->ts != DS_MALLOC) {
@@ -438,7 +440,7 @@ struct ast_str *ast_str_thread_get(struct ast_threadstorage *ts,
{
struct ast_str *buf;
- buf = ast_threadstorage_get(ts, sizeof(*buf) + init_len);
+ buf = (struct ast_str *)ast_threadstorage_get(ts, sizeof(*buf) + init_len);
if (buf == NULL)
return NULL;
@@ -458,7 +460,7 @@ struct ast_str *__ast_str_thread_get(struct ast_threadstorage *ts,
{
struct ast_str *buf;
- buf = __ast_threadstorage_get(ts, sizeof(*buf) + init_len, file, function, line);
+ buf = (struct ast_str *)__ast_threadstorage_get(ts, sizeof(*buf) + init_len, file, function, line);
if (buf == NULL)
return NULL;