From 65e35324307c2edab3d74f7ee9f92c35327f2d31 Mon Sep 17 00:00:00 2001 From: stormrider1982 Date: Mon, 23 Feb 2004 23:20:06 +0000 Subject: [PATCH] voila --- src/queueAdd.c | 3 +-- src/queueInit.c | 4 ++-- src/queueRem.c | 7 ++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/queueAdd.c b/src/queueAdd.c index e4a5f10..6b1e807 100644 --- a/src/queueAdd.c +++ b/src/queueAdd.c @@ -19,8 +19,7 @@ int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){ } /* TODO: verifier si la liste n'est pas vide... */ - if((strcmp(queue->headId,queue->id)==0) - && (strcmp(queue->tailId,queue->id)==0)) { + if((queue->headId = queue->id) && (queue->tailId = queue->id)) { NZG_ERROR("msgQueueAdd",queue->id); goto ERROR; } diff --git a/src/queueInit.c b/src/queueInit.c index bb25e04..4f0554b 100644 --- a/src/queueInit.c +++ b/src/queueInit.c @@ -28,8 +28,8 @@ msgQueue * queueInit(msgSpaceId externId, int queueIdx) { /* on remplit la structure msgQueue */ queue->elemCounter = 0; - strcpy(queue->head,queue->id); - strcpy(queue->tail,queue->id); + queue->head = queue->id; + queue->tail = queue->id; diff --git a/src/queueRem.c b/src/queueRem.c index 8cddbc4..76bb0c0 100644 --- a/src/queueRem.c +++ b/src/queueRem.c @@ -5,7 +5,8 @@ int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){ msgQueueElem * queueOldHeadElem; - if (strcmp(queue->headId,queue->tailId)==0){ + + if (strcmp(queue->headId,queue->tailId)==0){ NZG_ERROR("msgQueueElemRem : Empty queue",queue->id); goto ERROR; } @@ -22,8 +23,8 @@ int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){ goto ERROR; } - - return 0; + + return 0; ERROR: return -1; }