diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 298724a51..60c6fcab0 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -358,7 +358,7 @@ static bool createStartWindow(void) g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); if (!g_nxwmtest.startwindow) { - gdbg("ERROR: Failed to instantiate CStartWindow\n"); + gerr("ERROR: Failed to instantiate CStartWindow\n"); delete window; return false; } diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index fa1f3f36d..b1c2b2f15 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -204,7 +204,7 @@ void CGraphicsPort::drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gdbg("INxWindow::fill failed\n"); + gerr("INxWindow::fill failed\n"); } } @@ -234,7 +234,7 @@ void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gdbg("INxWindow::fill failed\n"); + gerr("INxWindow::fill failed\n"); } } @@ -263,7 +263,7 @@ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, if (!m_pNxWnd->drawLine(&vector, 1, color, caps)) { - gdbg("INxWindow::drawLine failed\n"); + gerr("INxWindow::drawLine failed\n"); } } diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 8736f20a2..a1fd45e1b 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -144,7 +144,7 @@ bool CNxServer::connect(void) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return false; } @@ -158,7 +158,7 @@ bool CNxServer::connect(void) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("board_lcd_initialize failed: %d\n", -ret); + gerr("board_lcd_initialize failed: %d\n", -ret); return false; } @@ -167,7 +167,7 @@ bool CNxServer::connect(void) m_hDevice = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!m_hDevice) { - gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return false; } @@ -184,14 +184,14 @@ bool CNxServer::connect(void) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("up_fbinitialize failed: %d\n", -ret); + gerr("up_fbinitialize failed: %d\n", -ret); return false; } m_hDevice = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!m_hDevice) { - gdbg("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", + gerr("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return false; } @@ -203,7 +203,7 @@ bool CNxServer::connect(void) m_hNxServer = nx_open(m_hDevice); if (!m_hNxServer) { - gdbg("CNxServer::connect: nx_open failed: %d\n", errno); + gerr("CNxServer::connect: nx_open failed: %d\n", errno); return false; } @@ -213,7 +213,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); disconnect(); return false; } @@ -240,7 +240,7 @@ bool CNxServer::connect(void) ret = sched_setparam(0, ¶m); if (ret < 0) { - gdbg("CNxServer::connect: sched_setparam failed: %d\n" , ret); + gerr("CNxServer::connect: sched_setparam failed: %d\n" , ret); return false; } @@ -253,7 +253,7 @@ bool CNxServer::connect(void) (FAR char * const *)0); if (serverId < 0) { - gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + gerr("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); return false; } @@ -276,7 +276,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -298,7 +298,7 @@ bool CNxServer::connect(void) ret = pthread_create(&thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gdbg("NxServer::connect: pthread_create failed: %d\n", ret); + gerr("NxServer::connect: pthread_create failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -329,7 +329,7 @@ bool CNxServer::connect(void) } else { - gdbg("NxServer::connect: nx_connect failed: %d\n", errno); + gerr("NxServer::connect: nx_connect failed: %d\n", errno); return false; } @@ -412,7 +412,7 @@ int CNxServer::server(int argc, char *argv[]) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return EXIT_FAILURE; } @@ -424,7 +424,7 @@ int CNxServer::server(int argc, char *argv[]) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("board_lcd_initialize failed: %d\n", -ret); + gerr("board_lcd_initialize failed: %d\n", -ret); return EXIT_FAILURE; } @@ -433,7 +433,7 @@ int CNxServer::server(int argc, char *argv[]) dev = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!dev) { - gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return EXIT_FAILURE; } @@ -447,14 +447,14 @@ int CNxServer::server(int argc, char *argv[]) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("nxterm_server: up_fbinitialize failed: %d\n", -ret); + gerr("nxterm_server: up_fbinitialize failed: %d\n", -ret); return EXIT_FAILURE; } dev = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!dev) { - gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); + gerr("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return 2; } @@ -497,7 +497,7 @@ FAR void *CNxServer::listener(FAR void *arg) // An error occurred... assume that we have lost connection with // the server. - gdbg("Lost server connection: %d\n", errno); + gerr("Lost server connection: %d\n", errno); break; } diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index 5a08a6f52..b0f907ddf 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -162,7 +162,7 @@ void CNxTimer::start(void) if (ret < 0) { - gdbg("work_queue failed: %d\n", ret); + gerr("work_queue failed: %d\n", ret); } m_isRunning = true; @@ -181,7 +181,7 @@ void CNxTimer::stop(void) if (ret < 0) { - gdbg("work_cancel failed: %d\n", ret); + gerr("work_cancel failed: %d\n", ret); } m_isRunning = false; diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index eb8217434..376a47f42 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -249,7 +249,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color1; if (!rowColor(m_rowCache[0], column, color1)) { - gdbg("ERROR rowColor failed for the first row\n"); + gerr("ERROR rowColor failed for the first row\n"); return false; } @@ -258,7 +258,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color2; if (!rowColor(m_rowCache[1], column, color2)) { - gdbg("ERROR rowColor failed for the second row\n"); + gerr("ERROR rowColor failed for the second row\n"); return false; } @@ -389,7 +389,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } } @@ -408,7 +408,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[0])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } @@ -425,7 +425,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } } diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index cf691b81e..4e2a468f9 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -82,8 +82,8 @@ */ #ifndef CONFIG_DEBUG_INPUT -# undef idbg -# define idbg gdbg +# undef ierr +# define ierr gerr # undef iinfo # define iinfo ginfo #endif @@ -434,7 +434,7 @@ bool CCalibration::createWidgets(void) CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR failed to create font\n"); + gerr("ERROR failed to create font\n"); return false; } @@ -447,7 +447,7 @@ bool CCalibration::createWidgets(void) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gdbg("ERROR: Failed to get window size\n"); + gerr("ERROR: Failed to get window size\n"); delete m_font; m_font = (NXWidgets::CNxFont *)0; return false; @@ -486,7 +486,7 @@ bool CCalibration::createWidgets(void) if (!m_text) { - gdbg("ERROR: Failed to create CLabel\n"); + gerr("ERROR: Failed to create CLabel\n"); delete m_font; m_font = (NXWidgets::CNxFont *)0; return false; @@ -539,7 +539,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) if (isRunning()) { - gdbg("The calibration thread is already running\n"); + gerr("The calibration thread is already running\n"); return false; } @@ -563,7 +563,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) int ret = pthread_create(&m_thread, &attr, calibration, (FAR void *)this); if (ret != 0) { - gdbg("pthread_create failed: %d\n", ret); + gerr("pthread_create failed: %d\n", ret); return false; } @@ -589,7 +589,7 @@ FAR void *CCalibration::calibration(FAR void *arg) if (!This->createWidgets()) { - gdbg("ERROR failed to create widgets\n"); + gerr("ERROR failed to create widgets\n"); return false; } @@ -1112,7 +1112,7 @@ void CCalibration::finishCalibration(void) sizeof(struct SCalibrationData)); if (ret != 0) { - gdbg("ERROR: Failed to save calibration data\n"); + gerr("ERROR: Failed to save calibration data\n"); } #endif // And provide the calibration data to the touchscreen, enabling @@ -1152,7 +1152,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gdbg("NXWidgets::INxWindow::getSize failed\n"); + gerr("NXWidgets::INxWindow::getSize failed\n"); return false; } @@ -1173,7 +1173,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - idbg("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); + ierr("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1184,7 +1184,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - idbg("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); + ierr("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1202,7 +1202,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - idbg("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); + ierr("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1213,7 +1213,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - idbg("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); + ierr("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions @@ -1241,7 +1241,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - idbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + ierr("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); // Similarly for Y // @@ -1262,7 +1262,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - idbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + ierr("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); #endif return true; @@ -1294,7 +1294,7 @@ IApplication *CCalibrationFactory::create(void) CFullScreenWindow *window = m_taskbar->openFullScreenWindow(); if (!window) { - gdbg("ERROR: Failed to create CFullScreenWindow\n"); + gerr("ERROR: Failed to create CFullScreenWindow\n"); return (IApplication *)0; } @@ -1302,7 +1302,7 @@ IApplication *CCalibrationFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CFullScreenWindow \n"); + gerr("ERROR: Failed to open CFullScreenWindow \n"); delete window; return (IApplication *)0; } @@ -1313,7 +1313,7 @@ IApplication *CCalibrationFactory::create(void) CCalibration *calibration = new CCalibration(m_taskbar, window, m_touchscreen); if (!calibration) { - gdbg("ERROR: Failed to instantiate CCalibration\n"); + gerr("ERROR: Failed to instantiate CCalibration\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index d0a4eb285..aa8dbc5b0 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -323,7 +323,7 @@ bool CHexCalculator::run(void) if (!createCalculator()) { - gdbg("ERROR: Failed to create widgets\n"); + gerr("ERROR: Failed to create widgets\n"); return false; } @@ -505,7 +505,7 @@ bool CHexCalculator::createCalculator(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR failed to create font\n"); + gerr("ERROR failed to create font\n"); return false; } @@ -522,7 +522,7 @@ bool CHexCalculator::createCalculator(void) m_buttonSize.w, m_buttonSize.h); if (!m_keypad) { - gdbg("ERROR: Failed to create CButtonArray\n"); + gerr("ERROR: Failed to create CButtonArray\n"); return false; } @@ -548,7 +548,7 @@ bool CHexCalculator::createCalculator(void) "0"); if (!m_text) { - gdbg("ERROR: Failed to create CLabel\n"); + gerr("ERROR: Failed to create CLabel\n"); return false; } @@ -658,7 +658,7 @@ int64_t CHexCalculator::evaluateBinaryOperation(uint8_t operation, int64_t value return value1 + value2; default: - gdbg("ERROR: Unexpected pending operation %d\n", operation); + gerr("ERROR: Unexpected pending operation %d\n", operation); return 0; } } @@ -945,7 +945,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) case KEY_NONE: default: - gdbg("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); + gerr("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); break; } @@ -978,7 +978,7 @@ IApplication *CHexCalculatorFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - gdbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -986,7 +986,7 @@ IApplication *CHexCalculatorFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -997,7 +997,7 @@ IApplication *CHexCalculatorFactory::create(void) CHexCalculator *hexCalculator = new CHexCalculator(m_taskbar, window); if (!hexCalculator) { - gdbg("ERROR: Failed to instantiate CHexCalculator\n"); + gerr("ERROR: Failed to instantiate CHexCalculator\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index 7ca1d9610..23631007c 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -130,7 +130,7 @@ bool CKeyboard::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gdbg("CKeyboard::start: pthread_create failed: %d\n", ret); + gerr("CKeyboard::start: pthread_create failed: %d\n", ret); return false; } @@ -219,7 +219,7 @@ int CKeyboard::open(void) // Let the top-level logic decide what it wants to do // about all really bad things - gdbg("ERROR: Failed to open %s for reading: %d\n", + gerr("ERROR: Failed to open %s for reading: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); return -errcode; } @@ -276,12 +276,12 @@ int CKeyboard::session(void) // Let the top-level listener logic decide what to do about // the read failure. - gdbg("ERROR: read %s failed: %d\n", + gerr("ERROR: read %s failed: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); return -errcode; } - fdbg("Awakened with EINTR\n"); + ferr("Awakened with EINTR\n"); } // Give the keyboard input to NX @@ -298,7 +298,7 @@ int CKeyboard::session(void) int ret = nx_kbdin(handle, (uint8_t)nbytes, rxbuffer); if (ret < 0) { - gdbg("ERROR: nx_kbdin failed: %d\n", ret); + gerr("ERROR: nx_kbdin failed: %d\n", ret); //break; ignore the error } } @@ -345,7 +345,7 @@ FAR void *CKeyboard::listener(FAR void *arg) This->m_kbdFd = This->open(); if (This->m_kbdFd < 0) { - gdbg("ERROR: open failed: %d\n", This->m_kbdFd); + gerr("ERROR: open failed: %d\n", This->m_kbdFd); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); return (FAR void *)0; @@ -370,7 +370,7 @@ FAR void *CKeyboard::listener(FAR void *arg) #ifdef CONFIG_NXWM_KEYBOARD_USBHOST if (ret < 0) { - fdbg("ERROR: CKeyboard::session() returned %d\n", ret); + ferr("ERROR: CKeyboard::session() returned %d\n", ret); } #else // No errors from session() are expected diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index ad72e383f..e6c075e06 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -65,13 +65,13 @@ /* We want debug output from this file if either audio or graphics debug is enabled. */ #if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef dbg +# undef gerr # undef info # ifdef CONFIG_CPP_HAVE_VARARGS -# define dbg(x...) +# define gerr(x...) # define info(x...) # else -# define dbg (void) +# define gerr (void) # define info (void) # endif #endif @@ -312,7 +312,7 @@ bool CMediaPlayer::run(void) if (!configureNxPlayer()) { - dbg("ERROR: Failed to configure NxPlayer\n"); + gerr("ERROR: Failed to configure NxPlayer\n"); return false; } @@ -320,7 +320,7 @@ bool CMediaPlayer::run(void) if (!createPlayer()) { - dbg("ERROR: Failed to create widgets\n"); + gerr("ERROR: Failed to create widgets\n"); return false; } } @@ -442,7 +442,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (!filePath) { - dbg("ERROR: Failed to allocate file path\n"); + gerr("ERROR: Failed to allocate file path\n"); return false; } @@ -460,7 +460,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (ret < 0) { int errcode = errno; - dbg("ERROR: Could not stat file %s: %d\n", filePath, errcode); + gerr("ERROR: Could not stat file %s: %d\n", filePath, errcode); UNUSED(errcode); // Make sure there is no previous file information @@ -472,7 +472,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (S_ISDIR(buf.st_mode) || S_ISBLK(buf.st_mode)) { - dbg("ERROR: Not a regular file\n"); + gerr("ERROR: Not a regular file\n"); // Make sure there is no previous file information @@ -503,7 +503,7 @@ void CMediaPlayer::stopPlaying(void) int ret = nxplayer_stop(m_player); if (ret < 0) { - auddbg("ERROR: nxplayer_stop failed: %d\n", ret); + auderr("ERROR: nxplayer_stop failed: %d\n", ret); } #endif @@ -659,7 +659,7 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) { // Device doesn't exit. Report an error - dbg("ERROR: Device %s not found\n", devPath); + gerr("ERROR: Device %s not found\n", devPath); return false; } @@ -667,13 +667,13 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) if (ret == -ENODEV) { - dbg("ERROR: Device %s is not an audio device\n", devPath); + gerr("ERROR: Device %s is not an audio device\n", devPath); return false; } if (ret < 0) { - dbg("ERROR: Error selecting device %s\n", devPath); + gerr("ERROR: Error selecting device %s\n", devPath); return false; } @@ -694,7 +694,7 @@ bool CMediaPlayer::configureNxPlayer(void) m_player = nxplayer_create(); if (!m_player) { - dbg("ERROR: Failed get NxPlayer handle\n"); + gerr("ERROR: Failed get NxPlayer handle\n"); return false; } @@ -703,7 +703,7 @@ bool CMediaPlayer::configureNxPlayer(void) if (!setDevice(CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE)) { - dbg("ERROR: Failed select NxPlayer audio device\n"); + gerr("ERROR: Failed select NxPlayer audio device\n"); return false; } #endif @@ -725,7 +725,7 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - dbg("ERROR: Failed to create font\n"); + gerr("ERROR: Failed to create font\n"); return false; } @@ -746,7 +746,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_playBitmap || !m_pauseBitmap || !m_rewindBitmap || !m_fforwardBitmap || !m_volumeBitmap) { - dbg("ERROR: Failed to one or more bitmaps\n"); + gerr("ERROR: Failed to one or more bitmaps\n"); return false; } @@ -796,7 +796,7 @@ bool CMediaPlayer::createPlayer(void) m_listbox = new NXWidgets::CListBox(control, 0, 0, m_windowSize.w, listHeight); if (!m_listbox) { - dbg("ERROR: Failed to create CListBox\n"); + gerr("ERROR: Failed to create CListBox\n"); return false; } @@ -877,7 +877,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_play) { - dbg("ERROR: Failed to create play control\n"); + gerr("ERROR: Failed to create play control\n"); return false; } @@ -904,7 +904,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_pause) { - dbg("ERROR: Failed to create pause control\n"); + gerr("ERROR: Failed to create pause control\n"); return false; } @@ -934,7 +934,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_rewind) { - dbg("ERROR: Failed to create rewind control\n"); + gerr("ERROR: Failed to create rewind control\n"); return false; } @@ -966,7 +966,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_fforward) { - dbg("ERROR: Failed to create fast forward control\n"); + gerr("ERROR: Failed to create fast forward control\n"); return false; } @@ -1007,7 +1007,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_volume) { - dbg("ERROR: Failed to create volume control\n"); + gerr("ERROR: Failed to create volume control\n"); return false; } @@ -1422,7 +1422,7 @@ void CMediaPlayer::setVolumeLevel(void) int newLevel = m_volume->getValue(); if (newLevel < 0 || newLevel > 100) { - dbg("ERROR: volume is out of range: %d\n", newLevel); + gerr("ERROR: volume is out of range: %d\n", newLevel); } // Has the volume level changed? @@ -1434,7 +1434,7 @@ void CMediaPlayer::setVolumeLevel(void) int ret = nxplayer_setvolume(m_player, (uint16_t)newLevel); if (ret < OK) { - dbg("ERROR: nxplayer_setvolume failed: %d\n", ret); + gerr("ERROR: nxplayer_setvolume failed: %d\n", ret); } else { @@ -1506,7 +1506,7 @@ void CMediaPlayer::checkFileSelection(void) // The play button will be disabled because m_fileReady is false. // No harm done if we were already STOPPED. - dbg("ERROR: getMediaFile failed\n"); + gerr("ERROR: getMediaFile failed\n"); setMediaPlayerState(MPLAYER_STOPPED); } else @@ -1628,7 +1628,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_rewind failed: %d\n", ret); + gerr("ERROR: nxplayer_rewind failed: %d\n", ret); } // Update the speed indicator @@ -1647,7 +1647,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_rewind failed: %d\n", ret); + gerr("ERROR: nxplayer_rewind failed: %d\n", ret); } else { @@ -1678,7 +1678,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_fforward failed: %d\n", ret); + gerr("ERROR: nxplayer_fforward failed: %d\n", ret); } // Update the speed indicator @@ -1697,7 +1697,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_fforward failed: %d\n", ret); + gerr("ERROR: nxplayer_fforward failed: %d\n", ret); } else { @@ -1734,7 +1734,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_resume(m_player); if (ret < 0) { - dbg("ERROR: nxplayer_resume() failed: %d\n", ret); + gerr("ERROR: nxplayer_resume() failed: %d\n", ret); } else { @@ -1757,7 +1757,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) if (!filePath) { - dbg("ERROR: Failed to allocate file path\n"); + gerr("ERROR: Failed to allocate file path\n"); return; } @@ -1769,7 +1769,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) AUDIO_FMT_UNDEF, AUDIO_FMT_UNDEF); if (ret < 0) { - dbg("ERROR: nxplayer_playfile %s failed: %d\n", filePath, ret); + gerr("ERROR: nxplayer_playfile %s failed: %d\n", filePath, ret); } else { @@ -1796,7 +1796,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + gerr("ERROR: nxplayer_cancel_motion failed: %d\n", ret); } else { @@ -1826,7 +1826,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_pause(m_player); if (ret < 0) { - dbg("ERROR: nxplayer_pause() failed: %d\n", ret); + gerr("ERROR: nxplayer_pause() failed: %d\n", ret); } else { @@ -1849,7 +1849,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + gerr("ERROR: nxplayer_cancel_motion failed: %d\n", ret); } else { @@ -1912,7 +1912,7 @@ IApplication *CMediaPlayerFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - dbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -1920,7 +1920,7 @@ IApplication *CMediaPlayerFactory::create(void) if (!window->open()) { - dbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -1931,7 +1931,7 @@ IApplication *CMediaPlayerFactory::create(void) CMediaPlayer *mediaPlayer = new CMediaPlayer(m_taskbar, window); if (!mediaPlayer) { - dbg("ERROR: Failed to instantiate CMediaPlayer\n"); + gerr("ERROR: Failed to instantiate CMediaPlayer\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index 84fc69109..da2a249d5 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -207,7 +207,7 @@ bool CNxTerm::run(void) if (m_pid >= 0 || m_nxterm != 0) { - gdbg("ERROR: All ready running or connected\n"); + gerr("ERROR: All ready running or connected\n"); return false; } @@ -217,7 +217,7 @@ bool CNxTerm::run(void) { // This might fail if a signal is received while we are waiting. - gdbg("ERROR: Failed to get semaphore\n"); + gerr("ERROR: Failed to get semaphore\n"); return false; } @@ -259,7 +259,7 @@ bool CNxTerm::run(void) bool result = true; if (m_pid < 0) { - gdbg("ERROR: Failed to create the NxTerm task\n"); + gerr("ERROR: Failed to create the NxTerm task\n"); result = false; } else @@ -290,7 +290,7 @@ bool CNxTerm::run(void) // sem_timedwait failed OR the NxTerm task reported a // failure. Stop the application - gdbg("ERROR: Failed start the NxTerm task\n"); + gerr("ERROR: Failed start the NxTerm task\n"); stop(); result = false; } @@ -430,7 +430,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) if (on_exit(exitHandler, g_nxtermvars.console) != 0) { - gdbg("ERROR: on_exit failed\n"); + gerr("ERROR: on_exit failed\n"); goto errout; } @@ -440,7 +440,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) g_nxtermvars.minor); if (!g_nxtermvars.nxterm) { - gdbg("ERROR: Failed register the console device\n"); + gerr("ERROR: Failed register the console device\n"); goto errout; } @@ -462,7 +462,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) #endif if (fd < 0) { - gdbg("ERROR: Failed open the console device\n"); + gerr("ERROR: Failed open the console device\n"); goto errout_with_nxterm; } @@ -591,7 +591,7 @@ IApplication *CNxTermFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - gdbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -599,7 +599,7 @@ IApplication *CNxTermFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -610,7 +610,7 @@ IApplication *CNxTermFactory::create(void) CNxTerm *nxterm = new CNxTerm(m_taskbar, window); if (!nxterm) { - gdbg("ERROR: Failed to instantiate CNxTerm\n"); + gerr("ERROR: Failed to instantiate CNxTerm\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 41d383fb1..d362aa8fc 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -67,13 +67,13 @@ */ #if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef dbg +# undef gerr # undef info # ifdef CONFIG_CPP_HAVE_VARARGS -# define dbg(x...) +# define gerr(x...) # define info(x...) # else -# define dbg (void) +# define gerr (void) # define info (void) # endif #endif @@ -170,7 +170,7 @@ bool CTouchscreen::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - dbg("CTouchscreen::start: pthread_create failed: %d\n", ret); + gerr("CTouchscreen::start: pthread_create failed: %d\n", ret); return false; } @@ -285,7 +285,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { - dbg("ERROR Failed initialize the touchscreen device: %d\n", errno); + gerr("ERROR Failed initialize the touchscreen device: %d\n", errno); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); return (FAR void *)0; @@ -297,7 +297,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) This->m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); if (This->m_touchFd < 0) { - dbg("ERROR Failed to open %s for reading: %d\n", + gerr("ERROR Failed to open %s for reading: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errno); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); @@ -358,7 +358,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) #ifdef CONFIG_DEBUG_FEATURES int errval = errno; - dbg("read %s failed: %d\n", + gerr("read %s failed: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errval); DEBUGASSERT(errval == EINTR); #endif @@ -377,7 +377,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) } else { - dbg("ERROR Unexpected read size=%d, expected=%d\n", + gerr("ERROR Unexpected read size=%d, expected=%d\n", nbytes, sizeof(struct touch_sample_s)); } } diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 2ffc309b3..7a003d6db 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -125,7 +125,7 @@ void CWindowMessenger::handleMouseEvent(void) int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -143,7 +143,7 @@ void CWindowMessenger::handleKeyboardEvent(void) int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -173,7 +173,7 @@ void CWindowMessenger::handleBlockedEvent(FAR void *arg) int ret = work_queue(USRWORK, &state->work, &destroyWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } @@ -196,7 +196,7 @@ void CWindowMessenger::destroyWorkCallback(FAR void *arg) // Then release the memory. - gdbg("Deleting app=%p\n", state->instance); + gerr("Deleting app=%p\n", state->instance); IApplication *app = (IApplication *)state->instance; delete app; delete state;