summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-31 14:15:36 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-31 14:15:36 +0000
commit683c7dbd29a864ee20c792918fd32eedf9b53f69 (patch)
treeecf3cd73d71ad66b3c62fe2f86aff56f2d8b06fe /nuttx
parent7e732a9cb78f197c4b44892a574842ca1eba0823 (diff)
downloadpx4-nuttx-683c7dbd29a864ee20c792918fd32eedf9b53f69.tar.gz
px4-nuttx-683c7dbd29a864ee20c792918fd32eedf9b53f69.tar.bz2
px4-nuttx-683c7dbd29a864ee20c792918fd32eedf9b53f69.zip
Can't use 'class' as a field name! Backward conditional compilation in usbmsc.c
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4350 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog5
-rw-r--r--nuttx/drivers/power/max1704x.c4
-rw-r--r--nuttx/drivers/usbdev/composite_descriptors.c6
-rw-r--r--nuttx/drivers/usbdev/pl2303.c6
-rw-r--r--nuttx/drivers/usbdev/usbmsc.c7
-rw-r--r--nuttx/drivers/usbdev/usbmsc_descriptors.c6
-rw-r--r--nuttx/include/nuttx/usb/usb.h12
7 files changed, 24 insertions, 22 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 476ef113e..5e4b902b5 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -2412,4 +2412,7 @@
OS to use the socket interface without having a socket descriptor.
* include/net/psock.h: Removed psock.h. The new interfaces are moved into
nuttx/net.h which already has similar logic.
-
+ * include/nuttx/usb/usb.h: Can't use 'class' as a field name in USB structures.
+ This upsets C++ if usb.h is included. 'class' -> 'classid' in this header
+ file and all places that referenced 'class'
+ * drivers/usbdev/usbmsc.c: Fixed some backward conditional compilation.
diff --git a/nuttx/drivers/power/max1704x.c b/nuttx/drivers/power/max1704x.c
index 01a66d80c..ec50515e6 100644
--- a/nuttx/drivers/power/max1704x.c
+++ b/nuttx/drivers/power/max1704x.c
@@ -317,7 +317,7 @@ static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr,
static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv,
b16_t *vcell)
{
- uint16_t regval;
+ uint16_t regval = 0;
int ret;
ret = max1704x_getreg16(priv, MAX1407X_VCELL_ADDR, &regval);
@@ -339,7 +339,7 @@ static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv,
static inline int max1704x_getsoc(FAR struct max1704x_dev_s *priv,
b16_t *soc)
{
- uint16_t regval;
+ uint16_t regval = 0;
int ret;
ret = max1704x_getreg16(priv, MAX1407X_VCELL_ADDR, &regval);
diff --git a/nuttx/drivers/usbdev/composite_descriptors.c b/nuttx/drivers/usbdev/composite_descriptors.c
index 3fbc5d7d3..9ea6ef2d7 100644
--- a/nuttx/drivers/usbdev/composite_descriptors.c
+++ b/nuttx/drivers/usbdev/composite_descriptors.c
@@ -85,11 +85,11 @@ static const struct usb_devdesc_s g_devdesc =
MSBYTE(0x0200)
},
#ifdef CONFIG_COMPOSITE_IAD
- USB_CLASS_MISC, /* class */
+ USB_CLASS_MISC, /* classid */
2, /* subclass */
1, /* protocol */
#else
- USB_CLASS_PER_INTERFACE, /* class */
+ USB_CLASS_PER_INTERFACE, /* classid */
0, /* subclass */
0, /* protocol */
#endif
@@ -138,7 +138,7 @@ static const struct usb_qualdesc_s g_qualdesc =
LSBYTE(0x0200),
MSBYTE(0x0200)
},
- USB_CLASS_VENDOR_SPEC, /* class */
+ USB_CLASS_VENDOR_SPEC, /* classid */
0, /* subclass */
0, /* protocol */
CONFIG_COMPOSITE_EP0MAXPACKET, /* mxpacketsize */
diff --git a/nuttx/drivers/usbdev/pl2303.c b/nuttx/drivers/usbdev/pl2303.c
index 81c3376dc..3931dac10 100644
--- a/nuttx/drivers/usbdev/pl2303.c
+++ b/nuttx/drivers/usbdev/pl2303.c
@@ -394,7 +394,7 @@ static const struct usb_devdesc_s g_devdesc =
USB_SIZEOF_DEVDESC, /* len */
USB_DESC_TYPE_DEVICE, /* type */
{LSBYTE(0x0200), MSBYTE(0x0200)}, /* usb */
- USB_CLASS_PER_INTERFACE, /* class */
+ USB_CLASS_PER_INTERFACE, /* classid */
0, /* subclass */
0, /* protocol */
CONFIG_PL2303_EP0MAXPACKET, /* maxpacketsize */
@@ -429,7 +429,7 @@ static const struct usb_ifdesc_s g_ifdesc =
0, /* ifno */
0, /* alt */
PL2303_NENDPOINTS, /* neps */
- USB_CLASS_VENDOR_SPEC, /* class */
+ USB_CLASS_VENDOR_SPEC, /* classid */
0, /* subclass */
0, /* protocol */
PL2303_CONFIGSTRID /* iif */
@@ -472,7 +472,7 @@ static const struct usb_qualdesc_s g_qualdesc =
USB_SIZEOF_QUALDESC, /* len */
USB_DESC_TYPE_DEVICEQUALIFIER, /* type */
{LSBYTE(0x0200), MSBYTE(0x0200) }, /* USB */
- USB_CLASS_VENDOR_SPEC, /* class */
+ USB_CLASS_VENDOR_SPEC, /* classid */
0, /* subclass */
0, /* protocol */
CONFIG_PL2303_EP0MAXPACKET, /* mxpacketsize */
diff --git a/nuttx/drivers/usbdev/usbmsc.c b/nuttx/drivers/usbdev/usbmsc.c
index 948b72fe6..51caeb431 100644
--- a/nuttx/drivers/usbdev/usbmsc.c
+++ b/nuttx/drivers/usbdev/usbmsc.c
@@ -139,7 +139,7 @@ static void usbmsc_disconnect(FAR struct usbdevclass_driver_s *driver,
/* Initialization/Uninitialization ******************************************/
static void usbmsc_lununinitialize(struct usbmsc_lun_s *lun);
-#ifndef CONFIG_USBMSC_COMPOSITE
+#ifdef CONFIG_USBMSC_COMPOSITE
static int usbmsc_exportluns(FAR void *handle);
#endif
@@ -1578,7 +1578,7 @@ int usbmsc_unbindlun(FAR void *handle, unsigned int lunno)
*
****************************************************************************/
-#ifndef CONFIG_USBMSC_COMPOSITE
+#ifdef CONFIG_USBMSC_COMPOSITE
static
#endif
int usbmsc_exportluns(FAR void *handle)
@@ -1708,7 +1708,6 @@ void usbmsc_uninitialize(FAR void *handle)
pthread_attr_t attr;
#endif
void *value;
- int ret;
int i;
#ifdef CONFIG_DEBUG
@@ -1743,7 +1742,7 @@ void usbmsc_uninitialize(FAR void *handle)
* garbage
*/
- ret = pthread_join(priv->thread, &value);
+ (void)pthread_join(priv->thread, &value);
}
priv->thread = 0;
diff --git a/nuttx/drivers/usbdev/usbmsc_descriptors.c b/nuttx/drivers/usbdev/usbmsc_descriptors.c
index 5d8efd448..8305a660a 100644
--- a/nuttx/drivers/usbdev/usbmsc_descriptors.c
+++ b/nuttx/drivers/usbdev/usbmsc_descriptors.c
@@ -77,7 +77,7 @@ static const struct usb_devdesc_s g_devdesc =
USB_SIZEOF_DEVDESC, /* len */
USB_DESC_TYPE_DEVICE, /* type */
{LSBYTE(0x0200), MSBYTE(0x0200)}, /* usb */
- USB_CLASS_PER_INTERFACE, /* class */
+ USB_CLASS_PER_INTERFACE, /* classid */
0, /* subclass */
0, /* protocol */
CONFIG_USBMSC_EP0MAXPACKET, /* maxpacketsize */
@@ -130,7 +130,7 @@ static const struct usb_ifdesc_s g_ifdesc =
USBMSC_INTERFACEID, /* ifno */
USBMSC_ALTINTERFACEID, /* alt */
USBMSC_NENDPOINTS, /* neps */
- USB_CLASS_MASS_STORAGE, /* class */
+ USB_CLASS_MASS_STORAGE, /* classid */
USBMSC_SUBCLASS_SCSI, /* subclass */
USBMSC_PROTO_BULKONLY, /* protocol */
USBMSC_INTERFACESTRID /* iif */
@@ -174,7 +174,7 @@ static const struct usb_qualdesc_s g_qualdesc =
LSBYTE(0x0200),
MSBYTE(0x0200)
},
- USB_CLASS_PER_INTERFACE, /* class */
+ USB_CLASS_PER_INTERFACE, /* classid */
0, /* subclass */
0, /* protocol */
CONFIG_USBMSC_EP0MAXPACKET, /* mxpacketsize */
diff --git a/nuttx/include/nuttx/usb/usb.h b/nuttx/include/nuttx/usb/usb.h
index 446acb4b2..b3c110dcd 100644
--- a/nuttx/include/nuttx/usb/usb.h
+++ b/nuttx/include/nuttx/usb/usb.h
@@ -1,8 +1,8 @@
/************************************************************************************
* include/nuttx/usb/usb.h
*
- * Copyright (C) 2008, 2009-2010 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008, 2009-2010, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -274,7 +274,7 @@ struct usb_devdesc_s
uint8_t len; /* Descriptor length */
uint8_t type; /* Descriptor type */
uint8_t usb[2]; /* USB version */
- uint8_t class; /* Device class */
+ uint8_t classid; /* Device class */
uint8_t subclass; /* Device sub-class */
uint8_t protocol; /* Device protocol */
uint8_t mxpacketsize; /* Max packet size (ep0) */
@@ -334,7 +334,7 @@ struct usb_ifdesc_s
uint8_t ifno; /* Interface number */
uint8_t alt; /* Alternate setting */
uint8_t neps; /* Number of endpoints */
- uint8_t class; /* Interface class */
+ uint8_t classid; /* Interface class */
uint8_t subclass; /* Interface sub-class */
uint8_t protocol; /* Interface protocol */
uint8_t iif; /* iInterface */
@@ -369,7 +369,7 @@ struct usb_qualdesc_s
uint8_t len; /* Descriptor length */
uint8_t type; /* Descriptor type */
uint8_t usb[2]; /* USB version */
- uint8_t class; /* Qualifier class */
+ uint8_t classid; /* Qualifier class */
uint8_t subclass; /* Qualifier sub-class */
uint8_t protocol; /* Qualifier protocol */
uint8_t mxpacketsize; /* Max packet size (ep0) */
@@ -394,7 +394,7 @@ struct usb_iaddesc_s
uint8_t type; /* Descriptor type */
uint8_t firstif; /* Number of first interface of the function */
uint8_t nifs; /* Number of interfaces associated with the function */
- uint8_t class; /* Class code*/
+ uint8_t classid; /* Class code */
uint8_t subclass; /* Sub-class code */
uint8_t protocol; /* Protocol code */
uint8_t ifunction; /* Index to string identifying the function */