aboutsummaryrefslogtreecommitdiffstats
path: root/formats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:39:04 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:39:04 +0000
commitd3d057390c26ce35b54750705377c4d3ff4e42bd (patch)
treea04b5ab1a5d778cb8c4239d8cac88ef1a5ebba5d /formats
parent9a2130e9dec6e913af3b75006c23feb0520d6814 (diff)
port gcc 4.3.x warning fixes from trunk to this branch
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@153743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats')
-rw-r--r--formats/format_gsm.c4
-rw-r--r--formats/format_ogg_vorbis.c16
-rw-r--r--formats/format_wav.c7
-rw-r--r--formats/format_wav_gsm.c4
4 files changed, 23 insertions, 8 deletions
diff --git a/formats/format_gsm.c b/formats/format_gsm.c
index d43844e64..d8a0813b6 100644
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -126,7 +126,9 @@ static int gsm_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
int i;
fseeko(fs->f, 0, SEEK_END);
for (i=0; i< (offset - max) / GSM_FRAME_SIZE; i++) {
- fwrite(gsm_silence, 1, GSM_FRAME_SIZE, fs->f);
+ if (!fwrite(gsm_silence, 1, GSM_FRAME_SIZE, fs->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
}
}
return fseeko(fs->f, offset, SEEK_SET);
diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c
index 669e96a7d..c2dc977b6 100644
--- a/formats/format_ogg_vorbis.c
+++ b/formats/format_ogg_vorbis.c
@@ -225,8 +225,12 @@ static int ogg_vorbis_rewrite(struct ast_filestream *s,
while (!tmp->eos) {
if (ogg_stream_flush(&tmp->os, &tmp->og) == 0)
break;
- fwrite(tmp->og.header, 1, tmp->og.header_len, s->f);
- fwrite(tmp->og.body, 1, tmp->og.body_len, s->f);
+ if (!fwrite(tmp->og.header, 1, tmp->og.header_len, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ if (!fwrite(tmp->og.body, 1, tmp->og.body_len, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
if (ogg_page_eos(&tmp->og))
tmp->eos = 1;
}
@@ -251,8 +255,12 @@ static void write_stream(struct vorbis_desc *s, FILE *f)
if (ogg_stream_pageout(&s->os, &s->og) == 0) {
break;
}
- fwrite(s->og.header, 1, s->og.header_len, f);
- fwrite(s->og.body, 1, s->og.body_len, f);
+ if (!fwrite(s->og.header, 1, s->og.header_len, f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ if (!fwrite(s->og.body, 1, s->og.body_len, f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
if (ogg_page_eos(&s->og)) {
s->eos = 1;
}
diff --git a/formats/format_wav.c b/formats/format_wav.c
index 2a40dedbd..856c28c1d 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -329,8 +329,11 @@ static void wav_close(struct ast_filestream *s)
char zero = 0;
struct wav_desc *fs = (struct wav_desc *)s->_private;
/* Pad to even length */
- if (fs->bytes & 0x1)
- fwrite(&zero, 1, 1, s->f);
+ if (fs->bytes & 0x1) {
+ if (!fwrite(&zero, 1, 1, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ }
}
static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c
index aa576195c..15c0381fe 100644
--- a/formats/format_wav_gsm.c
+++ b/formats/format_wav_gsm.c
@@ -496,7 +496,9 @@ static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
int i;
fseek(fs->f, 0, SEEK_END);
for (i=0; i< (offset - max) / MSGSM_FRAME_SIZE; i++) {
- fwrite(msgsm_silence, 1, MSGSM_FRAME_SIZE, fs->f);
+ if (!fwrite(msgsm_silence, 1, MSGSM_FRAME_SIZE, fs->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
}
}
s->secondhalf = 0;