From 16be58f769d9cfd6f87bf274e54a97e4d85c9afb Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Tue, 10 Nov 2020 22:01:09 +0100 Subject: [PATCH] aCOM TO NEJDE --- cv6/a_station.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/cv6/a_station.c b/cv6/a_station.c index 5a1d542..d4905fb 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -1,28 +1,15 @@ #include "a_station.h" #include #include +#include struct station* create_station(){ - struct station* station = (struct station*)calloc(1,sizeof(struct station)); - station->tracks = (struct car**)calloc(STATION_SIZE, sizeof(struct car*)); - station->track_count = STATION_SIZE; + struct station* station = (struct station*)calloc(1,sizeof(struct station)); + station->tracks = (struct car**)calloc(STATION_SIZE, sizeof(struct car*)); + station->track_count = STATION_SIZE; - return station; + return station; } -/*unsigned long hash(char *key, size_t len){ - unsigned long hash; - int i; - for(hash = i = 0; i < len; ++i) - { hash += key[i]; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - hash += (hash << 15); - return hash; -}*/ - void destroy_station(struct station* station){ //struct car* del =prev; for(int i=0;i>station->track_count;i++){ @@ -33,9 +20,7 @@ void destroy_station(struct station* station){ prev=del->next; free(del); } - } - free(station->tracks); free(station); }