git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes in gradient parsing
[swftools.git]
/
pdf2swf
/
xpdf
/
Dict.cc
diff --git
a/pdf2swf/xpdf/Dict.cc
b/pdf2swf/xpdf/Dict.cc
index
5eb077e
..
dd1517f
100644
(file)
--- a/
pdf2swf/xpdf/Dict.cc
+++ b/
pdf2swf/xpdf/Dict.cc
@@
-2,15
+2,16
@@
//
// Dict.cc
//
//
// Dict.cc
//
-// Copyright 1996-2002 Glyph & Cog, LLC
+// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#pragma implementation
#endif
-#include <aconf.h>
#include <stddef.h>
#include <string.h>
#include "gmem.h"
#include <stddef.h>
#include <string.h>
#include "gmem.h"
@@
-40,9
+41,13
@@
Dict::~Dict() {
}
void Dict::add(char *key, Object *val) {
}
void Dict::add(char *key, Object *val) {
- if (length + 1 > size) {
- size += 8;
- entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry));
+ if (length == size) {
+ if (length == 0) {
+ size = 8;
+ } else {
+ size *= 2;
+ }
+ entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
}
entries[length].key = key;
entries[length].val = *val;
}
entries[length].key = key;
entries[length].val = *val;