浏览代码

Add explicit typecasts to avoid compiler warning.

Fixes issue #684.

PiperOrigin-RevId: 249531001
ld
Chris Mumford 5 年前
committed by Victor Costan
父节点
当前提交
ae49533210
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      util/status.cc

+ 2
- 2
util/status.cc 查看文件

@ -20,8 +20,8 @@ const char* Status::CopyState(const char* state) {
Status::Status(Code code, const Slice& msg, const Slice& msg2) {
assert(code != kOk);
const uint32_t len1 = msg.size();
const uint32_t len2 = msg2.size();
const uint32_t len1 = static_cast<uint32_t>(msg.size());
const uint32_t len2 = static_cast<uint32_t>(msg2.size());
const uint32_t size = len1 + (len2 ? (2 + len2) : 0);
char* result = new char[size + 5];
memcpy(result, &size, sizeof(size));

正在加载...
取消
保存