- make all targparam.h files consistent with the arch includes

- add a new INTPTR_IS_LONG define and use it.

- XXX: the PTRDIFF, SIZEOF, INTPTR defines really make lint more relaxed
  in some platforms than others. We should really be looking for the
  particular tokens to enable this kind of checking. I.e.
  now:

	char *p;
	int foo = (int)p;

  does not produce a warning on INTPTR_IS_LONG == 0 platformas.
  In reality it should only elide the warning if:

	char *p;
	int foo = (intptr_t)p;

  but it is not that smart (yet).
This commit is contained in:
christos 2003-05-29 18:12:13 +00:00
parent 0328813526
commit 7d2c2eeaea
16 changed files with 59 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:56 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:13 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:57 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:13 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -46,9 +46,11 @@
#if defined(TARGET_OBJFMT_ELF)
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#else
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#endif
#define FLOAT_SIZE (4 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.1 2002/06/06 20:33:33 fredette Exp $ */
/* $NetBSD: targparam.h,v 1.2 2003/05/29 18:12:14 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:58 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:14 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.1 2002/02/04 00:18:33 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.2 2003/05/29 18:12:14 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:58 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:15 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:59 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:15 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -43,8 +43,15 @@
* kept in sync with the compiler!
*/
#ifdef _LP64
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#else
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#endif
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:59 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:15 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:54:59 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:15 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -43,8 +43,15 @@
* kept in sync with the compiler!
*/
#ifdef _LP64
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#else
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_LONG 0
#endif
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:15 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_ULONG 0
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.1 2002/07/11 18:55:13 scw Exp $ */
/* $NetBSD: targparam.h,v 1.2 2003/05/29 18:12:16 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -53,6 +53,7 @@
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#endif
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:16 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.3 2002/01/31 23:31:34 he Exp $ */
/* $NetBSD: targparam.h,v 1.4 2003/05/29 18:12:16 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:01 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:16 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -42,9 +42,15 @@
* or the value of sizeof is of type unsigned long. Note this MUST be
* kept in sync with the compiler!
*/
#ifdef __ELF__
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_ULONG 1
#else
#define PTRDIFF_IS_LONG 0
#define SIZEOF_IS_ULONG 0
#define INTPTR_IS_ULONG 0
#endif
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:02 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.3 2003/05/29 18:12:17 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -45,6 +45,7 @@
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: inittyp.c,v 1.4 2002/01/31 19:36:53 tv Exp $ */
/* $NetBSD: inittyp.c,v 1.5 2003/05/29 18:12:17 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: inittyp.c,v 1.4 2002/01/31 19:36:53 tv Exp $");
__RCSID("$NetBSD: inittyp.c,v 1.5 2003/05/29 18:12:17 christos Exp $");
#endif
#include <ctype.h>
@ -45,6 +45,12 @@ __RCSID("$NetBSD: inittyp.c,v 1.4 2002/01/31 19:36:53 tv Exp $");
/* various type information */
ttab_t ttab[NTSPEC];
#if INTPTR_IS_LONG
#define INT_RSIZE 3
#else
#define INT_RSIZE 4
#endif
void
inittyp(void)
{
@ -74,10 +80,10 @@ inittyp(void)
{ USHORT, { SHORT_SIZE, 2 * CHAR_BIT,
SHORT, USHORT,
1, 1, 0, 1, 1, "unsigned short" } },
{ INT, { INT_SIZE, 3 * CHAR_BIT,
{ INT, { INT_SIZE, INT_RSIZE * CHAR_BIT,
INT, UINT,
1, 0, 0, 1, 1, "int" } },
{ UINT, { INT_SIZE, 3 * CHAR_BIT,
{ UINT, { INT_SIZE, INT_RSIZE * CHAR_BIT,
INT, UINT,
1, 1, 0, 1, 1, "unsigned int" } },
{ LONG, { LONG_SIZE, 4 * CHAR_BIT,