Browse Source

Switch from C headers to C++ headers.

This CL makes the following substitutions.

* assert.h -> cassert
* math.h -> cmath
* stdarg.h -> cstdarg
* stddef.h -> cstddef
* stdint.h -> cstdint
* stdio.h -> cstdio
* stdlib.h -> cstdlib
* string.h -> cstring

PiperOrigin-RevId: 309080151
baseline
Victor Costan 4 years ago
parent
commit
3f934e3705
40 changed files with 65 additions and 76 deletions
  1. +3
    -2
      benchmarks/db_bench.cc
  2. +3
    -2
      benchmarks/db_bench_sqlite3.cc
  3. +3
    -2
      benchmarks/db_bench_tree_db.cc
  4. +2
    -3
      db/db_impl.cc
  5. +1
    -1
      db/db_iter.h
  6. +1
    -2
      db/dbformat.cc
  7. +1
    -1
      db/dumpfile.cc
  8. +2
    -2
      db/filename.cc
  9. +1
    -2
      db/filename.h
  10. +1
    -1
      db/leveldbutil.cc
  11. +1
    -1
      db/log_reader.cc
  12. +1
    -1
      db/log_reader.h
  13. +1
    -1
      db/log_writer.cc
  14. +1
    -1
      db/log_writer.h
  15. +1
    -2
      db/table_cache.h
  16. +1
    -2
      db/version_set.cc
  17. +1
    -2
      helpers/memenv/memenv.cc
  18. +1
    -1
      include/leveldb/cache.h
  19. +2
    -2
      include/leveldb/db.h
  20. +2
    -3
      include/leveldb/env.h
  21. +1
    -1
      include/leveldb/options.h
  22. +3
    -4
      include/leveldb/slice.h
  23. +1
    -1
      include/leveldb/table.h
  24. +1
    -1
      include/leveldb/table_builder.h
  25. +2
    -2
      table/block.h
  26. +1
    -2
      table/block_builder.cc
  27. +1
    -2
      table/block_builder.h
  28. +2
    -3
      table/filter_block.h
  29. +1
    -2
      table/format.h
  30. +1
    -1
      table/table_builder.cc
  31. +5
    -4
      util/cache.cc
  32. +2
    -2
      util/crc32c.cc
  33. +2
    -2
      util/crc32c.h
  34. +1
    -1
      util/hash.cc
  35. +2
    -2
      util/hash.h
  36. +2
    -2
      util/histogram.cc
  37. +3
    -5
      util/logging.cc
  38. +2
    -3
      util/logging.h
  39. +1
    -1
      util/random.h
  40. +1
    -1
      util/status.cc

+ 3
- 2
benchmarks/db_bench.cc View File

@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors. // found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <cstdio>
#include <cstdlib>
#include "leveldb/cache.h" #include "leveldb/cache.h"
#include "leveldb/db.h" #include "leveldb/db.h"
#include "leveldb/env.h" #include "leveldb/env.h"

+ 3
- 2
benchmarks/db_bench_sqlite3.cc View File

@ -3,8 +3,9 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors. // found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <sqlite3.h> #include <sqlite3.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include "util/histogram.h" #include "util/histogram.h"
#include "util/random.h" #include "util/random.h"

+ 3
- 2
benchmarks/db_bench_tree_db.cc View File

@ -3,8 +3,9 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors. // found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <kcpolydb.h> #include <kcpolydb.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include "util/histogram.h" #include "util/histogram.h"
#include "util/random.h" #include "util/random.h"

+ 2
- 3
db/db_impl.cc View File

@ -4,11 +4,10 @@
#include "db/db_impl.h" #include "db/db_impl.h"
#include <stdint.h>
#include <stdio.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
#include <cstdint>
#include <cstdio>
#include <set> #include <set>
#include <string> #include <string>
#include <vector> #include <vector>

+ 1
- 1
db/db_iter.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_
#define STORAGE_LEVELDB_DB_DB_ITER_H_ #define STORAGE_LEVELDB_DB_DB_ITER_H_
#include <stdint.h>
#include <cstdint>
#include "db/dbformat.h" #include "db/dbformat.h"
#include "leveldb/db.h" #include "leveldb/db.h"

