Mon Jul 20 18:45:27 2009 UTC ()
Use __constfunc instead of __attribute__((__const__)).


(joerg)
diff -r1.14 -r1.15 src/sys/sys/bswap.h
diff -r1.26 -r1.27 src/sys/sys/endian.h

cvs diff -r1.14 -r1.15 src/sys/sys/bswap.h (expand / switch to unified diff)

--- src/sys/sys/bswap.h 2009/06/19 15:24:17 1.14
+++ src/sys/sys/bswap.h 2009/07/20 18:45:27 1.15
@@ -1,36 +1,36 @@ @@ -1,36 +1,36 @@
1/* $NetBSD: bswap.h,v 1.14 2009/06/19 15:24:17 christos Exp $ */ 1/* $NetBSD: bswap.h,v 1.15 2009/07/20 18:45:27 joerg Exp $ */
2 2
3/* Written by Manuel Bouyer. Public domain */ 3/* Written by Manuel Bouyer. Public domain */
4 4
5#ifndef _SYS_BSWAP_H_ 5#ifndef _SYS_BSWAP_H_
6#define _SYS_BSWAP_H_ 6#define _SYS_BSWAP_H_
7 7
8#ifndef _LOCORE 8#ifndef _LOCORE
9#include <sys/cdefs.h> 9#include <sys/cdefs.h>
10#include <sys/types.h> 10#include <sys/types.h>
11 11
12#include <machine/bswap.h> 12#include <machine/bswap.h>
13 13
14__BEGIN_DECLS 14__BEGIN_DECLS
15/* Always declare the functions in case their address is taken (etc) */ 15/* Always declare the functions in case their address is taken (etc) */
16#if defined(_KERNEL) || defined(_STANDALONE) || !defined(__BSWAP_RENAME) 16#if defined(_KERNEL) || defined(_STANDALONE) || !defined(__BSWAP_RENAME)
17uint16_t bswap16(uint16_t) __attribute__((__const__)); 17uint16_t bswap16(uint16_t) __constfunc;
18uint32_t bswap32(uint32_t) __attribute__((__const__)); 18uint32_t bswap32(uint32_t) __constfunc;
19#else 19#else
20uint16_t bswap16(uint16_t) __RENAME(__bswap16) __attribute__((__const__)); 20uint16_t bswap16(uint16_t) __RENAME(__bswap16) __constfunc;
21uint32_t bswap32(uint32_t) __RENAME(__bswap32) __attribute__((__const__)); 21uint32_t bswap32(uint32_t) __RENAME(__bswap32) __constfunc;
22#endif 22#endif
23uint64_t bswap64(uint64_t) __attribute__((__const__)); 23uint64_t bswap64(uint64_t) __constfunc;
24__END_DECLS 24__END_DECLS
25 25
26#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__lint__) 26#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__lint__)
27 27
28/* machine/byte_swap.h might have defined inline versions */ 28/* machine/byte_swap.h might have defined inline versions */
29#ifndef __BYTE_SWAP_U64_VARIABLE 29#ifndef __BYTE_SWAP_U64_VARIABLE
30#define __BYTE_SWAP_U64_VARIABLE bswap64 30#define __BYTE_SWAP_U64_VARIABLE bswap64
31#endif 31#endif
32 32
33#ifndef __BYTE_SWAP_U32_VARIABLE 33#ifndef __BYTE_SWAP_U32_VARIABLE
34#define __BYTE_SWAP_U32_VARIABLE bswap32 34#define __BYTE_SWAP_U32_VARIABLE bswap32
35#endif 35#endif
36 36

cvs diff -r1.26 -r1.27 src/sys/sys/endian.h (expand / switch to unified diff)

--- src/sys/sys/endian.h 2007/07/20 15:07:15 1.26
+++ src/sys/sys/endian.h 2009/07/20 18:45:27 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: endian.h,v 1.26 2007/07/20 15:07:15 christos Exp $ */ 1/* $NetBSD: endian.h,v 1.27 2009/07/20 18:45:27 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1987, 1991, 1993 4 * Copyright (c) 1987, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -55,30 +55,30 @@ @@ -55,30 +55,30 @@
55#include <sys/types.h> 55#include <sys/types.h>
56 56
57#ifndef in_addr_t 57#ifndef in_addr_t
58typedef __in_addr_t in_addr_t; 58typedef __in_addr_t in_addr_t;
59#define in_addr_t __in_addr_t 59#define in_addr_t __in_addr_t
60#endif 60#endif
61 61
62#ifndef in_port_t 62#ifndef in_port_t
63typedef __in_port_t in_port_t; 63typedef __in_port_t in_port_t;
64#define in_port_t __in_port_t 64#define in_port_t __in_port_t
65#endif 65#endif
66 66
67__BEGIN_DECLS 67__BEGIN_DECLS
68uint32_t htonl(uint32_t) __attribute__((__const__)); 68uint32_t htonl(uint32_t) __constfunc;
69uint16_t htons(uint16_t) __attribute__((__const__)); 69uint16_t htons(uint16_t) __constfunc;
70uint32_t ntohl(uint32_t) __attribute__((__const__)); 70uint32_t ntohl(uint32_t) __constfunc;
71uint16_t ntohs(uint16_t) __attribute__((__const__)); 71uint16_t ntohs(uint16_t) __constfunc;
72__END_DECLS 72__END_DECLS
73 73
74#endif /* !_LOCORE */ 74#endif /* !_LOCORE */
75#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */ 75#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
76 76
77 77
78#include <machine/endian_machdep.h> 78#include <machine/endian_machdep.h>
79 79
80/* 80/*
81 * Define the order of 32-bit words in 64-bit words. 81 * Define the order of 32-bit words in 64-bit words.
82 */ 82 */
83#if _BYTE_ORDER == _LITTLE_ENDIAN 83#if _BYTE_ORDER == _LITTLE_ENDIAN
84#define _QUAD_HIGHWORD 1 84#define _QUAD_HIGHWORD 1