summaryrefslogtreecommitdiff
path: root/Build/source/libs/poppler/poppler-src/goo
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-10-08 23:17:38 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-10-08 23:17:38 +0000
commitafe79359dc247f3d58d44428e9e138eeb48e92e7 (patch)
tree118c45854878b54f5b506e2f11178d58e258a5d4 /Build/source/libs/poppler/poppler-src/goo
parent5f297e49f154edc427ed45a19cb16705a4c81fc0 (diff)
poppler 0.48.0
git-svn-id: svn://tug.org/texlive/trunk@42233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/poppler/poppler-src/goo')
-rw-r--r--Build/source/libs/poppler/poppler-src/goo/GooString.cc8
-rw-r--r--Build/source/libs/poppler/poppler-src/goo/GooString.h8
2 files changed, 7 insertions, 9 deletions
diff --git a/Build/source/libs/poppler/poppler-src/goo/GooString.cc b/Build/source/libs/poppler/poppler-src/goo/GooString.cc
index de9c93c9125..1c0c634ce5a 100644
--- a/Build/source/libs/poppler/poppler-src/goo/GooString.cc
+++ b/Build/source/libs/poppler/poppler-src/goo/GooString.cc
@@ -18,7 +18,7 @@
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
-// Copyright (C) 2008-2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008-2011, 2016 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2011 Kenji Uno <ku@digitaldolphins.jp>
// Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
// Copyright (C) 2012 Adrian Johnson <ajohnson@redneon.com>
@@ -163,7 +163,7 @@ void inline GooString::resize(int newLength) {
// assert(s != s1) the roundedSize condition ensures this
if (newLength < length) {
memcpy(s1, s, newLength);
- } else {
+ } else if (length > 0) {
memcpy(s1, s, length);
}
if (s != sStatic)
@@ -200,6 +200,10 @@ GooString::GooString() {
s = NULL;
length = 0;
Set(NULL);
+
+#if __cplusplus >= 201103L
+ static_assert(sizeof(GooString) == GooString::STR_FINAL_SIZE, "You should check memory alignment or STR_STATIC_SIZE calculation.");
+#endif
}
GooString::GooString(const char *sA) {
diff --git a/Build/source/libs/poppler/poppler-src/goo/GooString.h b/Build/source/libs/poppler/poppler-src/goo/GooString.h
index 3168dff181c..a37e02ab6eb 100644
--- a/Build/source/libs/poppler/poppler-src/goo/GooString.h
+++ b/Build/source/libs/poppler/poppler-src/goo/GooString.h
@@ -190,14 +190,8 @@ private:
// You can tweak the final object size for different time/space tradeoffs.
// In libc malloc(), rounding is 16 so it's best to choose a value that
// is a multiple of 16.
- class MemoryLayout {
- char c[sizeof(char*)];
- int i;
- char* s;
- };
-
static const int STR_FINAL_SIZE = 32;
- static const int STR_STATIC_SIZE = STR_FINAL_SIZE - sizeof(MemoryLayout) + sizeof(char*);
+ static const int STR_STATIC_SIZE = STR_FINAL_SIZE - sizeof(int) - sizeof(char*);
int roundedSize(int len);