175831Sasmodai/* $NetBSD: param.h,v 1.4 1995/07/23 18:14:41 ragge Exp $ */ 212099Sjoerg 312099Sjoerg/* 412099Sjoerg * Copyright (c) 1994, 1995 Jochen Pohl 512099Sjoerg * All Rights Reserved. 612099Sjoerg * 712099Sjoerg * Redistribution and use in source and binary forms, with or without 812099Sjoerg * modification, are permitted provided that the following conditions 912099Sjoerg * are met: 1012099Sjoerg * 1. Redistributions of source code must retain the above copyright 1112099Sjoerg * notice, this list of conditions and the following disclaimer. 1212099Sjoerg * 2. Redistributions in binary form must reproduce the above copyright 1312099Sjoerg * notice, this list of conditions and the following disclaimer in the 1412099Sjoerg * documentation and/or other materials provided with the distribution. 1512099Sjoerg * 3. All advertising materials mentioning features or use of this software 1612099Sjoerg * must display the following acknowledgement: 1712099Sjoerg * This product includes software developed by Jochen Pohl for 1812099Sjoerg * The NetBSD Project. 1912099Sjoerg * 4. The name of the author may not be used to endorse or promote products 2012099Sjoerg * derived from this software without specific prior written permission. 2112099Sjoerg * 2212099Sjoerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2312099Sjoerg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2412099Sjoerg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2512099Sjoerg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2612099Sjoerg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2712099Sjoerg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2812099Sjoerg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2912099Sjoerg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3012099Sjoerg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3112099Sjoerg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3275730Sasmodai * 3375730Sasmodai * $FreeBSD: releng/10.2/usr.bin/xlint/lint1/param.h 177927 2008-04-04 21:35:13Z imp $ 3412099Sjoerg */ 3512099Sjoerg 3612099Sjoerg/* 3712099Sjoerg * Minimun size of string buffer. If this is not enough, the buffer 3812099Sjoerg * is enlarged in steps of STRBLEN bytes. 3912099Sjoerg */ 4012099Sjoerg#define STRBLEN 256 4112099Sjoerg 4212099Sjoerg/* 4312099Sjoerg * This defines the size of memory blocks which are used to allocate 4412099Sjoerg * memory in larger chunks. 4512099Sjoerg */ 4612099Sjoerg#define MBLKSIZ ((size_t)0x4000) 4712099Sjoerg 4812099Sjoerg/* 4912099Sjoerg * Sizes of hash tables 5012099Sjoerg * Should be a prime. Possible primes are 5112099Sjoerg * 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511. 5212099Sjoerg * 5312099Sjoerg * HSHSIZ1 symbol table 1st pass 5412099Sjoerg * HSHSIZ2 symbol table 2nd pass 5512099Sjoerg * THSHSIZ2 type table 2nd pass 5612099Sjoerg */ 5712099Sjoerg#define HSHSIZ1 503 5812099Sjoerg#define HSHSIZ2 1009 5912099Sjoerg#define THSHSIZ2 1009 6012099Sjoerg 6112099Sjoerg/* 6212099Sjoerg * Should be set to 1 if the difference of two pointers is of type long 6312099Sjoerg * or the value of sizeof is of type unsigned long. 6412099Sjoerg */ 6584734Sdfr#ifdef __ia64__ 6612099Sjoerg#define PTRDIFF_IS_LONG 1 6712099Sjoerg#define SIZEOF_IS_ULONG 1 68114831Speter#elif __amd64__ 69114831Speter#define PTRDIFF_IS_LONG 1 70114831Speter#define SIZEOF_IS_ULONG 1 7184734Sdfr#elif __alpha__ 7284734Sdfr#define PTRDIFF_IS_LONG 1 7384734Sdfr#define SIZEOF_IS_ULONG 1 7412099Sjoerg#elif __i386__ 7512099Sjoerg#define PTRDIFF_IS_LONG 0 7612099Sjoerg#define SIZEOF_IS_ULONG 0 7712099Sjoerg#elif __m68k__ 7812099Sjoerg#define PTRDIFF_IS_LONG 0 7912099Sjoerg#define SIZEOF_IS_ULONG 0 8012099Sjoerg#elif __ns32k__ 8112099Sjoerg#define PTRDIFF_IS_LONG 0 8212099Sjoerg#define SIZEOF_IS_ULONG 0 83107716Sbenno#elif __powerpc__ 84107716Sbenno#define PTRDIFF_IS_LONG 0 85107716Sbenno#define SIZEOF_IS_ULONG 0 8612099Sjoerg#elif __sparc__ 8712099Sjoerg#define PTRDIFF_IS_LONG 0 8812099Sjoerg#define SIZEOF_IS_ULONG 0 8991977Sjake#elif __sparc64__ 9091977Sjake#define PTRDIFF_IS_LONG 1 9191977Sjake#define SIZEOF_IS_ULONG 1 9212099Sjoerg#elif __vax__ 9312099Sjoerg#define PTRDIFF_IS_LONG 0 9412099Sjoerg#define SIZEOF_IS_ULONG 0 95129223Scognet#elif __arm__ 96129223Scognet#define PTRDIFF_IS_LONG 0 97129223Scognet#define SIZEOF_IS_ULONG 0 98177927Simp#elif __mips__ 99177927Simp#define PTRDIFF_IS_LONG 0 100177927Simp#define SIZEOF_IS_ULONG 0 10112099Sjoerg#else 10212099Sjoerg#error unknown machine type 10312099Sjoerg#endif 10412099Sjoerg 10512099Sjoerg/* 10612099Sjoerg * Make sure this matches wchar_t. 10712099Sjoerg */ 10812099Sjoerg#define WCHAR SHORT 10912099Sjoerg 11012099Sjoerg#ifndef __GNUC__ 11112099Sjoerg#ifndef lint 11212099Sjoerg#ifndef QUAD_MAX /* necessary for mkdep */ 11312099Sjoerg#define QUAD_MAX LONG_MAX 11412099Sjoerg#define QUAD_MIN LONG_MIN 11512099Sjoerg#define UQUAD_MAX ULONG_MAX 11612099Sjoerg#endif 11712099Sjoergtypedef long quad_t; 11812099Sjoergtypedef u_long u_quad_t; 11912099Sjoerg#endif 12012099Sjoerg#endif 12112099Sjoerg 12212099Sjoerg 12312099Sjoerg/* 12412099Sjoerg * long double only in ANSI C. 12512099Sjoerg */ 12612099Sjoerg#ifdef __STDC__ 12712099Sjoergtypedef long double ldbl_t; 12812099Sjoerg#else 12912099Sjoergtypedef double ldbl_t; 13012099Sjoerg#endif 13112099Sjoerg 13212099Sjoerg/* 13312099Sjoerg * Some traditional compilers are not able to assign structures. 13412099Sjoerg */ 13512099Sjoerg#ifdef __STDC__ 13612099Sjoerg#define STRUCT_ASSIGN(dest, src) (dest) = (src) 13712099Sjoerg#else 13812099Sjoerg#define STRUCT_ASSIGN(dest, src) (void)memcpy(&(dest), &(src), \ 13912099Sjoerg sizeof (dest)); 14012099Sjoerg#endif 141