Fix issues detected by CppCheck tool

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3261 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-01-19 20:02:23 +00:00
parent f389facd71
commit 60c0de010a
14 changed files with 143 additions and 55 deletions
+5 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_closewindow.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-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
@@ -86,17 +86,19 @@
void nxbe_closewindow(struct nxbe_window_s *wnd)
{
FAR struct nxbe_state_s *be = wnd->be;
FAR struct nxbe_state_s *be;
#ifdef CONFIG_DEBUG
if (!wnd)
{
return;
}
#endif
be = wnd->be;
/* The background window should never be closed */
DEBUGASSERT(wnd != &be->bkgd);
#endif
/* Is there a window above the one being closed? */
+2 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_colormap.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-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
@@ -98,7 +98,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
size = 3 * CONFIG_NX_NCOLORS * sizeof(uint16_t);
alloc = (uint8_t*)malloc(size);
if (alloc < 0)
if (alloc == NULL)
{
return -ENOMEM;
}
+3 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxsu/nxsu_reportposition.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-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
@@ -79,7 +79,7 @@
void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
{
FAR struct nxbe_state_s *be = wnd->be;
FAR struct nxbe_state_s *be;
struct nxgl_size_s size;
#ifdef CONFIG_DEBUG
@@ -88,6 +88,7 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
return;
}
#endif
be = wnd->be;
/* This is very awkward in single user mode, but at least it is compatible.
* with the way things are done in multiple user mode.