| 1493 | } |
| 1494 | |
| 1495 | CheckedError Parser::ParseAlignAttribute(const std::string &align_constant, |
| 1496 | size_t min_align, size_t *align) { |
| 1497 | // Use uint8_t to avoid problems with size_t==`unsigned long` on LP64. |
| 1498 | uint8_t align_value; |
| 1499 | if (StringToNumber(align_constant.c_str(), &align_value) && |
| 1500 | VerifyAlignmentRequirements(static_cast<size_t>(align_value), |
| 1501 | min_align)) { |
| 1502 | *align = align_value; |
| 1503 | return NoError(); |
| 1504 | } |
| 1505 | return Error("unexpected force_align value '" + align_constant + |
| 1506 | "', alignment must be a power of two integer ranging from the " |
| 1507 | "type\'s natural alignment " + |
| 1508 | NumToString(min_align) + " to " + |
| 1509 | NumToString(FLATBUFFERS_MAX_ALIGNMENT)); |
| 1510 | } |
| 1511 | |
| 1512 | CheckedError Parser::ParseVector(const Type &type, uoffset_t *ovalue, |
| 1513 | FieldDef *field, size_t fieldn) { |
nothing calls this directly
no test coverage detected