struct QueueBuffer{ Uint16 *aBufferStart; Uint16 *aBufferEnd; Uint16 *pIn; Uint16 *pOut; unsigned int mCount; };
struct QueueBuffer *Queue_Register(Uint16 *pQueueBufArry,unsigned int mSize) { struct QueueBuffer *pQueueBuffer; Uint16 sQueue_size; //分配记录队列信息的结构变量 pQueueBuffer=(struct QueueBuffer *)Memory_Malloc(sizeof(struct QueueBuffer));
sQueue_size=sizeof(struct QueueBuffer); //记录队列信息的结构变量清0 Memory_Memset((unsigned char *) pQueueBuffer,0,sQueue_size);
//分配队列所需内存,这里使用编译器自动分配的内存 pQueueBuffer->aBufferStart=pQueueBuffer->pIn=pQueueBuffer->pOut=pQueueBufArry; //队列结束指针 pQueueBuffer->aBufferEnd=pQueueBuffer->aBufferStart+mSize; return pQueueBuffer; } 看这句话 pQueueBuffer->aBufferStart=pQueueBuffer->pIn=pQueueBuffer->pOut=pQueueBufArry; 在这个语句中, pQueueBufArry的值是0x00010003,但是给pQueueBuffer->aBufferStart aBufferStart=pQueueBuffer->pIn赋值之后,pQueueBuffer->aBufferStart变成0x00030001.。。。。不知道为什么赋值不对?
|