Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/gspa/gspa Make alloc() return void*, and eliminate ...



details:   https://anonhg.NetBSD.org/src/rev/4d2eddda8310
branches:  trunk
changeset: 495181:4d2eddda8310
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sun Jul 23 23:14:10 2000 +0000

description:
Make alloc() return void*, and eliminate the use of typeof.

diffstat:

 usr.sbin/gspa/gspa/gsp_ass.h |  6 +++---
 usr.sbin/gspa/gspa/gspa.c    |  8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 4d8ff4e08afb -r 4d2eddda8310 usr.sbin/gspa/gspa/gsp_ass.h
--- a/usr.sbin/gspa/gspa/gsp_ass.h      Sun Jul 23 23:07:39 2000 +0000
+++ b/usr.sbin/gspa/gspa/gsp_ass.h      Sun Jul 23 23:14:10 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gsp_ass.h,v 1.5 1999/06/22 20:27:21 is Exp $   */
+/*     $NetBSD: gsp_ass.h,v 1.6 2000/07/23 23:14:10 mycroft Exp $      */
 /*
  * GSP assembler - definitions
  *
@@ -127,7 +127,7 @@
 /* Prototypes */
 operand abs_adr(expr);
 operand add_operand(operand, operand);
-char *alloc(size_t nbytes);
+void *alloc(size_t nbytes);
 expr bexpr(int, expr, expr);
 void do_asg(char *, expr, int flags);
 void do_list_pc(void);
@@ -186,4 +186,4 @@
 #endif
 #endif
 
-#define new(x) ((x) = (typeof (x)) alloc (sizeof(*(x))))
+#define new(x) ((x) = alloc (sizeof(*(x))))
diff -r 4d8ff4e08afb -r 4d2eddda8310 usr.sbin/gspa/gspa/gspa.c
--- a/usr.sbin/gspa/gspa/gspa.c Sun Jul 23 23:07:39 2000 +0000
+++ b/usr.sbin/gspa/gspa/gspa.c Sun Jul 23 23:14:10 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gspa.c,v 1.5 1999/06/22 20:27:21 is Exp $      */
+/*     $NetBSD: gspa.c,v 1.6 2000/07/23 23:14:10 mycroft Exp $ */
 /*
  * GSP assembler main program
  *
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: gspa.c,v 1.5 1999/06/22 20:27:21 is Exp $");
+__RCSID("$NetBSD: gspa.c,v 1.6 2000/07/23 23:14:10 mycroft Exp $");
 #endif
 
 #include <sys/param.h>
@@ -291,10 +291,10 @@
        longjmp(synerrjmp, 1);
 }
 
-char *
+void *
 alloc(size_t nbytes)
 {
-       char *p;
+       void *p;
 
        if( (p = malloc(nbytes)) == NULL ){
                fprintf(stderr, "Insufficient memory at line %d\n", lineno);



Home | Main Index | Thread Index | Old Index