Commit d460a7dc authored by Andrew Krieger's avatar Andrew Krieger Committed by Facebook Github Bot

clang-on-windows compatibility nits

Summary:
clang whines about these to varying degrees. They seem like
braindead fixes.

Reviewed By: yfeldblum

Differential Revision: D7918701

fbshipit-source-id: a5aae179c2df89ef52148a500e95cd1cd25a1f0b
parent baef20f9
......@@ -724,7 +724,7 @@ class UnboundedQueue {
}
FOLLY_ALWAYS_INLINE Ticket minTicket() const noexcept {
DCHECK_EQ((min_ & (SegmentSize - 1)), 0);
DCHECK_EQ((min_ & (SegmentSize - 1)), Ticket(0));
return min_;
}
......
......@@ -16,7 +16,7 @@
#pragma once
#ifdef _WIN32
#if defined(_WIN32) && !defined(__clang__)
#include <assert.h>
#include <folly/Portability.h>
#include <intrin.h>
......
......@@ -219,7 +219,7 @@ ssize_t read(int fh, void* buf, size_t count) {
return r;
}
}
auto r = _read(fh, buf, unsigned int(count));
auto r = _read(fh, buf, static_cast<unsigned int>(count));
if (r == -1 && GetLastError() == ERROR_NO_DATA) {
// This only happens if the file was non-blocking and
// no data was present. We have to translate the error
......@@ -312,7 +312,7 @@ ssize_t write(int fh, void const* buf, size_t count) {
return r;
}
}
auto r = _write(fh, buf, unsigned int(count));
auto r = _write(fh, buf, static_cast<unsigned int>(count));
if ((r > 0 && size_t(r) != count) || (r == -1 && errno == ENOSPC)) {
// Writing to a pipe with a full buffer doesn't generate
// any error type, unless it caused us to write exactly 0
......
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