Project

General

Profile

Bug #5218 » 0001-5218-posix-definition-of-NULL.patch

Richard PALO, 2014-10-11 05:15 PM

View differences:

usr/src/cmd/fm/modules/common/fabric-xlate/fx_fabric.c
50 50
	PCI_MA,			PCI_STAT_R_MAST_AB,	NULL,
51 51
	PCI_REC_TA,		PCI_STAT_R_TARG_AB,	NULL,
52 52
	PCI_SIG_TA,		PCI_STAT_S_TARG_AB,	NULL,
53
	NULL, NULL, NULL
53
	NULL, 0 , NULL
54 54
};
55 55

  
56 56
/* Translate Fabric ereports to ereport.io.pci.sec-* */
......
63 63
#endif
64 64
	PCI_REC_TA,		PCI_STAT_R_TARG_AB,	NULL,
65 65
	PCI_SIG_TA,		PCI_STAT_S_TARG_AB,	NULL,
66
	NULL, NULL, NULL, NULL,
66
	NULL, 0 , NULL
67 67
};
68 68

  
69 69

  
70 70
/* Translate Fabric ereports to ereport.io.pci.dto */
71 71
static fab_erpt_tbl_t fab_pci_bdg_ctl_erpt_tbl[] = {
72 72
	PCI_DTO,	PCI_BCNF_BCNTRL_DTO_STAT,	NULL,
73
	NULL, NULL, NULL
73
	NULL, 0, NULL
74 74
};
75 75

  
76 76
/* Translate Fabric ereports to ereport.io.pciex.* */
......
81 81
	PCIEX_BDP,	PCIE_AER_CE_BAD_DLLP,		NULL,
82 82
	PCIEX_BTP,	PCIE_AER_CE_BAD_TLP,		NULL,
83 83
	PCIEX_ANFE,	PCIE_AER_CE_AD_NFE,		NULL,
84
	NULL, NULL, NULL
84
	NULL, 0, NULL
85 85
};
86 86

  
87 87
/*
......
104 104
	PCIEX_UR,	PCIE_AER_UCE_UR,		PCI_TARG_MA,
105 105
#endif
106 106
	PCIEX_POIS,	PCIE_AER_UCE_PTLP,		PCI_TARG_MDPE,
107
	NULL, NULL, NULL
107
	NULL, 0, NULL
108 108
};
109 109

  
110 110
/* Translate Fabric ereports to ereport.io.pciex.* */
......
124 124
	PCIEX_S_PERR,	PCIE_AER_SUCE_PERR_ASSERT,	PCI_TARG_MDPE,
125 125
	PCIEX_S_SERR,	PCIE_AER_SUCE_SERR_ASSERT,	NULL,
126 126
	PCIEX_INTERR,	PCIE_AER_SUCE_INTERNAL_ERR,	NULL,
127
	NULL, NULL, NULL
127
	NULL, 0, NULL
128 128
};
129 129

  
130 130
/* Translate Fabric ereports to ereport.io.pcix.* */
......
132 132
	PCIX_SPL_DIS,		PCI_PCIX_SPL_DSCD,	NULL,
133 133
	PCIX_UNEX_SPL,		PCI_PCIX_UNEX_SPL,	NULL,
134 134
	PCIX_RX_SPL_MSG,	PCI_PCIX_RX_SPL_MSG,	NULL,
135
	NULL, NULL, NULL
135
	NULL, 0, NULL
136 136
};
137 137
static fab_erpt_tbl_t *fab_pcix_bdg_erpt_tbl = fab_pcix_erpt_tbl;
138 138

  
......
142 142
	PCIX_UNEX_SPL,		PCI_PCIX_BSS_UNEX_SPL,	NULL,
143 143
	PCIX_BSS_SPL_OR,	PCI_PCIX_BSS_SPL_OR,	NULL,
144 144
	PCIX_BSS_SPL_DLY,	PCI_PCIX_BSS_SPL_DLY,	NULL,
145
	NULL, NULL, NULL
145
	NULL, 0, NULL
146 146
};
147 147

  
148 148
/* Translate Fabric ereports to ereport.io.pciex.* */
......
153 153
	PCIEX_FAT,		PCIE_DEVSTS_FE_DETECTED,	NULL,
