Commit 1c1d9a70 authored by Albert Astals Cid's avatar Albert Astals Cid

Enable modernize-deprecated-headers

parent 5713d0da
......@@ -40,7 +40,7 @@ build_clang_libcpp:
script:
- git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
- mkdir -p build && cd build
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- ninja
- ctest --output-on-failure
......
......@@ -263,7 +263,6 @@ if(ENABLE_ZLIB)
endif()
if (NSS3_FOUND)
add_definitions(${NSS3_CFLAGS})
set(ENABLE_NSS3 ON)
endif()
if(JPEG_FOUND)
......@@ -461,6 +460,7 @@ if (ENABLE_NSS3)
)
if(${CMAKE_VERSION} VERSION_LESS "3.6.0")
set(poppler_LIBS ${poppler_LIBS} ${NSS3_LIBRARIES})
include_directories(SYSTEM ${NSS3_INCLUDE_DIRS})
else()
set(poppler_LIBS ${poppler_LIBS} PkgConfig::NSS3)
endif()
......
......@@ -32,7 +32,7 @@
#include "Error.h"
#include "CharTypes.h"
#include <stdarg.h>
#include <cstdarg>
class GooString;
class PDFRectangle;
......
......@@ -26,8 +26,8 @@
#include <config.h>
#include <stdio.h>
#include <limits.h>
#include <cstdio>
#include <climits>
#include "goo/gfile.h"
#include "goo/gmem.h"
#include "poppler/Error.h"
......
......@@ -23,7 +23,7 @@
#include <config.h>
#include <stdlib.h>
#include <cstdlib>
#include "FoFiEncodings.h"
//------------------------------------------------------------------------
......
......@@ -23,9 +23,9 @@
//
//========================================================================
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <cstdio>
#include <cstring>
#include <climits>
#include "goo/gfile.h"
#include "goo/GooCheckedOps.h"
#include "FoFiIdentifier.h"
......
......@@ -32,9 +32,9 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include "goo/gmem.h"
#include "goo/GooLikely.h"
......
......@@ -28,7 +28,7 @@
#ifndef FOFITRUETYPE_H
#define FOFITRUETYPE_H
#include "stddef.h"
#include <cstddef>
#include <unordered_map>
#include <string>
#include "FoFiBase.h"
......
......@@ -27,9 +27,9 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <cstdlib>
#include <cstring>
#include <climits>
#include "goo/glibc.h"
#include "goo/gmem.h"
#include "goo/GooLikely.h"
......
......@@ -26,9 +26,9 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include "goo/gmem.h"
#include "goo/gstrtod.h"
#include "goo/GooLikely.h"
......@@ -2673,7 +2673,7 @@ int FoFiType1C::getDeltaIntArray(int *arr, int maxLen) const {
x = 0;
for (i = 0; i < n; ++i) {
int y;
if (unlikely(isinf(ops[i].num))) {
if (unlikely(std::isinf(ops[i].num))) {
return i;
}
if (checkedAdd(x, (int)ops[i].num, &y)) {
......
include_directories(
SYSTEM
${GTK3_INCLUDE_DIRS}
)
......
......@@ -17,7 +17,7 @@
*/
#include "config.h"
#include <errno.h>
#include <cerrno>
#include <goo/gfile.h>
......
......@@ -22,7 +22,7 @@
*/
#include "config.h"
#include <string.h>
#include <cstring>
#ifndef __GI_SCANNER__
#include <memory>
......
......@@ -19,7 +19,7 @@
#include "config.h"
#include <errno.h>
#include <cerrno>
#include <goo/gfile.h>
......
......@@ -17,7 +17,7 @@
*/
#include "config.h"
#include <math.h>
#include <cmath>
#ifndef __GI_SCANNER__
#include <GlobalParams.h>
......
......@@ -25,7 +25,7 @@
#include <StructElement.h>
#include <GlobalParams.h>
#include <UnicodeMap.h>
#include <math.h>
#include <cmath>
#endif /* !__GI_SCANNER__ */
#include "poppler.h"
......
......@@ -14,7 +14,7 @@
#include <config.h>
#include "GooTimer.h"
#include <string.h>
#include <cstring>
#define USEC_PER_SEC 1000000
......
......@@ -15,7 +15,7 @@
#ifndef IMGWRITER_H
#define IMGWRITER_H
#include <stdio.h>
#include <cstdio>
class ImgWriter
{
......
......@@ -19,8 +19,8 @@
#ifdef ENABLE_LIBPNG
#include <zlib.h>
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "poppler/Error.h"
#include "goo/gmem.h"
......
......@@ -16,7 +16,7 @@
#ifdef ENABLE_LIBTIFF
#include <string.h>
#include <cstring>
#ifdef _WIN32
#include <io.h>
......
......@@ -43,8 +43,8 @@
#ifndef _MSC_VER
# include <libgen.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
std::string gbasename(const char* filename)
{
......
......@@ -40,11 +40,11 @@
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <limits.h>
# include <string.h>
# include <climits>
# include <cstring>
# include <pwd.h>
#endif // _WIN32
#include <stdio.h>
#include <cstdio>
#include <limits>
#include "GooString.h"
#include "gfile.h"
......
......@@ -36,10 +36,10 @@
#define GFILE_H
#include "poppler-config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <time.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <ctime>
extern "C" {
#if defined(_WIN32)
# include <sys/stat.h>
......
......@@ -16,7 +16,7 @@
#include "config.h"
#include <time.h>
#include <ctime>
#ifndef HAVE_GMTIME_R
struct tm *gmtime_r(const time_t *timep, struct tm *result);
......
......@@ -61,7 +61,7 @@
#ifndef HAVE_STRTOK_R
#include <string.h>
#include <cstring>
#define __rawmemchr strchr
......
......@@ -22,10 +22,10 @@
#include "gstrtod.h"
#include <locale.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <clocale>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#define ascii_isspace(c) \
(c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
......
......@@ -52,9 +52,9 @@
#include <config.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include "goo/gmem.h"
#include "goo/gstrtod.h"
#include "Error.h"
......@@ -77,7 +77,7 @@
#include "FileSpec.h"
#include "DateInfo.h"
#include "Link.h"
#include <string.h>
#include <cstring>
#include <algorithm>
#ifndef M_PI
......
......@@ -8,8 +8,8 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "goo/gmem.h"
#include "FontEncodingTables.h"
#include "BuiltinFont.h"
......
......@@ -7,7 +7,7 @@
//========================================================================
#include <config.h>
#include <stdlib.h>
#include <cstdlib>
#include "FontEncodingTables.h"
#include "BuiltinFontTables.h"
......
......@@ -27,10 +27,10 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include "goo/gmem.h"
#include "goo/gfile.h"
#include "goo/GooString.h"
......
......@@ -39,7 +39,7 @@
#include <config.h>
#include "config.h"
#include <string.h>
#include <cstring>
#include "CairoFontEngine.h"
#include "CairoOutputDev.h"
#include "GlobalParams.h"
......
......@@ -41,9 +41,9 @@
#include <config.h>
#include <cstdint>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cairo.h>
#include "goo/gfile.h"
......
......@@ -47,11 +47,11 @@
#include <config.h>
#include <cstdint>
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <cstdint>
#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include "goo/gmem.h"
#include "CairoRescaleBox.h"
......
......@@ -43,8 +43,8 @@
#include <config.h>
#include <stddef.h>
#include <stdlib.h>
#include <cstddef>
#include <cstdlib>
#include "goo/gmem.h"
#include "Object.h"
#include "PDFDoc.h"
......
......@@ -12,8 +12,8 @@
#include "CertificateInfo.h"
#include <string.h>
#include <stdlib.h>
#include <cstring>
#include <cstdlib>
X509CertificateInfo::PublicKeyInfo::PublicKeyInfo() :
publicKeyType(OTHERKEY),
......
......@@ -14,7 +14,7 @@
#define CERTIFICATEINFO_H
#include <memory>
#include <time.h>
#include <ctime>
#include "goo/GooString.h"
enum CertificateKeyUsageExtension
......
......@@ -36,8 +36,8 @@
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include "goo/glibc.h"
#include "goo/gmem.h"
#include "goo/gfile.h"
......
......@@ -17,15 +17,15 @@
#define DCTSTREAM_H
#include "poppler-config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <setjmp.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <csetjmp>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <ctype.h>
#include <cstring>
#include <cctype>
#include "goo/gmem.h"
#include "goo/gfile.h"
#include "Error.h"
......
......@@ -26,8 +26,8 @@
#include "glibc.h"
#include "DateInfo.h"
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
/* See PDF Reference 1.3, Section 3.8.2 for PDF Date representation */
bool parseDateString(const char *dateString, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute)
......
......@@ -25,7 +25,7 @@
#define DATE_INFO_H
#include "goo/GooString.h"
#include <time.h>
#include <ctime>
bool parseDateString(const char *string, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute);
......
......@@ -31,7 +31,7 @@
#include <config.h>
#include <cstdint>
#include <string.h>
#include <cstring>
#include "goo/gmem.h"
#include "goo/grandom.h"
#include "Decrypt.h"
......
......@@ -27,9 +27,9 @@
#include <config.h>
#include <poppler-config.h>
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <cstdio>
#include <cstddef>
#include <cstdarg>
#include "GooString.h"
#include "GlobalParams.h"
#include "Error.h"
......
......@@ -27,7 +27,7 @@
#ifndef ERROR_H
#define ERROR_H
#include <stdarg.h>
#include <cstdarg>
#include "poppler-config.h"
#include "goo/gfile.h"
#include "goo/GooString.h"
......
......@@ -13,14 +13,14 @@
#define FLATEENCODE_H
#include "poppler-config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <ctype.h>
#include <cstring>
#include <cctype>
#include "goo/gmem.h"
#include "goo/gfile.h"
#include "Error.h"
......
......@@ -13,14 +13,14 @@
#define FLATESTREAM_H
#include "poppler-config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <ctype.h>
#include <cstring>
#include <cctype>
#include "goo/gmem.h"
#include "goo/gfile.h"
#include "Error.h"
......
......@@ -7,7 +7,7 @@
//========================================================================
#include <config.h>
#include <stdlib.h>
#include <cstdlib>
#include "FontEncodingTables.h"
const char *macRomanEncoding[256] = {
......
......@@ -30,11 +30,11 @@
//========================================================================
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <cstring>
#include <cmath>
#include "GlobalParams.h"
#include "Error.h"
#include "Object.h"
......
......@@ -34,10 +34,10 @@
#include <set>
#include <limits>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include "goo/gmem.h"