| 140 | if(*str != 0 && end && *end == 0) return value; \ |
| 141 | } while(0) |
| 142 | address_t ArgumentValue::getAddress() const { |
| 143 | switch(type) { |
| 144 | case ArgumentSpec::TYPE_ADDRESS: |
| 145 | case ArgumentSpec::TYPE_HEX: { |
| 146 | /*const char *str = data.c_str(); |
| 147 | char *end = nullptr; |
| 148 | address_t address = std::strtoul(str, &end, 16); |
| 149 | if(*str != 0 && *end == 0) return address;*/ |
| 150 | STR_TO_INT(data, std::strtoul, 16); |
| 151 | throw std::string("Invalid argument, ") + ArgumentSpec::getExpectedMessage(type); |
| 152 | } |
| 153 | default: |
| 154 | throw "Calling ArgumentValue::getAddress() on unexpected argument type"; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | long ArgumentValue::getNumber() const { |
| 159 | switch(type) { |