Fix -Wsign-compare
[folly.git] / folly / io / Cursor-defs.h
index 2ee9319dc3b78dabc413f46d54f0098d8bbb84bd..9bee20982662ca8becd6160b8ba42c8f26caa1ea 100644 (file)
@@ -47,7 +47,7 @@ void Appender::vprintf(const char* fmt, va_list ap) {
   }
   // vsnprintf() returns the number of characters that would be printed,
   // not including the terminating nul.
   }
   // vsnprintf() returns the number of characters that would be printed,
   // not including the terminating nul.
-  if (ret < length()) {
+  if (size_t(ret) < length()) {
     // All of the data was successfully written.
     append(ret);
     return;
     // All of the data was successfully written.
     append(ret);
     return;
@@ -61,7 +61,7 @@ void Appender::vprintf(const char* fmt, va_list ap) {
   if (ret < 0) {
     throw std::runtime_error("error formatting printf() data");
   }
   if (ret < 0) {
     throw std::runtime_error("error formatting printf() data");
   }
-  if (ret >= length()) {
+  if (size_t(ret) >= length()) {
     // This shouldn't ever happen.
     throw std::runtime_error("unexpectedly out of buffer space on second "
                              "vsnprintf() attmept");
     // This shouldn't ever happen.
     throw std::runtime_error("unexpectedly out of buffer space on second "
                              "vsnprintf() attmept");