Skip to content

Commit

Permalink
Fix some compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flakey5 authored and jasnell committed Nov 24, 2022
1 parent 89b638f commit 2adc7d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/dataqueue/queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DataQueueImpl final : public DataQueue,
: entries_(std::move(list)),
idempotent_(true),
size_(Just(size)),
capped_size_(Just(0UL)) {}
capped_size_(Just<size_t>(0UL)) {}

// Constructor for a non-idempotent DataQueue. This kind of queue can have
// entries added to it over time. The size is set to 0 initially. The queue
Expand All @@ -69,7 +69,7 @@ class DataQueueImpl final : public DataQueue,
// providing a size.
DataQueueImpl(Maybe<size_t> cap = Nothing<size_t>())
: idempotent_(false),
size_(Just(0UL)),
size_(Just<size_t>(0UL)),
capped_size_(cap) {}

// Disallow moving and copying.
Expand Down Expand Up @@ -176,7 +176,7 @@ class DataQueueImpl final : public DataQueue,
size_t capped_size;
size_t size;
if (capped_size_.To(&capped_size) && size_.To(&size)) {
return capped_size > size ? Just(capped_size - size) : Just(0UL);
return capped_size > size ? Just(capped_size - size) : Just<size_t>(0UL);
}
return Nothing<size_t>();
}
Expand Down Expand Up @@ -613,7 +613,7 @@ class EmptyEntry final : public EntryBase {
return std::make_unique<EmptyEntry>();
}

Maybe<size_t> size() const override { return Just(0UL); }
Maybe<size_t> size() const override { return Just<size_t>(0UL); }

bool isIdempotent() const override { return true; }

Expand Down
9 changes: 5 additions & 4 deletions src/node_blob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ MaybeLocal<Value> Blob::GetArrayBuffer(Environment* env) {
size_t len = length();
std::shared_ptr<BackingStore> store =
ArrayBuffer::NewBackingStore(env->isolate(), len);

/*if (len > 0) {
unsigned char* dest = static_cast<unsigned char*>(store->Data());
size_t total = 0;
Expand All @@ -176,15 +177,15 @@ MaybeLocal<Value> Blob::GetArrayBuffer(Environment* env) {
}

BaseObjectPtr<Blob> Blob::Slice(Environment* env, size_t start, size_t end) {
return Create(env, this->data_queue->slice(start, v8::Just(end)));
return Create(env, this->data_queue_->slice(start, v8::Just(end)));
}

Blob::Blob(
Environment* env,
v8::Local<v8::Object> obj,
std::shared_ptr<DataQueue> data_queue)
: BaseObject(env, obj),
data_queue(data_queue) {
data_queue_(data_queue) {
MakeWeak();
}

Expand All @@ -205,7 +206,7 @@ BaseObject::TransferMode Blob::GetTransferMode() const {
}

std::unique_ptr<worker::TransferData> Blob::CloneForMessaging() const {
return std::make_unique<BlobTransferData>(data_queue);
return std::make_unique<BlobTransferData>(data_queue_);
}

void Blob::StoreDataObject(const v8::FunctionCallbackInfo<v8::Value>& args) {
Expand Down Expand Up @@ -410,7 +411,7 @@ BlobBindingData::BlobBindingData(Environment* env, Local<Object> wrap)
}

void BlobBindingData::MemoryInfo(MemoryTracker* tracker) const {
tracker->TrackField("data_objects", data_objects_);
tracker->TrackField("data_objects_", data_objects_);
}

void BlobBindingData::store_data_object(
Expand Down
4 changes: 2 additions & 2 deletions src/node_blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Blob : public BaseObject {

BaseObjectPtr<Blob> Slice(Environment* env, size_t start, size_t end);

inline size_t length() const { return this->data_queue->size().ToChecked(); }
inline size_t length() const { return this->data_queue_->size().ToChecked(); }

class BlobTransferData : public worker::TransferData {
public:
Expand Down Expand Up @@ -82,7 +82,7 @@ class Blob : public BaseObject {
std::shared_ptr<DataQueue> data_queue);

private:
std::shared_ptr<DataQueue> data_queue;
std::shared_ptr<DataQueue> data_queue_;
};

// TODO(@flakey5): revisit when DataQueue is complete
Expand Down

0 comments on commit 2adc7d5

Please sign in to comment.