diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-04 12:57:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-04 12:57:22 +0000 |
commit | 05d31bd06816565ec8af26885ecaa26851851e18 (patch) | |
tree | e9267ad7e7f24d444cb8c8fd290e24e6c1f88c99 /nuttx/examples/nx/nx_main.c | |
parent | 01fab0c78eeef5461a896847f05caec51d26050f (diff) | |
download | px4-nuttx-05d31bd06816565ec8af26885ecaa26851851e18.tar.gz px4-nuttx-05d31bd06816565ec8af26885ecaa26851851e18.tar.bz2 px4-nuttx-05d31bd06816565ec8af26885ecaa26851851e18.zip |
Removed superfluous toolbar handle
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1412 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nx/nx_main.c')
-rw-r--r-- | nuttx/examples/nx/nx_main.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/nuttx/examples/nx/nx_main.c b/nuttx/examples/nx/nx_main.c index ed7b7a3bb..bc4bd0abe 100644 --- a/nuttx/examples/nx/nx_main.c +++ b/nuttx/examples/nx/nx_main.c @@ -256,18 +256,18 @@ static inline int nxeg_setposition(NXTKWINDOW hwnd, FAR struct nxgl_point_s *pos ****************************************************************************/ #ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS -static inline NXTKTOOLBAR nxeq_opentoolbar(NXTKWINDOW hwnd, nxgl_coord_t height, - FAR const struct nx_callback_s *cb, - FAR void *arg) +static inline int nxeq_opentoolbar(NXTKWINDOW hwnd, nxgl_coord_t height, + FAR const struct nx_callback_s *cb, + FAR void *arg) { - NXTKTOOLBAR htb; - htb = nxtk_opentoolbar(hwnd, height, cb, arg); - if (!htb < 0) + int ret; + ret = nxtk_opentoolbar(hwnd, height, cb, arg); + if (ret < 0) { message("user_start: nxtk_opentoolbar failed: %d\n", errno); g_exitcode = NXEXIT_NXOPENTOOLBAR; } - return htb; + return ret; } #endif @@ -505,8 +505,6 @@ int user_start(int argc, char *argv[]) #else NXTKWINDOW hwnd1; NXTKWINDOW hwnd2; - NXTKTOOLBAR htb1; - NXTKTOOLBAR htb2; #endif struct nxgl_size_s size; struct nxgl_point_s pt; @@ -595,8 +593,8 @@ int user_start(int argc, char *argv[]) #ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS message("user_start: Add toolbar to window #1\n"); - htb1 = nxeq_opentoolbar(hwnd1, CONFIG_TOOLBAR_HEIGHT, &g_tbcb, (FAR void*)1); - if (!htb1) + ret = nxeq_opentoolbar(hwnd1, CONFIG_TOOLBAR_HEIGHT, &g_tbcb, (FAR void*)1); + if (ret < 0) { goto errout_with_hwnd1; } @@ -655,8 +653,8 @@ int user_start(int argc, char *argv[]) #ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS message("user_start: Add toolbar to window #2\n"); - htb2 = nxeq_opentoolbar(hwnd2, CONFIG_TOOLBAR_HEIGHT, &g_tbcb, (FAR void*)2); - if (!htb2) + ret = nxeq_opentoolbar(hwnd2, CONFIG_TOOLBAR_HEIGHT, &g_tbcb, (FAR void*)2); + if (ret < 0) { goto errout_with_hwnd2; } |