diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-19 20:02:23 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-19 20:02:23 +0000 |
commit | 4e4397a64f8d2d45e529ec113e56652fc59e1db5 (patch) | |
tree | 6f1493fe70f7e5f2470d21cfbb711588e9da7506 /nuttx/graphics/nxbe | |
parent | 76bb5e20d25f228383f34c4a827303713553e838 (diff) | |
download | px4-nuttx-4e4397a64f8d2d45e529ec113e56652fc59e1db5.tar.gz px4-nuttx-4e4397a64f8d2d45e529ec113e56652fc59e1db5.tar.bz2 px4-nuttx-4e4397a64f8d2d45e529ec113e56652fc59e1db5.zip |
Fix issues detected by CppCheck tool
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3261 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics/nxbe')
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_closewindow.c | 8 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_colormap.c | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/nuttx/graphics/nxbe/nxbe_closewindow.c b/nuttx/graphics/nxbe/nxbe_closewindow.c index c5c15023c..7e7e3f45e 100644 --- a/nuttx/graphics/nxbe/nxbe_closewindow.c +++ b/nuttx/graphics/nxbe/nxbe_closewindow.c @@ -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? */ diff --git a/nuttx/graphics/nxbe/nxbe_colormap.c b/nuttx/graphics/nxbe/nxbe_colormap.c index f35393b20..31072fb16 100644 --- a/nuttx/graphics/nxbe/nxbe_colormap.c +++ b/nuttx/graphics/nxbe/nxbe_colormap.c @@ -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; } |