154 154
	PCIEX_NONFAT,		PCIE_DEVSTS_NFE_DETECTED,	NULL,
155 155
	PCIEX_CORR,		PCIE_DEVSTS_CE_DETECTED,	NULL,
156
	NULL, NULL, NULL
156
	NULL, 0, NULL
157 157
};
158 158

  
159 159
/* Translate Fabric ereports to ereport.io.pciex.* */
......
163 163
	PCIEX_RC_CE_MSG,	PCIE_AER_RE_STS_CE_RCVD,	NULL,
164 164
	PCIEX_RC_MCE_MSG,	PCIE_AER_RE_STS_MUL_CE_RCVD,	NULL,
165 165
	PCIEX_RC_MUE_MSG,	PCIE_AER_RE_STS_MUL_FE_NFE_RCVD, NULL,
166
	NULL, NULL, NULL
166
	NULL, 0, NULL
167 167
};
168 168

  
169 169
/*
......
175 175
	PCIEX_RC_FE_MSG,	PCIE_DEVSTS_FE_DETECTED,	NULL,
176 176
	PCIEX_RC_NFE_MSG,	PCIE_DEVSTS_NFE_DETECTED,	NULL,
177 177
	PCIEX_RC_CE_MSG,	PCIE_DEVSTS_CE_DETECTED,	NULL,
178
	NULL, NULL, NULL,
178
	NULL, 0, NULL
179 179
};
180 180

  
181 181
/* ARGSUSED */
usr/src/cmd/mdb/common/modules/genunix/sysevent.c
181 181
int
182 182
sysevent_subclass_list_walk_init(mdb_walk_state_t *wsp)
183 183
{
184
	if (wsp->walk_addr == NULL) {
184
	if (wsp->walk_addr == 0L) {
185 185
		mdb_warn("sysevent_subclass_list does not support global "
186 186
		    "walks");
187 187
		return (WALK_ERR);
......
196 196
{
197 197
	int status;
198 198

  
199
	if (wsp->walk_addr == NULL)
199
	if (wsp->walk_addr == 0L)
200 200
		return (WALK_DONE);
201 201

  
202 202
	if (mdb_vread(wsp->walk_data, sizeof (subclass_lst_t),
......
230 230
{
231 231
	class_walk_data_t *cl_walker;
232 232

  
233
	if (wsp->walk_addr == NULL) {
233
	if (wsp->walk_addr == 0L) {
234 234
		mdb_warn("sysevent_class_list does not support global walks");
235 235
		return (WALK_ERR);
236 236
	}
......
259 259
	cl_walker = (class_walk_data_t *)wsp->walk_data;
260 260

  
261 261
	/* Skip over empty class table entries */
262
	if (wsp->walk_addr != NULL) {
262
	if (wsp->walk_addr != 0L) {
263 263
		if (mdb_vread(&clist, sizeof (class_lst_t),
264 264
		    wsp->walk_addr) == -1) {
265 265
			mdb_warn("failed to read class list at %p",
usr/src/cmd/mdb/common/modules/usba/usb.c
98 98
	usba_device2devinfo_cbdata_t	*cb_data =
99 99
			    (usba_device2devinfo_cbdata_t *)cb_arg;
100 100

  
101
	if ((cur_usb_dev = mdb_usba_get_usba_device(dip_addr)) == NULL) {
101
	if ((cur_usb_dev = mdb_usba_get_usba_device(dip_addr)) == 0) {
102 102
		/*
103 103
		 * If there's no corresponding usba_device_t, this dip isn't
104 104
		 * a usb node.  Might be an sd node.  Ignore it.
......
182 182
usba_list_walk_init(mdb_walk_state_t *wsp)
183 183
{
184 184
	/* Must have a start addr.  */
185
	if (wsp->walk_addr == NULL) {
185
	if (wsp->walk_addr == 0L) {
186 186
		mdb_warn("not a global walk.  Starting address required\n");
187 187

  
188 188
		return (WALK_ERR);
......
215 215
	wsp->walk_addr = (uintptr_t)list_entry.next;
216 216

  
217 217
	/* Check if we're at the last element */
218
	if (wsp->walk_addr == NULL) {
218
	if (wsp->walk_addr == 0L) {
219 219

  
220 220
		return (WALK_DONE);
221 221
	}
......
237 237
int
238 238
usb_pipe_handle_walk_init(mdb_walk_state_t *wsp)
239 239
{
240
	if (wsp->walk_addr == NULL) {
240
	if (wsp->walk_addr == 0L) {
241 241
		mdb_warn("not a global walk; usba_device_t required\n");
242 242

  
243 243
		return (WALK_ERR);
......
403 403
{
404 404
	usba_list_entry_t	list_entry;
405 405

  
406
	if (wsp->walk_addr != NULL) {
406
	if (wsp->walk_addr != 0L) {
407 407
		mdb_warn(
408 408
		    "global walk only.  Must be invoked without an address\n");
409 409

  
......
437 437
	char		pathname[MAXNAMELEN];
438 438
	char		dname[MODMAXNAMELEN + 1] = "<unatt>"; /* Driver name */
439 439
	char		drv_statep[MODMAXNAMELEN+ 10];
440
	uint_t		usb_flag  = NULL;
440
	uint_t		usb_flag  = 0;
441 441
	boolean_t	no_driver_attached = FALSE;
442 442
	uintptr_t	dip_addr;
443 443
	struct dev_info	devinfo;
......
509 509

  
510 510
	if (usb_flag & USB_DUMP_VERBOSE) {
511 511
		int		i;
512
		uintptr_t	statep = NULL;
512
		uintptr_t	statep = 0;
513 513
		char		*string_descr;
514 514
		char		**config_cloud, **conf_str_descr;
515 515
		usb_dev_descr_t	usb_dev_descr;
......
717 717
	}
718 718
	local_debug_buf[debug_buf_size - 1] = '\0';
719 719

  
720
	if (strlen(local_debug_buf) == NULL) {
720
	if (strlen(local_debug_buf) == 0) {
721 721

  
722 722
		return (DCMD_OK);
723 723
	}
724 724

  
725
	if ((term_p = strstr(local_debug_buf, ">>>>")) == NULL) {
725
	if ((term_p = strstr(local_debug_buf, ">>>>")) == 0) {
726 726
		mdb_warn("failed to find terminator \">>>>\"\n");
727 727

  
728 728
		return (DCMD_ERR);
usr/src/cmd/svc/svcs/svcs.c
553 553
	int r;
554 554

  
555 555
	r = inst_get_single_val(inst, SCF_PG_RESTARTER, pname, SCF_TYPE_TIME,
556
	    tvp, NULL, ok_if_empty ? EMPTY_OK : 0, 0, 1);
556
	    tvp, 0, ok_if_empty ? EMPTY_OK : 0, 0, 1);
557 557

  
558 558
	return (r == 0 ? 0 : -1);
559 559
}
......
1650 1650
		    SCF_PROPERTY_STATE_TIMESTAMP, &tv, 0);
1651 1651
	} else {
1652 1652
		r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
1653
		    SCF_TYPE_TIME, &tv, NULL, 0);
1653
		    SCF_TYPE_TIME, &tv, 0, 0);
1654 1654
	}
1655 1655

  
1656 1656
	if (r != 0) {
......
1702 1702
		    SCF_PROPERTY_STATE_TIMESTAMP, &tv, 0);
1703 1703
	else
1704 1704
		r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
1705
		    SCF_TYPE_TIME, &tv, NULL, 0);
1705
		    SCF_TYPE_TIME, &tv, 0, 0);
1706 1706

  
1707 1707
	if (r == 0) {
1708 1708
		int64_t sec;
......
2514 2514
			    gettext("next_state"), buf);
2515 2515

  
2516 2516
		if (pg_get_single_val(rpg, SCF_PROPERTY_STATE_TIMESTAMP,
2517
		    SCF_TYPE_TIME, &tv, NULL, 0) == 0) {
2517
		    SCF_TYPE_TIME, &tv, 0, 0) == 0) {
2518 2518
			stime = tv.tv_sec;
2519 2519
			tmp = localtime(&stime);
2520 2520
			for (tbsz = 50; ; tbsz *= 2) {
usr/src/head/iso/stddef_iso.h
27 27
 * Copyright 1999-2003 Sun Microsystems, Inc.  All rights reserved.
28 28
 * Use is subject to license terms.
29 29
 */
30
/* Copyright 2014 PALO, Richard. */
30 31

  
31 32
/*
32 33
 * An application should not include this header directly.  Instead it
......
56 57
#endif
57 58

  
58 59
#ifndef	NULL
60
#if !defined(__cplusplus)
61
#define	NULL    ((void *)0)
62
#else
63
#if __cplusplus >= 201103L
64
#define	NULL    nullptr
65
#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
66
#define	NULL    __null
67
#else
59 68
#if defined(_LP64)
60 69
#define	NULL    0L
61 70
#else
62 71
#define	NULL    0
63 72
#endif
64 73
#endif
74
#endif
75
#endif
65 76

  
66 77
#if !defined(_PTRDIFF_T) || __cplusplus >= 199711L
67 78
#define	_PTRDIFF_T
usr/src/head/unistd.h
30 30
/*	  All Rights Reserved  	*/
31 31

  
32 32
/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
33
/* Copyright 2014 PALO, Richard. */
33 34

  
34 35
#ifndef _UNISTD_H
35 36
#define	_UNISTD_H
......
179 180
#endif
180 181

  
181 182
#ifndef NULL
183
#if !defined(__cplusplus)
184
#define	NULL    ((void *)0)
185
#else
186
#if __cplusplus >= 201103L
187
#define	NULL    nullptr
188
#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
189
#define	NULL    __null
190
#else
182 191
#if defined(_LP64)
183 192
#define	NULL	0L
184 193
#else
185 194
#define	NULL	0
186 195
#endif
187 196
#endif
197
#endif
198
#endif
188 199

  
189 200
#define	STDIN_FILENO	0
190 201
#define	STDOUT_FILENO	1
usr/src/lib/cfgadm_plugins/pci/common/cfga.c
1083 1083
				if ((strncmp(str, func_strs[MODE], len) == 0) &&
1084 1084
				    (*(str+(len)) == '=')) {
1085 1085
				    for (str = (str+(++len)), i = 0;
1086
					*str != NULL; i++, str++) {
1086
					*str != '\0'; i++, str++) {
1087 1087
						buf[i] = *str;
1088 1088

  
1089 1089
				    }
......
1281 1281
	if ((root_node = di_init("/", DINFOCPYALL|DINFOPATH))
1282 1282
		== DI_NODE_NIL) {
1283 1283
		DBG(1, ("di_init() failed\n"));
1284
		return (NULL);
1284
		return (0);
1285 1285
	}
1286 1286

  
1287 1287
	slotarg->devpath = (char *)devcomp;
......
1289 1289
	if ((slotarg->promp = di_prom_init()) == DI_PROM_HANDLE_NIL) {
1290 1290
		DBG(1, ("di_prom_init() failed\n"));
1291 1291
		di_fini(root_node);
1292
		return (NULL);
1292
		return (0);
1293 1293
	}
1294 1294

  
1295 1295
	(void) di_walk_minor(root_node, "ddi_ctl:attachment_point:pci",
usr/src/lib/cfgadm_plugins/shp/common/shp.c
953 953
				if ((strncmp(str, func_strs[MODE], len) == 0) &&
954 954
				    (*(str+(len)) == '=')) {
955 955
					for (str = (str+(++len)), i = 0;
956
					    *str != NULL; i++, str++) {
956
					    *str != '\0'; i++, str++) {
957 957
						buf[i] = *str;
958 958
					}
959 959
				}
usr/src/lib/libdtrace/common/dt_handle.c
247 247
	err.dteda_action = -1;
248 248
	err.dteda_offset = -1;
249 249
	err.dteda_fault = DTRACEFLT_LIBRARY;
250
	err.dteda_addr = NULL;
250
	err.dteda_addr = 0L;
251 251

  
252 252
	len = strlen(faultstr) +
253 253
	    strlen(errpd->dtpd_provider) + strlen(errpd->dtpd_mod) +
usr/src/lib/libscf/common/midlevel.c
1342 1342
	}
1343 1343

  
1344 1344
	if (scf_handle_decode_fmri(ret->h, fmri, NULL, NULL, ret->inst,
1345
	    NULL, NULL, NULL) == -1) {
1345
	    NULL, NULL, 0) == -1) {
1346 1346
		goto out;
1347 1347
	}
1348 1348

  
1349
- 
(1-1/2)