mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 00:30:20 +00:00
Replace magic number size from msgArray array with a define.
(same patch as before, I just split this part out) (close issue #12326) Reported by: travishein Patches: app_voicemail_code_documentation.patch uploaded by travishein (license 385) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -399,6 +399,8 @@ struct vm_zone {
|
|||||||
char msg_format[512];
|
char msg_format[512];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define VMSTATE_MAX_MSG_ARRAY 256
|
||||||
|
|
||||||
/*! Voicemail mailbox state */
|
/*! Voicemail mailbox state */
|
||||||
struct vm_state {
|
struct vm_state {
|
||||||
char curbox[80];
|
char curbox[80];
|
||||||
@@ -418,7 +420,7 @@ struct vm_state {
|
|||||||
#ifdef IMAP_STORAGE
|
#ifdef IMAP_STORAGE
|
||||||
ast_mutex_t lock;
|
ast_mutex_t lock;
|
||||||
int updated; /*!< decremented on each mail check until 1 -allows delay */
|
int updated; /*!< decremented on each mail check until 1 -allows delay */
|
||||||
long msgArray[256];
|
long msgArray[VMSTATE_MAX_MSG_ARRAY];
|
||||||
MAILSTREAM *mailstream;
|
MAILSTREAM *mailstream;
|
||||||
int vmArrayIndex;
|
int vmArrayIndex;
|
||||||
char imapuser[80]; /*!< IMAP server login */
|
char imapuser[80]; /*!< IMAP server login */
|
||||||
@@ -9946,7 +9948,7 @@ static void init_vm_state(struct vm_state *vms)
|
|||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
vms->vmArrayIndex = 0;
|
vms->vmArrayIndex = 0;
|
||||||
for (x = 0; x < 256; x++) {
|
for (x = 0; x < VMSTATE_MAX_MSG_ARRAY; x++) {
|
||||||
vms->msgArray[x] = 0;
|
vms->msgArray[x] = 0;
|
||||||
}
|
}
|
||||||
ast_mutex_init(&vms->lock);
|
ast_mutex_init(&vms->lock);
|
||||||
@@ -9955,7 +9957,7 @@ static void init_vm_state(struct vm_state *vms)
|
|||||||
static void check_msgArray(struct vm_state *vms)
|
static void check_msgArray(struct vm_state *vms)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < 256; x++) {
|
for (x = 0; x < VMSTATE_MAX_MSG_ARRAY; x++) {
|
||||||
if (vms->msgArray[x] != 0) {
|
if (vms->msgArray[x] != 0) {
|
||||||
ast_debug(1, "Item %d set to %ld\n", x, vms->msgArray[x]);
|
ast_debug(1, "Item %d set to %ld\n", x, vms->msgArray[x]);
|
||||||
}
|
}
|
||||||
@@ -9972,7 +9974,7 @@ static void check_msgArray(struct vm_state *vms)
|
|||||||
static void copy_msgArray(struct vm_state *dst, struct vm_state *src)
|
static void copy_msgArray(struct vm_state *dst, struct vm_state *src)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < 256; x++) {
|
for (x = 0; x < VMSTATE_MAX_MSG_ARRAY; x++) {
|
||||||
dst->msgArray[x] = src->msgArray[x];
|
dst->msgArray[x] = src->msgArray[x];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user