This commit is contained in:
Isaac Shoebottom 2023-12-02 23:16:56 -04:00
parent 025b2640fc
commit f049e8aeff
3 changed files with 1 additions and 8 deletions

View File

@ -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;
} }

View File

@ -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);

View File

@ -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);
} }
} }