From b4217b23f5b8ba5eedf0bc7354cea76d0575de3a Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Thu, 16 Aug 2012 09:23:01 -0400 Subject: make flash struct an argument to the flash read/write functions --- parser.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'parser.c') diff --git a/parser.c b/parser.c index 60025d0..a3b61d5 100644 --- a/parser.c +++ b/parser.c @@ -902,7 +902,7 @@ static int Go_Str_eprom_47(gchar** response, int channel, char *loc_string,char *(char *)(&globals.Flash.flash_start + eprom_loc+i)=store_string[i]; } *(char *)(&globals.Flash.flash_start + eprom_loc + i)=(char) 0; /* end of string */ - writeUserBlock(eprom_loc,strlen(store_string)+1); + writeUserBlock(globals.Flash, eprom_loc, strlen(store_string)+1); return OK; } else { return OutOfRange; @@ -925,7 +925,7 @@ static int Go_int_eprom_48(gchar** response, int channel, char *loc_string,char /* diag:eprom:int - 48 */ int eprom_loc; int i; - int the_number; + short the_number; eprom_loc = atoi(loc_string); /* convert location string to a number */ @@ -936,9 +936,9 @@ static int Go_int_eprom_48(gchar** response, int channel, char *loc_string,char switch (command_type) { case command_param_units: - the_number=atoi(store_string); - *(short *)(&globals.Flash.flash_start + eprom_loc)=(short) the_number; - writeUserBlock(eprom_loc,sizeof(the_number)); + the_number=(short) atoi(store_string); + *(short *)(&globals.Flash.flash_start + eprom_loc) = the_number; + writeUserBlock(globals.Flash, eprom_loc, sizeof (the_number)); return OK; break; @@ -972,7 +972,7 @@ static int Go_Float_eprom51(gchar** response, int channel, char *loc_string,char case command_param_units: the_number=atof(store_string); *(float *)(&globals.Flash.flash_start + eprom_loc)=the_number; - writeUserBlock(eprom_loc,sizeof(the_number)); + writeUserBlock(globals.Flash, eprom_loc, sizeof(the_number)); return OK; break; @@ -1006,7 +1006,7 @@ static int Go_char_eprom_70(gchar** response, int channel, char *loc_string,char case command_param_units: the_number=(char) atoi(store_string); *(char *)(&globals.Flash.flash_start + eprom_loc)=the_number; - writeUserBlock(eprom_loc,sizeof(the_number)); + writeUserBlock(globals.Flash, eprom_loc, sizeof(the_number)); return OK; break; -- cgit