• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.OSDN Installation Manager Tool


Commit MetaInfo

Révision2e5e8d50c4490b32b666efc42a7ea07b6e890f82 (tree)
l'heure2020-06-21 20:31:36
AuteurKeith Marshall <keith@user...>
CommiterKeith Marshall

Message de Log

Ensure non-void functions always return explicit values.

Change Summary

Modification

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
1+2020-06-21 Keith Marshall <keith@users.osdn.me>
2+
3+ Ensure non-void functions always return explicit values.
4+
5+ * src/guimain.cpp (WinMain): Remove explicit EXIT_FAILURE returns from
6+ individual exception handlers; relocate it to the default execution
7+ path, to which all such handlers will fall through.
8+
9+ * src/dmhguix.cpp (dmhTypeGUI::notify) [DMH_COMPILE_DIGEST]: Return
10+ number of bytes added to message queue; fall through, to return zero,
11+ on failure to extend the queue.
12+
113 2020-06-20 Keith Marshall <keith@users.osdn.me>
214
315 Simplify numeric argument interpreter function.
--- a/src/dmhguix.cpp
+++ b/src/dmhguix.cpp
@@ -3,8 +3,8 @@
33 *
44 * $Id$
55 *
6- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
7- * Copyright (C) 2009-2013, MinGW.org Project
6+ * Written by Keith Marshall <keith@users.osdn.me>
7+ * Copyright (C) 2009-2013, 2020, MinGW.org Project
88 *
99 *
1010 * Implementation of GUI specific API extensions, providing support
@@ -395,6 +395,7 @@ int dmhTypeGUI::notify( const dmh_severity code, const char *fmt, va_list argv )
395395 * to the buffered collection.
396396 */
397397 msglen += vsprintf( (msgbuf = newbuf) + msglen, fmt, argv );
398+ return newlen - 1;
398399 }
399400 }
400401 else if( (msgbuf = (char *)(malloc( newlen ))) != NULL )
@@ -406,6 +407,10 @@ int dmhTypeGUI::notify( const dmh_severity code, const char *fmt, va_list argv )
406407 mode = code | (mode & ~DMH_SEVERITY_MASK);
407408 return dispatch_message( vsprintf( msgbuf, fmt, argv ) );
408409 }
410+ /* If we get to here, then no message was dispatched; the
411+ * effective message length should be returned as zero.
412+ */
413+ return 0;
409414 }
410415
411416 static inline HWND last_active_popup( HWND owner )
--- a/src/guimain.cpp
+++ b/src/guimain.cpp
@@ -3,8 +3,8 @@
33 *
44 * $Id$
55 *
6- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
7- * Copyright (C) 2012, 2013, MinGW.org Project
6+ * Written by Keith Marshall <keith@users.osdn.me>
7+ * Copyright (C) 2012, 2013, 2020, MinGW.org Project
88 *
99 *
1010 * Implementation of the WinMain() function, providing the program
@@ -95,7 +95,6 @@ int APIENTRY WinMain
9595 * and identified by the diagnostic message handler...
9696 */
9797 MessageBox( NULL, e.what(), "WinMain", MB_ICONERROR );
98- return EXIT_FAILURE;
9998 }
10099 catch( runtime_error &e )
101100 {
@@ -104,15 +103,14 @@ int APIENTRY WinMain
104103 * processing of its message loop...
105104 */
106105 MessageBox( NULL, e.what(), "WinMain", MB_ICONERROR );
107- return EXIT_FAILURE;
108106 }
109107 catch(...)
110108 { /* ...and here, we diagnose any other error which we weren't
111109 * able to explicitly identify.
112110 */
113111 MessageBox( NULL, "Unknown exception", "WinMain", MB_ICONERROR );
114- return EXIT_FAILURE;
115112 }
113+ return EXIT_FAILURE;
116114 }
117115
118116 /* $RCSfile$: end of file */