Merged revisions 90155 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90155 | tilghman | 2007-11-29 11:29:59 -0600 (Thu, 29 Nov 2007) | 5 lines

Use of "private" as a field name in a header file messes with C++ projects
Reported by: chewbacca
Patch by: casper
(Closes issue #11401)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-11-29 17:50:44 +00:00
parent 4807fe0f0d
commit afac5cce50
9 changed files with 22 additions and 22 deletions

View File

@@ -62,7 +62,7 @@ struct g726_desc {
*/ */
static int g726_open(struct ast_filestream *tmp, int rate) static int g726_open(struct ast_filestream *tmp, int rate)
{ {
struct g726_desc *s = (struct g726_desc *)tmp->private; struct g726_desc *s = (struct g726_desc *)tmp->_private;
s->rate = rate; s->rate = rate;
ast_debug(1, "Created filestream G.726-%dk.\n", 40 - s->rate * 8); ast_debug(1, "Created filestream G.726-%dk.\n", 40 - s->rate * 8);
return 0; return 0;
@@ -115,7 +115,7 @@ static int g726_16_rewrite(struct ast_filestream *s, const char *comment)
static struct ast_frame *g726_read(struct ast_filestream *s, int *whennext) static struct ast_frame *g726_read(struct ast_filestream *s, int *whennext)
{ {
int res; int res;
struct g726_desc *fs = (struct g726_desc *)s->private; struct g726_desc *fs = (struct g726_desc *)s->_private;
/* Send a frame from the file to the appropriate channel */ /* Send a frame from the file to the appropriate channel */
s->fr.frametype = AST_FRAME_VOICE; s->fr.frametype = AST_FRAME_VOICE;
@@ -135,7 +135,7 @@ static struct ast_frame *g726_read(struct ast_filestream *s, int *whennext)
static int g726_write(struct ast_filestream *s, struct ast_frame *f) static int g726_write(struct ast_filestream *s, struct ast_frame *f)
{ {
int res; int res;
struct g726_desc *fs = (struct g726_desc *)s->private; struct g726_desc *fs = (struct g726_desc *)s->_private;
if (f->frametype != AST_FRAME_VOICE) { if (f->frametype != AST_FRAME_VOICE) {
ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); ast_log(LOG_WARNING, "Asked to write non-voice frame!\n");

View File

@@ -67,7 +67,7 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext)
int mark; int mark;
unsigned short len; unsigned short len;
unsigned int ts; unsigned int ts;
struct h263_desc *fs = (struct h263_desc *)s->private; struct h263_desc *fs = (struct h263_desc *)s->_private;
/* Send a frame from the file to the appropriate channel */ /* Send a frame from the file to the appropriate channel */
if ((res = fread(&len, 1, sizeof(len), s->f)) < 1) if ((res = fread(&len, 1, sizeof(len), s->f)) < 1)

View File

@@ -59,7 +59,7 @@ static struct ast_frame *h264_read(struct ast_filestream *s, int *whennext)
int mark=0; int mark=0;
unsigned short len; unsigned short len;
unsigned int ts; unsigned int ts;
struct h264_desc *fs = (struct h264_desc *)s->private; struct h264_desc *fs = (struct h264_desc *)s->_private;
/* Send a frame from the file to the appropriate channel */ /* Send a frame from the file to the appropriate channel */
if ((res = fread(&len, 1, sizeof(len), s->f)) < 1) if ((res = fread(&len, 1, sizeof(len), s->f)) < 1)

View File

@@ -85,7 +85,7 @@ static int ogg_vorbis_open(struct ast_filestream *s)
int result; int result;
char **ptr; char **ptr;
char *buffer; char *buffer;
struct vorbis_desc *tmp = (struct vorbis_desc *)s->private; struct vorbis_desc *tmp = (struct vorbis_desc *)s->_private;
tmp->writing = 0; tmp->writing = 0;
@@ -195,7 +195,7 @@ static int ogg_vorbis_rewrite(struct ast_filestream *s,
ogg_packet header; ogg_packet header;
ogg_packet header_comm; ogg_packet header_comm;
ogg_packet header_code; ogg_packet header_code;
struct vorbis_desc *tmp = (struct vorbis_desc *)s->private; struct vorbis_desc *tmp = (struct vorbis_desc *)s->_private;
tmp->writing = 1; tmp->writing = 1;
@@ -272,7 +272,7 @@ static int ogg_vorbis_write(struct ast_filestream *fs, struct ast_frame *f)
int i; int i;
float **buffer; float **buffer;
short *data; short *data;
struct vorbis_desc *s = (struct vorbis_desc *)fs->private; struct vorbis_desc *s = (struct vorbis_desc *)fs->_private;
if (!s->writing) { if (!s->writing) {
ast_log(LOG_ERROR, "This stream is not set up for writing!\n"); ast_log(LOG_ERROR, "This stream is not set up for writing!\n");
@@ -311,7 +311,7 @@ static int ogg_vorbis_write(struct ast_filestream *fs, struct ast_frame *f)
*/ */
static void ogg_vorbis_close(struct ast_filestream *fs) static void ogg_vorbis_close(struct ast_filestream *fs)
{ {
struct vorbis_desc *s = (struct vorbis_desc *)fs->private; struct vorbis_desc *s = (struct vorbis_desc *)fs->_private;
if (s->writing) { if (s->writing) {
/* Tell the Vorbis encoder that the stream is finished /* Tell the Vorbis encoder that the stream is finished
@@ -343,7 +343,7 @@ static int read_samples(struct ast_filestream *fs, float ***pcm)
int result; int result;
char *buffer; char *buffer;
int bytes; int bytes;
struct vorbis_desc *s = (struct vorbis_desc *)fs->private; struct vorbis_desc *s = (struct vorbis_desc *)fs->_private;
while (1) { while (1) {
samples_in = vorbis_synthesis_pcmout(&s->vd, pcm); samples_in = vorbis_synthesis_pcmout(&s->vd, pcm);
@@ -426,7 +426,7 @@ static struct ast_frame *ogg_vorbis_read(struct ast_filestream *fs,
int val; int val;
int samples_in; int samples_in;
int samples_out = 0; int samples_out = 0;
struct vorbis_desc *s = (struct vorbis_desc *)fs->private; struct vorbis_desc *s = (struct vorbis_desc *)fs->_private;
short *buf; /* SLIN data buffer */ short *buf; /* SLIN data buffer */
fs->fr.frametype = AST_FRAME_VOICE; fs->fr.frametype = AST_FRAME_VOICE;

View File

@@ -167,7 +167,7 @@ static int pcm_write(struct ast_filestream *fs, struct ast_frame *f)
#ifdef REALTIME_WRITE #ifdef REALTIME_WRITE
if (s->fmt->format == AST_FORMAT_ALAW) { if (s->fmt->format == AST_FORMAT_ALAW) {
struct pcm_desc *pd = (struct pcm_desc *)fs->private; struct pcm_desc *pd = (struct pcm_desc *)fs->_private;
struct stat stat_buf; struct stat stat_buf;
unsigned long cur_time = get_time(); unsigned long cur_time = get_time();
unsigned long fpos = ( cur_time - pd->start_time ) * 8; /* 8 bytes per msec */ unsigned long fpos = ( cur_time - pd->start_time ) * 8; /* 8 bytes per msec */

View File

@@ -307,7 +307,7 @@ static int wav_open(struct ast_filestream *s)
/* We don't have any header to read or anything really, but /* We don't have any header to read or anything really, but
if we did, it would go here. We also might want to check if we did, it would go here. We also might want to check
and be sure it's a valid file. */ and be sure it's a valid file. */
struct wav_desc *tmp = (struct wav_desc *)s->private; struct wav_desc *tmp = (struct wav_desc *)s->_private;
if ((tmp->maxlen = check_header(s->f)) < 0) if ((tmp->maxlen = check_header(s->f)) < 0)
return -1; return -1;
return 0; return 0;
@@ -327,7 +327,7 @@ static int wav_rewrite(struct ast_filestream *s, const char *comment)
static void wav_close(struct ast_filestream *s) static void wav_close(struct ast_filestream *s)
{ {
char zero = 0; char zero = 0;
struct wav_desc *fs = (struct wav_desc *)s->private; struct wav_desc *fs = (struct wav_desc *)s->_private;
/* Pad to even length */ /* Pad to even length */
if (fs->bytes & 0x1) if (fs->bytes & 0x1)
fwrite(&zero, 1, 1, s->f); fwrite(&zero, 1, 1, s->f);
@@ -344,7 +344,7 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
int bytes = WAV_BUF_SIZE; /* in bytes */ int bytes = WAV_BUF_SIZE; /* in bytes */
off_t here; off_t here;
/* Send a frame from the file to the appropriate channel */ /* Send a frame from the file to the appropriate channel */
struct wav_desc *fs = (struct wav_desc *)s->private; struct wav_desc *fs = (struct wav_desc *)s->_private;
here = ftello(s->f); here = ftello(s->f);
if (fs->maxlen - here < bytes) /* truncate if necessary */ if (fs->maxlen - here < bytes) /* truncate if necessary */
@@ -382,7 +382,7 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f)
int x; int x;
short tmp[8000], *tmpi; short tmp[8000], *tmpi;
#endif #endif
struct wav_desc *s = (struct wav_desc *)fs->private; struct wav_desc *s = (struct wav_desc *)fs->_private;
int res; int res;
if (f->frametype != AST_FRAME_VOICE) { if (f->frametype != AST_FRAME_VOICE) {

View File

@@ -370,7 +370,7 @@ static int wav_open(struct ast_filestream *s)
/* We don't have any header to read or anything really, but /* We don't have any header to read or anything really, but
if we did, it would go here. We also might want to check if we did, it would go here. We also might want to check
and be sure it's a valid file. */ and be sure it's a valid file. */
struct wavg_desc *fs = (struct wavg_desc *)s->private; struct wavg_desc *fs = (struct wavg_desc *)s->_private;
if (check_header(s->f)) if (check_header(s->f))
return -1; return -1;
@@ -401,7 +401,7 @@ static void wav_close(struct ast_filestream *s)
static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
{ {
/* Send a frame from the file to the appropriate channel */ /* Send a frame from the file to the appropriate channel */
struct wavg_desc *fs = (struct wavg_desc *)s->private; struct wavg_desc *fs = (struct wavg_desc *)s->_private;
s->fr.frametype = AST_FRAME_VOICE; s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_GSM; s->fr.subclass = AST_FORMAT_GSM;
@@ -435,7 +435,7 @@ static int wav_write(struct ast_filestream *s, struct ast_frame *f)
{ {
int len; int len;
int size; int size;
struct wavg_desc *fs = (struct wavg_desc *)s->private; struct wavg_desc *fs = (struct wavg_desc *)s->_private;
if (f->frametype != AST_FRAME_VOICE) { if (f->frametype != AST_FRAME_VOICE) {
ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); ast_log(LOG_WARNING, "Asked to write non-voice frame!\n");
@@ -481,7 +481,7 @@ static int wav_write(struct ast_filestream *s, struct ast_frame *f)
static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence) static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
{ {
off_t offset=0, distance, max; off_t offset=0, distance, max;
struct wavg_desc *s = (struct wavg_desc *)fs->private; struct wavg_desc *s = (struct wavg_desc *)fs->_private;
off_t min = MSGSM_DATA_OFFSET; off_t min = MSGSM_DATA_OFFSET;
off_t cur = ftello(fs->f); off_t cur = ftello(fs->f);

View File

@@ -114,7 +114,7 @@ struct ast_filestream {
FILE *f; FILE *f;
struct ast_frame fr; /*!< frame produced by read, typically */ struct ast_frame fr; /*!< frame produced by read, typically */
char *buf; /*!< buffer pointed to by ast_frame; */ char *buf; /*!< buffer pointed to by ast_frame; */
void *private; /*!< pointer to private buffer */ void *_private; /*!< pointer to private buffer */
const char *orig_chan_name; const char *orig_chan_name;
}; };

View File

@@ -282,7 +282,7 @@ static struct ast_filestream *get_filestream(struct ast_format *fmt, FILE *bfile
s->f = bfile; s->f = bfile;
if (fmt->desc_size) if (fmt->desc_size)
s->private = ((char *)(s+1)) + fmt->buf_size; s->_private = ((char *)(s+1)) + fmt->buf_size;
if (fmt->buf_size) if (fmt->buf_size)
s->buf = (char *)(s+1); s->buf = (char *)(s+1);
s->fr.src = fmt->name; s->fr.src = fmt->name;