[asterisk-commits] tilghman: trunk r160208 - in /trunk: ./ apps/ channels/ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 1 18:37:21 CST 2008
Author: tilghman
Date: Mon Dec 1 18:37:21 2008
New Revision: 160208
URL: http://svn.digium.com/view/asterisk?view=rev&rev=160208
Log:
Merged revisions 160207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r160207 | tilghman | 2008-12-01 18:25:16 -0600 (Mon, 01 Dec 2008) | 3 lines
Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc
and glibc.
........
Modified:
trunk/ (props changed)
trunk/apps/app_voicemail.c
trunk/channels/chan_features.c
trunk/include/asterisk/stringfields.h
trunk/main/cli.c
trunk/main/frame.c
trunk/main/pbx.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Dec 1 18:37:21 2008
@@ -2843,7 +2843,9 @@
}
}
}
- truncate(full_fn, fdlen);
+ if (truncate(full_fn, fdlen) < 0) {
+ ast_log(LOG_WARNING, "Unable to truncate '%s': %s\n", full_fn, strerror(errno));
+ }
}
} else {
res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
Modified: trunk/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_features.c?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/channels/chan_features.c (original)
+++ trunk/channels/chan_features.c Mon Dec 1 18:37:21 2008
@@ -449,7 +449,11 @@
for (x=1;x<4;x++) {
if (b2)
ast_free(b2);
- asprintf(&b2, "%s/%s-%d", p->tech, p->dest, x);
+ if (asprintf(&b2, "%s/%s-%d", p->tech, p->dest, x) < 0) {
+ ast_log(LOG_WARNING, "Unable to create channel name: %s\n", strerror(errno));
+ b2 = NULL;
+ continue;
+ }
for (y=0;y<3;y++) {
if (y == idx)
continue;
Modified: trunk/include/asterisk/stringfields.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/stringfields.h?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/include/asterisk/stringfields.h (original)
+++ trunk/include/asterisk/stringfields.h Mon Dec 1 18:37:21 2008
@@ -255,12 +255,16 @@
const char *__d__ = (data); \
size_t __dlen__ = (__d__) ? strlen(__d__) + 1 : 1; \
const char **__p__ = (const char **) (ptr); \
+ char *__q__; \
if (__dlen__ == 1) \
*__p__ = __ast_string_field_empty; \
- else if (!__ast_string_field_ptr_grow(&(x)->__field_mgr, __dlen__, ptr)) \
- memcpy((char *) *__p__, __d__, __dlen__); \
- else if ((*__p__ = __ast_string_field_alloc_space(&(x)->__field_mgr, &(x)->__field_mgr_pool, __dlen__))) \
- memcpy((char *) *__p__, __d__, __dlen__); \
+ else if (!__ast_string_field_ptr_grow(&(x)->__field_mgr, __dlen__, ptr)) { \
+ __q__ = (char *) *__p__; \
+ memcpy(__q__, __d__, __dlen__); \
+ } else if ((*__p__ = __ast_string_field_alloc_space(&(x)->__field_mgr, &(x)->__field_mgr_pool, __dlen__))) { \
+ __q__ = (char *) *__p__; \
+ memcpy(__q__, __d__, __dlen__); \
+ } \
} while (0)
/*!
Modified: trunk/main/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cli.c?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/main/cli.c (original)
+++ trunk/main/cli.c Mon Dec 1 18:37:21 2008
@@ -1769,7 +1769,8 @@
e->_full_cmd = NULL;
if (e->handler) {
/* this is a new-style entry. Reset fields and free memory. */
- memset((char **)(e->cmda), '\0', sizeof(e->cmda));
+ char *cmda = (char *) e->cmda;
+ memset(cmda, '\0', sizeof(e->cmda));
ast_free(e->command);
e->command = NULL;
e->usage = NULL;
Modified: trunk/main/frame.c
URL: http://svn.digium.com/view/asterisk/trunk/main/frame.c?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/main/frame.c (original)
+++ trunk/main/frame.c Mon Dec 1 18:37:21 2008
@@ -478,9 +478,12 @@
memcpy(out->data.ptr, f->data.ptr, out->datalen);
}
if (srclen > 0) {
+ /* This may seem a little strange, but it's to avoid a gcc (4.2.4) compiler warning */
+ char *src;
out->src = buf + sizeof(*out) + AST_FRIENDLY_OFFSET + f->datalen;
+ src = (char *) out->src;
/* Must have space since we allocated for it */
- strcpy((char *)out->src, f->src);
+ strcpy(src, f->src);
}
ast_copy_flags(out, f, AST_FRFLAG_HAS_TIMING_INFO);
out->ts = f->ts;
Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=160208&r1=160207&r2=160208
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Mon Dec 1 18:37:21 2008
@@ -7077,14 +7077,19 @@
{
struct ast_ignorepat *ignorepat, *ignorepatc, *ignorepatl = NULL;
int length;
+ char *pattern;
length = sizeof(struct ast_ignorepat);
length += strlen(value) + 1;
if (!(ignorepat = ast_calloc(1, length)))
return -1;
/* The cast to char * is because we need to write the initial value.
- * The field is not supposed to be modified otherwise
+ * The field is not supposed to be modified otherwise. Also, gcc 4.2
+ * sees the cast as dereferencing a type-punned pointer and warns about
+ * it. This is the workaround (we're telling gcc, yes, that's really
+ * what we wanted to do).
*/
- strcpy((char *)ignorepat->pattern, value);
+ pattern = (char *) ignorepat->pattern;
+ strcpy(pattern, value);
ignorepat->next = NULL;
ignorepat->registrar = registrar;
ast_wrlock_context(con);
More information about the asterisk-commits
mailing list