From 413bf90ca426a6c462eb1245660b0ef1b8830fd7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 1 Nov 2007 14:22:58 +0000 Subject: [PATCH] attempt to make gcc 4.3 happy, getting off to a great new friendship git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6128 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_async.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index ec8dd9c783..ca6acf9e31 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1233,23 +1233,24 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, const char switch_copy_string(helper->uuid_str, uuid, sizeof(helper->uuid_str)); - cur = (char *) helper + sizeof(*helper); + cur = (char *) helper; + cur += sizeof(*helper); if (extension) { + switch_copy_string(cur, extension, strlen(extension) + 1); helper->extension = cur; - switch_copy_string(helper->extension, extension, strlen(extension) + 1); cur += strlen(helper->extension) + 1; } if (dialplan) { + switch_copy_string(cur, dialplan, strlen(dialplan) + 1); helper->dialplan = cur; - switch_copy_string(helper->dialplan, dialplan, strlen(dialplan) + 1); cur += strlen(helper->dialplan) + 1; } if (context) { + switch_copy_string(cur, context, strlen(context) + 1); helper->context = cur; - switch_copy_string(helper->context, context, strlen(context) + 1); } return switch_scheduler_add_task(runtime, sch_transfer_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG); @@ -1275,14 +1276,17 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uui { struct broadcast_helper *helper; size_t len = sizeof(*helper) + strlen(path) + 1; + char *cur = NULL; switch_zmalloc(helper, len); - + + cur = (char *) helper; + cur += sizeof(*helper); switch_copy_string(helper->uuid_str, uuid, sizeof(helper->uuid_str)); helper->flags = flags; - helper->path = (char *) helper + sizeof(*helper); - switch_copy_string(helper->path, path, len - sizeof(helper)); - + + switch_copy_string(cur, path, len - sizeof(helper)); + helper->path = cur; return switch_scheduler_add_task(runtime, sch_broadcast_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG); }