[Asterisk-code-review] general: Very minor coding guideline fixes. (asterisk[20])

Friendly Automation asteriskteam at digium.com
Wed Aug 17 11:05:11 CDT 2022


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

Change subject: general: Very minor coding guideline fixes.
......................................................................

general: Very minor coding guideline fixes.

Fixes a few coding guideline violations:
* Use of C99 comments
* Opening brace on same line as function prototype

ASTERISK-30163 #close

Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7
---
M apps/app_mp3.c
M include/asterisk/strings.h
M main/channel_internal_api.c
M main/strings.c
4 files changed, 4 insertions(+), 5 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/apps/app_mp3.c b/apps/app_mp3.c
index 9bc23c0..ef342b3 100644
--- a/apps/app_mp3.c
+++ b/apps/app_mp3.c
@@ -101,7 +101,7 @@
 	/* Execute mpg123, but buffer if it's a net connection */
 	if (!strncasecmp(filename, "http://", 7) && strstr(filename, ".m3u")) {
 	    char buffer_size_str[8];
-	    snprintf(buffer_size_str, 8, "%u", (int) 0.5*2*sampling_rate/1000); // 0.5 seconds for a live stream
+	    snprintf(buffer_size_str, 8, "%u", (int) 0.5*2*sampling_rate/1000); /* 0.5 seconds for a live stream */
 		/* Most commonly installed in /usr/local/bin */
 	    execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);
 		/* But many places has it in /usr/bin */
@@ -111,7 +111,7 @@
 	}
 	else if (!strncasecmp(filename, "http://", 7)) {
 	    char buffer_size_str[8];
-	    snprintf(buffer_size_str, 8, "%u", 6*2*sampling_rate/1000); // 6 seconds for a remote MP3 file
+	    snprintf(buffer_size_str, 8, "%u", 6*2*sampling_rate/1000); /* 6 seconds for a remote MP3 file */
 		/* Most commonly installed in /usr/local/bin */
 	    execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);
 		/* But many places has it in /usr/bin */
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index d2c3c82..d0a4cbb 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -1370,7 +1370,6 @@
  * \return AO2 container for strings
  * \retval NULL if allocation failed
  */
-//struct ao2_container *ast_str_container_alloc_options(enum ao2_container_opts opts, int buckets);
 struct ao2_container *ast_str_container_alloc_options(enum ao2_alloc_opts opts, int buckets);
 
 /*!
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c
index 123f61a..bc0fb4c 100644
--- a/main/channel_internal_api.c
+++ b/main/channel_internal_api.c
@@ -1283,7 +1283,8 @@
 	return &chan->flags;
 }
 
-static int collect_names_cb(void *obj, void *arg, int flags) {
+static int collect_names_cb(void *obj, void *arg, int flags)
+{
 	struct ast_control_pvt_cause_code *cause_code = obj;
 	struct ast_str **str = arg;
 
diff --git a/main/strings.c b/main/strings.c
index 20769fa..d40eed6 100644
--- a/main/strings.c
+++ b/main/strings.c
@@ -197,7 +197,6 @@
 	return cmp ? 0 : CMP_MATCH;
 }
 
-//struct ao2_container *ast_str_container_alloc_options(enum ao2_container_opts opts, int buckets)
 struct ao2_container *ast_str_container_alloc_options(enum ao2_alloc_opts opts, int buckets)
 {
 	return ao2_container_alloc_hash(opts, 0, buckets, str_hash, str_sort, str_cmp);

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

Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7
Gerrit-Change-Number: 18945
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.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/20220817/38965eee/attachment.html>


More information about the asterisk-code-review mailing list