aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_g726.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-26 17:06:17 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-26 17:06:17 +0000
commita1fa45760e632d9a689d0476b25409af81a4f5d1 (patch)
treefed62da6065b0ba8588fe15f5adcc22c8e0d638a /codecs/codec_g726.c
parente4747d0d1c05c97e56dabb236b0195327b1e8ee2 (diff)
Convert casts to unions, to fix alignment issues on Solaris
(closes issue #12932) Reported by: snuffy Patches: bug_12932_20080627.diff uploaded by snuffy (license 35) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@125386 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_g726.c')
-rw-r--r--codecs/codec_g726.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/codecs/codec_g726.c b/codecs/codec_g726.c
index 8d1346e66..80e0e8ea9 100644
--- a/codecs/codec_g726.c
+++ b/codecs/codec_g726.c
@@ -693,7 +693,7 @@ static int g726aal2tolin_framein (struct ast_trans_pvt *pvt, struct ast_frame *f
{
struct g726_coder_pvt *tmp = pvt->pvt;
unsigned char *src = f->data.ptr;
- int16_t *dst = (int16_t *) pvt->outbuf + pvt->samples;
+ int16_t *dst = pvt->outbuf.i16 + pvt->samples;
unsigned int i;
for (i = 0; i < f->datalen; i++) {
@@ -718,7 +718,7 @@ static int lintog726aal2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
unsigned char d = g726_encode(src[i], &tmp->g726); /* this sample */
if (tmp->next_flag & 0x80) { /* merge with leftover sample */
- pvt->outbuf[pvt->datalen++] = ((tmp->next_flag & 0xf)<< 4) | d;
+ pvt->outbuf.c[pvt->datalen++] = ((tmp->next_flag & 0xf)<< 4) | d;
pvt->samples += 2; /* 2 samples per byte */
tmp->next_flag = 0;
} else {
@@ -734,7 +734,7 @@ static int g726tolin_framein (struct ast_trans_pvt *pvt, struct ast_frame *f)
{
struct g726_coder_pvt *tmp = pvt->pvt;
unsigned char *src = f->data.ptr;
- int16_t *dst = (int16_t *) pvt->outbuf + pvt->samples;
+ int16_t *dst = pvt->outbuf.i16 + pvt->samples;
unsigned int i;
for (i = 0; i < f->datalen; i++) {
@@ -759,7 +759,7 @@ static int lintog726_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
unsigned char d = g726_encode(src[i], &tmp->g726); /* this sample */
if (tmp->next_flag & 0x80) { /* merge with leftover sample */
- pvt->outbuf[pvt->datalen++] = (d << 4) | (tmp->next_flag & 0xf);
+ pvt->outbuf.c[pvt->datalen++] = (d << 4) | (tmp->next_flag & 0xf);
pvt->samples += 2; /* 2 samples per byte */
tmp->next_flag = 0;
} else {
@@ -774,7 +774,7 @@ static int lintog726_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static int g726tog726aal2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
unsigned char *src = f->data.ptr;
- unsigned char *dst = (unsigned char *) pvt->outbuf + pvt->samples;
+ unsigned char *dst = pvt->outbuf.uc + pvt->samples;
unsigned int i;
for (i = 0; i < f->datalen; i++)