From 1bb56fb39d8db0c9a419818f82fa7e517cad55bc Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 16 Jun 2009 23:23:31 +0000 Subject: Reserved word 'private' in C header files is a problem for C++ git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1890 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 ++ nuttx/Documentation/NuttX.html | 4 +++- nuttx/drivers/pipe_common.c | 14 +++++------- nuttx/drivers/serial.c | 10 ++++----- nuttx/drivers/usbdev/usbdev_scsi.c | 12 +++++------ nuttx/drivers/usbdev/usbdev_serial.c | 40 +++++++++++++++++------------------ nuttx/drivers/usbdev/usbdev_storage.c | 40 +++++++++++++++++------------------ nuttx/fs/fs_poll.c | 4 ++-- nuttx/fs/fs_registerblockdriver.c | 6 +++--- nuttx/fs/fs_registerdriver.c | 9 ++++---- nuttx/include/net/uip/uip.h | 8 +++---- nuttx/include/nuttx/fs.h | 4 ++-- nuttx/include/nuttx/usbdev.h | 6 +++--- nuttx/include/poll.h | 4 ++-- nuttx/net/connect.c | 10 ++++----- nuttx/net/net_close.c | 8 +++---- nuttx/net/net_poll.c | 18 ++++++++-------- nuttx/net/recvfrom.c | 28 ++++++++++++------------ nuttx/net/send.c | 10 ++++----- nuttx/net/sendto.c | 12 +++++------ nuttx/net/uip/uip_callback.c | 4 ++-- nuttx/net/uip/uip_icmpping.c | 10 ++++----- 22 files changed, 131 insertions(+), 132 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 027d3f90b..488f31f3e 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -782,5 +782,7 @@ * Add configuration options to suppress or eliminate cloning of file and/or socket descriptors when a new task is started by task_create(): CONFIG_FDCLONE_DISABLE, CONFIG_FDCLONE_STDIO, CONFIG_SDCLONE_DISABLE. + * Use of C++ reserved word 'private' in C header files causes problems + for C++ that include them. diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index f47a76af8..1343756eb 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: June 15, 2009

+

Last Updated: June 16, 2009