+ 1
- 2
db/dbformat.cc View File

@ -4,8 +4,7 @@
#include "db/dbformat.h" #include "db/dbformat.h"
#include <stdio.h>
#include <cstdio>
#include <sstream> #include <sstream>
#include "port/port.h" #include "port/port.h"

+ 1
- 1
db/dumpfile.cc View File

@ -4,7 +4,7 @@
#include "leveldb/dumpfile.h" #include "leveldb/dumpfile.h"
#include <stdio.h>
#include <cstdio>
#include "db/dbformat.h" #include "db/dbformat.h"
#include "db/filename.h" #include "db/filename.h"

+ 2
- 2
db/filename.cc View File

@ -4,8 +4,8 @@
#include "db/filename.h" #include "db/filename.h"
#include <ctype.h>
#include <stdio.h>
#include <cassert>
#include <cstdio>
#include "db/dbformat.h" #include "db/dbformat.h"
#include "leveldb/env.h" #include "leveldb/env.h"

+ 1
- 2
db/filename.h View File

@ -7,8 +7,7 @@
#ifndef STORAGE_LEVELDB_DB_FILENAME_H_ #ifndef STORAGE_LEVELDB_DB_FILENAME_H_
#define STORAGE_LEVELDB_DB_FILENAME_H_ #define STORAGE_LEVELDB_DB_FILENAME_H_
#include <stdint.h>
#include <cstdint>
#include <string> #include <string>
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 1
- 1
db/leveldbutil.cc View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors. // found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <stdio.h>
#include <cstdio>
#include "leveldb/dumpfile.h" #include "leveldb/dumpfile.h"
#include "leveldb/env.h" #include "leveldb/env.h"

+ 1
- 1
db/log_reader.cc View File

@ -4,7 +4,7 @@
#include "db/log_reader.h" #include "db/log_reader.h"
#include <stdio.h>
#include <cstdio>
#include "leveldb/env.h" #include "leveldb/env.h"
#include "util/coding.h" #include "util/coding.h"

+ 1
- 1
db/log_reader.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_DB_LOG_READER_H_ #ifndef STORAGE_LEVELDB_DB_LOG_READER_H_
#define STORAGE_LEVELDB_DB_LOG_READER_H_ #define STORAGE_LEVELDB_DB_LOG_READER_H_
#include <stdint.h>
#include <cstdint>
#include "db/log_format.h" #include "db/log_format.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 1
- 1
db/log_writer.cc View File

@ -4,7 +4,7 @@
#include "db/log_writer.h" #include "db/log_writer.h"
#include <stdint.h>
#include <cstdint>
#include "leveldb/env.h" #include "leveldb/env.h"
#include "util/coding.h" #include "util/coding.h"

+ 1
- 1
db/log_writer.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_ #ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_
#define STORAGE_LEVELDB_DB_LOG_WRITER_H_ #define STORAGE_LEVELDB_DB_LOG_WRITER_H_
#include <stdint.h>
#include <cstdint>
#include "db/log_format.h" #include "db/log_format.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 1
- 2
db/table_cache.h View File

@ -7,8 +7,7 @@
#ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_ #ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_
#define STORAGE_LEVELDB_DB_TABLE_CACHE_H_ #define STORAGE_LEVELDB_DB_TABLE_CACHE_H_
#include <stdint.h>
#include <cstdint>
#include <string> #include <string>
#include "db/dbformat.h" #include "db/dbformat.h"

+ 1
- 2
db/version_set.cc View File

@ -4,9 +4,8 @@
#include "db/version_set.h" #include "db/version_set.h"
#include <stdio.h>
#include <algorithm> #include <algorithm>
#include <cstdio>
#include "db/filename.h" #include "db/filename.h"
#include "db/log_reader.h" #include "db/log_reader.h"

+ 1
- 2
helpers/memenv/memenv.cc View File

@ -4,8 +4,7 @@
#include "helpers/memenv/memenv.h" #include "helpers/memenv/memenv.h"
#include <string.h>
#include <cstring>
#include <limits> #include <limits>
#include <map> #include <map>
#include <string> #include <string>

