summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-04-09 12:56:30 +0000
committerMatthew Jordan <mjordan@digium.com>2015-04-09 12:56:30 +0000
commit6ba6e3dffd57f1c62c0c7f9a9030c1f41b5a6350 (patch)
treea37689439efaf52dad71e900bdb725c43654e46e /include/asterisk
parente05c8ae68e95367ea60fdc5e8a5f2cf7f24e0f32 (diff)
clang compiler warnings: Fix autological comparisons
This fixes autological comparison warnings in the following: * chan_skinny: letohl may return a signed or unsigned value, depending on the macro chosen * func_curl: Provide a specific cast to CURLoption to prevent mismatch * cel: Fix enum comparisons where the enum can never be negative * enum: Fix comparison of return result of dn_expand, which returns a signed int value * event: Fix enum comparisons where the enum can never be negative * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be negative * presencestate: Use the actual enum value for INVALID state * security_events: Fix enum comparisons where the enum can never be negative * udptl: Don't bother to check if the return value from encode_length is less than 0, as it returns an unsigned int * translate: Since the parameters are unsigned int, don't bother checking to see if they are negative. The cast to unsigned int would already blow past the matrix bounds. * res_pjsip_exten_state: Use a temporary value to cache the return of ast_hint_presence_state * res_stasis_playback: Fix enum comparisons where the enum can never be negative * res_stasis_recording: Add an enum value for the case where the recording operation is in error; fix enum comparisons * resource_bridges: Use enum value as opposed to -1 * resource_channels: Use enum value as opposed to -1 Review: https://reviewboard.asterisk.org/r/4533 ASTERISK-24917 Reported by: dkdegroot patches: rb4533.patch submitted by dkdegroot (License 6600) ........ Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@434470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/app.h2
-rw-r--r--include/asterisk/cel.h4
-rw-r--r--include/asterisk/logger.h2
-rw-r--r--include/asterisk/utils.h2
4 files changed, 7 insertions, 3 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index d70d8a6f2..6171dd4f2 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -985,6 +985,8 @@ int ast_play_and_wait(struct ast_channel *chan, const char *fn);
* \since 12
*/
enum ast_record_if_exists {
+ /*! Return an Error State for IF_Exists */
+ AST_RECORD_IF_EXISTS_ERROR = -1,
/*! Fail the recording. */
AST_RECORD_IF_EXISTS_FAIL,
/*! Overwrite the existing recording. */
diff --git a/include/asterisk/cel.h b/include/asterisk/cel.h
index 833b48b85..350b4bf9f 100644
--- a/include/asterisk/cel.h
+++ b/include/asterisk/cel.h
@@ -39,6 +39,8 @@ extern "C" {
* \brief CEL event types
*/
enum ast_cel_event_type {
+ AST_CEL_INVALID_VALUE = -1,
+ AST_CEL_ALL = 0,
/*! \brief channel birth */
AST_CEL_CHANNEL_START = 1,
/*! \brief channel end */
@@ -75,7 +77,7 @@ enum ast_cel_event_type {
AST_CEL_LOCAL_OPTIMIZE = 17,
};
-/*!
+/*!
* \brief Check to see if CEL is enabled
*
* \since 1.8
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index 1fe9b6c04..22151157c 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -403,7 +403,7 @@ void ast_callid_strnprint(char *buffer, size_t buffer_size, struct ast_callid *c
#define DEBUG_ATLEAST(level) \
(option_debug >= (level) \
- || (ast_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= (level)))
+ || (ast_opt_dbg_module && (int)ast_debug_get_by_module(AST_MODULE) >= (level)))
/*!
* \brief Log a DEBUG message
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index bbcc2da93..f3f571972 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -816,7 +816,7 @@ int ast_safe_mkdir(const char *base_path, const char *path, int mode);
* \param a the array to bound check
* \return 0 if value out of bounds, otherwise true (non-zero)
*/
-#define ARRAY_IN_BOUNDS(v, a) IN_BOUNDS(v, 0, ARRAY_LEN(a) - 1)
+#define ARRAY_IN_BOUNDS(v, a) IN_BOUNDS((int) (v), 0, ARRAY_LEN(a) - 1)
/* Definition for Digest authorization */
struct ast_http_digest {