[Asterisk-cvs] asterisk frame.c,1.68,1.69
kpfleming
kpfleming
Mon Oct 31 13:22:56 CST 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv3988
Modified Files:
frame.c
Log Message:
don't pass short arguments by value, it will cause compiler warnings on most platforms about implicit conversions (thanks Luigi!)
Index: frame.c
===================================================================
RCS file: /usr/cvsroot/asterisk/frame.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- frame.c 28 Oct 2005 21:49:27 -0000 1.68
+++ frame.c 31 Oct 2005 18:15:02 -0000 1.69
@@ -1257,15 +1257,19 @@
{
int count;
short *fdata = f->data;
+ short adjust_value = abs(adjustment);
if ((f->frametype != AST_FRAME_VOICE) || (f->subclass != AST_FORMAT_SLINEAR))
return -1;
+ if (!adjustment)
+ return 0;
+
for (count = 0; count < f->samples; count++) {
if (adjustment > 0) {
- ast_slinear_saturated_multiply(&fdata[count], abs(adjustment));
+ ast_slinear_saturated_multiply(&fdata[count], &adjust_value);
} else if (adjustment < 0) {
- ast_slinear_saturated_divide(&fdata[count], abs(adjustment));
+ ast_slinear_saturated_divide(&fdata[count], &adjust_value);
}
}
@@ -1289,7 +1293,7 @@
for (count = 0, data1 = f1->data, data2 = f2->data;
count < f1->samples;
count++, data1++, data2++)
- ast_slinear_saturated_add(data1, *data2);
+ ast_slinear_saturated_add(data1, data2);
return 0;
}
More information about the svn-commits
mailing list