[asterisk-commits] rmudgett: branch 11 r405281 - /branches/11/main/logger.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 10 11:50:55 CST 2014


Author: rmudgett
Date: Fri Jan 10 11:50:40 2014
New Revision: 405281

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

Modified:
    branches/11/main/logger.c

Modified: branches/11/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/logger.c?view=diff&rev=405281&r1=405280&r2=405281
==============================================================================
--- branches/11/main/logger.c (original)
+++ branches/11/main/logger.c Fri Jan 10 11:50:40 2014
@@ -1294,7 +1294,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;
@@ -1310,7 +1310,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;
@@ -1322,8 +1323,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");
@@ -1353,7 +1353,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;
@@ -1374,10 +1375,11 @@
 	return 0;
 }
 
-int ast_callid_threadassoc_remove()
+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 asterisk-commits mailing list