diff options
Diffstat (limited to 'Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc')
-rw-r--r-- | Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc b/Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc index 1319666779b..25b3de13d52 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/UnicodeMap.cc @@ -14,6 +14,9 @@ // under GPL version 2 or later // // Copyright (C) 2010 Jakub Wilk <jwilk@jwilk.net> +// Copyright (C) 2017 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2017 Jean Ghali <jghali@libertysurf.fr> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -28,6 +31,7 @@ #include <stdio.h> #include <string.h> +#include "goo/glibc.h" #include "goo/gmem.h" #include "goo/gfile.h" #include "goo/GooString.h" @@ -55,7 +59,7 @@ UnicodeMap *UnicodeMap::parse(GooString *encodingNameA) { UnicodeMapExt *eMap; int size, eMapsSize; char buf[256]; - int line, nBytes, i, x; + int line, nBytes, i; char *tok1, *tok2, *tok3; char *tokptr; @@ -102,6 +106,7 @@ UnicodeMap *UnicodeMap::parse(GooString *encodingNameA) { eMap = &map->eMaps[map->eMapsLen]; sscanf(tok1, "%x", &eMap->u); for (i = 0; i < nBytes; ++i) { + unsigned int x; sscanf(tok3 + i*2, "%2x", &x); eMap->code[i] = (char)x; } @@ -134,7 +139,7 @@ UnicodeMap::UnicodeMap(GooString *encodingNameA) { eMaps = NULL; eMapsLen = 0; refCnt = 1; -#if MULTITHREADED +#ifdef MULTITHREADED gInitMutex(&mutex); #endif } @@ -149,7 +154,7 @@ UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, eMaps = NULL; eMapsLen = 0; refCnt = 1; -#if MULTITHREADED +#ifdef MULTITHREADED gInitMutex(&mutex); #endif } @@ -163,7 +168,7 @@ UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, eMaps = NULL; eMapsLen = 0; refCnt = 1; -#if MULTITHREADED +#ifdef MULTITHREADED gInitMutex(&mutex); #endif } @@ -176,17 +181,17 @@ UnicodeMap::~UnicodeMap() { if (eMaps) { gfree(eMaps); } -#if MULTITHREADED +#ifdef MULTITHREADED gDestroyMutex(&mutex); #endif } void UnicodeMap::incRefCnt() { -#if MULTITHREADED +#ifdef MULTITHREADED gLockMutex(&mutex); #endif ++refCnt; -#if MULTITHREADED +#ifdef MULTITHREADED gUnlockMutex(&mutex); #endif } @@ -194,11 +199,11 @@ void UnicodeMap::incRefCnt() { void UnicodeMap::decRefCnt() { GBool done; -#if MULTITHREADED +#ifdef MULTITHREADED gLockMutex(&mutex); #endif done = --refCnt == 0; -#if MULTITHREADED +#ifdef MULTITHREADED gUnlockMutex(&mutex); #endif if (done) { |