A bunch of CODING_GUIDELINES related fixes. Not even close to done.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Sean Bright 16 years ago
parent ff4bfb966a
commit d2c67ee8e5

@ -16,15 +16,14 @@
* at the top of the source tree.
*/
/*! \file
*
* \brief Comedian Mail - Voicemail System
*
/*!
* \file
* \author Mark Spencer <markster@digium.com>
* \brief Comedian Mail - Voicemail System
*
* \extref Unixodbc - http://www.unixodbc.org
* \extref A source distribution of University of Washington's IMAP
c-client (http://www.washington.edu/imap/
* \extref unixODBC (http://www.unixodbc.org/)
* \extref A source distribution of University of Washington's IMAP c-client
* (http://www.washington.edu/imap/)
*
* \par See also
* \arg \ref Config_vm
@ -33,8 +32,6 @@ c-client (http://www.washington.edu/imap/
* \note This module requires res_adsi to load. This needs to be optional
* during compilation.
*
*
*
* \note This file is now almost impossible to work with, due to all \#ifdefs.
* Feels like the database code before realtime. Someone - please come up
* with a plan to clean this up.
@ -1357,7 +1354,7 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
static void vm_change_password_shell(struct ast_vm_user *vmu, char *newpassword)
{
char buf[255];
snprintf(buf,255,"%s %s %s %s",ext_pass_cmd,vmu->context,vmu->mailbox,newpassword);
snprintf(buf, sizeof(buf), "%s %s %s %s", ext_pass_cmd, vmu->context, vmu->mailbox, newpassword);
if (!ast_safe_system(buf)) {
ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
/* Reset the password in memory, too */
@ -3823,7 +3820,7 @@ static int base_encode(char *filename, FILE *so)
unsigned char igroup[3], ogroup[4];
int c, n;
igroup[0]= igroup[1]= igroup[2]= 0;
memset(igroup, 0, sizeof(igroup));
for (n = 0; n < 3; n++) {
if ((c = inchar(&bio, fi)) == EOF) {
@ -4183,7 +4180,8 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
}
}
fprintf(p, "Message-ID: <Asterisk-%d-%d-%s-%d@%s>" ENDL, msgnum + 1, (unsigned int)ast_random(), mailbox, (int)getpid(), host);
fprintf(p, "Message-ID: <Asterisk-%d-%d-%s-%d@%s>" ENDL, msgnum + 1,
(unsigned int) ast_random(), mailbox, (int) getpid(), host);
if (imap) {
/* additional information needed for IMAP searching */
fprintf(p, "X-Asterisk-VM-Message-Num: %d" ENDL, msgnum + 1);
@ -4220,7 +4218,8 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
fprintf(p, "MIME-Version: 1.0" ENDL);
if (attach_user_voicemail) {
/* Something unique. */
snprintf(bound, sizeof(bound), "----voicemail_%d%s%d%d", msgnum + 1, mailbox, (int)getpid(), (unsigned int)ast_random());
snprintf(bound, sizeof(bound), "----voicemail_%d%s%d%d", msgnum + 1, mailbox,
(int) getpid(), (unsigned int) ast_random());
fprintf(p, "Content-Type: multipart/mixed; boundary=\"%s\"" ENDL, bound);
fprintf(p, ENDL ENDL "This is a multi-part message in MIME format." ENDL ENDL);
@ -8537,7 +8536,8 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
if ((pwdchange & PWDCHANGE_EXTERNAL) && !ast_strlen_zero(ext_pass_cmd))
vm_change_password_shell(vmu, newpassword);
ast_debug(1,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
ast_debug(1, "User %s set password to %s of length %d\n",
vms->username, newpassword, (int) strlen(newpassword));
cmd = ast_play_and_wait(chan, vm_passchanged);
break;
case '*':
@ -8734,7 +8734,7 @@ static int vm_browse_messages_en(struct ast_channel *chan, struct vm_state *vms,
*/
static int vm_browse_messages_it(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;
int cmd;
if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);
@ -8760,7 +8760,7 @@ static int vm_browse_messages_it(struct ast_channel *chan, struct vm_state *vms,
*/
static int vm_browse_messages_es(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;
int cmd;
if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);
@ -8786,7 +8786,7 @@ static int vm_browse_messages_es(struct ast_channel *chan, struct vm_state *vms,
*/
static int vm_browse_messages_pt(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;
int cmd;
if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);
@ -8812,7 +8812,7 @@ static int vm_browse_messages_pt(struct ast_channel *chan, struct vm_state *vms,
*/
static int vm_browse_messages_zh(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;
int cmd;
if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);

Loading…
Cancel
Save