@@ -1474,6 +1474,8 @@ nuttx-0.4.9 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * dup() and dup2() will now clone socket descriptors * All socket descriptors ar now cloned when when a new task is started via task_create(). + * Use of C++ reserved word 'private' in C header files causes problems + for C++ that include them. pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/pipe_common.c b/nuttx/drivers/pipe_common.c index 434501559..7bfddb7db 100644 --- a/nuttx/drivers/pipe_common.c +++ b/nuttx/drivers/pipe_common.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/pipe_common.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,10 +33,6 @@ * ****************************************************************************/ -/**************************************************************************** - * Compilation Switches - ****************************************************************************/ - /**************************************************************************** * Included Files ****************************************************************************/ @@ -550,14 +546,14 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Bind the poll structure and this slot */ dev->d_fds[i] = fds; - fds->private = &dev->d_fds[i]; + fds->priv = &dev->d_fds[i]; break; } } if (i >= CONFIG_DEV_PIPE_NPOLLWAITERS) { - fds->private = NULL; + fds->priv = NULL; ret = -EBUSY; goto errout; } @@ -599,7 +595,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, { /* This is a request to tear down the poll. */ - struct pollfd **slot = (struct pollfd **)fds->private; + struct pollfd **slot = (struct pollfd **)fds->priv; #ifdef CONFIG_DEBUG if (!slot) @@ -612,7 +608,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Remove all memory of the poll setup */ *slot = NULL; - fds->private = NULL; + fds->priv = NULL; } errout: diff --git a/nuttx/drivers/serial.c b/nuttx/drivers/serial.c index 98ba07e21..a7cb42b20 100644 --- a/nuttx/drivers/serial.c +++ b/nuttx/drivers/serial.c @@ -436,14 +436,14 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) /* Bind the poll structure and this slot */ dev->fds[i] = fds; - fds->private = &dev->fds[i]; + fds->priv = &dev->fds[i]; break; } } if (i >= CONFIG_DEV_CONSOLE_NPOLLWAITERS) { - fds->private = NULL; + fds->priv = NULL; ret = -EBUSY; goto errout; } @@ -481,11 +481,11 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) } } - else if (fds->private) + else if (fds->priv) { /* This is a request to tear down the poll. */ - struct pollfd **slot = (struct pollfd **)fds->private; + struct pollfd **slot = (struct pollfd **)fds->priv; #ifdef CONFIG_DEBUG if (!slot) @@ -498,7 +498,7 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) /* Remove all memory of the poll setup */ *slot = NULL; - fds->private = NULL; + fds->priv = NULL; } errout: diff --git a/nuttx/drivers/usbdev/usbdev_scsi.c b/nuttx/drivers/usbdev/usbdev_scsi.c index 088dc3ec2..e17999b20 100644 --- a/nuttx/drivers/usbdev/usbdev_scsi.c +++ b/nuttx/drivers/usbdev/usbdev_scsi.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/usbdev/usbdev_storage.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Mass storage class device. Bulk-only with SCSI subclass. @@ -1604,7 +1604,7 @@ static int usbstrg_idlestate(FAR struct usbstrg_dev_s *priv) req = privreq->req; req->len = CONFIG_USBSTRG_BULKOUTREQLEN; - req->private = privreq; + req->priv = privreq; req->callback = usbstrg_rdcomplete; if (EP_SUBMIT(priv->epbulkout, req) != OK) @@ -2046,7 +2046,7 @@ static int usbstrg_cmdreadstate(FAR struct usbstrg_dev_s *priv) /* And submit the request to the bulk IN endpoint */ req->len = priv->nreqbytes; - req->private = privreq; + req->priv = privreq; req->callback = usbstrg_wrcomplete; req->flags = 0; @@ -2189,7 +2189,7 @@ static int usbstrg_cmdwritestate(FAR struct usbstrg_dev_s *priv) */ req->len = CONFIG_USBSTRG_BULKOUTREQLEN; - req->private = privreq; + req->priv = privreq; req->callback = usbstrg_rdcomplete; ret = EP_SUBMIT(priv->epbulkout, req); @@ -2283,7 +2283,7 @@ static int usbstrg_cmdfinishstate(FAR struct usbstrg_dev_s *priv) req = privreq->req; req->len = priv->nreqbytes; req->callback = usbstrg_wrcomplete; - req->private = privreq; + req->priv = privreq; req->flags = USBDEV_REQFLAGS_NULLPKT; ret = EP_SUBMIT(priv->epbulkin, privreq->req); @@ -2429,7 +2429,7 @@ static int usbstrg_cmdstatusstate(FAR struct usbstrg_dev_s *priv) req->len = USBSTRG_CSW_SIZEOF; req->callback = usbstrg_wrcomplete; - req->private = privreq; + req->priv = privreq; req->flags = USBDEV_REQFLAGS_NULLPKT; ret = EP_SUBMIT(priv->epbulkin, req); diff --git a/nuttx/drivers/usbdev/usbdev_serial.c b/nuttx/drivers/usbdev/usbdev_serial.c index 116accc57..569b0e118 100644 --- a/nuttx/drivers/usbdev/usbdev_serial.c +++ b/nuttx/drivers/usbdev/usbdev_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/usbdev/usbdev_serial.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This logic emulates the Prolific PL2303 serial/USB converter @@ -613,7 +613,7 @@ static int usbclass_sndpacket(FAR struct usbser_dev_s *priv) /* Then submit the request to the endpoint */ req->len = len; - req->private = reqcontainer; + req->priv = reqcontainer; req->flags = USBDEV_REQFLAGS_NULLPKT; ret = EP_SUBMIT(ep, req); if (ret != OK) @@ -1045,7 +1045,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINCONFIGFAIL), 0); goto errout; } - priv->epintin->private = priv; + priv->epintin->priv = priv; /* Configure the IN bulk endpoint */ @@ -1070,7 +1070,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) goto errout; } - priv->epbulkin->private = priv; + priv->epbulkin->priv = priv; /* Configure the OUT bulk endpoint */ @@ -1086,7 +1086,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) goto errout; } - priv->epbulkout->private = priv; + priv->epbulkout->priv = priv; /* Queue read requests in the bulk OUT endpoint */ @@ -1148,7 +1148,7 @@ static void usbclass_rdcomplete(FAR struct usbdev_ep_s *ep, /* Sanity check */ #ifdef CONFIG_DEBUG - if (!ep || !ep->private || !req) + if (!ep || !ep->priv || !req) { usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0); return; @@ -1157,7 +1157,7 @@ static void usbclass_rdcomplete(FAR struct usbdev_ep_s *ep, /* Extract references to private data */ - priv = (FAR struct usbser_dev_s*)ep->private; + priv = (FAR struct usbser_dev_s*)ep->priv; /* Process the received data unless this is some unusual condition */ @@ -1215,7 +1215,7 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep, /* Sanity check */ #ifdef CONFIG_DEBUG - if (!ep || !ep->private || !req || !req->private) + if (!ep || !ep->priv || !req || !req->priv) { usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0); return; @@ -1224,8 +1224,8 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep, /* Extract references to our private data */ - priv = (FAR struct usbser_dev_s *)ep->private; - reqcontainer = (FAR struct usbser_req_s *)req->private; + priv = (FAR struct usbser_dev_s *)ep->priv; + reqcontainer = (FAR struct usbser_req_s *)req->priv; /* Return the write request to the free list */ @@ -1280,8 +1280,8 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver /* Bind the structures */ - priv->usbdev = dev; - dev->ep0->private = priv; + priv->usbdev = dev; + dev->ep0->priv = priv; /* Preallocate control request */ @@ -1310,7 +1310,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver ret = -ENODEV; goto errout; } - priv->epintin->private = priv; + priv->epintin->priv = priv; /* Pre-allocate the IN bulk endpoint */ @@ -1321,7 +1321,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver ret = -ENODEV; goto errout; } - priv->epbulkin->private = priv; + priv->epbulkin->priv = priv; /* Pre-allocate the OUT bulk endpoint */ @@ -1332,7 +1332,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver ret = -ENODEV; goto errout; } - priv->epbulkout->private = priv; + priv->epbulkout->priv = priv; /* Pre-allocate read requests */ @@ -1352,7 +1352,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver ret = -ENOMEM; goto errout; } - reqcontainer->req->private = reqcontainer; + reqcontainer->req->priv = reqcontainer; reqcontainer->req->callback = usbclass_rdcomplete; } @@ -1374,7 +1374,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver ret = -ENOMEM; goto errout; } - reqcontainer->req->private = reqcontainer; + reqcontainer->req->priv = reqcontainer; reqcontainer->req->callback = usbclass_wrcomplete; flags = irqsave(); @@ -1422,7 +1422,7 @@ static void usbclass_unbind(FAR struct usbdev_s *dev) /* Extract reference to private data */ - priv = (FAR struct usbser_dev_s *)dev->ep0->private; + priv = (FAR struct usbser_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv) @@ -1547,7 +1547,7 @@ static int usbclass_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s * /* Extract reference to private data */ usbtrace(TRACE_CLASSSETUP, ctrl->req); - priv = (FAR struct usbser_dev_s *)dev->ep0->private; + priv = (FAR struct usbser_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv || !priv->ctrlreq) @@ -1806,7 +1806,7 @@ static void usbclass_disconnect(FAR struct usbdev_s *dev) /* Extract reference to private data */ - priv = (FAR struct usbser_dev_s *)dev->ep0->private; + priv = (FAR struct usbser_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv) diff --git a/nuttx/drivers/usbdev/usbdev_storage.c b/nuttx/drivers/usbdev/usbdev_storage.c index 99651c15b..43c02c66f 100644 --- a/nuttx/drivers/usbdev/usbdev_storage.c +++ b/nuttx/drivers/usbdev/usbdev_storage.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/usbdev/usbdev_storage.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Mass storage class device. Bulk-only with SCSI subclass. @@ -504,8 +504,8 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_ /* Bind the structures */ - priv->usbdev = dev; - dev->ep0->private = priv; + priv->usbdev = dev; + dev->ep0->priv = priv; /* The configured EP0 size should match the reported EP0 size. We could * easily adapt to the reported EP0 size, but then we could not use the @@ -541,7 +541,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_ ret = -ENODEV; goto errout; } - priv->epbulkin->private = priv; + priv->epbulkin->priv = priv; /* Pre-allocate the OUT bulk endpoint */ @@ -552,7 +552,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_ ret = -ENODEV; goto errout; } - priv->epbulkout->private = priv; + priv->epbulkout->priv = priv; /* Pre-allocate read requests */ @@ -566,7 +566,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_ ret = -ENOMEM; goto errout; } - reqcontainer->req->private = reqcontainer; + reqcontainer->req->priv = reqcontainer; reqcontainer->req->callback = usbstrg_rdcomplete; } @@ -582,7 +582,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_ ret = -ENOMEM; goto errout; } - reqcontainer->req->private = reqcontainer; + reqcontainer->req->priv = reqcontainer; reqcontainer->req->callback = usbstrg_wrcomplete; flags = irqsave(); @@ -629,7 +629,7 @@ static void usbstrg_unbind(FAR struct usbdev_s *dev) /* Extract reference to private data */ - priv = (FAR struct usbstrg_dev_s *)dev->ep0->private; + priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv) @@ -743,7 +743,7 @@ static int usbstrg_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *c /* Extract reference to private data */ usbtrace(TRACE_CLASSSETUP, ctrl->req); - priv = (FAR struct usbstrg_dev_s *)dev->ep0->private; + priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv || !priv->ctrlreq) @@ -1018,7 +1018,7 @@ static void usbstrg_disconnect(FAR struct usbdev_s *dev) /* Extract reference to private data */ - priv = (FAR struct usbstrg_dev_s *)dev->ep0->private; + priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv; #ifdef CONFIG_DEBUG if (!priv) @@ -1139,7 +1139,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config) goto errout; } - priv->epbulkin->private = priv; + priv->epbulkin->priv = priv; /* Configure the OUT bulk endpoint */ @@ -1155,7 +1155,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config) goto errout; } - priv->epbulkout->private = priv; + priv->epbulkout->priv = priv; /* Queue read requests in the bulk OUT endpoint */ @@ -1164,7 +1164,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config) privreq = &priv->rdreqs[i]; req = privreq->req; req->len = CONFIG_USBSTRG_BULKOUTREQLEN; - req->private = privreq; + req->priv = privreq; req->callback = usbstrg_rdcomplete; ret = EP_SUBMIT(priv->epbulkout, req); if (ret < 0) @@ -1227,7 +1227,7 @@ void usbstrg_wrcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req /* Sanity check */ #ifdef CONFIG_DEBUG - if (!ep || !ep->private || !req || !req->private) + if (!ep || !ep->priv || !req || !req->priv) { usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_WRCOMPLETEINVALIDARGS), 0); return; @@ -1236,8 +1236,8 @@ void usbstrg_wrcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req /* Extract references to private data */ - priv = (FAR struct usbstrg_dev_s*)ep->private; - privreq = (FAR struct usbstrg_req_s *)req->private; + priv = (FAR struct usbstrg_dev_s*)ep->priv; + privreq = (FAR struct usbstrg_req_s *)req->priv; /* Return the write request to the free list */ @@ -1287,7 +1287,7 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req /* Sanity check */ #ifdef CONFIG_DEBUG - if (!ep || !ep->private || !req || !req->private) + if (!ep || !ep->priv || !req || !req->priv) { usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_RDCOMPLETEINVALIDARGS), 0); return; @@ -1296,8 +1296,8 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req /* Extract references to private data */ - priv = (FAR struct usbstrg_dev_s*)ep->private; - privreq = (FAR struct usbstrg_req_s *)req->private; + priv = (FAR struct usbstrg_dev_s*)ep->priv; + privreq = (FAR struct usbstrg_req_s *)req->priv; /* Process the received data unless this is some unusual condition */ @@ -1335,7 +1335,7 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req /* Return the read request to the bulk out endpoint for re-filling */ req = privreq->req; - req->private = privreq; + req->priv = privreq; req->callback = usbstrg_rdcomplete; ret = EP_SUBMIT(priv->epbulkout, req); diff --git a/nuttx/fs/fs_poll.c b/nuttx/fs/fs_poll.c index c9b418453..dd71bfa48 100644 --- a/nuttx/fs/fs_poll.c +++ b/nuttx/fs/fs_poll.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_poll.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -165,7 +165,7 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem) fds[i].sem = sem; fds[i].revents = 0; - fds[i].private = NULL; + fds[i].priv = NULL; /* Set up the poll */ diff --git a/nuttx/fs/fs_registerblockdriver.c b/nuttx/fs/fs_registerblockdriver.c index b4d89e773..aad6a9224 100644 --- a/nuttx/fs/fs_registerblockdriver.c +++ b/nuttx/fs/fs_registerblockdriver.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs_registerblockdriver.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -69,7 +69,7 @@ STATUS register_blockdriver(const char *path, const struct block_operations *bops, - mode_t mode, void *private) + mode_t mode, void *priv) { struct inode *node; STATUS ret = -ENOMEM; @@ -93,7 +93,7 @@ STATUS register_blockdriver(const char *path, #ifdef CONFIG_FILE_MODE node->i_mode = mode; #endif - node->i_private = private; + node->i_private = priv; ret = OK; } diff --git a/nuttx/fs/fs_registerdriver.c b/nuttx/fs/fs_registerdriver.c index aedf06caf..5299ba28d 100644 --- a/nuttx/fs/fs_registerdriver.c +++ b/nuttx/fs/fs_registerdriver.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_registerdriver.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,9 +67,8 @@ * Name: register_driver ****************************************************************************/ -STATUS register_driver(const char *path, - const struct file_operations *fops, - mode_t mode, void *private) +STATUS register_driver(const char *path, const struct file_operations *fops, + mode_t mode, void *priv) { struct inode *node; STATUS ret = ERROR; @@ -92,7 +91,7 @@ STATUS register_driver(const char *path, #ifdef CONFIG_FILE_MODE node->i_mode = mode; #endif - node->i_private = private; + node->i_private = priv; ret = OK; } diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h index 640ac07fc..0482b9099 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/net/uip/uip.h @@ -5,7 +5,7 @@ * are used by uIP programs as well as internal uIP structures and function * declarations. * - * Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: @@ -203,7 +203,7 @@ struct uip_ip_hdr * flink - Supports a singly linked list * event - Provides the address of the callback function entry point. * pvconn is a pointer to one of struct uip_conn or struct uip_udp_conn. - * private - Holds a reference to application specific data that will + * priv - Holds a reference to application specific data that will * provided * flags - Set by the application to inform the uIP layer which flags * are and are not handled by the callback. @@ -213,8 +213,8 @@ struct uip_driver_s; /* Forward reference */ struct uip_callback_s { FAR struct uip_callback_s *flink; - uint16 (*event)(struct uip_driver_s *dev, void *pvconn, void *pvprivate, uint16 flags); - void *private; + uint16 (*event)(struct uip_driver_s *dev, void *pvconn, void *pvpriv, uint16 flags); + void *priv; uint16 flags; }; diff --git a/nuttx/include/nuttx/fs.h b/nuttx/include/nuttx/fs.h index 68733029f..b33bfa234 100644 --- a/nuttx/include/nuttx/fs.h +++ b/nuttx/include/nuttx/fs.h @@ -351,7 +351,7 @@ EXTERN int files_dup(FAR struct file *filep1, FAR struct file *filep2); #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 EXTERN int file_dup(int fd); #else -# defile file_dup(fd) dup(fd) +# define file_dup(fd) dup(fd) #endif /* fs_filedup2.c *************************************************************/ @@ -363,7 +363,7 @@ EXTERN int file_dup(int fd); #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 EXTERN int file_dup2(int fd1, int fd2); #else -# defile file_dup2(fd1, fd2) dup2(fd1, fd2) +# define file_dup2(fd1, fd2) dup2(fd1, fd2) #endif /* fs_openblockdriver.c ******************************************************/ diff --git a/nuttx/include/nuttx/usbdev.h b/nuttx/include/nuttx/usbdev.h index 57a9f36fe..0deea404e 100644 --- a/nuttx/include/nuttx/usbdev.h +++ b/nuttx/include/nuttx/usbdev.h @@ -1,7 +1,7 @@ /************************************************************************************ * include/nuttx/usbdev.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * NOTE: This interface was inspired by the Linux gadget interface by @@ -199,7 +199,7 @@ struct usbdev_req_s /* Callback when the transfer completes */ void (*callback)(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req); - void *private; /* Used only by callee */ + void *priv; /* Used only by callee */ }; /* Endpoint-specific interface to USB controller hardware. */ @@ -240,7 +240,7 @@ struct usbdev_ep_s const struct usbdev_epops_s *ops; /* Endpoint operations */ ubyte eplog; /* Logical endpoint address */ uint16 maxpacket; /* Maximum packet size for this endpoint */ - void *private; /* For use by class driver */ + void *priv; /* For use by class driver */ }; /* struct usbdev_s represents a usb device */ diff --git a/nuttx/include/poll.h b/nuttx/include/poll.h index 3b41ec99a..72c370c88 100644 --- a/nuttx/include/poll.h +++ b/nuttx/include/poll.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/poll.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -108,7 +108,7 @@ struct pollfd sem_t *sem; /* Pointer to semaphore used to post output event */ pollevent_t events; /* The input event flags */ pollevent_t revents; /* The output event flags */ - FAR void *private; /* For use by drivers */ + FAR void *priv; /* For use by drivers */ }; /**************************************************************************** diff --git a/nuttx/net/connect.c b/nuttx/net/connect.c index 9f9818d33..b530fd4d8 100644 --- a/nuttx/net/connect.c +++ b/nuttx/net/connect.c @@ -76,7 +76,7 @@ static inline int tcp_setup_callbacks(FAR struct socket *psock, FAR struct tcp_connect_s *pstate); static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int status); static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn, - void *pvprivate, uint16 flags); + void *pvpriv, uint16 flags); #ifdef CONFIG_NET_IPv6 static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in6 *inaddr); #else @@ -161,7 +161,7 @@ static inline int tcp_setup_callbacks(FAR struct socket *psock, if (pstate->tc_cb) { pstate->tc_cb->flags = UIP_NEWDATA|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT|UIP_CONNECTED; - pstate->tc_cb->private = (void*)pstate; + pstate->tc_cb->priv = (void*)pstate; pstate->tc_cb->event = tcp_connect_interrupt; /* Set up to receive callbacks on connection-related events */ @@ -223,13 +223,13 @@ static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int stat #ifdef CONFIG_NET_TCP static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { - struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvprivate; + struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvpriv; nvdbg("flags: %04x\n", flags); - /* 'private' might be null in some race conditions (?) */ + /* 'priv' might be null in some race conditions (?) */ if (pstate) { diff --git a/nuttx/net/net_close.c b/nuttx/net/net_close.c index f8de0614a..4a486d972 100644 --- a/nuttx/net/net_close.c +++ b/nuttx/net/net_close.c @@ -88,9 +88,9 @@ struct tcp_close_s #ifdef CONFIG_NET_TCP static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { - struct tcp_close_s *pstate = (struct tcp_close_s *)pvprivate; + struct tcp_close_s *pstate = (struct tcp_close_s *)pvpriv; nvdbg("flags: %04x\n", flags); @@ -105,7 +105,7 @@ static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn, /* The disconnection is complete */ pstate->cl_cb->flags = 0; - pstate->cl_cb->private = NULL; + pstate->cl_cb->priv = NULL; pstate->cl_cb->event = NULL; sem_post(&pstate->cl_sem); nvdbg("Resuming\n"); @@ -167,7 +167,7 @@ static inline void netclose_disconnect(FAR struct socket *psock) sem_init(&state.cl_sem, 0, 0); state.cl_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT; - state.cl_cb->private = (void*)&state; + state.cl_cb->priv = (void*)&state; state.cl_cb->event = netclose_interrupt; /* Notify the device driver of the availaibilty of TX data */ diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index 5e7a18133..adbd9c101 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/net_poll.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,13 +102,13 @@ #ifdef HAVE_NETPOLL static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn, - FAR void *pvprivate, uint16 flags) + FAR void *pvpriv, uint16 flags) { - FAR struct pollfd *fds = (FAR struct pollfd *)pvprivate; + FAR struct pollfd *fds = (FAR struct pollfd *)pvpriv; nvdbg("flags: %04x\n", flags); - /* 'private' might be null in some race conditions (?) */ + /* 'priv' might be null in some race conditions (?) */ if (fds) { @@ -194,12 +194,12 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds) /* Initialize the callbcack structure */ cb->flags = UIP_NEWDATA|UIP_BACKLOG|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; - cb->private = (FAR void *)fds; + cb->priv = (FAR void *)fds; cb->event = poll_interrupt; /* Save the nps reference in the poll structure for use at teardown as well */ - fds->private = (FAR void *)cb; + fds->priv = (FAR void *)cb; /* Check for read data availability now */ @@ -246,7 +246,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds) /* Sanity check */ #ifdef CONFIG_DEBUG - if (!conn || !fds->private) + if (!conn || !fds->priv) { return -EINVAL; } @@ -254,7 +254,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds) /* Recover the socket descriptor poll state info from the poll structure */ - cb = (FAR struct uip_callback_s *)fds->private; + cb = (FAR struct uip_callback_s *)fds->priv; if (cb) { /* Release the callback */ @@ -265,7 +265,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds) /* Release the poll/select data slot */ - fds->private = NULL; + fds->priv = NULL; } return OK; diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index 0b1c9a07a..6ff8e5724 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -359,13 +359,13 @@ static inline void recvfrom_tcpsender(struct uip_driver_s *dev, struct recvfrom_ #ifdef CONFIG_NET_TCP static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { - struct recvfrom_s *pstate = (struct recvfrom_s *)pvprivate; + struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv; nvdbg("flags: %04x\n", flags); - /* 'private' might be null in some race conditions (?) */ + /* 'priv' might be null in some race conditions (?) */ if (pstate) { @@ -400,7 +400,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, */ pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Wake up the waiting thread, returning the number of bytes @@ -428,7 +428,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, /* Stop further callbacks */ pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Report not connected */ @@ -454,7 +454,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, nvdbg("TCP timeout\n"); pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Report an error only if no data has been received */ @@ -542,13 +542,13 @@ static inline void recvfrom_udpsender(struct uip_driver_s *dev, struct recvfrom_ #ifdef CONFIG_NET_UDP static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { - struct recvfrom_s *pstate = (struct recvfrom_s *)pvprivate; + struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv; nvdbg("flags: %04x\n", flags); - /* 'private' might be null in some race conditions (?) */ + /* 'priv' might be null in some race conditions (?) */ if (pstate) { @@ -567,7 +567,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, /* Don't allow any further UDP call backs. */ pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Save the sender's address in the caller's 'from' location */ @@ -594,7 +594,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, /* Stop further callbacks */ pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Report not connected */ @@ -622,7 +622,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, /* Stop further callbacks */ pstate->rf_cb->flags = 0; - pstate->rf_cb->private = NULL; + pstate->rf_cb->priv = NULL; pstate->rf_cb->event = NULL; /* Report a timeout error */ @@ -795,7 +795,7 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, /* Set up the callback in the connection */ state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; - state.rf_cb->private = (void*)&state; + state.rf_cb->priv = (void*)&state; state.rf_cb->event = recvfrom_udpinterrupt; /* Enable the UDP socket */ @@ -898,7 +898,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, if (state.rf_cb) { state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; - state.rf_cb->private = (void*)&state; + state.rf_cb->priv = (void*)&state; state.rf_cb->event = recvfrom_tcpinterrupt; /* Wait for either the receive to complete or for an error/timeout to occur. diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 5ec9e47ee..f3d04c1a5 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/send.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -196,10 +196,10 @@ static inline int send_timeout(struct send_s *pstate) ****************************************************************************/ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { struct uip_conn *conn = (struct uip_conn*)pvconn; - struct send_s *pstate = (struct send_s *)pvprivate; + struct send_s *pstate = (struct send_s *)pvpriv; nvdbg("flags: %04x acked: %d sent: %d\n", flags, pstate->snd_acked, pstate->snd_sent); @@ -328,7 +328,7 @@ end_wait: /* Do not allow any further callbacks */ pstate->snd_cb->flags = 0; - pstate->snd_cb->private = NULL; + pstate->snd_cb->priv = NULL; pstate->snd_cb->event = NULL; /* Wake up the waiting thread */ @@ -468,7 +468,7 @@ ssize_t send(int sockfd, const void *buf, size_t len, int flags) /* Set up the callback in the connection */ state.snd_cb->flags = UIP_ACKDATA|UIP_REXMIT|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; - state.snd_cb->private = (void*)&state; + state.snd_cb->priv = (void*)&state; state.snd_cb->event = send_interrupt; /* Notify the device driver of the availaibilty of TX data */ diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index 102b49797..d74275ae7 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/sendto.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -82,7 +82,7 @@ struct sendto_s * Parameters: * dev The sructure of the network driver that caused the interrupt * conn An instance of the UDP connection structure cast to void * - * pvprivate An instance of struct sendto_s cast to void* + * pvpriv An instance of struct sendto_s cast to void* * flags Set of events describing why the callback was invoked * * Returned Value: @@ -94,9 +94,9 @@ struct sendto_s ****************************************************************************/ #ifdef CONFIG_NET_UDP -static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvprivate, uint16 flags) +static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpriv, uint16 flags) { - struct sendto_s *pstate = (struct sendto_s *)pvprivate; + struct sendto_s *pstate = (struct sendto_s *)pvpriv; nvdbg("flags: %04x\n", flags); if (pstate) @@ -138,7 +138,7 @@ static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpri /* Don't allow any further call backs. */ pstate->st_cb->flags = 0; - pstate->st_cb->private = NULL; + pstate->st_cb->priv = NULL; pstate->st_cb->event = NULL; /* Wake up the waiting thread */ @@ -315,7 +315,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, if (state.st_cb) { state.st_cb->flags = UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; - state.st_cb->private = (void*)&state; + state.st_cb->priv = (void*)&state; state.st_cb->event = sendto_interrupt; /* Enable the UDP socket */ diff --git a/nuttx/net/uip/uip_callback.c b/nuttx/net/uip/uip_callback.c index 60ead736f..690ef47be 100644 --- a/nuttx/net/uip/uip_callback.c +++ b/nuttx/net/uip/uip_callback.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_callback.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -236,7 +236,7 @@ uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn, uint16 fl */ nvdbg("Call event=%p with flags=%04x\n", list->event, flags); - flags = list->event(dev, pvconn, list->private, flags); + flags = list->event(dev, pvconn, list->priv, flags); } /* Set up for the next time through the loop */ diff --git a/nuttx/net/uip/uip_icmpping.c b/nuttx/net/uip/uip_icmpping.c index 6c2c57c91..9a68ca543 100644 --- a/nuttx/net/uip/uip_icmpping.c +++ b/nuttx/net/uip/uip_icmpping.c @@ -134,7 +134,7 @@ static inline int ping_timeout(struct icmp_ping_s *pstate) * Parameters: * dev The structure of the network driver that caused the interrupt * conn The received packet, cast to void * - * pvprivate An instance of struct icmp_ping_s cast to void* + * pvpriv An instance of struct icmp_ping_s cast to void* * flags Set of events describing why the callback was invoked * * Returned Value: @@ -146,9 +146,9 @@ static inline int ping_timeout(struct icmp_ping_s *pstate) ****************************************************************************/ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, - void *pvprivate, uint16 flags) + void *pvpriv, uint16 flags) { - struct icmp_ping_s *pstate = (struct icmp_ping_s *)pvprivate; + struct icmp_ping_s *pstate = (struct icmp_ping_s *)pvpriv; ubyte *ptr; int failcode = -ETIMEDOUT; int i; @@ -269,7 +269,7 @@ end_wait: /* Do not allow any further callbacks */ pstate->png_cb->flags = 0; - pstate->png_cb->private = NULL; + pstate->png_cb->priv = NULL; pstate->png_cb->event = NULL; /* Wake up the waiting thread */ @@ -334,7 +334,7 @@ int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dse if (state.png_cb) { state.png_cb->flags = UIP_POLL|UIP_ECHOREPLY; - state.png_cb->private = (void*)&state; + state.png_cb->priv = (void*)&state; state.png_cb->event = ping_interrupt; state.png_result = -EINTR; /* Assume sem-wait interrupted by signal */ -- cgit v1.2.3