git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved xpdf stuff from lib/xpdf to lib/pdf/xpdf
[swftools.git]
/
pdf2swf
/
xpdf
/
GList.cc
diff --git
a/pdf2swf/xpdf/GList.cc
b/pdf2swf/xpdf/GList.cc
index
f52bc26
..
fb5fd62
100644
(file)
--- a/
pdf2swf/xpdf/GList.cc
+++ b/
pdf2swf/xpdf/GList.cc
@@
-2,15
+2,17
@@
//
// GList.cc
//
//
// GList.cc
//
-// Copyright 2001-2002 Glyph & Cog, LLC
+// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#pragma implementation
#endif
-#include <aconf.h>
+#include <stdlib.h>
#include <string.h>
#include "gmem.h"
#include "GList.h"
#include <string.h>
#include "gmem.h"
#include "GList.h"
@@
-21,14
+23,14
@@
GList::GList() {
size = 8;
GList::GList() {
size = 8;
- data = (void **)gmalloc(size * sizeof(void*));
+ data = (void **)gmallocn(size, sizeof(void*));
length = 0;
inc = 0;
}
GList::GList(int sizeA) {
size = sizeA;
length = 0;
inc = 0;
}
GList::GList(int sizeA) {
size = sizeA;
- data = (void **)gmalloc(size * sizeof(void*));
+ data = (void **)gmallocn(size, sizeof(void*));
length = 0;
inc = 0;
}
length = 0;
inc = 0;
}
@@
-80,12
+82,16
@@
void *GList::del(int i) {
return p;
}
return p;
}
+void GList::sort(int (*cmp)(const void *obj1, const void *obj2)) {
+ qsort(data, length, sizeof(void *), cmp);
+}
+
void GList::expand() {
size += (inc > 0) ? inc : size;
void GList::expand() {
size += (inc > 0) ? inc : size;
- data = (void **)grealloc(data, size * sizeof(void*));
+ data = (void **)greallocn(data, size, sizeof(void*));
}
void GList::shrink() {
size -= (inc > 0) ? inc : size/2;
}
void GList::shrink() {
size -= (inc > 0) ? inc : size/2;
- data = (void **)grealloc(data, size * sizeof(void*));
+ data = (void **)greallocn(data, size, sizeof(void*));
}
}