diff options
author | Mark Spencer <markster@digium.com> | 2005-01-10 14:46:59 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-01-10 14:46:59 +0000 |
commit | 92eb0c2018018027bce11ece6b126cdabf3b25ea (patch) | |
tree | 94729885f0b947fa8b165ec1de895249d579c6c0 /include/asterisk/utils.h | |
parent | e7cb9750213a8a88de1818f2d5b2b928c2661afd (diff) |
More flagification, courtesy drumkilla (bug #3280)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/utils.h')
-rwxr-xr-x | include/asterisk/utils.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index ff42c1312..ff0c2cb7e 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -82,6 +82,33 @@ extern unsigned int __unsigned_int_flags_dummy; (p)->flags &= ~(flag); \ } while (0) +/* Non-type checking variations for non-unsigned int flags. You + should only use non-unsigned int flags where required by + protocol etc and if you know what you're doing :) */ +#define ast_test_flag_nonstd(p,flag) ({ \ + ((p)->flags & (flag)); \ + }) + +#define ast_set_flag_nonstd(p,flag) do { \ + ((p)->flags |= (flag)); \ + } while(0) + +#define ast_clear_flag_nonstd(p,flag) do { \ + ((p)->flags &= ~(flag)); \ + } while(0) + +#define ast_copy_flags_nonstd(dest,src,flagz) do { \ + (dest)->flags &= ~(flagz); \ + (dest)->flags |= ((src)->flags & (flagz)); \ + } while (0) + +#define ast_set2_flag_nonstd(p,value,flag) do { \ + if (value) \ + (p)->flags |= (flag); \ + else \ + (p)->flags &= ~(flag); \ + } while (0) + #define AST_FLAGS_ALL UINT_MAX struct ast_flags { |