The MinGW.org Installation Manager Tool
Revisión | 5b2d4297d3a55a55004dc78573fcd0415647f376 (tree) |
---|---|
Tiempo | 2020-06-22 06:54:25 |
Autor | ![]() |
Commiter | Keith Marshall |
Declare functions as void when return value is immaterial.
@@ -1,5 +1,16 @@ | ||
1 | 1 | 2020-06-21 Keith Marshall <keith@users.osdn.me> |
2 | 2 | |
3 | + Declare functions as void when return value is immaterial. | |
4 | + | |
5 | + * src/pkginet.h (pkgDownloadMeter::Update): Declare it as a pure | |
6 | + virtual void function, rather than as pure virtual int. | |
7 | + | |
8 | + * src/pkginet.cpp (pkgDownloadMeterTTY::Update) | |
9 | + * src/pkgnget.cpp (pkgDownloadMeterGUI::Update): Amend derivative | |
10 | + implementations to match; do not return anything. | |
11 | + | |
12 | +2020-06-21 Keith Marshall <keith@users.osdn.me> | |
13 | + | |
3 | 14 | Ensure non-void functions always return explicit values. |
4 | 15 | |
5 | 16 | * src/guimain.cpp (WinMain): Remove explicit EXIT_FAILURE returns from |
@@ -3,8 +3,8 @@ | ||
3 | 3 | * |
4 | 4 | * $Id$ |
5 | 5 | * |
6 | - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
7 | - * Copyright (C) 2009-2013, 2017, MinGW.org Project | |
6 | + * Written by Keith Marshall <keith@users.osdn.me> | |
7 | + * Copyright (C) 2009-2013, 2017, 2020, MinGW.org Project | |
8 | 8 | * |
9 | 9 | * |
10 | 10 | * Implementation of the package download machinery for mingw-get. |
@@ -89,7 +89,7 @@ class pkgDownloadMeterTTY: public pkgDownloadMeter | ||
89 | 89 | pkgDownloadMeterTTY( const char*, unsigned long ); |
90 | 90 | virtual ~pkgDownloadMeterTTY(); |
91 | 91 | |
92 | - virtual int Update( unsigned long ); | |
92 | + virtual void Update( unsigned long ); | |
93 | 93 | |
94 | 94 | private: |
95 | 95 | /* This buffer is used to store each compiled status report, |
@@ -126,7 +126,7 @@ class pkgDownloadMeterTTY: public pkgDownloadMeter | ||
126 | 126 | */ |
127 | 127 | public: |
128 | 128 | pkgDownloadMeterTTY( const char*, unsigned long ){} |
129 | - virtual int Update( unsigned long ){ return 0; } | |
129 | + virtual void Update( unsigned long ){} | |
130 | 130 | }; |
131 | 131 | |
132 | 132 | #endif |
@@ -161,7 +161,7 @@ unsigned long percentage( unsigned long x, unsigned long q ) | ||
161 | 161 | |
162 | 162 | #if IMPLEMENTATION_LEVEL == PACKAGE_BASE_COMPONENT |
163 | 163 | |
164 | -int pkgDownloadMeterTTY::Update( unsigned long count ) | |
164 | +void pkgDownloadMeterTTY::Update( unsigned long count ) | |
165 | 165 | { |
166 | 166 | /* Implementation of method to update the download progress report, |
167 | 167 | * displaying the current byte count and anticipated final byte count, |
@@ -193,7 +193,7 @@ int pkgDownloadMeterTTY::Update( unsigned long count ) | ||
193 | 193 | dmh_printf( "%s\n", source_url ); |
194 | 194 | source_url = NULL; |
195 | 195 | } |
196 | - return dmh_printf( "\r%s%%", status_report ); | |
196 | + (void)(dmh_printf( "\r%s%%", status_report )); | |
197 | 197 | } |
198 | 198 | |
199 | 199 | #endif |
@@ -4,8 +4,8 @@ | ||
4 | 4 | * |
5 | 5 | * $Id$ |
6 | 6 | * |
7 | - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
8 | - * Copyright (C) 2009, 2010, 2011, 2012, MinGW.org Project | |
7 | + * Written by Keith Marshall <keith@users.osdn.me> | |
8 | + * Copyright (C) 2009-2012, 2020, MinGW.org Project | |
9 | 9 | * |
10 | 10 | * |
11 | 11 | * Public declaration of the download metering class, and support |
@@ -67,7 +67,7 @@ class pkgDownloadMeter | ||
67 | 67 | /* The working method to refresh the download progress display; |
68 | 68 | * each derived class MUST furnish an implementation for this. |
69 | 69 | */ |
70 | - virtual int Update( unsigned long ) = 0; | |
70 | + virtual void Update( unsigned long ) = 0; | |
71 | 71 | |
72 | 72 | protected: |
73 | 73 | /* Reference pointer to the primary instance of the download |
@@ -3,8 +3,8 @@ | ||
3 | 3 | * |
4 | 4 | * $Id$ |
5 | 5 | * |
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 | |
8 | 8 | * |
9 | 9 | * |
10 | 10 | * Implementation of the network download agent interface, through |
@@ -42,7 +42,7 @@ class pkgDownloadMeterGUI: public pkgDownloadMeter | ||
42 | 42 | pkgDownloadMeterGUI( HWND ); |
43 | 43 | |
44 | 44 | virtual void ResetGUI( const char *, unsigned long ); |
45 | - virtual int Update( unsigned long ); | |
45 | + virtual void Update( unsigned long ); | |
46 | 46 | |
47 | 47 | inline ~pkgDownloadMeterGUI(); |
48 | 48 |
@@ -202,7 +202,7 @@ void pkgDownloadMeterGUI::ResetGUI( const char *filename, unsigned long size ) | ||
202 | 202 | SendMessage( progress_bar, PBM_SETPOS, 0, 0 ); |
203 | 203 | } |
204 | 204 | |
205 | -int pkgDownloadMeterGUI::Update( unsigned long count ) | |
205 | +void pkgDownloadMeterGUI::Update( unsigned long count ) | |
206 | 206 | { |
207 | 207 | /* Method to update the download progress report; the download |
208 | 208 | * agent invokes this after each block of archive data has been |