]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
make ast_waitstream_* return value compatible with platforms that use unsigned char...
authorKevin P. Fleming <kpfleming@digium.com>
Sun, 5 Jun 2005 15:04:43 +0000 (15:04 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sun, 5 Jun 2005 15:04:43 +0000 (15:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5846 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c
channel.c
file.c
include/asterisk/channel.h
include/asterisk/file.h
pbx.c

diff --git a/app.c b/app.c
index 93273b1a739008f4144ada140115671b9c293bb3..07799f87c90432a810eec5f711afb4518cb44193 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -513,7 +513,8 @@ static int global_maxsilence = 0;
 
 int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
 {
-       char d, *fmts;
+       int d;
+       char *fmts;
        char comment[256];
        int x, fmtcnt=1, res=-1,outmsg=0;
        struct ast_frame *f;
@@ -730,7 +731,8 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 
 int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence)
 {
-       char d = 0, *fmts;
+       int d = 0;
+       char *fmts;
        char comment[256];
        int x, fmtcnt=1, res=-1,outmsg=0;
        struct ast_frame *f;
index 3a3d1f983918f3101c9e4fc90fece02781ec5803..0018b6309934d417b1d68981d6494329e5b141e0 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -1235,11 +1235,11 @@ int ast_waitfor(struct ast_channel *c, int ms)
        return ms;
 }
 
-char ast_waitfordigit(struct ast_channel *c, int ms)
+int ast_waitfordigit(struct ast_channel *c, int ms)
 {
        /* XXX Should I be merged with waitfordigit_full XXX */
        struct ast_frame *f;
-       char result = 0;
+       int result = 0;
        /* Stop if we're a zombie or need a soft hangup */
        if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c)) 
                return -1;
@@ -1279,7 +1279,7 @@ int ast_settimeout(struct ast_channel *c, int samples, int (*func)(void *data),
 #endif 
        return res;
 }
-char ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
+int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
 {
        struct ast_frame *f;
        struct ast_channel *rchan;
@@ -2188,7 +2188,7 @@ int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int fti
 {
        int pos=0;
        int to = ftimeout;
-       char d;
+       int d;
        /* XXX Merge with full version? XXX */
        /* Stop if we're a zombie or need a soft hangup */
        if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c)) 
@@ -2227,7 +2227,7 @@ int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, in
 {
        int pos=0;
        int to = ftimeout;
-       char d;
+       int d;
        /* Stop if we're a zombie or need a soft hangup */
        if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c)) 
                return -1;
diff --git a/file.c b/file.c
index 831b2ec2ed79bc5f93219bb4c92fcd88e7bc7a36..1c4e42bc72ca8e43bf86b82a5c9c7a012b45acc9 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -934,7 +934,7 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con
        return fs;
 }
 
-char ast_waitstream(struct ast_channel *c, const char *breakon)
+int ast_waitstream(struct ast_channel *c, const char *breakon)
 {
        /* XXX Maybe I should just front-end ast_waitstream_full ? XXX */
        int res;
@@ -990,7 +990,7 @@ char ast_waitstream(struct ast_channel *c, const char *breakon)
        return (c->_softhangup ? -1 : 0);
 }
 
-char ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms)
+int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms)
 {
        int res;
        struct ast_frame *fr;
@@ -1059,7 +1059,7 @@ char ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *f
        return (c->_softhangup ? -1 : 0);
 }
 
-char ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int cmdfd)
+int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int cmdfd)
 {
        int res;
        int ms;
index 5335d284bae5d442574dac8559c2314bbf19c912..893e34add5b5cc1493510063dfe196ce24cc1911 100755 (executable)
@@ -754,11 +754,11 @@ struct ast_channel *ast_get_channel_by_name_locked(char *channame);
  * \param c channel to wait for a digit on
  * \param ms how many milliseconds to wait
  * Wait for a digit.  Returns <0 on error, 0 on no entry, and the digit on success. */
-char ast_waitfordigit(struct ast_channel *c, int ms);
+int ast_waitfordigit(struct ast_channel *c, int ms);
 
 /* Same as above with audio fd for outputing read audio and ctrlfd to monitor for
    reading. Returns 1 if ctrlfd becomes available */
-char ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd);
+int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd);
 
 /*! Reads multiple digits */
 /*! 
index 3ca59e6253643b791fec477062659d2c6e2a857f..8b6104df8628c4eba98e060da5eb3cf6fdbc4a81 100755 (executable)
@@ -122,7 +122,7 @@ int ast_filecopy(const char *oldname, const char *newname, const char *fmt);
  * Wait for a stream to stop or for any one of a given digit to arrive,  Returns 0 
  * if the stream finishes, the character if it was interrupted, and -1 on error 
  */
-char ast_waitstream(struct ast_channel *c, const char *breakon);
+int ast_waitstream(struct ast_channel *c, const char *breakon);
 
 /*! Same as waitstream but allows stream to be forwarded or rewound */
 /*!
@@ -135,11 +135,11 @@ char ast_waitstream(struct ast_channel *c, const char *breakon);
  * Wait for a stream to stop or for any one of a given digit to arrive,  Returns 0 
  * if the stream finishes, the character if it was interrupted, and -1 on error 
  */
-char ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms);
+int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms);
 
 /* Same as waitstream, but with audio output to fd and monitored fd checking.  Returns
    1 if monfd is ready for reading */
-char ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd);
+int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd);
 
 /*! Starts reading from a file */
 /*!
diff --git a/pbx.c b/pbx.c
index 11df3884513399bff85625710f8f572bd016590a..10d8dc0a6f5ccca8d22aa29fb89e25728ebc6be0 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -2238,7 +2238,7 @@ int ast_exec_extension(struct ast_channel *c, const char *context, const char *e
 static int __ast_pbx_run(struct ast_channel *c)
 {
        int firstpass = 1;
-       char digit;
+       int digit;
        char exten[256];
        int pos;
        int waittime;