- Timestamp:
- Oct 24, 2021, 4:50:32 AM (3 years ago)
- Location:
- Daodan/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_Config.c
r1017 r1162 300 300 case C_CMD: 301 301 break; 302 case C_FLOAT: 303 STARTUPMESSAGE("Option %s.%s = %f (def %f)", config[s].name, co->name, co->value.floatVal, co->defaultValue.floatVal); 304 break; 302 305 default: 303 306 STARTUPMESSAGE("Option %s.%s = %d (def %d)", config[s].name, co->name, co->value.intBoolVal, co->defaultValue.intBoolVal); … … 361 364 case C_INT: 362 365 return "Int"; 366 case C_FLOAT: 367 return "Float"; 363 368 case C_BOOL: 364 369 return "Bool"; … … 391 396 case C_CMD: 392 397 return 0; 398 case C_FLOAT: 399 val = malloc(50); 400 sprintf(val, "%f", optVal->floatVal); 401 return val; 393 402 default: 394 403 val = malloc(20); … … 411 420 case C_INT: 412 421 return opt->defaultValue.intBoolVal != opt->value.intBoolVal; 422 case C_FLOAT: 423 return opt->defaultValue.floatVal != opt->value.floatVal; 413 424 } 414 425 return 0; … … 526 537 case C_INT: 527 538 co->value.intBoolVal = strtol(value, NULL, 0); 539 break; 540 case C_FLOAT: 541 co->value.floatVal = strtof(value, NULL); 528 542 break; 529 543 case C_BOOL: -
Daodan/src/Daodan_Config.h
r1000 r1162 10 10 C_BOOL, 11 11 C_INT, 12 C_FLOAT, 12 13 C_STRING, 13 14 EXT_BOOL … … 16 17 typedef union { 17 18 int intBoolVal; 19 float floatVal; 18 20 uint8_t* extBoolVal; 19 21 char* stringVal;
Note:
See TracChangeset
for help on using the changeset viewer.