+ 1
- 1
include/leveldb/cache.h View File

@ -18,7 +18,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_CACHE_H_ #ifndef STORAGE_LEVELDB_INCLUDE_CACHE_H_
#define STORAGE_LEVELDB_INCLUDE_CACHE_H_ #define STORAGE_LEVELDB_INCLUDE_CACHE_H_
#include <stdint.h>
#include <cstdint>
#include "leveldb/export.h" #include "leveldb/export.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 2
- 2
include/leveldb/db.h View File

@ -5,8 +5,8 @@
#ifndef STORAGE_LEVELDB_INCLUDE_DB_H_ #ifndef STORAGE_LEVELDB_INCLUDE_DB_H_
#define STORAGE_LEVELDB_INCLUDE_DB_H_ #define STORAGE_LEVELDB_INCLUDE_DB_H_
#include <stdint.h>
#include <stdio.h>
#include <cstdint>
#include <cstdio>
#include "leveldb/export.h" #include "leveldb/export.h"
#include "leveldb/iterator.h" #include "leveldb/iterator.h"

+ 2
- 3
include/leveldb/env.h View File

@ -13,9 +13,8 @@
#ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_ #ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_
#define STORAGE_LEVELDB_INCLUDE_ENV_H_ #define STORAGE_LEVELDB_INCLUDE_ENV_H_
#include <stdarg.h>
#include <stdint.h>
#include <cstdarg>
#include <cstdint>
#include <string> #include <string>
#include <vector> #include <vector>

+ 1
- 1
include/leveldb/options.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_OPTIONS_H_ #ifndef STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
#define STORAGE_LEVELDB_INCLUDE_OPTIONS_H_ #define STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
#include <stddef.h>
#include <cstddef>
#include "leveldb/export.h" #include "leveldb/export.h"

+ 3
- 4
include/leveldb/slice.h View File

@ -15,10 +15,9 @@
#ifndef STORAGE_LEVELDB_INCLUDE_SLICE_H_ #ifndef STORAGE_LEVELDB_INCLUDE_SLICE_H_
#define STORAGE_LEVELDB_INCLUDE_SLICE_H_ #define STORAGE_LEVELDB_INCLUDE_SLICE_H_
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <string> #include <string>
#include "leveldb/export.h" #include "leveldb/export.h"

+ 1
- 1
include/leveldb/table.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_H_ #ifndef STORAGE_LEVELDB_INCLUDE_TABLE_H_
#define STORAGE_LEVELDB_INCLUDE_TABLE_H_ #define STORAGE_LEVELDB_INCLUDE_TABLE_H_
#include <stdint.h>
#include <cstdint>
#include "leveldb/export.h" #include "leveldb/export.h"
#include "leveldb/iterator.h" #include "leveldb/iterator.h"

+ 1
- 1
include/leveldb/table_builder.h View File

@ -13,7 +13,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_ #ifndef STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
#define STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_ #define STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
#include <stdint.h>
#include <cstdint>
#include "leveldb/export.h" #include "leveldb/export.h"
#include "leveldb/options.h" #include "leveldb/options.h"

+ 2
- 2
table/block.h View File

@ -5,8 +5,8 @@
#ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_
#define STORAGE_LEVELDB_TABLE_BLOCK_H_ #define STORAGE_LEVELDB_TABLE_BLOCK_H_
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include "leveldb/iterator.h" #include "leveldb/iterator.h"

+ 1
- 2
table/block_builder.cc View File

@ -28,9 +28,8 @@
#include "table/block_builder.h" #include "table/block_builder.h"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <cassert>
#include "leveldb/comparator.h" #include "leveldb/comparator.h"
#include "leveldb/options.h" #include "leveldb/options.h"

+ 1
- 2
table/block_builder.h View File

@ -5,8 +5,7 @@
#ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ #ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
#define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ #define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
#include <stdint.h>
#include <cstdint>
#include <vector> #include <vector>
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 2
- 3
table/filter_block.h View File

