aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-12 19:22:19 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-12 19:22:19 +0000
commitc01dbd5df9999a3803e0b43878e9371f0282c787 (patch)
treef867c5020743dd967455a0bdee6fc52492c1d37e /channels
parenta4a189a21e6610b13c7a02fd893abb76590d976e (diff)
The use of an ifdef to check for FreeBSD is useless here because the two
versions of the format string are identical. Also, since each format is only used once, get rid of the use of defines all together. (issue #8344, julieng) In passing, also clean up the formatting a but to get rid of the nesting without the use of braces, as defined in the coding guidelines. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47520 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 1c636cabe..f7cdcb289 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -4222,30 +4222,22 @@ static int manager_iax2_show_netstats( struct mansession *s, struct message *m )
static int iax2_show_firmware(int fd, int argc, char *argv[])
{
-#define FORMAT2 "%-15.15s %-15.15s %-15.15s\n"
-#if !defined(__FreeBSD__)
-#define FORMAT "%-15.15s %-15d %-15d\n"
-#else /* __FreeBSD__ */
-#define FORMAT "%-15.15s %-15d %-15d\n" /* XXX 2.95 ? */
-#endif /* __FreeBSD__ */
struct iax_firmware *cur = NULL;
if ((argc != 3) && (argc != 4))
return RESULT_SHOWUSAGE;
+ ast_cli(fd, "%-15.15s %-15.15s %-15.15s\n", "Device", "Version", "Size");
AST_LIST_LOCK(&firmwares);
-
- ast_cli(fd, FORMAT2, "Device", "Version", "Size");
- AST_LIST_TRAVERSE(&firmwares, cur, list)
- if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname)))
- ast_cli(fd, FORMAT, cur->fwh->devname, ntohs(cur->fwh->version),
- (int)ntohl(cur->fwh->datalen));
-
+ AST_LIST_TRAVERSE(&firmwares, cur, list) {
+ if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname))) {
+ ast_cli(fd, "%-15.15s %-15d %-15d\n", cur->fwh->devname,
+ ntohs(cur->fwh->version), (int)ntohl(cur->fwh->datalen));
+ }
+ }
AST_LIST_UNLOCK(&firmwares);
return RESULT_SUCCESS;
-#undef FORMAT
-#undef FORMAT2
}
/* JDG: callback to display iax peers in manager */