Converted scope-local variables into function-local variables.

The 6502-specific LC implementation doesn't allow for scope-local vaiables between PT_BEGIN/PROCESS_BEGIN/PSOCK_BEGIN and PT_BEGIN/PROCESS_END/PSOCK_END.
This commit is contained in:
Oliver Schmidt 2011-04-12 14:12:09 +02:00
parent b19fb0ac9e
commit 07f3df45be
11 changed files with 50 additions and 44 deletions

View file

@ -131,6 +131,7 @@ PROCESS_THREAD(shell_binprint_process, ev, data)
uint16_t *ptr;
int i;
char buf[2*64], *bufptr;
uint16_t val;
PROCESS_BEGIN();
@ -145,9 +146,8 @@ PROCESS_THREAD(shell_binprint_process, ev, data)
bufptr = buf;
ptr = (uint16_t *)input->data1;
for(i = 0; i < input->len1 && i < input->len1 - 1; i += 2) {
uint16_t data;
memcpy(&data, ptr, sizeof(data));
bufptr += sprintf(bufptr, "%u ", data);
memcpy(&val, ptr, sizeof(val));
bufptr += sprintf(bufptr, "%u ", val);
if(bufptr - buf >= sizeof(buf) - 6) {
shell_output_str(&binprint_command, buf, "");
bufptr = buf;
@ -160,9 +160,8 @@ PROCESS_THREAD(shell_binprint_process, ev, data)
ptr = (uint16_t *)input->data2;
for(i = 0; i < input->len2 && i < input->len2 - 1; i += 2) {
uint16_t data;
memcpy(&data, ptr, sizeof(data));
bufptr += sprintf(bufptr, "%u ", data);
memcpy(&val, ptr, sizeof(val));
bufptr += sprintf(bufptr, "%u ", val);
if(bufptr - buf >= sizeof(buf) - 6) {
shell_output_str(&binprint_command, buf, "");
bufptr = buf;
@ -180,8 +179,9 @@ PROCESS_THREAD(shell_binprint_process, ev, data)
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_size_process, ev, data)
{
struct shell_input *input;
static unsigned long size;
struct shell_input *input;
char buf[10];
PROCESS_BEGIN();
size = 0;
@ -193,7 +193,6 @@ PROCESS_THREAD(shell_size_process, ev, data)
size += input->len1 + input->len2;
if(input->len1 + input->len2 == 0) {
char buf[10];
snprintf(buf, sizeof(buf), "%lu", size);
shell_output_str(&size_command, buf, "");
PROCESS_EXIT();