diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-19 21:17:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-19 21:17:37 +0000 |
commit | a6755a8af06d2602b771e41aab8db262fd3184ec (patch) | |
tree | a65a82dbba91cac2b42f8d73e6d96d701e473847 /nuttx | |
parent | e6c2f9b9de21f1281370f850cac367897eba9c60 (diff) | |
download | px4-nuttx-a6755a8af06d2602b771e41aab8db262fd3184ec.tar.gz px4-nuttx-a6755a8af06d2602b771e41aab8db262fd3184ec.tar.bz2 px4-nuttx-a6755a8af06d2602b771e41aab8db262fd3184ec.zip |
Fix more issues detected by CppCheck tool
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3264 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 2 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 4 | ||||
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_skeleton.c | 2 | ||||
-rw-r--r-- | nuttx/sched/mq_initialize.c | 6 | ||||
-rw-r--r-- | nuttx/sched/pthread_mutexinit.c | 10 |
5 files changed, 14 insertions, 10 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 4f838a08e..a00a7e9f2 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1435,3 +1435,5 @@ class driver. * configs/olimex-lpc1766stk/hidkbd - Added a configuration to build the USB host HID keyboard class driver test for the LPC17xx. + * Ran the tool CppCheck (http://sourceforge.net/apps/mediawiki/cppcheck) and + fixed several errors in the code identified by the tool.
\ No newline at end of file diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 192f9b79c..692752ae8 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@ <tr align="center" bgcolor="#e4e4e4"> <td> <h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1> - <p>Last Updated: January 18, 2011</p> + <p>Last Updated: January 19, 2011</p> </td> </tr> </table> @@ -2116,6 +2116,8 @@ nuttx-5.17 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> class driver. * configs/olimex-lpc1766stk/hidkbd - Added a configuration to build the USB host HID keyboard class driver test for the LPC17xx. + * Ran the tool CppCheck (http://sourceforge.net/apps/mediawiki/cppcheck) and + fixed several errors in the code identified by the tool. pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c index 81fbf5e7a..efb7a58ba 100644 --- a/nuttx/drivers/usbhost/usbhost_skeleton.c +++ b/nuttx/drivers/usbhost/usbhost_skeleton.c @@ -614,7 +614,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, static inline int usbhost_devinit(FAR struct usbhost_state_s *priv) { - int ret; + int ret = OK; /* Set aside a transfer buffer for exclusive use by the class driver */ diff --git a/nuttx/sched/mq_initialize.c b/nuttx/sched/mq_initialize.c index 2fcd304dd..2e85e148c 100644 --- a/nuttx/sched/mq_initialize.c +++ b/nuttx/sched/mq_initialize.c @@ -1,7 +1,7 @@ /************************************************************************ * sched/mq_initialize.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -210,8 +210,8 @@ void mq_initialize(void) * Function: mq_desblockalloc * * Description: - * Allocate a block of message descriptors and place them - * on the free list. + * Allocate a block of message descriptors and place them on the free + * list. * * Inputs: * None diff --git a/nuttx/sched/pthread_mutexinit.c b/nuttx/sched/pthread_mutexinit.c index 60a095caf..6004076cb 100644 --- a/nuttx/sched/pthread_mutexinit.c +++ b/nuttx/sched/pthread_mutexinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_mutexinit.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -124,14 +124,14 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR pthread_mutexattr_t *attr { ret = EINVAL; } - } - /* Set up attributes unique to the mutex type */ + /* Set up attributes unique to the mutex type */ #ifdef CONFIG_MUTEX_TYPES - mutex->type = type; - mutex->nlocks = 0; + mutex->type = type; + mutex->nlocks = 0; #endif + } sdbg("Returning %d\n", ret); return ret; |