Index: main/astobj2.c =================================================================== --- main/astobj2.c (revision 282013) +++ main/astobj2.c (working copy) @@ -102,7 +102,8 @@ * * \return the pointer to the astobj2 structure */ -static inline struct astobj2 *INTERNAL_OBJ(void *user_data) +#define INTERNAL_OBJ(a) _INTERNAL_OBJ(a, __FILE__, __LINE__, __PRETTY_FUNCTION__) +static inline struct astobj2 *_INTERNAL_OBJ(void *user_data, const char *file, int lineno, const char *func) { struct astobj2 *p; @@ -113,7 +114,7 @@ p = (struct astobj2 *) ((char *) user_data - sizeof(*p)); if (AO2_MAGIC != (p->priv_data.magic) ) { - ast_log(LOG_ERROR, "bad magic number 0x%x for %p\n", p->priv_data.magic, p); + ast_log(__LOG_ERROR, file, lineno, func, "bad magic number 0x%x for %p\n", p->priv_data.magic, p); p = NULL; } @@ -145,7 +146,7 @@ int __ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var) { - struct astobj2 *p = INTERNAL_OBJ(user_data); + struct astobj2 *p = _INTERNAL_OBJ(user_data, file, line, func); if (p == NULL) return -1; @@ -159,7 +160,7 @@ int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var) { - struct astobj2 *p = INTERNAL_OBJ(user_data); + struct astobj2 *p = _INTERNAL_OBJ(user_data, file, line, func); if (p == NULL) return -1; @@ -173,7 +174,7 @@ int __ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var) { - struct astobj2 *p = INTERNAL_OBJ(user_data); + struct astobj2 *p = _INTERNAL_OBJ(user_data, file, line, func); int ret; if (p == NULL) @@ -204,7 +205,7 @@ int __ao2_ref_debug(void *user_data, const int delta, char *tag, char *file, int line, const char *funcname) { - struct astobj2 *obj = INTERNAL_OBJ(user_data); + struct astobj2 *obj = _INTERNAL_OBJ(user_data, file, line, funcname); if (obj == NULL) return -1; @@ -476,12 +477,12 @@ int i; /* create a new list entry */ struct bucket_entry *p; - struct astobj2 *obj = INTERNAL_OBJ(user_data); + struct astobj2 *obj = _INTERNAL_OBJ(user_data, file, line, func); if (obj == NULL) return NULL; - if (INTERNAL_OBJ(c) == NULL) + if (_INTERNAL_OBJ(c, file, line, func) == NULL) return NULL; p = ast_calloc(1, sizeof(*p)); @@ -538,7 +539,7 @@ void *__ao2_unlink_debug(struct ao2_container *c, void *user_data, char *tag, char *file, int line, const char *funcname) { - if (INTERNAL_OBJ(user_data) == NULL) /* safety check on the argument */ + if (_INTERNAL_OBJ(user_data, file, line, funcname) == NULL) /* safety check on the argument */ return NULL; __ao2_callback_debug(c, OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA, ao2_match_by_addr, user_data, tag, file, line, funcname); @@ -591,7 +592,7 @@ struct ao2_container *multi_container = NULL; struct ao2_iterator *multi_iterator = NULL; - if (INTERNAL_OBJ(c) == NULL) /* safety check on the argument */ + if (_INTERNAL_OBJ(c, file, line, funcname) == NULL) /* safety check on the argument */ return NULL; /*