+2020-06-21 Keith Marshall <keith@users.osdn.me>
+
+ Ensure non-void functions always return explicit values.
+
+ * src/guimain.cpp (WinMain): Remove explicit EXIT_FAILURE returns from
+ individual exception handlers; relocate it to the default execution
+ path, to which all such handlers will fall through.
+
+ * src/dmhguix.cpp (dmhTypeGUI::notify) [DMH_COMPILE_DIGEST]: Return
+ number of bytes added to message queue; fall through, to return zero,
+ on failure to extend the queue.
+
2020-06-20 Keith Marshall <keith@users.osdn.me>
Simplify numeric argument interpreter function.
*
* $Id$
*
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009-2013, MinGW.org Project
+ * Written by Keith Marshall <keith@users.osdn.me>
+ * Copyright (C) 2009-2013, 2020, MinGW.org Project
*
*
* Implementation of GUI specific API extensions, providing support
* to the buffered collection.
*/
msglen += vsprintf( (msgbuf = newbuf) + msglen, fmt, argv );
+ return newlen - 1;
}
}
else if( (msgbuf = (char *)(malloc( newlen ))) != NULL )
mode = code | (mode & ~DMH_SEVERITY_MASK);
return dispatch_message( vsprintf( msgbuf, fmt, argv ) );
}
+ /* If we get to here, then no message was dispatched; the
+ * effective message length should be returned as zero.
+ */
+ return 0;
}
static inline HWND last_active_popup( HWND owner )
*
* $Id$
*
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2012, 2013, MinGW.org Project
+ * Written by Keith Marshall <keith@users.osdn.me>
+ * Copyright (C) 2012, 2013, 2020, MinGW.org Project
*
*
* Implementation of the WinMain() function, providing the program
* and identified by the diagnostic message handler...
*/
MessageBox( NULL, e.what(), "WinMain", MB_ICONERROR );
- return EXIT_FAILURE;
}
catch( runtime_error &e )
{
* processing of its message loop...
*/
MessageBox( NULL, e.what(), "WinMain", MB_ICONERROR );
- return EXIT_FAILURE;
}
catch(...)
{ /* ...and here, we diagnose any other error which we weren't
* able to explicitly identify.
*/
MessageBox( NULL, "Unknown exception", "WinMain", MB_ICONERROR );
- return EXIT_FAILURE;
}
+ return EXIT_FAILURE;
}
/* $RCSfile$: end of file */