Commit ff93def6 authored by Kenton Varda's avatar Kenton Varda

Resolve TODO(now|soon) and remove KJ_DBG.

parent e5747a57
...@@ -1148,9 +1148,8 @@ private: ...@@ -1148,9 +1148,8 @@ private:
size_t defaultOffset = 0; // pointers only: offset of the default value within the schema. size_t defaultOffset = 0; // pointers only: offset of the default value within the schema.
size_t defaultSize = 0; // blobs only: byte size of the default value. size_t defaultSize = 0; // blobs only: byte size of the default value.
auto typeBody = slot.getType();
auto defaultBody = slot.getDefaultValue(); auto defaultBody = slot.getDefaultValue();
switch (typeBody.which()) { // TODO(now): Use typeSchema, not typeBody. switch (typeSchema.which()) {
case schema::Type::VOID: case schema::Type::VOID:
kind = FieldKind::PRIMITIVE; kind = FieldKind::PRIMITIVE;
setterDefault = " = ::capnp::VOID"; setterDefault = " = ::capnp::VOID";
...@@ -1239,7 +1238,7 @@ private: ...@@ -1239,7 +1238,7 @@ private:
if (defaultBody.hasAnyPointer()) { if (defaultBody.hasAnyPointer()) {
defaultOffset = field.getDefaultValueSchemaOffset(); defaultOffset = field.getDefaultValueSchemaOffset();
} }
if (typeBody.getAnyPointer().isParameter()) { if (typeSchema.getBrandParameter() != nullptr) {
kind = FieldKind::BRAND_PARAMETER; kind = FieldKind::BRAND_PARAMETER;
} }
break; break;
......
...@@ -2775,7 +2775,7 @@ void OrphanBuilder::truncate(ElementCount size, bool isText) { ...@@ -2775,7 +2775,7 @@ void OrphanBuilder::truncate(ElementCount size, bool isText) {
return; return;
} }
// TODO(soon): Implement truncation of all sizes. // TODO(someday): Implement truncation of all sizes.
KJ_ASSERT(ref->listRef.elementSize() == ElementSize::BYTE, KJ_ASSERT(ref->listRef.elementSize() == ElementSize::BYTE,
"Not implemented: truncate non-blob."); "Not implemented: truncate non-blob.");
......
...@@ -132,7 +132,6 @@ TEST(Message, MessageBuilderInitSpaceAvailable) { ...@@ -132,7 +132,6 @@ TEST(Message, MessageBuilderInitSpaceAvailable) {
KJ_ASSERT(segs[0].begin() == buffer); KJ_ASSERT(segs[0].begin() == buffer);
MessageBuilder::SegmentInit init = { kj::ArrayPtr<word>(buffer), segs[0].size() }; MessageBuilder::SegmentInit init = { kj::ArrayPtr<word>(buffer), segs[0].size() };
KJ_DBG(init.space.size(), init.wordsUsed);
// Init a new builder from the old segments. // Init a new builder from the old segments.
TestInitMessageBuilder builder2(kj::arrayPtr(&init, 1)); TestInitMessageBuilder builder2(kj::arrayPtr(&init, 1));
......
...@@ -141,7 +141,7 @@ static kj::StringTree print(const DynamicValue::Reader& value, ...@@ -141,7 +141,7 @@ static kj::StringTree print(const DynamicValue::Reader& value,
} }
case DynamicValue::TEXT: case DynamicValue::TEXT:
case DynamicValue::DATA: { case DynamicValue::DATA: {
// TODO(now): Data should be printed as binary literal. // TODO(someday): Maybe data should be printed as binary literal.
kj::ArrayPtr<const char> chars; kj::ArrayPtr<const char> chars;
if (value.getType() == DynamicValue::DATA) { if (value.getType() == DynamicValue::DATA) {
chars = value.as<Data>().asChars(); chars = value.as<Data>().asChars();
......
...@@ -351,7 +351,7 @@ public: ...@@ -351,7 +351,7 @@ public:
if (isStream && (addr.generic.sa_family == AF_INET || if (isStream && (addr.generic.sa_family == AF_INET ||
addr.generic.sa_family == AF_INET6)) { addr.generic.sa_family == AF_INET6)) {
// TODO(0.5): As a hack for the 0.4 release we are always setting // TODO(perf): As a hack for the 0.4 release we are always setting
// TCP_NODELAY because Nagle's algorithm pretty much kills Cap'n Proto's // TCP_NODELAY because Nagle's algorithm pretty much kills Cap'n Proto's
// RPC protocol. Later, we should extend the interface to provide more // RPC protocol. Later, we should extend the interface to provide more
// control over this. Perhaps write() should have a flag which // control over this. Perhaps write() should have a flag which
......
...@@ -187,7 +187,7 @@ public: ...@@ -187,7 +187,7 @@ public:
bool poll() override { return false; } bool poll() override { return false; }
void wake() const override { void wake() const override {
// TODO(soon): Implement using condvar. // TODO(someday): Implement using condvar.
kj::throwRecoverableException(KJ_EXCEPTION(UNIMPLEMENTED, kj::throwRecoverableException(KJ_EXCEPTION(UNIMPLEMENTED,
"Cross-thread events are not yet implemented for EventLoops with no EventPort.")); "Cross-thread events are not yet implemented for EventLoops with no EventPort."));
} }
......
...@@ -123,7 +123,7 @@ String getStackSymbols(ArrayPtr<void* const> trace) { ...@@ -123,7 +123,7 @@ String getStackSymbols(ArrayPtr<void* const> trace) {
} // namespace } // namespace
ArrayPtr<const char> KJ_STRINGIFY(Exception::Type type) { StringPtr KJ_STRINGIFY(Exception::Type type) {
static const char* TYPE_STRINGS[] = { static const char* TYPE_STRINGS[] = {
"failed", "failed",
"overloaded", "overloaded",
...@@ -131,8 +131,7 @@ ArrayPtr<const char> KJ_STRINGIFY(Exception::Type type) { ...@@ -131,8 +131,7 @@ ArrayPtr<const char> KJ_STRINGIFY(Exception::Type type) {
"unimplemented" "unimplemented"
}; };
const char* s = TYPE_STRINGS[static_cast<uint>(type)]; return TYPE_STRINGS[static_cast<uint>(type)];
return arrayPtr(s, strlen(s));
} }
String KJ_STRINGIFY(const Exception& e) { String KJ_STRINGIFY(const Exception& e) {
......
...@@ -120,8 +120,7 @@ private: ...@@ -120,8 +120,7 @@ private:
friend class ExceptionImpl; friend class ExceptionImpl;
}; };
// TODO(soon): These should return StringPtr. StringPtr KJ_STRINGIFY(Exception::Type type);
ArrayPtr<const char> KJ_STRINGIFY(Exception::Type type);
String KJ_STRINGIFY(const Exception& e); String KJ_STRINGIFY(const Exception& e);
// ======================================================================================= // =======================================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment