Skip to content

Commit 5417da6

Browse files
committed
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
1 parent 251d935 commit 5417da6

8 files changed

+19
-19
lines changed

snappy-sinksource.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29-
#include <cstddef>
29+
#include <stddef.h>
3030
#include <cstring>
3131

3232
#include "snappy-sinksource.h"

snappy-stubs-internal.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@
3535
#include "config.h"
3636
#endif
3737

38-
#include <cstdint>
38+
#include <stdint.h>
39+
40+
#include <cassert>
41+
#include <cstdlib>
3942
#include <cstring>
4043
#include <limits>
4144
#include <string>
4245

43-
#include <assert.h>
44-
#include <stdlib.h>
45-
#include <string.h>
46-
4746
#ifdef HAVE_SYS_MMAN_H
4847
#include <sys/mman.h>
4948
#endif

snappy-test.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@
3131
#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
3232
#define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
3333

34+
#include <cstdarg>
35+
#include <cstdio>
3436
#include <iostream>
3537
#include <string>
3638

3739
#include "snappy-stubs-internal.h"
3840

39-
#include <stdio.h>
40-
#include <stdarg.h>
41-
4241
#ifdef HAVE_SYS_MMAN_H
4342
#include <sys/mman.h>
4443
#endif

snappy.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@
6868
#include <immintrin.h>
6969
#endif
7070

71-
#include <stdio.h>
72-
7371
#include <algorithm>
72+
#include <cstdio>
7473
#include <cstring>
7574
#include <string>
7675
#include <vector>

snappy.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
#ifndef THIRD_PARTY_SNAPPY_SNAPPY_H__
4040
#define THIRD_PARTY_SNAPPY_SNAPPY_H__
4141

42-
#include <cstddef>
43-
#include <cstdint>
42+
#include <stddef.h>
43+
#include <stdint.h>
44+
4445
#include <string>
4546

4647
#include "snappy-stubs-public.h"

snappy_compress_fuzzer.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
//
2929
// libFuzzer harness for fuzzing snappy compression code.
3030

31+
#include <stddef.h>
32+
#include <stdint.h>
33+
3134
#include <cassert>
32-
#include <cstddef>
33-
#include <cstdint>
3435
#include <string>
3536

3637
#include "snappy.h"

snappy_uncompress_fuzzer.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
//
2929
// libFuzzer harness for fuzzing snappy's decompression code.
3030

31+
#include <stddef.h>
32+
#include <stdint.h>
33+
3134
#include <cassert>
32-
#include <cstddef>
33-
#include <cstdint>
3435
#include <string>
3536

3637
#include "snappy.h"

snappy_unittest.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29-
#include <math.h>
30-
#include <stdlib.h>
29+
#include <cmath>
30+
#include <cstdlib>
3131

3232
#include <algorithm>
3333
#include <random>

0 commit comments

Comments
 (0)