[svn-commits] rmudgett: trunk r405284 - in /trunk: ./ main/logger.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jan 10 12:17:50 CST 2014


Author: rmudgett
Date: Fri Jan 10 12:17:48 2014
New Revision: 405284

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405284
Log:
Logging callid: Fix some sizeof() references per coding guidelines.
........

Merged revisions 405281 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405282 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/main/logger.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/logger.c?view=diff&rev=405284&r1=405283&r2=405284
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Fri Jan 10 12:17:48 2014
@@ -1304,7 +1304,7 @@
 {
 	struct ast_callid *call;
 
-	call = ao2_alloc_options(sizeof(struct ast_callid), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);
+	call = ao2_alloc_options(sizeof(*call), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);
 	if (!call) {
 		ast_log(LOG_ERROR, "Could not allocate callid struct.\n");
 		return NULL;
@@ -1320,7 +1320,8 @@
 struct ast_callid *ast_read_threadstorage_callid(void)
 {
 	struct ast_callid **callid;
-	callid = ast_threadstorage_get(&unique_callid, sizeof(struct ast_callid **));
+
+	callid = ast_threadstorage_get(&unique_callid, sizeof(*callid));
 	if (callid && *callid) {
 		ast_callid_ref(*callid);
 		return *callid;
@@ -1332,8 +1333,7 @@
 
 int ast_callid_threadassoc_change(struct ast_callid *callid)
 {
-	struct ast_callid **id =
-		ast_threadstorage_get(&unique_callid, sizeof(struct ast_callid **));
+	struct ast_callid **id = ast_threadstorage_get(&unique_callid, sizeof(*id));
 
 	if (!id) {
 		ast_log(LOG_ERROR, "Failed to allocate thread storage.\n");
@@ -1363,7 +1363,8 @@
 int ast_callid_threadassoc_add(struct ast_callid *callid)
 {
 	struct ast_callid **pointing;
-	pointing = ast_threadstorage_get(&unique_callid, sizeof(struct ast_callid **));
+
+	pointing = ast_threadstorage_get(&unique_callid, sizeof(*pointing));
 	if (!(pointing)) {
 		ast_log(LOG_ERROR, "Failed to allocate thread storage.\n");
 		return -1;
@@ -1387,7 +1388,8 @@
 int ast_callid_threadassoc_remove(void)
 {
 	struct ast_callid **pointing;
-	pointing = ast_threadstorage_get(&unique_callid, sizeof(struct ast_callid **));
+
+	pointing = ast_threadstorage_get(&unique_callid, sizeof(*pointing));
 	if (!(pointing)) {
 		ast_log(LOG_ERROR, "Failed to allocate thread storage.\n");
 		return -1;




More information about the svn-commits mailing list