1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 05_gmem.dpatch by <hamish@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Change all size parameters to size_t (why?)
8
diff -urNad --exclude=CVS --exclude=.svn ./goo/gmem.c /tmp/dpep-work.0qyf6L/xpdf-3.01/goo/gmem.c
9
--- ./goo/gmem.c 2005-08-19 19:02:18.000000000 +1000
10
+++ /tmp/dpep-work.0qyf6L/xpdf-3.01/goo/gmem.c 2005-08-19 19:05:34.000000000 +1000
13
#endif /* DEBUG_MEM */
15
-void *gmalloc(int size) {
16
+void *gmalloc(size_t size) {
27
-void *grealloc(void *p, int size) {
28
+void *grealloc(void *p, size_t size) {
41
-void *gmallocn(int nObjs, int objSize) {
43
+void *gmallocn(int nObjs, size_t objSize) {
47
if (objSize == 0 || n / objSize != nObjs) {
52
-void *greallocn(void *p, int nObjs, int objSize) {
54
+void *greallocn(void *p, int nObjs, size_t objSize) {
58
if (objSize == 0 || n / objSize != nObjs) {
68
diff -urNad --exclude=CVS --exclude=.svn ./goo/gmem.h /tmp/dpep-work.0qyf6L/xpdf-3.01/goo/gmem.h
69
--- ./goo/gmem.h 2005-08-19 19:02:18.000000000 +1000
70
+++ /tmp/dpep-work.0qyf6L/xpdf-3.01/goo/gmem.h 2005-08-19 19:04:24.000000000 +1000
72
* Same as malloc, but prints error message and exits if malloc()
75
-extern void *gmalloc(int size);
76
+extern void *gmalloc(size_t size);
79
* Same as realloc, but prints error message and exits if realloc()
80
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
82
-extern void *grealloc(void *p, int size);
83
+extern void *grealloc(void *p, size_t size);
86
* These are similar to gmalloc and grealloc, but take an object count
88
* bytes, but there is an additional error check that the total size
89
* doesn't overflow an int.
91
-extern void *gmallocn(int nObjs, int objSize);
92
-extern void *greallocn(void *p, int nObjs, int objSize);
93
+extern void *gmallocn(int nObjs, size_t objSize);
94
+extern void *greallocn(void *p, int nObjs, size_t objSize);
97
* Same as free, but checks for and ignores NULL pointers.