Kill a bunch of manual __attribute__ usages and replace them with the equivalent sys/cdefs.h invocation.diff -r1.4 -r1.5 src/lib/libbluetooth/bluetooth.h
(joerg)
--- src/lib/libbluetooth/bluetooth.h 2009/08/03 15:59:42 1.4
+++ src/lib/libbluetooth/bluetooth.h 2011/11/28 12:44:18 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bluetooth.h,v 1.4 2009/08/03 15:59:42 plunky Exp $ */ | 1 | /* $NetBSD: bluetooth.h,v 1.5 2011/11/28 12:44:18 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2001-2009 Maksim Yevmenkin <m_evmenkin@yahoo.com> | 4 | * Copyright (c) 2001-2009 Maksim Yevmenkin <m_evmenkin@yahoo.com> | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -150,34 +150,34 @@ int bt_devfilter_evt_tst(const struct bt | @@ -150,34 +150,34 @@ int bt_devfilter_evt_tst(const struct bt | |||
150 | int bt_devinquiry(const char *, time_t, int, struct bt_devinquiry **); | 150 | int bt_devinquiry(const char *, time_t, int, struct bt_devinquiry **); | |
151 | int bt_devinfo(const char *, struct bt_devinfo *); | 151 | int bt_devinfo(const char *, struct bt_devinfo *); | |
152 | int bt_devenum(bt_devenum_cb_t *, void *); | 152 | int bt_devenum(bt_devenum_cb_t *, void *); | |
153 | 153 | |||
154 | /* | 154 | /* | |
155 | * bthcid(8) PIN Client API | 155 | * bthcid(8) PIN Client API | |
156 | */ | 156 | */ | |
157 | 157 | |||
158 | /* Client PIN Request packet */ | 158 | /* Client PIN Request packet */ | |
159 | typedef struct { | 159 | typedef struct { | |
160 | bdaddr_t laddr; /* local address */ | 160 | bdaddr_t laddr; /* local address */ | |
161 | bdaddr_t raddr; /* remote address */ | 161 | bdaddr_t raddr; /* remote address */ | |
162 | uint8_t time; /* validity (seconds) */ | 162 | uint8_t time; /* validity (seconds) */ | |
163 | } __attribute__ ((packed)) bthcid_pin_request_t; | 163 | } __packed bthcid_pin_request_t; | |
164 | 164 | |||
165 | /* Client PIN Response packet */ | 165 | /* Client PIN Response packet */ | |
166 | typedef struct { | 166 | typedef struct { | |
167 | bdaddr_t laddr; /* local address */ | 167 | bdaddr_t laddr; /* local address */ | |
168 | bdaddr_t raddr; /* remote address */ | 168 | bdaddr_t raddr; /* remote address */ | |
169 | uint8_t pin[HCI_PIN_SIZE]; /* PIN */ | 169 | uint8_t pin[HCI_PIN_SIZE]; /* PIN */ | |
170 | } __attribute__ ((packed)) bthcid_pin_response_t; | 170 | } __packed bthcid_pin_response_t; | |
171 | 171 | |||
172 | /* Default socket name */ | 172 | /* Default socket name */ | |
173 | #define BTHCID_SOCKET_NAME "/var/run/bthcid" | 173 | #define BTHCID_SOCKET_NAME "/var/run/bthcid" | |
174 | 174 | |||
175 | #ifdef COMPAT_BLUEZ | 175 | #ifdef COMPAT_BLUEZ | |
176 | /* | 176 | /* | |
177 | * Linux BlueZ compatibility | 177 | * Linux BlueZ compatibility | |
178 | */ | 178 | */ | |
179 | 179 | |||
180 | #define bacmp(ba1, ba2) memcmp((ba1), (ba2), sizeof(bdaddr_t)) | 180 | #define bacmp(ba1, ba2) memcmp((ba1), (ba2), sizeof(bdaddr_t)) | |
181 | #define bacpy(dst, src) memcpy((dst), (src), sizeof(bdaddr_t)) | 181 | #define bacpy(dst, src) memcpy((dst), (src), sizeof(bdaddr_t)) | |
182 | #define ba2str(ba, str) bt_ntoa((ba), (str)) | 182 | #define ba2str(ba, str) bt_ntoa((ba), (str)) | |
183 | #define str2ba(str, ba) (bt_aton((str), (ba)) == 1 ? 0 : -1) | 183 | #define str2ba(str, ba) (bt_aton((str), (ba)) == 1 ? 0 : -1) |
--- src/lib/libform/form.h 2010/02/03 15:34:43 1.20
+++ src/lib/libform/form.h 2011/11/28 12:44:18 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: form.h,v 1.20 2010/02/03 15:34:43 roy Exp $ */ | 1 | /* $NetBSD: form.h,v 1.21 2011/11/28 12:44:18 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998-1999 Brett Lymn | 4 | * Copyright (c) 1998-1999 Brett Lymn | |
5 | * (blymn@baea.com.au, brett_lymn@yahoo.com.au) | 5 | * (blymn@baea.com.au, brett_lymn@yahoo.com.au) | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code has been donated to The NetBSD Foundation by the Author. | 8 | * This code has been donated to The NetBSD Foundation by the Author. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -345,28 +345,27 @@ FIELDTYPE *new_fieldtype(int (* field_ | @@ -345,28 +345,27 @@ FIELDTYPE *new_fieldtype(int (* field_ | |||
345 | FORM *new_form(FIELD **); | 345 | FORM *new_form(FIELD **); | |
346 | int new_page(FIELD *); | 346 | int new_page(FIELD *); | |
347 | int pos_form_cursor(FORM *); | 347 | int pos_form_cursor(FORM *); | |
348 | int post_form(FORM *); | 348 | int post_form(FORM *); | |
349 | int scale_form(FORM *, int *, int *); | 349 | int scale_form(FORM *, int *, int *); | |
350 | int set_current_field(FORM *, FIELD *); | 350 | int set_current_field(FORM *, FIELD *); | |
351 | int set_field_back(FIELD *, chtype); | 351 | int set_field_back(FIELD *, chtype); | |
352 | int set_field_buffer(FIELD *, int, char *); | 352 | int set_field_buffer(FIELD *, int, char *); | |
353 | int set_field_fore(FIELD *, chtype); | 353 | int set_field_fore(FIELD *, chtype); | |
354 | int set_field_init(FORM *, Form_Hook); | 354 | int set_field_init(FORM *, Form_Hook); | |
355 | int set_field_just(FIELD *, int); | 355 | int set_field_just(FIELD *, int); | |
356 | int set_field_opts(FIELD *, Form_Options); | 356 | int set_field_opts(FIELD *, Form_Options); | |
357 | int set_field_pad(FIELD *, int); | 357 | int set_field_pad(FIELD *, int); | |
358 | int set_field_printf(FIELD *, int, char *, ...) | 358 | int set_field_printf(FIELD *, int, char *, ...) __printflike(3, 4); | |
359 | __attribute__((__format__(__printf__, 3, 4))); | |||
360 | int set_field_status(FIELD *, int); | 359 | int set_field_status(FIELD *, int); | |
361 | int set_field_term(FORM *, Form_Hook); | 360 | int set_field_term(FORM *, Form_Hook); | |
362 | int set_field_type(FIELD *, FIELDTYPE *, ...); | 361 | int set_field_type(FIELD *, FIELDTYPE *, ...); | |
363 | int set_field_userptr(FIELD *, void *); | 362 | int set_field_userptr(FIELD *, void *); | |
364 | int set_fieldtype_arg(FIELDTYPE *, char *(*)(va_list *), | 363 | int set_fieldtype_arg(FIELDTYPE *, char *(*)(va_list *), | |
365 | char *(*)(char *), | 364 | char *(*)(char *), | |
366 | void (*)(char *)); | 365 | void (*)(char *)); | |
367 | int set_fieldtype_choice(FIELDTYPE *, int (*)(FIELD *, char *), | 366 | int set_fieldtype_choice(FIELDTYPE *, int (*)(FIELD *, char *), | |
368 | int (*)(FIELD *, char *)); | 367 | int (*)(FIELD *, char *)); | |
369 | int set_form_fields(FORM *, FIELD **); | 368 | int set_form_fields(FORM *, FIELD **); | |
370 | int set_form_init(FORM *, Form_Hook); | 369 | int set_form_init(FORM *, Form_Hook); | |
371 | int set_form_opts(FORM *, Form_Options); | 370 | int set_form_opts(FORM *, Form_Options); | |
372 | int set_form_page(FORM *, int); | 371 | int set_form_page(FORM *, int); |
--- src/lib/libisns/isns_pdu.h 2011/08/17 10:08:43 1.2
+++ src/lib/libisns/isns_pdu.h 2011/11/28 12:44:18 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: isns_pdu.h,v 1.2 2011/08/17 10:08:43 christos Exp $ */ | 1 | /* $NetBSD: isns_pdu.h,v 1.3 2011/11/28 12:44:18 joerg Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2004,2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2004,2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Wasabi Systems, Inc. | 8 | * by Wasabi Systems, Inc. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -161,32 +161,32 @@ struct isns_trans_s { | @@ -161,32 +161,32 @@ struct isns_trans_s { | |||
161 | uint16_t func_id; | 161 | uint16_t func_id; | |
162 | uint32_t flags; | 162 | uint32_t flags; | |
163 | struct isns_config_s *cfg_p; | 163 | struct isns_config_s *cfg_p; | |
164 | 164 | |||
165 | struct isns_get_tlv_info_s get_tlv_info; | 165 | struct isns_get_tlv_info_s get_tlv_info; | |
166 | 166 | |||
167 | struct isns_pdu_s *pdu_req_list; | 167 | struct isns_pdu_s *pdu_req_list; | |
168 | struct isns_pdu_s *pdu_rsp_list; | 168 | struct isns_pdu_s *pdu_rsp_list; | |
169 | 169 | |||
170 | uint16_t disconnect_cnt; | 170 | uint16_t disconnect_cnt; | |
171 | }; | 171 | }; | |
172 | 172 | |||
173 | struct isns_pdu_hdr_s { | 173 | struct isns_pdu_hdr_s { | |
174 | uint16_t isnsp_version __attribute__ ((packed)); | 174 | uint16_t isnsp_version __packed; | |
175 | uint16_t func_id __attribute__ ((packed)); | 175 | uint16_t func_id __packed; | |
176 | uint16_t payload_len __attribute__ ((packed)); | 176 | uint16_t payload_len __packed; | |
177 | uint16_t flags __attribute__ ((packed)); | 177 | uint16_t flags __packed; | |
178 | uint16_t trans_id __attribute__ ((packed)); | 178 | uint16_t trans_id __packed; | |
179 | uint16_t seq_id __attribute__ ((packed)); | 179 | uint16_t seq_id __packed; | |
180 | }; | 180 | }; | |
181 | 181 | |||
182 | struct isns_pdu_s { | 182 | struct isns_pdu_s { | |
183 | struct isns_config_s *cfg_p; | 183 | struct isns_config_s *cfg_p; | |
184 | struct isns_pdu_hdr_s hdr; | 184 | struct isns_pdu_hdr_s hdr; | |
185 | int byteorder_host; | 185 | int byteorder_host; | |
186 | struct isns_buffer_s *payload_p; | 186 | struct isns_buffer_s *payload_p; | |
187 | struct isns_pdu_s *next; | 187 | struct isns_pdu_s *next; | |
188 | }; | 188 | }; | |
189 | 189 | |||
190 | 190 | |||
191 | #define isns_get_pdu_request(_trans) \ | 191 | #define isns_get_pdu_request(_trans) \ | |
192 | (((_trans) == ISNS_INVALID_TRANS) \ | 192 | (((_trans) == ISNS_INVALID_TRANS) \ |
--- src/lib/libterminfo/compile.c 2011/04/11 21:37:19 1.5
+++ src/lib/libterminfo/compile.c 2011/11/28 12:44:19 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $ */ | 1 | /* $NetBSD: compile.c,v 1.6 2011/11/28 12:44:19 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Roy Marples. | 7 | * by Roy Marples. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -22,46 +22,46 @@ | @@ -22,46 +22,46 @@ | |||
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | */ | 28 | */ | |
29 | 29 | |||
30 | #if HAVE_NBTOOL_CONFIG_H | 30 | #if HAVE_NBTOOL_CONFIG_H | |
31 | #include "nbtool_config.h" | 31 | #include "nbtool_config.h" | |
32 | #endif | 32 | #endif | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __RCSID("$NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $"); | 35 | __RCSID("$NetBSD: compile.c,v 1.6 2011/11/28 12:44:19 joerg Exp $"); | |
36 | 36 | |||
37 | #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H | 37 | #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H | |
38 | #include <sys/endian.h> | 38 | #include <sys/endian.h> | |
39 | #endif | 39 | #endif | |
40 | 40 | |||
41 | #include <assert.h> | 41 | #include <assert.h> | |
42 | #include <ctype.h> | 42 | #include <ctype.h> | |
43 | #include <err.h> | 43 | #include <err.h> | |
44 | #include <errno.h> | 44 | #include <errno.h> | |
45 | #include <limits.h> | 45 | #include <limits.h> | |
46 | #include <stdarg.h> | 46 | #include <stdarg.h> | |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> | |
48 | #include <stdint.h> | 48 | #include <stdint.h> | |
49 | #include <stdio.h> | 49 | #include <stdio.h> | |
50 | #include <string.h> | 50 | #include <string.h> | |
51 | #include <term_private.h> | 51 | #include <term_private.h> | |
52 | #include <term.h> | 52 | #include <term.h> | |
53 | 53 | |||
54 | static void __attribute__((__format__(__printf__, 2, 3))) | 54 | static void __printflike(2, 3) | |
55 | dowarn(int flags, const char *fmt, ...) | 55 | dowarn(int flags, const char *fmt, ...) | |
56 | { | 56 | { | |
57 | va_list va; | 57 | va_list va; | |
58 | 58 | |||
59 | errno = EINVAL; | 59 | errno = EINVAL; | |
60 | if (flags & TIC_WARNING) { | 60 | if (flags & TIC_WARNING) { | |
61 | va_start(va, fmt); | 61 | va_start(va, fmt); | |
62 | vwarnx(fmt, va); | 62 | vwarnx(fmt, va); | |
63 | va_end(va); | 63 | va_end(va); | |
64 | } | 64 | } | |
65 | } | 65 | } | |
66 | 66 | |||
67 | char * | 67 | char * |