summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2020-04-29 19:59:39 +0000
committerVictor Costan <costan@google.com>2020-04-29 20:51:13 +0000
commit3f934e3705444a3df80b128ddefc4cf440441ffe (patch)
tree7f9003632579b80fb7ba535ecd2abbfc911502d0 /util
parent23d67e7c1f4396919bd0c73c0eced13a0dac37f3 (diff)
downloadleveldb-3f934e3705444a3df80b128ddefc4cf440441ffe.tar.gz
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
Diffstat (limited to 'util')
-rw-r--r--util/cache.cc9
-rw-r--r--util/crc32c.cc4
-rw-r--r--util/crc32c.h4
-rw-r--r--util/hash.cc2
-rw-r--r--util/hash.h4
-rw-r--r--util/histogram.cc4
-rw-r--r--util/logging.cc8
-rw-r--r--util/logging.h5
-rw-r--r--util/random.h2
-rw-r--r--util/status.cc2
10 files changed, 21 insertions, 23 deletions
diff --git a/util/cache.cc b/util/cache.cc
index 12de306..509e5eb 100644
--- a/util/cache.cc
+++ b/util/cache.cc
@@ -2,11 +2,12 @@
// 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.
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-
#include "leveldb/cache.h"
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+
#include "port/port.h"
#include "port/thread_annotations.h"
#include "util/hash.h"
diff --git a/util/crc32c.cc b/util/crc32c.cc
index c2e61f7..3f18908 100644
--- a/util/crc32c.cc
+++ b/util/crc32c.cc
@@ -6,8 +6,8 @@
#include "util/crc32c.h"
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
#include "port/port.h"
#include "util/coding.h"
diff --git a/util/crc32c.h b/util/crc32c.h
index 98fabb0..b420b5f 100644
--- a/util/crc32c.h
+++ b/util/crc32c.h
@@ -5,8 +5,8 @@
#ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_
#define STORAGE_LEVELDB_UTIL_CRC32C_H_
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
namespace leveldb {
namespace crc32c {
diff --git a/util/hash.cc b/util/hash.cc
index dd47c11..8122fa8 100644
--- a/util/hash.cc
+++ b/util/hash.cc
@@ -4,7 +4,7 @@
#include "util/hash.h"
-#include <string.h>
+#include <cstring>
#include "util/coding.h"
diff --git a/util/hash.h b/util/hash.h
index 74bdb6e..87ab279 100644
--- a/util/hash.h
+++ b/util/hash.h
@@ -7,8 +7,8 @@
#ifndef STORAGE_LEVELDB_UTIL_HASH_H_
#define STORAGE_LEVELDB_UTIL_HASH_H_
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
namespace leveldb {
diff --git a/util/histogram.cc b/util/histogram.cc
index 65092c8..d110d28 100644
--- a/util/histogram.cc
+++ b/util/histogram.cc
@@ -4,8 +4,8 @@
#include "util/histogram.h"
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <cstdio>
#include "port/port.h"
diff --git a/util/logging.cc b/util/logging.cc
index 75e9d03..39d8551 100644
--- a/util/logging.cc
+++ b/util/logging.cc
@@ -4,11 +4,9 @@
#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 "leveldb/env.h"
diff --git a/util/logging.h b/util/logging.h
index 8ff2da8..a0394b2 100644
--- a/util/logging.h
+++ b/util/logging.h
@@ -8,9 +8,8 @@
#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_
#define STORAGE_LEVELDB_UTIL_LOGGING_H_
-#include <stdint.h>
-#include <stdio.h>
-
+#include <cstdint>
+#include <cstdio>
#include <string>
#include "port/port.h"
diff --git a/util/random.h b/util/random.h
index 76f7daf..fe76ab4 100644
--- a/util/random.h
+++ b/util/random.h
@@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_
#define STORAGE_LEVELDB_UTIL_RANDOM_H_
-#include <stdint.h>
+#include <cstdint>
namespace leveldb {
diff --git a/util/status.cc b/util/status.cc
index 15ce747..6b6528b 100644
--- a/util/status.cc
+++ b/util/status.cc
@@ -4,7 +4,7 @@
#include "leveldb/status.h"
-#include <stdio.h>
+#include <cstdio>
#include "port/port.h"