diff --git a/file/chunk_file.cpp b/file/chunk_file.cpp index 8c5abaa8c0..072e36b387 100644 --- a/file/chunk_file.cpp +++ b/file/chunk_file.cpp @@ -24,7 +24,7 @@ ChunkFile::ChunkFile(const char *filename, bool _read) { didFail = true; return; } - eof = size; + eof = (int)size; return; } @@ -213,7 +213,7 @@ void ChunkFile::writeWString(String str) { // Takes utf-8 void ChunkFile::writeWString(const std::string &str) { unsigned short *text; - size_t len = str.length(); + int len = (int)str.length(); text = new unsigned short[len+1]; for (size_t i=0; i 0) { ssize_t nwritten; - if ((nwritten = write(fd, buffer, nleft)) <= 0) { + if ((nwritten = (ssize_t)write(fd, buffer, nleft)) <= 0) { if (errno == EINTR) nwritten = 0; else diff --git a/thread/prioritizedworkqueue.cpp b/thread/prioritizedworkqueue.cpp index ea54d35dac..c747a36ba8 100644 --- a/thread/prioritizedworkqueue.cpp +++ b/thread/prioritizedworkqueue.cpp @@ -67,20 +67,6 @@ PrioritizedWorkQueueItem *PrioritizedWorkQueue::Pop() { } } -void PrioritizedWorkQueue::Wait(PrioritizedWorkQueueItem *item) { - while (true) { - bool stillThere = false; - lock_guard guard(mutex_); - for (int i = 0; i < queue_.empty(); i++) { - if (queue_[i] == item) - stillThere = true; - } - if (!stillThere) - break; - sleep_ms(100); - } -} - // TODO: This feels ugly. Revisit later. static std::thread *workThread; diff --git a/thread/prioritizedworkqueue.h b/thread/prioritizedworkqueue.h index 506e3146b0..9f5241c0e8 100644 --- a/thread/prioritizedworkqueue.h +++ b/thread/prioritizedworkqueue.h @@ -35,9 +35,6 @@ public: bool Done() { return done_; } void Stop(); - // Try not to use this. It's a hack. - void Wait(PrioritizedWorkQueueItem *item); - private: bool done_; recursive_mutex mutex_;