Changed the parameter 'char * data' of process_start to the

type process_data_t. This was an artifact when the choice was
made to use the void * type for the data parameter in processes.

Changed parameter 'void * data' of process_post_synch to
process_data_t for consistency.

Checked all the uses of process_start() in contiki and fixed casts
of the data parameter.
This commit is contained in:
Roy Scheefhals 2014-06-12 13:40:28 +02:00
parent cff30a394b
commit 1058ea986a
14 changed files with 18 additions and 18 deletions

View File

@ -633,7 +633,7 @@ deluge_disseminate(char *file, unsigned version)
if(next_object_id > 0 || init_object(&current_object, file, version) < 0) {
return -1;
}
process_start(&deluge_process, file);
process_start(&deluge_process, (void *)file);
return 0;
}

View File

@ -162,7 +162,7 @@ http_post_auth(const uint8_t *username_password, const char *msg)
PRINTF("message '%s'\n", s->message);*/
/* Spawn process to deal with TCP connection */
process_start(&http_post_auth_process, (char *)s);
process_start(&http_post_auth_process, (void *)s);
return 1;
}
/*---------------------------------------------------------------------------*/

View File

@ -159,7 +159,7 @@ recv_trickle(struct trickle_conn *c)
if(crc == crc16_data(msg->netcmd, len, 0)) {
/* Start the server process with the incoming command. */
process_start(&shell_netcmd_server_process, msg->netcmd);
process_start(&shell_netcmd_server_process, (void *)msg->netcmd);
}
}
}

View File

@ -162,7 +162,7 @@ recv_uc(struct unicast_conn *c, const linkaddr_t *from)
if(crc == crc16_data(msg->sendcmd, len, 0)) {
/* Start the server process with the incoming command. */
process_start(&shell_sendcmd_server_process, msg->sendcmd);
process_start(&shell_sendcmd_server_process, (void *)msg->sendcmd);
}
}
}

View File

@ -266,7 +266,7 @@ PROCESS_THREAD(shell_repeat_process, ev, data)
etimer_set(&etimer, CLOCK_SECOND * period);
for(i = 0; reps == 0 || i < reps; ++i) {
process_start(&shell_repeat_server_process, command);
process_start(&shell_repeat_server_process, (void *)command);
process_post(&shell_repeat_server_process,
PROCESS_EVENT_CONTINUE,
&shell_repeat_process);

View File

@ -298,7 +298,7 @@ start_command(char *commandline, struct shell_command *child)
c->child = child;
/* printf("shell: start_command starting '%s'\n", c->process->name);*/
/* Start a new process for the command. */
process_start(c->process, args);
process_start(c->process, (void *)args);
}
return c;
@ -364,7 +364,7 @@ shell_input(char *commandline, int commandline_len)
if(commandline[0] == '~' &&
commandline[1] == 'K') {
/* process_start(&shell_killall_process, commandline);*/
/* process_start(&shell_killall_process, (void *)commandline);*/
if(front_process != &shell_process) {
process_exit(front_process);
}

View File

@ -62,7 +62,7 @@ dlloader_load(char *path, char *arg)
/* Start the process. */
printf("Starting '%s'\n", PROCESS_NAME_STRING(*p));
process_start(*p, arg);
process_start(*p, (void *)arg);
return LOADER_OK;
}

View File

@ -96,7 +96,7 @@ process_alloc_event(void)
}
/*---------------------------------------------------------------------------*/
void
process_start(struct process *p, const char *arg)
process_start(struct process *p, process_data_t data)
{
struct process *q;
@ -117,7 +117,7 @@ process_start(struct process *p, const char *arg)
PRINTF("process: starting '%s'\n", PROCESS_NAME_STRING(p));
/* Post a synchronous initialization event to the process. */
process_post_synch(p, PROCESS_EVENT_INIT, (process_data_t)arg);
process_post_synch(p, PROCESS_EVENT_INIT, data);
}
/*---------------------------------------------------------------------------*/
static void

View File

@ -339,7 +339,7 @@ struct process {
* process
*
*/
CCIF void process_start(struct process *p, const char *arg);
CCIF void process_start(struct process *p, process_data_t data);
/**
* Post an asynchronous event.
@ -362,7 +362,7 @@ CCIF void process_start(struct process *p, const char *arg);
* \retval PROCESS_ERR_FULL The event queue was full and the event could
* not be posted.
*/
CCIF int process_post(struct process *p, process_event_t ev, void* data);
CCIF int process_post(struct process *p, process_event_t ev, process_data_t data);
/**
* Post a synchronous event to a process.
@ -375,7 +375,7 @@ CCIF int process_post(struct process *p, process_event_t ev, void* data);
* with the event.
*/
CCIF void process_post_synch(struct process *p,
process_event_t ev, void* data);
process_event_t ev, process_data_t data);
/**
* \brief Cause a process to exit

View File

@ -112,7 +112,7 @@ main(void)
procinit_init();
process_start((struct process *)&ethernet_process, (char *)ethernet_config);
process_start((struct process *)&ethernet_process, (void *)ethernet_config);
autostart_start(autostart_processes);

View File

@ -108,7 +108,7 @@ main(void)
procinit_init();
process_start((struct process *)&ethernet_process, (char *)ethernet_config);
process_start((struct process *)&ethernet_process, (void *)ethernet_config);
autostart_start(autostart_processes);

View File

@ -126,7 +126,7 @@ main(void)
procinit_init();
process_start((struct process *)&ethernet_process, (char *)ethernet_config);
process_start((struct process *)&ethernet_process, (void *)ethernet_config);
autostart_start(autostart_processes);

View File

@ -124,7 +124,7 @@ main(void)
procinit_init();
process_start((struct process *)&ethernet_process, (char *)ethernet_config);
process_start((struct process *)&ethernet_process, (void *)ethernet_config);
autostart_start(autostart_processes);

View File

@ -62,7 +62,7 @@ dll_loader_load(char *name, char *arg)
/* Start the process. */
debug_printf("Starting '%s'\n", (**(struct process ***)&p)->name);
process_start(**(struct process ***)&p, arg);
process_start(**(struct process ***)&p, (void *)arg);
return LOADER_OK;
}