Skip to content

Commit 536c6e3

Browse files
author
Jeroen Vermeulen
committed
Modernize "C" includes in mert.
This is one of those little chores in managing a long-lived C++ project: standard C headers like stdio.h and math.h now have their own place in the C++ standard as resp. cstdio, cmath, and so on. In this branch the #include names are updated for the mert/ subdirectory; more branches to follow. C++11 adds cstdint, but to support compilation with the previous standard, that change is left for later.
1 parent 98e09b1 commit 536c6e3

12 files changed

+20
-20
lines changed

mert/HypPackEnumerator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <string>
1313
#include <vector>
1414
#include <utility>
15-
#include <stddef.h>
15+
#include <cstddef>
1616

1717
#include "FeatureDataIterator.h"
1818
#include "ScoreDataIterator.h"

mert/MeteorScorer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <iterator>
77
#include <sstream>
88
#include <stdexcept>
9-
#include <stdio.h>
9+
#include <cstdio>
1010
#include <string>
1111
#include <vector>
1212

mert/Permutation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <fstream>
1010
#include <sstream>
11-
#include <math.h>
11+
#include <cmath>
1212
#include "Permutation.h"
1313
#include "Util.h"
1414

mert/PermutationScorer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <stdexcept>
1111
#include <string>
1212
#include <vector>
13-
#include <limits.h>
13+
#include <climits>
1414
#include "Types.h"
1515
#include "ScoreData.h"
1616
#include "Scorer.h"

mert/TER/alignmentStruct.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323

2424

2525
#include <vector>
26-
#include <stdio.h>
26+
#include <cstdio>
2727
#include <string>
2828
#include <sstream>
2929
#include "tools.h"
@@ -64,4 +64,4 @@ class alignmentStruct
6464
};
6565

6666
}
67-
#endif
67+
#endif

mert/TER/bestShiftStruct.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323

2424

2525
#include <vector>
26-
#include <stdio.h>
26+
#include <cstdio>
2727
#include <string>
2828
#include <sstream>
2929
#include "tools.h"

mert/TER/infosHasher.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2222
#define __INFOSHASHER_H__
2323
#include <string>
2424
// #include <ext/hash_map>
25-
#include <stdio.h>
25+
#include <cstdio>
2626
#include <iostream>
2727
#include <sstream>
2828
#include <vector>
@@ -51,4 +51,4 @@ class infosHasher
5151

5252

5353
}
54-
#endif
54+
#endif

mert/TER/terAlignment.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323

2424

2525
#include <vector>
26-
#include <stdio.h>
27-
#include <string.h>
26+
#include <cstdio>
27+
#include <cstring>
2828
#include "tools.h"
2929
#include "terShift.h"
3030

@@ -74,4 +74,4 @@ class terAlignment
7474
};
7575

7676
}
77-
#endif
77+
#endif

mert/TER/terShift.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323

2424

2525
#include <vector>
26-
#include <stdio.h>
26+
#include <cstdio>
2727
#include <string>
2828
#include <sstream>
2929
#include "tools.h"
@@ -65,4 +65,4 @@ class terShift
6565
};
6666

6767
}
68-
#endif
68+
#endif

mert/TER/tercalc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2222
#define _TERCPPTERCALC_H___
2323

2424
#include <vector>
25-
#include <stdio.h>
26-
#include <string.h>
25+
#include <cstdio>
26+
#include <cstring>
2727
#include <sstream>
2828
#include "hashMap.h"
2929
#include "hashMapInfos.h"

mert/TER/tools.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424

2525
#include <vector>
2626
#include <iostream>
27-
#include <stdio.h>
28-
#include <stdlib.h>
27+
#include <cstdio>
28+
#include <cstdlib>
2929
#include <string>
3030
#include <sstream>
3131
#include <boost/xpressive/xpressive.hpp>

mert/evaluator.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#include <vector>
55
#include <algorithm>
66
#include <getopt.h>
7-
#include <math.h>
7+
#include <cmath>
88

99
#if defined __MINGW32__
10-
#include <time.h>
10+
#include <ctime>
1111
#endif // defined
1212

1313
#include "Scorer.h"

0 commit comments

Comments
 (0)