summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2020-04-29 19:32:47 +0000
committerVictor Costan <costan@google.com>2020-04-29 19:38:03 +0000
commit5417da69b7e150bcfb9c18304c0aa95d8caf7f34 (patch)
treea98189eb5c71da384d9c3238573058720701fd91
parent251d935d5096da77c4fef26ea41b019430da5572 (diff)
downloadsnappy-git-5417da69b7e150bcfb9c18304c0aa95d8caf7f34.tar.gz
Switch from C headers to C++ headers.
This CL makes the following substitutions. * assert.h -> cassert * math.h -> cmath * stdarg.h -> cstdarg * stdio.h -> cstdio * stdlib.h -> cstdlib * string.h -> cstring stddef.h and stdint.h are not migrated to C++ headers. PiperOrigin-RevId: 309074805
-rw-r--r--snappy-sinksource.cc2
-rw-r--r--snappy-stubs-internal.h9
-rw-r--r--snappy-test.h5
-rw-r--r--snappy.cc3
-rw-r--r--snappy.h5
-rw-r--r--snappy_compress_fuzzer.cc5
-rw-r--r--snappy_uncompress_fuzzer.cc5
-rw-r--r--snappy_unittest.cc4
8 files changed, 19 insertions, 19 deletions
diff --git a/snappy-sinksource.cc b/snappy-sinksource.cc
index b161797..605a2cb 100644
--- a/snappy-sinksource.cc
+++ b/snappy-sinksource.cc
@@ -26,7 +26,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <cstddef>
+#include <stddef.h>
#include <cstring>
#include "snappy-sinksource.h"
diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h
index 2a7af30..0e62e73 100644
--- a/snappy-stubs-internal.h
+++ b/snappy-stubs-internal.h
@@ -35,15 +35,14 @@
#include "config.h"
#endif
-#include <cstdint>
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdlib>
#include <cstring>
#include <limits>
#include <string>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
diff --git a/snappy-test.h b/snappy-test.h
index 603f486..682998b 100644
--- a/snappy-test.h
+++ b/snappy-test.h
@@ -31,14 +31,13 @@
#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
#define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
+#include <cstdarg>
+#include <cstdio>
#include <iostream>
#include <string>
#include "snappy-stubs-internal.h"
-#include <stdio.h>
-#include <stdarg.h>
-
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
diff --git a/snappy.cc b/snappy.cc
index 0aab795..6daddc0 100644
--- a/snappy.cc
+++ b/snappy.cc
@@ -68,9 +68,8 @@
#include <immintrin.h>
#endif
-#include <stdio.h>
-
#include <algorithm>
+#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
diff --git a/snappy.h b/snappy.h
index c8352aa..e4fdad3 100644
--- a/snappy.h
+++ b/snappy.h
@@ -39,8 +39,9 @@
#ifndef THIRD_PARTY_SNAPPY_SNAPPY_H__
#define THIRD_PARTY_SNAPPY_SNAPPY_H__
-#include <cstddef>
-#include <cstdint>
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "snappy-stubs-public.h"
diff --git a/snappy_compress_fuzzer.cc b/snappy_compress_fuzzer.cc
index 1d0119e..1d4429a 100644
--- a/snappy_compress_fuzzer.cc
+++ b/snappy_compress_fuzzer.cc
@@ -28,9 +28,10 @@
//
// libFuzzer harness for fuzzing snappy compression code.
+#include <stddef.h>
+#include <stdint.h>
+
#include <cassert>
-#include <cstddef>
-#include <cstdint>
#include <string>
#include "snappy.h"
diff --git a/snappy_uncompress_fuzzer.cc b/snappy_uncompress_fuzzer.cc
index 8071c00..385bfb5 100644
--- a/snappy_uncompress_fuzzer.cc
+++ b/snappy_uncompress_fuzzer.cc
@@ -28,9 +28,10 @@
//
// libFuzzer harness for fuzzing snappy's decompression code.
+#include <stddef.h>
+#include <stdint.h>
+
#include <cassert>
-#include <cstddef>
-#include <cstdint>
#include <string>
#include "snappy.h"
diff --git a/snappy_unittest.cc b/snappy_unittest.cc
index db44c90..c4c85fd 100644
--- a/snappy_unittest.cc
+++ b/snappy_unittest.cc
@@ -26,8 +26,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <math.h>
-#include <stdlib.h>
+#include <cmath>
+#include <cstdlib>
#include <algorithm>
#include <random>