summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_sscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/lib/lib_sscanf.c')
-rw-r--r--nuttx/lib/lib_sscanf.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/nuttx/lib/lib_sscanf.c b/nuttx/lib/lib_sscanf.c
index e06839f47..b02515da7 100644
--- a/nuttx/lib/lib_sscanf.c
+++ b/nuttx/lib/lib_sscanf.c
@@ -1,7 +1,7 @@
-/************************************************************
+/****************************************************************************
* lib_sscanf.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <nuttx/compiler.h>
#include <sys/types.h>
@@ -45,51 +45,51 @@
#include <ctype.h>
#include <debug.h>
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
#define MAXLN 128
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Function Prototypes
- ************************************************************/
+ ****************************************************************************/
int vsscanf(char *buf, const char *s, va_list ap);
-/**********************************************************
+/**************************************************************************
* Global Constant Data
- **********************************************************/
+ **************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/**********************************************************
+/**************************************************************************
* Private Constant Data
- **********************************************************/
+ **************************************************************************/
static const char spaces[] = " \t\n\r\f\v";
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sscanf
*
* Description:
* ANSI standard sscanf implementation.
*
- ************************************************************/
+ ****************************************************************************/
int sscanf(const char *buf, const char *fmt, ...)
{
@@ -103,13 +103,13 @@ int sscanf(const char *buf, const char *fmt, ...)
} /* end sscanf */
-/************************************************************
+/****************************************************************************
* Function: vsscanf
*
* Description:
* ANSI standard vsscanf implementation.
*
- ************************************************************/
+ ****************************************************************************/
int vsscanf(char *buf, const char *s, va_list ap)
{
int count;
@@ -261,7 +261,9 @@ int vsscanf(char *buf, const char *s, va_list ap)
else if (*s == 'f')
{
#if 1
-# warning "No floating point conversions"
+# ifdef CONFIG_CPP_HAVE_WARNING
+# warning "No floating point conversions"
+# endif
void *pv = va_arg(ap, void*);
lvdbg("vsscanf: Return 0.0 to %p\n", pv);