| 1042 | } |
| 1043 | |
| 1044 | static std::string offsetExpr(const std::vector<Field>& fields, |
| 1045 | size_t index, |
| 1046 | const std::vector<Field>& sideFields, |
| 1047 | const std::vector<std::string>& external) { |
| 1048 | std::vector<std::string> terms; |
| 1049 | for (size_t i = 0; i < index; ++i) { |
| 1050 | if (fields[i].type == "bytes") |
| 1051 | terms.push_back(lengthExpr(fields[i], sideFields, external)); |
| 1052 | else |
| 1053 | terms.push_back("sizeof(" + fields[i].type + ")"); |
| 1054 | } |
| 1055 | return sumExpr(terms); |
| 1056 | } |
| 1057 | |
| 1058 | static std::string sumExpr(const std::vector<Field>& fields, |
| 1059 | const std::vector<Field>& sideFields, |
nothing calls this directly
no outgoing calls
no test coverage detected