Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/unifdef - we don't need stdbool.h anymore.



details:   https://anonhg.NetBSD.org/src/rev/6879f9e4999c
branches:  trunk
changeset: 750854:6879f9e4999c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 16 21:26:59 2010 +0000

description:
- we don't need stdbool.h anymore.
- the previous fix for the negative index logic was wrong, fix it.

diffstat:

 usr.bin/unifdef/stdbool.h |  48 -----------------------------------------------
 usr.bin/unifdef/unifdef.c |   8 +++---
 2 files changed, 4 insertions(+), 52 deletions(-)

diffs (88 lines):

diff -r 092b07678cee -r 6879f9e4999c usr.bin/unifdef/stdbool.h
--- a/usr.bin/unifdef/stdbool.h Sat Jan 16 21:05:28 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*     $NetBSD: stdbool.h,v 1.1 2003/07/30 08:53:50 itojun Exp $       */
-
-/*
- * Copyright (c) 2000 Jeroen Ruigrok van der Werven <asmodai%FreeBSD.org@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: /r/ncvs/src/include/stdbool.h,v 1.6 2002/08/16 07:33:14 alfred Exp $
- */
-
-#ifndef _STDBOOL_H_
-#define        _STDBOOL_H_     
-
-#define        __bool_true_false_are_defined   1
-
-#ifndef __cplusplus
-
-#define        false   0
-#define        true    1
-
-#define        bool    _Bool
-#if __STDC_VERSION__ < 199901L && __GNUC__ < 3
-typedef        int     _Bool;
-#endif
-
-#endif /* !__cplusplus */
-
-#endif /* !_STDBOOL_H_ */
diff -r 092b07678cee -r 6879f9e4999c usr.bin/unifdef/unifdef.c
--- a/usr.bin/unifdef/unifdef.c Sat Jan 16 21:05:28 2010 +0000
+++ b/usr.bin/unifdef/unifdef.c Sat Jan 16 21:26:59 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unifdef.c,v 1.15 2009/07/13 19:05:41 roy Exp $ */
+/*     $NetBSD: unifdef.c,v 1.16 2010/01/16 21:26:59 christos Exp $    */
 
 /*
  * Copyright (c) 1985, 1993
@@ -77,7 +77,7 @@
 #endif
 #ifdef __IDSTRING
 __IDSTRING(Berkeley, "@(#)unifdef.c    8.1 (Berkeley) 6/6/93");
-__IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.15 2009/07/13 19:05:41 roy Exp $");
+__IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.16 2010/01/16 21:26:59 christos Exp $");
 __IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.161 2003/07/01 15:32:48 fanf2 Exp $");
 #endif
 #endif /* not lint */
@@ -760,7 +760,7 @@
                        return (LT_IF);
                cp = skipcomment(cp);
                sym = findsym(cp);
-               if (sym < 0 || !symlist)
+               if (sym < 0 || symlist)
                        return (LT_IF);
                *valp = (value[sym] != NULL);
                cp = skipsym(cp);
@@ -771,7 +771,7 @@
        } else if (!endsym(*cp)) {
                debug("eval%d symbol", ops - eval_ops);
                sym = findsym(cp);
-               if (sym < 0 || !symlist)
+               if (sym < 0 || symlist)
                        return (LT_IF);
                if (value[sym] == NULL)
                        *valp = 0;



Home | Main Index | Thread Index | Old Index