]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix return values on systems where an unsigned char is the default (bug #4455)
authorRussell Bryant <russell@russellbryant.com>
Tue, 14 Jun 2005 18:41:48 +0000 (18:41 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 14 Jun 2005 18:41:48 +0000 (18:41 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5908 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 4ecc452681db7eebd1a3937ae038bab98ba1c049..5653cf1672c622f2f1d94517cd60d3b5d4c4196f 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -520,7 +520,8 @@ static int global_maxsilence = 0;
 
 int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, 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;
@@ -736,7 +737,8 @@ int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfi
 
 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 10b88237754068ff8fbac35effbcf0ae6d3b4ebb..125829809b29f180842184794144f945a10e5c30 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -1089,11 +1089,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 (c->zombie || ast_check_hangup(c)) 
                return -1;
@@ -1133,7 +1133,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;
@@ -2013,7 +2013,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 (c->zombie || ast_check_hangup(c)) 
@@ -2052,7 +2052,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 (c->zombie || ast_check_hangup(c)) 
                return -1;
diff --git a/file.c b/file.c
index 5b3dd11f3281e6a2b4bc375483ea3ae5a9e6b6d8..88285b7f0d3c9ef2ebf025c5db87a9f569edbcd9 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -932,7 +932,7 @@ struct ast_filestream *ast_writefile(char *filename, char *type, char *comment,
        return fs;
 }
 
-char ast_waitstream(struct ast_channel *c, char *breakon)
+int ast_waitstream(struct ast_channel *c, char *breakon)
 {
        /* XXX Maybe I should just front-end ast_waitstream_full ? XXX */
        int res;
@@ -988,7 +988,7 @@ char ast_waitstream(struct ast_channel *c, char *breakon)
        return (c->_softhangup ? -1 : 0);
 }
 
-char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms)
+int ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms)
 {
        int res;
        struct ast_frame *fr;
@@ -1057,7 +1057,7 @@ char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char
        return (c->_softhangup ? -1 : 0);
 }
 
-char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int cmdfd)
+int ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int cmdfd)
 {
        int res;
        int ms;
index 516e3a9a8ac596741570319534f7911d863c401d..f99831d38fdf43ce80bbb4911173b3181fa0ce5a 100755 (executable)
@@ -643,11 +643,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 074518552d845eec38a2d841d8d48249b6876c16..dadd59b0b8677b378eba50be83459e9a3a9cd9c5 100755 (executable)
@@ -121,7 +121,7 @@ int ast_filecopy(char *oldname, char *newname, 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, char *breakon);
+int ast_waitstream(struct ast_channel *c, char *breakon);
 
 //! Same as waitstream but allows stream to be forwarded or rewound
 /*!
@@ -134,11 +134,11 @@ char ast_waitstream(struct ast_channel *c, 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, char *breakon, char *forward, char *rewind, int ms);
+int ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, 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, char *breakon, int audiofd, int monfd);
+int ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int monfd);
 
 //! Starts reading from a file
 /*!
diff --git a/pbx.c b/pbx.c
index ded9be66d6c8d227bced399a692a1043095a0157..d788e1319c2b6280e44f37a12a99b39b2d779e78 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -1775,7 +1775,7 @@ int ast_spawn_extension(struct ast_channel *c, char *context, char *exten, int p
 int ast_pbx_run(struct ast_channel *c)
 {
        int firstpass = 1;
-       char digit;
+       int digit;
        char exten[256];
        int pos;
        int waittime;