From 5417da69b7e150bcfb9c18304c0aa95d8caf7f34 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Wed, 29 Apr 2020 19:32:47 +0000 Subject: [PATCH] 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 --- snappy-sinksource.cc | 2 +- snappy-stubs-internal.h | 9 ++++----- snappy-test.h | 5 ++--- snappy.cc | 3 +-- snappy.h | 5 +++-- snappy_compress_fuzzer.cc | 5 +++-- snappy_uncompress_fuzzer.cc | 5 +++-- snappy_unittest.cc | 4 ++-- 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 +#include #include #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 +#include + +#include +#include #include #include #include -#include -#include -#include - #ifdef HAVE_SYS_MMAN_H #include #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 +#include #include #include #include "snappy-stubs-internal.h" -#include -#include - #ifdef HAVE_SYS_MMAN_H #include #endif diff --git a/snappy.cc b/snappy.cc index 0aab795..6daddc0 100644 --- a/snappy.cc +++ b/snappy.cc @@ -68,9 +68,8 @@ #include #endif -#include - #include +#include #include #include #include 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 -#include +#include +#include + #include #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 +#include + #include -#include -#include #include #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 +#include + #include -#include -#include #include #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 -#include +#include +#include #include #include