Cleanup
This commit is contained in:
parent
025b2640fc
commit
f049e8aeff
@ -57,10 +57,6 @@ void delete(DiskQueue *queue, DiskRequest request) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DiskRequest peek(DiskQueue *queue) {
|
|
||||||
return *queue->head;
|
|
||||||
}
|
|
||||||
|
|
||||||
DiskRequest *dequeue(DiskQueue *queue) {
|
DiskRequest *dequeue(DiskQueue *queue) {
|
||||||
DiskRequest *head = queue->head;
|
DiskRequest *head = queue->head;
|
||||||
queue->head = head->next;
|
queue->head = head->next;
|
||||||
@ -81,7 +77,7 @@ void destroyDiskQueue(DiskQueue *queue) {
|
|||||||
|
|
||||||
int calcDistance(int position, int destination) {
|
int calcDistance(int position, int destination) {
|
||||||
if (position > destination) {
|
if (position > destination) {
|
||||||
return destination + (10000 - position);
|
return destination + (9999 + 1 - position);
|
||||||
} else {
|
} else {
|
||||||
return destination - position;
|
return destination - position;
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,6 @@ void enqueue(DiskQueue *queue, int time, int position);
|
|||||||
|
|
||||||
void delete(DiskQueue *queue, DiskRequest request);
|
void delete(DiskQueue *queue, DiskRequest request);
|
||||||
|
|
||||||
DiskRequest peek(DiskQueue *queue);
|
|
||||||
|
|
||||||
DiskRequest *dequeue(DiskQueue *queue);
|
DiskRequest *dequeue(DiskQueue *queue);
|
||||||
|
|
||||||
DiskRequest *findClosest(DiskQueue *queue, int position, double time);
|
DiskRequest *findClosest(DiskQueue *queue, int position, double time);
|
||||||
|
@ -68,7 +68,6 @@ void cscan(int start) {
|
|||||||
if (request != NULL) {
|
if (request != NULL) {
|
||||||
delete(queue, *request);
|
delete(queue, *request);
|
||||||
}
|
}
|
||||||
//printf("Movement: %i Time:%.1lf\n", movement, seekTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user