aboutsummaryrefslogtreecommitdiffstats
path: root/main/event.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-11 16:29:29 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-11 16:29:29 +0000
commit3e1330a03aa149baba57107b5413aab845c1fe38 (patch)
tree40020697f794556aa645285a87154014091b0346 /main/event.c
parent2020d2079737c991a378ee3e486099fee5363337 (diff)
* In unaligned.h, remove some unnecessary casts and mark the arg of the
get_unaligned functions as const * In event.c, use get_unaligned_uint32() in a couple of places to fix issues on architectures that don't allow unaligned access git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92305 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/event.c')
-rw-r--r--main/event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/event.c b/main/event.c
index be0d3f286..333b628a1 100644
--- a/main/event.c
+++ b/main/event.c
@@ -32,6 +32,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
+#include "asterisk/unaligned.h"
/* Only use one thread for now to ensure ordered delivery */
#define NUM_EVENT_THREADS 1
@@ -392,7 +393,7 @@ enum ast_event_ie_type ast_event_iterator_get_ie_type(struct ast_event_iterator
uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator)
{
- return ntohl(*iterator->ie->ie_payload);
+ return ntohl(get_unaligned_uint32(iterator->ie->ie_payload));
}
const char *ast_event_iterator_get_ie_str(struct ast_event_iterator *iterator)
@@ -416,7 +417,7 @@ uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_
ie_val = ast_event_get_ie_raw(event, ie_type);
- return ie_val ? ntohl(*ie_val) : 0;
+ return ie_val ? ntohl(get_unaligned_uint32(ie_val)) : 0;
}
const char *ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)