I am getting a the warning "assignment from incompatible pointer type" when compiling my code, I have spent ages trying everything I can think of, but I am not very experienced at using C so it is probably something really simple that I just can't see.
I have commented the lines that are getting the warning
typedef struct{
FILE *fp;
int mem,timestart,timeend,wait;
char name[50];
} process;
typedef struct{
process *data;
struct queue *next;
} queue;
queue *readyfirst = NULL;
queue *readylast = NULL;
queue *blockedfirst[10] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
queue *blockedlast[10] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
void toready(process *p){
queue *ready = malloc(sizeof(queue));
ready->data = p;
if(readyfirst == NULL){
readyfirst = ready;
readylast = ready;
} else {
readylast->next = ready; //warning: assignment from incompatible pointer type
readylast = ready;
readylast->next = NULL;
}
}
void checkblocked(){
for(int i=0; i<10; i++){
if(blockedfirst[i]->data->wait == 0){
toready(blockedfirst[i]->data);
blockedfirst[i] = blockedfirst[i]->next; //warning: assignment from incompatible pointer type
}
}
}