Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 Accept PTR for addtype



details:   https://anonhg.NetBSD.org/src/rev/bc3a1553aa5c
branches:  trunk
changeset: 822202:bc3a1553aa5c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 06 23:04:52 2017 +0000

description:
Accept PTR for addtype

diffstat:

 usr.bin/xlint/lint1/decl.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r b3459e13eac8 -r bc3a1553aa5c usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Mon Mar 06 22:29:35 2017 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Mon Mar 06 23:04:52 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.67 2016/12/27 21:52:35 christos Exp $ */
+/* $NetBSD: decl.c,v 1.68 2017/03/06 23:04:52 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.67 2016/12/27 21:52:35 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.68 2017/03/06 23:04:52 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -256,7 +256,7 @@
        tspec_t t;
 #ifdef DEBUG
        char buf[1024];
-       printf("addtype %s\n", tyname(buf, sizeof(buf), tp));
+       printf("%s: %s\n", __func__, tyname(buf, sizeof(buf), tp));
 #endif
        if (tp->t_typedef) {
                if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC ||
@@ -355,6 +355,8 @@
                                dcs->d_terr = 1;
                        dcs->d_atyp = t;
                }
+       } else if (t == PTR) {
+               dcs->d_type = tp;
        } else {
                /*
                 * remember specifiers "void", "char", "int",
@@ -727,6 +729,10 @@
        tp = dcs->d_type;
        scl = dcs->d_scl;
 
+#ifdef DEBUG
+       char buf[1024];
+       printf("%s: %s\n", __func__, tyname(buf, sizeof(buf), tp));
+#endif
        if (t == NOTSPEC && s == NOTSPEC && l == NOTSPEC && c == NOTSPEC &&
            tp == NULL)
                dcs->d_notyp = 1;



Home | Main Index | Thread Index | Old Index