Implement simulated counter hardware and more string literal changes
r3637 | dcl | 2012-07-11 15:08:50 +1000 (Wed, 11 Jul 2012) | 1 line
This commit is contained in:
@@ -61,7 +61,7 @@ static struct param_command_t {
|
||||
};
|
||||
#define NUM_CMDS ((int) ((sizeof(param_command)/sizeof(param_command[0]))))
|
||||
|
||||
static int name_to_command(char* name)
|
||||
static int name_to_command(const char* name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < NUM_CMDS; ++i) {
|
||||
@@ -73,7 +73,7 @@ static int name_to_command(char* name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool param_set(pPARAMETERS pp, char* name, char* value)
|
||||
bool param_set(pPARAMETERS pp, const char* name, const char* value)
|
||||
{
|
||||
bool result = false;
|
||||
switch (name_to_command(name))
|
||||
@@ -190,8 +190,10 @@ bool param_set(pPARAMETERS pp, char* name, char* value)
|
||||
pp->source = strtol(value, NULL, 10);
|
||||
if (pp->source < 1)
|
||||
pp->source = 0;
|
||||
#ifndef SIMULATE_HARDWARE
|
||||
else if (pp->source > 3)
|
||||
pp->source = 0;
|
||||
#endif
|
||||
dbg_printf(0, "=>%d\n", pp->source);
|
||||
break;
|
||||
case CMD_FILTER:
|
||||
@@ -243,7 +245,7 @@ bool param_set(pPARAMETERS pp, char* name, char* value)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool param_set_cmd(pPARAMETERS pp, char* cmd)
|
||||
bool param_set_cmd(pPARAMETERS pp, const char* cmd)
|
||||
{
|
||||
char name[100];
|
||||
char value[100];
|
||||
|
||||
Reference in New Issue
Block a user