[Asterisk-code-review] stasis: Avoid 'dispatched' as unused variable in normal mode. (asterisk[master])

Friendly Automation asteriskteam at digium.com
Mon Nov 1 12:54:53 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16639 )

Change subject: stasis: Avoid 'dispatched' as unused variable in normal mode.
......................................................................

stasis: Avoid 'dispatched' as unused variable in normal mode.

ASTERISK-29710

Change-Id: Ia849f1172e4e694c5d5d7f0cad449f936ee12216
---
M main/stasis.c
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/main/stasis.c b/main/stasis.c
index bc11b7f..b825f39 100644
--- a/main/stasis.c
+++ b/main/stasis.c
@@ -1433,8 +1433,8 @@
 	struct stasis_message *message, struct stasis_subscription *sync_sub)
 {
 	size_t i;
-	unsigned int dispatched = 0;
 #ifdef AST_DEVMODE
+	unsigned int dispatched = 0;
 	int message_type_id = stasis_message_type_id(stasis_message_type(message));
 	struct stasis_message_type_statistics *statistics;
 	struct timeval start;
@@ -1484,8 +1484,10 @@
 		struct stasis_subscription *sub = AST_VECTOR_GET(&topic->subscribers, i);
 
 		ast_assert(sub != NULL);
-
-		dispatched += dispatch_message(sub, message, (sub == sync_sub));
+#ifdef AST_DEVMODE
+		dispatched +=
+#endif
+			dispatch_message(sub, message, (sub == sync_sub));
 	}
 	ao2_unlock(topic);
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16639
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ia849f1172e4e694c5d5d7f0cad449f936ee12216
Gerrit-Change-Number: 16639
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211101/83036c13/attachment-0001.html>


More information about the asterisk-code-review mailing list