@ -9,9 +9,8 @@
#ifndef STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_ #ifndef STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
#define STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_ #define STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <string> #include <string>
#include <vector> #include <vector>

+ 1
- 2
table/format.h View File

@ -5,8 +5,7 @@
#ifndef STORAGE_LEVELDB_TABLE_FORMAT_H_ #ifndef STORAGE_LEVELDB_TABLE_FORMAT_H_
#define STORAGE_LEVELDB_TABLE_FORMAT_H_ #define STORAGE_LEVELDB_TABLE_FORMAT_H_
#include <stdint.h>
#include <cstdint>
#include <string> #include <string>
#include "leveldb/slice.h" #include "leveldb/slice.h"

+ 1
- 1
table/table_builder.cc View File

@ -4,7 +4,7 @@
#include "leveldb/table_builder.h" #include "leveldb/table_builder.h"
#include <assert.h>
#include <cassert>
#include "leveldb/comparator.h" #include "leveldb/comparator.h"
#include "leveldb/env.h" #include "leveldb/env.h"

+ 5
- 4
util/cache.cc View File

@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors. // found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "leveldb/cache.h" #include "leveldb/cache.h"
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include "port/port.h" #include "port/port.h"
#include "port/thread_annotations.h" #include "port/thread_annotations.h"
#include "util/hash.h" #include "util/hash.h"

+ 2
- 2
util/crc32c.cc View File

@ -6,8 +6,8 @@
#include "util/crc32c.h" #include "util/crc32c.h"
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include "port/port.h" #include "port/port.h"
#include "util/coding.h" #include "util/coding.h"

+ 2
- 2
util/crc32c.h View File

@ -5,8 +5,8 @@
#ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_ #ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_
#define STORAGE_LEVELDB_UTIL_CRC32C_H_ #define STORAGE_LEVELDB_UTIL_CRC32C_H_
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
namespace leveldb { namespace leveldb {
namespace crc32c { namespace crc32c {

+ 1
- 1
util/hash.cc View File

@ -4,7 +4,7 @@
#include "util/hash.h" #include "util/hash.h"
#include <string.h>
#include <cstring>
#include "util/coding.h" #include "util/coding.h"

+ 2
- 2
util/hash.h View File

@ -7,8 +7,8 @@
#ifndef STORAGE_LEVELDB_UTIL_HASH_H_ #ifndef STORAGE_LEVELDB_UTIL_HASH_H_
#define STORAGE_LEVELDB_UTIL_HASH_H_ #define STORAGE_LEVELDB_UTIL_HASH_H_
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
namespace leveldb { namespace leveldb {

+ 2
- 2
util/histogram.cc View File

@ -4,8 +4,8 @@
#include "util/histogram.h" #include "util/histogram.h"
#include <math.h>
#include <stdio.h>
#include <cmath>
#include <cstdio>
#include "port/port.h" #include "port/port.h"

+ 3
- 5
util/logging.cc View File

@ -4,11 +4,9 @@
#include "util/logging.h" #include "util/logging.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <limits> #include <limits>
#include "leveldb/env.h" #include "leveldb/env.h"

+ 2
- 3
util/logging.h View File

@ -8,9 +8,8 @@
#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_ #ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_
#define STORAGE_LEVELDB_UTIL_LOGGING_H_ #define STORAGE_LEVELDB_UTIL_LOGGING_H_
#include <stdint.h>
#include <stdio.h>
#include <cstdint>
#include <cstdio>
#include <string> #include <string>
#include "port/port.h" #include "port/port.h"

+ 1
- 1
util/random.h View File

@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_ #ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_
#define STORAGE_LEVELDB_UTIL_RANDOM_H_ #define STORAGE_LEVELDB_UTIL_RANDOM_H_
#include <stdint.h>
#include <cstdint>
namespace leveldb { namespace leveldb {

+ 1
- 1
util/status.cc View File

@ -4,7 +4,7 @@
#include "leveldb/status.h" #include "leveldb/status.h"
#include <stdio.h>
#include <cstdio>
#include "port/port.h" #include "port/port.h"

Loading…
Cancel
Save