[Mono-devel-list] patch for mcs/jay
Laurent Morichetti
l_m at pacbell.net
Thu Jul 17 18:54:57 EDT 2003
Here is a small patch for jay to fix a codegen problem with gcc-2.96 on IPF.
-Laurent
Index: mcs/jay/defs.h
===================================================================
RCS file: /mono/mcs/jay/defs.h,v
retrieving revision 1.2
diff -u -b -r1.2 defs.h
--- mcs/jay/defs.h 9 Feb 2003 16:37:28 -0000 1.2
+++ mcs/jay/defs.h 17 Jul 2003 22:39:57 -0000
@@ -134,12 +134,12 @@
/* storage allocation macros */
-#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n)))
+#define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n)))
#define FREE(x) (free((char*)(x)))
-#define MALLOC(n) (malloc((unsigned)(n)))
+#define MALLOC(n) (malloc((size_t)(n)))
#define NEW(t) ((t*)allocate(sizeof(t)))
-#define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t))))
-#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
+#define NEW2(n,t) ((t*)allocate((size_t)((n)*sizeof(t))))
+#define REALLOC(p,n) (realloc((char*)(p),(size_t)(n)))
/* the structure of a symbol table entry */
Index: mcs/jay/lr0.c
===================================================================
RCS file: /mono/mcs/jay/lr0.c,v
retrieving revision 1.1
diff -u -b -r1.1 lr0.c
--- mcs/jay/lr0.c 14 Jul 2001 23:30:40 -0000 1.1
+++ mcs/jay/lr0.c 17 Jul 2003 22:49:57 -0000
@@ -338,7 +338,7 @@
iend = kernel_end[symbol];
n = iend - isp1;
- p = (core *) allocate((unsigned) (sizeof(core) + (n - 1) * sizeof(short)));+ p = (core *) allocate((size_t) (sizeof(core) + (n - 1) * sizeof(short)));
p->accessing_symbol = symbol;
p->number = nstates;
p->nitems = n;
@@ -439,7 +439,7 @@
register short *sp2;
register short *send;
- p = (shifts *) allocate((unsigned) (sizeof(shifts) +
+ p = (shifts *) allocate((size_t) (sizeof(shifts) +
(nshifts - 1) * sizeof(short)));
p->number = this_state->number;
@@ -488,7 +488,7 @@
if (count)
{
- p = (reductions *) allocate((unsigned) (sizeof(reductions) +
+ p = (reductions *) allocate((size_t) (sizeof(reductions) +
(count - 1) * sizeof(short)));
p->number = this_state->number;
Index: jay/main.c
===================================================================
RCS file: /mono/mcs/jay/main.c,v
retrieving revision 1.6
diff -u -b -r1.6 main.c
---mcs/ jay/main.c 20 May 2003 21:06:47 -0000 1.6
+++ mcs/jay/main.c 17 Jul 2003 22:49:58 -0000
@@ -234,7 +234,7 @@
char *
allocate(n)
-unsigned n;
+size_t n;
{
register char *p;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030717/6f707da7/attachment.html
More information about the Mono-devel-list
mailing list