~ubuntu-branches/ubuntu/lucid/xpdf/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches-obselete/05_gmem.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Andy Price
  • Date: 2007-05-17 22:04:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517220433-gzcx2lrvllkbl7mr
Tags: 3.02-1ubuntu1
* Merge from Debian unstable (LP: #113365), remaining changes:
  - Added back 09_xpdfrc_manpage.dpatch (LP #71753)
  - Set Ubuntu maintainer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 05_gmem.dpatch by  <hamish@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Change all size parameters to size_t (why?)
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -54,9 +54,9 @@
 
12
 
 
13
 #endif /* DEBUG_MEM */
 
14
 
 
15
-void *gmalloc(int size) {
 
16
+void *gmalloc(size_t size) {
 
17
 #ifdef DEBUG_MEM
 
18
-  int size1;
 
19
+  size_t size1;
 
20
   char *mem;
 
21
   GMemHdr *hdr;
 
22
   void *data;
 
23
@@ -96,11 +96,11 @@
 
24
 #endif
 
25
 }
 
26
 
 
27
-void *grealloc(void *p, int size) {
 
28
+void *grealloc(void *p, size_t size) {
 
29
 #ifdef DEBUG_MEM
 
30
   GMemHdr *hdr;
 
31
   void *q;
 
32
-  int oldSize;
 
33
+  size_t oldSize;
 
34
 
 
35
   if (size == 0) {
 
36
     if (p)
 
37
@@ -137,8 +137,8 @@
 
38
 #endif
 
39
 }
 
40
 
 
41
-void *gmallocn(int nObjs, int objSize) {
 
42
-  int n;
 
43
+void *gmallocn(int nObjs, size_t objSize) {
 
44
+  size_t n;
 
45
 
 
46
   n = nObjs * objSize;
 
47
   if (objSize == 0 || n / objSize != nObjs) {
 
48
@@ -148,8 +148,8 @@
 
49
   return gmalloc(n);
 
50
 }
 
51
 
 
52
-void *greallocn(void *p, int nObjs, int objSize) {
 
53
-  int n;
 
54
+void *greallocn(void *p, int nObjs, size_t objSize) {
 
55
+  size_t n;
 
56
 
 
57
   n = nObjs * objSize;
 
58
   if (objSize == 0 || n / objSize != nObjs) {
 
59
@@ -161,7 +161,7 @@
 
60
 
 
61
 void gfree(void *p) {
 
62
 #ifdef DEBUG_MEM
 
63
-  int size;
 
64
+  size_t size;
 
65
   GMemHdr *hdr;
 
66
   GMemHdr *prevHdr, *q;
 
67
   int lst;
 
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
 
71
@@ -19,13 +19,13 @@
 
72
  * Same as malloc, but prints error message and exits if malloc()
 
73
  * returns NULL.
 
74
  */
 
75
-extern void *gmalloc(int size);
 
76
+extern void *gmalloc(size_t size);
 
77
 
 
78
 /*
 
79
  * Same as realloc, but prints error message and exits if realloc()
 
80
  * returns NULL.  If <p> is NULL, calls malloc instead of realloc().
 
81
  */
 
82
-extern void *grealloc(void *p, int size);
 
83
+extern void *grealloc(void *p, size_t size);
 
84
 
 
85
 /*
 
86
  * These are similar to gmalloc and grealloc, but take an object count
 
87
@@ -33,8 +33,8 @@
 
88
  * bytes, but there is an additional error check that the total size
 
89
  * doesn't overflow an int.
 
90
  */
 
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);
 
95
 
 
96
 /*
 
97
  * Same as free, but checks for and ignores NULL pointers.