[asterisk-dev] Help Understanding Changes to app_queue's call_queue structure
Jamuel Starkey
jamuel at hcvoip.com
Fri Jul 1 23:13:23 CDT 2011
Hi,
It appears that in 1.8 and beyond the call_queue structure has been changed so that members such as name, moh, announce, etc have been now declared as AST_STRING_FIELD as opposed to char[80]'s:
TRUNK app_queue.c snippet:
struct call_queue {
AST_DECLARE_STRING_FIELDS(
/*! Queue name */
AST_STRING_FIELD(name);
/*! Music on Hold class */
AST_STRING_FIELD(moh);
/*! Announcement to play when call is answered */
AST_STRING_FIELD(announce);
[SNIP]
}
As opposed to 1.6.2.x app_queue.c snippet
struct call_queue {
/*! Queue name */
char name[80];
/*! Music on Hold class */
char moh[80];
/*! Announcement to play when call is answered */
char announce[80];
[SNIP]
}
So take my test function:
static int foo_snippet()
{
struct call_queue tmpq;
ast_copy_string(tmpq.name, "MyQueue", sizeof(tmpq.name));
return 0;
}
Under 1.6.2.18 it compiles quietly. But under TRUNK I get:
% make all
app_queue.c: In function 'foo_snippet':
app_queue.c:XXXX: warning: passing argument 1 of 'ast_copy_string' discards qualifiers from pointer target type
I'm working under the assumption that all warnings are bad but I really don't understand what I should do to resolve this as I don't really understand the underlying AST_DECLARE_STRING_FIELDS macro per se.
I was wondering if someone would kindly explain what's going wrong with my usage of a call_queue structure in app_queue. Any instructional insight with respect to the implication of the change to the call_queue structure beyond 1.6.2 and/or how to resolve the particular warning would be greatly appreciated.
Gratefully,
JPS
More information about the asterisk-dev
mailing list