voila
This commit is contained in:
parent
63e808c1e9
commit
65e3532430
3 changed files with 7 additions and 7 deletions
|
@ -19,8 +19,7 @@ int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: verifier si la liste n'est pas vide... */
|
/* TODO: verifier si la liste n'est pas vide... */
|
||||||
if((strcmp(queue->headId,queue->id)==0)
|
if((queue->headId = queue->id) && (queue->tailId = queue->id)) {
|
||||||
&& (strcmp(queue->tailId,queue->id)==0)) {
|
|
||||||
NZG_ERROR("msgQueueAdd",queue->id);
|
NZG_ERROR("msgQueueAdd",queue->id);
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,8 @@ msgQueue * queueInit(msgSpaceId externId, int queueIdx) {
|
||||||
|
|
||||||
/* on remplit la structure msgQueue */
|
/* on remplit la structure msgQueue */
|
||||||
queue->elemCounter = 0;
|
queue->elemCounter = 0;
|
||||||
strcpy(queue->head,queue->id);
|
queue->head = queue->id;
|
||||||
strcpy(queue->tail,queue->id);
|
queue->tail = queue->id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){
|
int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){
|
||||||
msgQueueElem * queueOldHeadElem;
|
msgQueueElem * queueOldHeadElem;
|
||||||
|
|
||||||
if (strcmp(queue->headId,queue->tailId)==0){
|
|
||||||
|
if (strcmp(queue->headId,queue->tailId)==0){
|
||||||
NZG_ERROR("msgQueueElemRem : Empty queue",queue->id);
|
NZG_ERROR("msgQueueElemRem : Empty queue",queue->id);
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +23,8 @@ int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
ERROR:
|
ERROR:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue