[Asterisk-code-review] general: Very minor formatting improvements. (asterisk[master])
N A
asteriskteam at digium.com
Thu Jul 28 16:16:00 CDT 2022
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18885 )
Change subject: general: Very minor formatting improvements.
......................................................................
general: Very minor formatting improvements.
Fixes some drastic formatting inconsistencies
of doxygen comments in an IAX2 header file.
Also 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 channels/iax2/include/iax2.h
M main/channel_internal_api.c
M main/strings.c
4 files changed, 39 insertions(+), 39 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/18885/1
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/channels/iax2/include/iax2.h b/channels/iax2/include/iax2.h
index 0d92674..9c18543 100644
--- a/channels/iax2/include/iax2.h
+++ b/channels/iax2/include/iax2.h
@@ -128,11 +128,11 @@
#define IAX_DEFAULT_PORTNO 4569
/*! IAX Information elements */
-#define IAX_IE_CALLED_NUMBER 1 /*!< Number/extension being called - string */
-#define IAX_IE_CALLING_NUMBER 2 /*!< Calling number - string */
+#define IAX_IE_CALLED_NUMBER 1 /*!< Number/extension being called - string */
+#define IAX_IE_CALLING_NUMBER 2 /*!< Calling number - string */
#define IAX_IE_CALLING_ANI 3 /*!< Calling number ANI for billing - string */
#define IAX_IE_CALLING_NAME 4 /*!< Name of caller - string */
-#define IAX_IE_CALLED_CONTEXT 5 /*!< Context for number - string */
+#define IAX_IE_CALLED_CONTEXT 5 /*!< Context for number - string */
#define IAX_IE_USERNAME 6 /*!< Username (peer or user) for authentication - string */
#define IAX_IE_PASSWORD 7 /*!< Password for authentication - string */
#define IAX_IE_CAPABILITY 8 /*!< Actual codec capability - unsigned int */
@@ -140,12 +140,12 @@
#define IAX_IE_LANGUAGE 10 /*!< Desired language - string */
#define IAX_IE_VERSION 11 /*!< Protocol version - short */
#define IAX_IE_ADSICPE 12 /*!< CPE ADSI capability - short */
-#define IAX_IE_DNID 13 /*!< Originally dialed DNID - string */
+#define IAX_IE_DNID 13 /*!< Originally dialed DNID - string */
#define IAX_IE_AUTHMETHODS 14 /*!< Authentication method(s) - short */
#define IAX_IE_CHALLENGE 15 /*!< Challenge data for MD5/RSA - string */
#define IAX_IE_MD5_RESULT 16 /*!< MD5 challenge result - string */
#define IAX_IE_RSA_RESULT 17 /*!< RSA challenge result - string */
-#define IAX_IE_APPARENT_ADDR 18 /*!< Apparent address of peer - struct sockaddr_in */
+#define IAX_IE_APPARENT_ADDR 18 /*!< Apparent address of peer - struct sockaddr_in */
#define IAX_IE_REFRESH 19 /*!< When to refresh registration - short */
#define IAX_IE_DPSTATUS 20 /*!< Dialplan status - short */
#define IAX_IE_CALLNO 21 /*!< Call number of peer - short */
@@ -157,7 +157,7 @@
#define IAX_IE_TRANSFERID 27 /*!< Transfer Request Identifier -- int */
#define IAX_IE_RDNIS 28 /*!< Referring DNIS -- string */
#define IAX_IE_PROVISIONING 29 /*!< Provisioning info */
-#define IAX_IE_AESPROVISIONING 30 /*!< AES Provisioning info */
+#define IAX_IE_AESPROVISIONING 30 /*!< AES Provisioning info */
#define IAX_IE_DATETIME 31 /*!< Date/Time */
#define IAX_IE_DEVICETYPE 32 /*!< Device Type -- string */
#define IAX_IE_SERVICEIDENT 33 /*!< Service Identifier -- string */
@@ -172,7 +172,7 @@
#define IAX_IE_CAUSECODE 42 /*!< Hangup cause (u8) */
#define IAX_IE_ENCRYPTION 43 /*!< Encryption format (u16) */
#define IAX_IE_ENCKEY 44 /*!< Encryption key (raw) */
-#define IAX_IE_CODEC_PREFS 45 /*!< Codec Negotiation */
+#define IAX_IE_CODEC_PREFS 45 /*!< Codec Negotiation */
#define IAX_IE_RR_JITTER 46 /*!< Received jitter (as in RFC1889) u32 */
#define IAX_IE_RR_LOSS 47 /*!< Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889 */
@@ -184,15 +184,15 @@
#define IAX_IE_OSPTOKEN 53 /*!< OSP token */
#define IAX_IE_CALLTOKEN 54 /*!< Call number security token */
-#define IAX_IE_CAPABILITY2 55 /*!< Actual codec capability - u8 version + integer array */
-#define IAX_IE_FORMAT2 56 /*!< Desired codec format - u8 version + integer array */
+#define IAX_IE_CAPABILITY2 55 /*!< Actual codec capability - u8 version + integer array */
+#define IAX_IE_FORMAT2 56 /*!< Desired codec format - u8 version + integer array */
-#define IAX_IE_CALLINGANI2 57 /*!< Calling Originating Line Information (ANI2) digits */
+#define IAX_IE_CALLINGANI2 57 /*!< Calling Originating Line Information (ANI2) digits */
-#define IAX_MAX_OSPBLOCK_SIZE 254 /*!< Max OSP token block size, 255 bytes - 1 byte OSP token block index */
-#define IAX_MAX_OSPBLOCK_NUM 4
-#define IAX_MAX_OSPTOKEN_SIZE (IAX_MAX_OSPBLOCK_SIZE * IAX_MAX_OSPBLOCK_NUM)
-#define IAX_MAX_OSPBUFF_SIZE (IAX_MAX_OSPTOKEN_SIZE + 16)
+#define IAX_MAX_OSPBLOCK_SIZE 254 /*!< Max OSP token block size, 255 bytes - 1 byte OSP token block index */
+#define IAX_MAX_OSPBLOCK_NUM 4
+#define IAX_MAX_OSPTOKEN_SIZE (IAX_MAX_OSPBLOCK_SIZE * IAX_MAX_OSPBLOCK_NUM)
+#define IAX_MAX_OSPBUFF_SIZE (IAX_MAX_OSPTOKEN_SIZE + 16)
#define IAX_AUTH_PLAINTEXT (1 << 0)
#define IAX_AUTH_MD5 (1 << 1)
@@ -204,21 +204,21 @@
#define IAX_META_TRUNK 1 /*!< Trunk meta-message */
#define IAX_META_VIDEO 2 /*!< Video frame */
-#define IAX_META_TRUNK_SUPERMINI 0 /*!< This trunk frame contains classic supermini frames */
-#define IAX_META_TRUNK_MINI 1 /*!< This trunk frame contains trunked mini frames */
+#define IAX_META_TRUNK_SUPERMINI 0 /*!< This trunk frame contains classic supermini frames */
+#define IAX_META_TRUNK_MINI 1 /*!< This trunk frame contains trunked mini frames */
-#define IAX_RATE_8KHZ (1 << 0) /*!< 8khz sampling (default if absent) */
-#define IAX_RATE_11KHZ (1 << 1) /*!< 11.025khz sampling */
-#define IAX_RATE_16KHZ (1 << 2) /*!< 16khz sampling */
-#define IAX_RATE_22KHZ (1 << 3) /*!< 22.05khz sampling */
-#define IAX_RATE_44KHZ (1 << 4) /*!< 44.1khz sampling */
-#define IAX_RATE_48KHZ (1 << 5) /*!< 48khz sampling */
+#define IAX_RATE_8KHZ (1 << 0) /*!< 8khz sampling (default if absent) */
+#define IAX_RATE_11KHZ (1 << 1) /*!< 11.025khz sampling */
+#define IAX_RATE_16KHZ (1 << 2) /*!< 16khz sampling */
+#define IAX_RATE_22KHZ (1 << 3) /*!< 22.05khz sampling */
+#define IAX_RATE_44KHZ (1 << 4) /*!< 44.1khz sampling */
+#define IAX_RATE_48KHZ (1 << 5) /*!< 48khz sampling */
#define IAX_DPSTATUS_EXISTS (1 << 0)
-#define IAX_DPSTATUS_CANEXIST (1 << 1)
-#define IAX_DPSTATUS_NONEXISTENT (1 << 2)
-#define IAX_DPSTATUS_IGNOREPAT (1 << 14)
-#define IAX_DPSTATUS_MATCHMORE (1 << 15)
+#define IAX_DPSTATUS_CANEXIST (1 << 1)
+#define IAX_DPSTATUS_NONEXISTENT (1 << 2)
+#define IAX_DPSTATUS_IGNOREPAT (1 << 14)
+#define IAX_DPSTATUS_MATCHMORE (1 << 15)
/*! iax2 format bit field for handling codecs the old way */
typedef int64_t iax2_format;
@@ -228,11 +228,11 @@
/*! Full frames are always delivered reliably */
struct ast_iax2_full_hdr {
- unsigned short scallno; /*!< Source call number -- high bit must be 1 */
- unsigned short dcallno; /*!< Destination call number -- high bit is 1 if retransmission */
+ unsigned short scallno; /*!< Source call number -- high bit must be 1 */
+ unsigned short dcallno; /*!< Destination call number -- high bit is 1 if retransmission */
unsigned int ts; /*!< 32-bit timestamp in milliseconds (from 1st transmission) */
- unsigned char oseqno; /*!< Packet number (outgoing) */
- unsigned char iseqno; /*!< Packet number (next incoming expected) */
+ unsigned char oseqno; /*!< Packet number (outgoing) */
+ unsigned char iseqno; /*!< Packet number (next incoming expected) */
unsigned char type; /*!< Frame type */
unsigned char csub; /*!< Compressed subclass */
unsigned char iedata[0];
@@ -247,8 +247,8 @@
/*! Mini header is used only for voice frames -- delivered unreliably */
struct ast_iax2_mini_hdr {
- unsigned short callno; /*!< Source call number -- high bit must be 0, rest must be non-zero */
- unsigned short ts; /*!< 16-bit Timestamp (high 16 bits from last ast_iax2_full_hdr) */
+ unsigned short callno; /*!< Source call number -- high bit must be 0, rest must be non-zero */
+ unsigned short ts; /*!< 16-bit Timestamp (high 16 bits from last ast_iax2_full_hdr) */
/* Frametype implicitly VOICE_FRAME */
/* subclass implicit from last ast_iax2_full_hdr */
unsigned char data[0];
@@ -270,18 +270,18 @@
struct ast_iax2_video_hdr {
unsigned short zeros; /*!< Zeros field -- must be zero */
unsigned short callno; /*!< Video call number */
- unsigned short ts; /*!< Timestamp and mark if present */
+ unsigned short ts; /*!< Timestamp and mark if present */
unsigned char data[0];
} __attribute__ ((__packed__));
struct ast_iax2_meta_trunk_hdr {
- unsigned int ts; /*!< 32-bit timestamp for all messages */
+ unsigned int ts; /*!< 32-bit timestamp for all messages */
unsigned char data[0];
} __attribute__ ((__packed__));
struct ast_iax2_meta_trunk_entry {
unsigned short callno; /*!< Call number */
- unsigned short len; /*!< Length of data for this callno */
+ unsigned short len; /*!< Length of data for this callno */
} __attribute__ ((__packed__));
/*! When trunktimestamps are used, we use this format instead */
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/+/18885
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7
Gerrit-Change-Number: 18885
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220728/4aac9bd8/attachment-0001.html>
More information about the asterisk-code-review
mailing list