some bug fixes
This commit is contained in:
parent
85e2c8e90f
commit
ecc7c55a6e
1 changed files with 6 additions and 8 deletions
|
@ -42,8 +42,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -167,7 +165,7 @@ kj::String safeIdentifier(kj::StringPtr identifier) {
|
|||
}
|
||||
|
||||
kj::String spaces(int n) {
|
||||
return kj::str(std::string(n * 2, ' '));
|
||||
return kj::str(kj::repeat(' ', n * 2));
|
||||
}
|
||||
|
||||
// =======================================================================================
|
||||
|
@ -918,11 +916,11 @@ private:
|
|||
spaces(indent), " public ", type, ".Reader get", titleCase, "() {\n",
|
||||
(kind == FieldKind::LIST ?
|
||||
kj::strTree(spaces(indent),
|
||||
" return new ", type, ".Reader.new(_reader.getPointerField(",
|
||||
" return new ", type, ".Reader(_reader.getPointerField(",
|
||||
offset, ").getList(), ", elementReaderType, ".factory);\n") :
|
||||
(kind == FieldKind::BLOB ?
|
||||
kj::strTree(spaces(indent), " return _reader.getPointerField(",
|
||||
offset,".getText());\n") :
|
||||
offset,").getText();\n") :
|
||||
kj::strTree(spaces(indent), "Struct\n"))), // XXX
|
||||
spaces(indent), " }\n",
|
||||
"\n"),
|
||||
|
@ -1515,9 +1513,9 @@ private:
|
|||
return FileText {
|
||||
kj::strTree(
|
||||
"// Generated by Cap'n Proto compiler, DO NOT EDIT\n"
|
||||
"// source: ", baseName(displayName), "\n"
|
||||
"\n"
|
||||
"import capnp;\n",
|
||||
"// source: ", baseName(displayName), "\n",
|
||||
"\n",
|
||||
//"import capnp;\n",
|
||||
hasInterfaces ? kj::strTree("#include <capnp/capability.h>\n") : kj::strTree(),
|
||||
"\n",
|
||||
KJ_MAP(path, includes) {
|
||||
|
|
Loading…
Reference in a new issue