Hello again,
got myself stuck again with my lack of time between coding c. Gotten myself lost with pointers this time i'm pretty sure.
Declaration in header file
extern DiskRequest proc_new_disk_request(int procnum, int sectornum, ReadOrWrite rw);
Where i'm calling it from and some code around it to make sense
algo_request(int procnum, ReadOrWrite rw, int sectornum)
{
DiskRequest *new_request;
line 151: new_request = proc_new_disk_request(procnum, sectornum, rw);
...
}
The function itself
DiskRequest proc_new_disk_request(int procnum, int sectornum, ReadOrWrite rw)
{
DiskRequest *new_request;
new_request = (DiskRequest *) checked_malloc(sizeof(DiskRequest));
new_request->dr_procnum = procnum;
new_request->dr_sectornum = sectornum;
new_request->dr_rw = rw;
new_request->dr_next = NULL;
return *new_request;
}
The error the compiler is giving me:
disk.c:151: error: incompatible types in assignment