Skip to content

Commit

Permalink
s/std::snprintf/snprintf
Browse files Browse the repository at this point in the history
Summary:
Looks like std::snprintf is not available on all platforms (e.g. MSVC 2010). Change it back to snprintf, where we have a macro in port.h to workaround compatibility.
Closes #2308

Differential Revision: D5070988

Pulled By: yiwu-arbug

fbshipit-source-id: bedfc1660bab0431c583ad434b7e68265e1211b1
  • Loading branch information
Yi Wu committed May 16, 2017
1 parent ab8129a commit 1371271
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions utilities/blob_db/blob_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// of patent rights can be found in the PATENTS file in the same directory.
#ifndef ROCKSDB_LITE

#include <stdio.h>
#include <chrono>
#include <cinttypes>
#include <cstdio>
#include <memory>
#include "utilities/blob_db/blob_db_impl.h"

Expand Down Expand Up @@ -89,17 +89,17 @@ std::shared_ptr<Reader> BlobFile::OpenSequentialReader(

std::string BlobFile::DumpState() const {
char str[1000];
std::snprintf(str, sizeof(str),
"path: %s fn: %" PRIu64 " blob_count: %" PRIu64
" gc_epoch: %" PRIu64 " file_size: %" PRIu64
" deleted_count: %" PRIu64 " deleted_size: %" PRIu64
" closed: %d can_be_deleted: %d ttl_range: (%d, %d)"
" sn_range: (%" PRIu64 " %" PRIu64 "), writer: %d reader: %d",
path_to_dir_.c_str(), file_number_, blob_count_.load(),
gc_epoch_.load(), file_size_.load(), deleted_count_,
deleted_size_, closed_.load(), can_be_deleted_.load(),
ttl_range_.first, ttl_range_.second, sn_range_.first,
sn_range_.second, (!!log_writer_), (!!ra_file_reader_));
snprintf(str, sizeof(str),
"path: %s fn: %" PRIu64 " blob_count: %" PRIu64 " gc_epoch: %" PRIu64
" file_size: %" PRIu64 " deleted_count: %" PRIu64
" deleted_size: %" PRIu64
" closed: %d can_be_deleted: %d ttl_range: (%d, %d)"
" sn_range: (%" PRIu64 " %" PRIu64 "), writer: %d reader: %d",
path_to_dir_.c_str(), file_number_, blob_count_.load(),
gc_epoch_.load(), file_size_.load(), deleted_count_, deleted_size_,
closed_.load(), can_be_deleted_.load(), ttl_range_.first,
ttl_range_.second, sn_range_.first, sn_range_.second,
(!!log_writer_), (!!ra_file_reader_));
return str;
}

Expand Down

0 comments on commit 1371271

Please sign in to comment.