From 3b5eb8f49dcc09d02ea371ee37dfa056011d5b99 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Mon, 2 Oct 2017 15:13:42 +1030 Subject: [PATCH 20/22] c++11 has long long --- fofi/FoFiTrueType.cc | 1 + fofi/FoFiType1.cc | 1 + goo/GooString.cc | 36 ------------------------------------ goo/GooString.h | 13 ------------- poppler/Object.h | 1 + poppler/PDFDoc.cc | 1 + 6 files changed, 4 insertions(+), 49 deletions(-) diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc index 4495cb3b..96e89c5c 100644 --- a/fofi/FoFiTrueType.cc +++ b/fofi/FoFiTrueType.cc @@ -37,6 +37,7 @@ #include #include +#include #include #include "goo/gtypes.h" #include "goo/gmem.h" diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc index f741d5d3..a07a96c3 100644 --- a/fofi/FoFiType1.cc +++ b/fofi/FoFiType1.cc @@ -32,6 +32,7 @@ #include #include +#include #include "goo/gmem.h" #include "goo/GooLikely.h" #include "FoFiEncodings.h" diff --git a/goo/GooString.cc b/goo/GooString.cc index 10976e87..4df6d673 100644 --- a/goo/GooString.cc +++ b/goo/GooString.cc @@ -56,12 +56,8 @@ union GooStringFormatArg { Guint ui; long l; Gulong ul; -#ifdef LLONG_MAX long long ll; -#endif -#ifdef ULLONG_MAX unsigned long long ull; -#endif double f; char c; char *s; @@ -89,20 +85,16 @@ enum GooStringFormatType { fmtULongHexUpper, fmtULongOctal, fmtULongBinary, -#ifdef LLONG_MAX fmtLongLongDecimal, fmtLongLongHex, fmtLongLongHexUpper, fmtLongLongOctal, fmtLongLongBinary, -#endif -#ifdef ULLONG_MAX fmtULongLongDecimal, fmtULongLongHex, fmtULongLongHexUpper, fmtULongLongOctal, fmtULongLongBinary, -#endif fmtDouble, fmtDoubleTrimSmallAware, fmtDoubleTrim, @@ -115,12 +107,8 @@ enum GooStringFormatType { static const char *formatStrings[] = { "d", "x", "X", "o", "b", "ud", "ux", "uX", "uo", "ub", "ld", "lx", "lX", "lo", "lb", "uld", "ulx", "ulX", "ulo", "ulb", -#ifdef LLONG_MAX "lld", "llx", "llX", "llo", "llb", -#endif -#ifdef ULLONG_MAX "ulld", "ullx", "ullX", "ullo", "ullb", -#endif "f", "gs", "g", "c", "s", @@ -424,7 +412,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { case fmtULongBinary: args[argsLen].ul = va_arg(argList, Gulong); break; -#ifdef LLONG_MAX case fmtLongLongDecimal: case fmtLongLongHex: case fmtLongLongHexUpper: @@ -432,8 +419,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { case fmtLongLongBinary: args[argsLen].ll = va_arg(argList, long long); break; -#endif -#ifdef ULLONG_MAX case fmtULongLongDecimal: case fmtULongLongHex: case fmtULongLongHexUpper: @@ -441,7 +426,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { case fmtULongLongBinary: args[argsLen].ull = va_arg(argList, unsigned long long); break; -#endif case fmtDouble: case fmtDoubleTrim: case fmtDoubleTrimSmallAware: @@ -531,7 +515,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { case fmtULongBinary: formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 2, &str, &len); break; -#ifdef LLONG_MAX case fmtLongLongDecimal: formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 10, &str, &len); break; @@ -548,8 +531,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { case fmtLongLongBinary: formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 2, &str, &len); break; -#endif -#ifdef ULLONG_MAX case fmtULongLongDecimal: formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 10, &str, &len); @@ -570,7 +551,6 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 2, &str, &len); break; -#endif case fmtDouble: formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len); break; @@ -641,23 +621,13 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) { static const char lowerCaseDigits[17] = "0123456789abcdef"; static const char upperCaseDigits[17] = "0123456789ABCDEF"; -#ifdef LLONG_MAX void GooString::formatInt(long long x, char *buf, int bufSize, GBool zeroFill, int width, int base, char **p, int *len, GBool upperCase) { -#else -void GooString::formatInt(long x, char *buf, int bufSize, - GBool zeroFill, int width, int base, - char **p, int *len, GBool upperCase) { -#endif const char *vals = upperCase ? upperCaseDigits : lowerCaseDigits; GBool neg; int start, i, j; -#ifdef LLONG_MAX unsigned long long abs_x; -#else - unsigned long abs_x; -#endif i = bufSize; if ((neg = x < 0)) { @@ -686,15 +656,9 @@ void GooString::formatInt(long x, char *buf, int bufSize, *len = bufSize - i; } -#ifdef ULLONG_MAX void GooString::formatUInt(unsigned long long x, char *buf, int bufSize, GBool zeroFill, int width, int base, char **p, int *len, GBool upperCase) { -#else -void GooString::formatUInt(Gulong x, char *buf, int bufSize, - GBool zeroFill, int width, int base, - char **p, int *len, GBool upperCase) { -#endif const char *vals = upperCase ? upperCaseDigits : lowerCaseDigits; int i, j; diff --git a/goo/GooString.h b/goo/GooString.h index a5418c3d..1e35d776 100644 --- a/goo/GooString.h +++ b/goo/GooString.h @@ -35,7 +35,6 @@ #pragma interface #endif -#include // for LLONG_MAX and ULLONG_MAX #include #include // for NULL #include "gtypes.h" @@ -187,24 +186,12 @@ private: char *s; void resize(int newLength); -#ifdef LLONG_MAX static void formatInt(long long x, char *buf, int bufSize, GBool zeroFill, int width, int base, char **p, int *len, GBool upperCase = gFalse); -#else - static void formatInt(long x, char *buf, int bufSize, - GBool zeroFill, int width, int base, - char **p, int *len, GBool upperCase = gFalse); -#endif -#ifdef ULLONG_MAX static void formatUInt(unsigned long long x, char *buf, int bufSize, GBool zeroFill, int width, int base, char **p, int *len, GBool upperCase = gFalse); -#else - static void formatUInt(Gulong x, char *buf, int bufSize, - GBool zeroFill, int width, int base, - char **p, int *len, GBool upperCase = gFalse); -#endif static void formatDouble(double x, char *buf, int bufSize, int prec, GBool trim, char **p, int *len); static void formatDoubleSmallAware(double x, char *buf, int bufSize, int prec, diff --git a/poppler/Object.h b/poppler/Object.h index 8b18af68..7e734615 100644 --- a/poppler/Object.h +++ b/poppler/Object.h @@ -38,6 +38,7 @@ #include #include #include +#include #include "goo/gtypes.h" #include "goo/gmem.h" #include "goo/GooString.h" diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index 1f997488..50a5163c 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include -- 2.11.0