mirror of https://github.com/libAthena/athena.git
proper string-size computation for binarySize
This commit is contained in:
parent
b6b54d0921
commit
f248d1746e
|
@ -841,7 +841,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeExprStr.size())
|
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||||
fileOut << " __isz += (" << sizeExprStr << ");\n";
|
fileOut << " __isz += (" << sizeExprStr << ");\n";
|
||||||
else
|
else
|
||||||
fileOut << " __isz += " << fieldName << ".size() + 1;\n";
|
fileOut << " __isz += " << fieldName << ".size() + 1;\n";
|
||||||
|
@ -879,7 +879,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeExprStr.size())
|
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||||
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
||||||
else
|
else
|
||||||
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
||||||
|
@ -913,7 +913,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sizeExprStr.size())
|
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||||
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
||||||
else
|
else
|
||||||
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
||||||
|
|
Loading…
Reference in New Issue