- use symbolic constants and macros to play with the debug flag

on the frame counters. Document it in the header file.
- provide a single exit point for a function;
- mark XXX some unclear parts of the code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-04-21 14:49:21 +00:00
parent e61e34e8a1
commit 0dbf814a79
4 changed files with 25 additions and 26 deletions

View File

@@ -403,9 +403,13 @@ struct ast_channel {
unsigned long insmpl;
unsigned long outsmpl;
/* Frames in/out counters */
/* Frames in/out counters. The high bit is a debug mask, so
* the counter is only in the remaining bits
*/
unsigned int fin;
unsigned int fout;
#define DEBUGCHAN_FLAG 0x80000000
#define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | ((x++) & ~DEBUGCHAN_FLAG) )
/* Why is the channel hanged up */
int hangupcause;