Skip to content

Commit 92ece28

Browse files
committed
COMP: Prefer the C++ headers over the C99 headers
Using the C++11 headers keeps the library cleaner and more rigorously scoped use of namespaces.
1 parent fed056a commit 92ece28

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

include/json/assertions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
88

99
#include <sstream>
10-
#include <stdlib.h>
10+
#include <cstdlib>
1111

1212
#if !defined(JSON_IS_AMALGAMATION)
1313
#include "config.h"

include/json/config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
#ifndef JSON_CONFIG_H_INCLUDED
77
#define JSON_CONFIG_H_INCLUDED
8-
#include <stddef.h>
9-
#include <stdint.h> //typedef int64_t, uint64_t
8+
#include <cstddef>
9+
#include <cstdint> //typedef int64_t, uint64_t
1010
#include <string> //typedef String
1111

1212
/// If defined, indicates that json library is embedded in CppTL library.

src/jsontestrunner/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <algorithm> // sort
1717
#include <json/json.h>
1818
#include <sstream>
19-
#include <stdio.h>
19+
#include <cstdio>
2020

2121
struct Options {
2222
JSONCPP_STRING path;

src/lib_json/json_value.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#endif // if !defined(JSON_IS_AMALGAMATION)
1111
#include <cassert>
1212
#include <cstring>
13-
#include <math.h>
13+
#include <cmath>
1414
#include <sstream>
1515
#include <utility>
1616
#ifdef JSON_USE_CPPTL

src/lib_json/json_writer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#endif
2929

3030
#else
31-
#include <math.h>
32-
#include <stdio.h>
31+
#include <cmath>
32+
#include <cstdio>
3333

3434
#if defined(_MSC_VER)
3535
#if !defined(isnan)

src/test_lib_json/jsontest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC
77
#include "jsontest.h"
8-
#include <stdio.h>
8+
#include <cstdio>
99
#include <string>
1010

1111
#if defined(_MSC_VER)

src/test_lib_json/jsontest.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <json/value.h>
1212
#include <json/writer.h>
1313
#include <sstream>
14-
#include <stdio.h>
14+
#include <cstdio>
1515
#include <string>
1616

1717
// //////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)