Skip to content
  • Daan Vreeken's avatar
    ebdd92b7
    Implement full argument type checking for parameters. The code could also be · ebdd92b7
    Daan Vreeken authored
    used to verify the arguments and types of block create functions, etc., but
    start by validating parameters for now. This helps a lot when writing .ctrl
    files as the parser will now stop with a sensible error instead of a segfault
    when arguments are mismatched.
    
    Some example output:
    ERROR: Invalid number of arguments! Expecting 1 argument instead of 3.
    ERROR: Argument mismatch while trying to set 'divider' param on block 'heater'
    ERROR: pand-test.ctrl:169: Error setting parameter
    
    ERROR: Argument mismatch in argument 1. Expected argument of type 'int' instead of 'char*'
    ERROR: Argument mismatch while trying to set 'divider' param on block 'heater'
    ERROR: pand-test.ctrl:169: Error setting parameter
    
    	modified:   controller/controller_load.c
    ebdd92b7
    Implement full argument type checking for parameters. The code could also be
    Daan Vreeken authored
    used to verify the arguments and types of block create functions, etc., but
    start by validating parameters for now. This helps a lot when writing .ctrl
    files as the parser will now stop with a sensible error instead of a segfault
    when arguments are mismatched.
    
    Some example output:
    ERROR: Invalid number of arguments! Expecting 1 argument instead of 3.
    ERROR: Argument mismatch while trying to set 'divider' param on block 'heater'
    ERROR: pand-test.ctrl:169: Error setting parameter
    
    ERROR: Argument mismatch in argument 1. Expected argument of type 'int' instead of 'char*'
    ERROR: Argument mismatch while trying to set 'divider' param on block 'heater'
    ERROR: pand-test.ctrl:169: Error setting parameter
    
    	modified:   controller/controller_load.c
Loading