diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-16 23:26:35 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-16 23:26:35 +0000 |
commit | a5cb42eb374822390654563f5c8953b370c36bfd (patch) | |
tree | b7abefcd8790f100491f5f613cdd39faa87a74e1 | |
parent | a8680bf79fa2ef20c5e14f7ffda84a9b28017a00 (diff) |
minor changes and eliminate some compiler warnings
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6803 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | apps/app_mixmonitor.c | 3 | ||||
-rwxr-xr-x | apps/app_muxmon.c | 3 | ||||
-rwxr-xr-x | file.c | 13 |
3 files changed, 7 insertions, 12 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 852eae8d9..73e5c5a50 100755 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -28,8 +28,6 @@ #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0 #define minmax(x,y) x ? (x > y) ? y : ((x < (y * -1)) ? (y * -1) : x) : 0 -AST_MUTEX_DEFINE_STATIC(modlock); - static char *tdesc = "Native Channel Monitoring Module"; static char *app = "MuxMon"; static char *synopsis = "Record A Call Natively"; @@ -460,7 +458,6 @@ static int muxmon_cli(int fd, int argc, char **argv) { char *op, *chan_name = NULL, *args = NULL; struct ast_channel *chan; - int count = 0; if (argc > 2) { op = argv[1]; diff --git a/apps/app_muxmon.c b/apps/app_muxmon.c index 852eae8d9..73e5c5a50 100755 --- a/apps/app_muxmon.c +++ b/apps/app_muxmon.c @@ -28,8 +28,6 @@ #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0 #define minmax(x,y) x ? (x > y) ? y : ((x < (y * -1)) ? (y * -1) : x) : 0 -AST_MUTEX_DEFINE_STATIC(modlock); - static char *tdesc = "Native Channel Monitoring Module"; static char *app = "MuxMon"; static char *synopsis = "Record A Call Natively"; @@ -460,7 +458,6 @@ static int muxmon_cli(int fd, int argc, char **argv) { char *op, *chan_name = NULL, *args = NULL; struct ast_channel *chan; - int count = 0; if (argc > 2) { op = argv[1]; @@ -870,7 +870,8 @@ struct ast_filestream *ast_readfile(const char *filename, const char *type, cons struct ast_filestream *ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode) { int fd, myflags = 0; - FILE *bfile; + /* compiler claims this variable can be used before initialization... */ + FILE *bfile = NULL; struct ast_format *f; struct ast_filestream *fs = NULL; char *fn, *orig_fn = NULL; @@ -908,7 +909,7 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con } } - if (option_cache_record_files && fd >= 0) { + if (option_cache_record_files && (fd > -1)) { char *c; fclose(bfile); @@ -923,8 +924,9 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con size = strlen(fn) + strlen(record_cache_dir) + 2; buf = alloca(size); - memset(buf, 0, size); - snprintf(buf, size, "%s/%s", record_cache_dir, fn); + strcpy(buf, record_cache_dir); + strcat(buf, "/"); + strcat(buf, fn); free(fn); fn = buf; fd = open(fn, flags | myflags, mode); @@ -938,9 +940,8 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con } } } - if (fd >= 0) { + if (fd > -1) { errno = 0; - if ((fs = f->rewrite(bfile, comment))) { fs->trans = NULL; fs->fmt = f; |