• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

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

Revisiond713d9c13b5976fd05843c087fd16353969b395d (tree)
Zeit2012-12-14 23:27:16
AutorKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Log Message

Insert a missing snprintf format effector.

Ändern Zusammenfassung

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
11 2012-12-14 Keith Marshall <keithmarshall@users.sourceforge.net>
22
3+ Insert a missing snprintf format effector.
4+
5+ * src/pkgnget.cpp (pkgDownloadMeterGUI::Update): Add omitted '%'
6+ format specifier, in "%%", for formatting percentage-complete value.
7+ Rename "size_buf" automatic variable as "buf"; this results in shorter
8+ source lines, and consequently a tidier source code layout.
9+ (pkgDownloadMeterGUI::ResetGUI): Likewise s/size_buf/buf/
10+
11+2012-12-14 Keith Marshall <keithmarshall@users.sourceforge.net>
12+
313 Add a missing header reference.
414
515 * src/approot.h: Include stdint.h; this ensures that wchar_t is
--- a/src/pkgnget.cpp
+++ b/src/pkgnget.cpp
@@ -73,11 +73,11 @@ void pkgDownloadMeterGUI::ResetGUI( const char *filename, unsigned long size )
7373 * download of a new archive file; the name of this file, and its
7474 * anticipated size are preset, as specified by the arguments.
7575 */
76- char size_buf[12]; SizeFormat( size_buf, 0 );
76+ char buf[12]; SizeFormat( buf, 0 );
7777 SendMessage( file_name, WM_SETTEXT, 0, (LPARAM)(filename) );
78- SendMessage( copy_size, WM_SETTEXT, 0, (LPARAM)(size_buf) );
79- SizeFormat( size_buf, content_length = size );
80- SendMessage( file_size, WM_SETTEXT, 0, (LPARAM)(size_buf) );
78+ SendMessage( copy_size, WM_SETTEXT, 0, (LPARAM)(buf) );
79+ SizeFormat( buf, content_length = size );
80+ SendMessage( file_size, WM_SETTEXT, 0, (LPARAM)(buf) );
8181 SendMessage( copy_frac, WM_SETTEXT, 0, (LPARAM)("0 %") );
8282 SendMessage( progress_bar, PBM_SETRANGE, 0, MAKELPARAM( 0, 100 ) );
8383 SendMessage( progress_bar, PBM_SETPOS, 0, 0 );
@@ -90,21 +90,21 @@ int pkgDownloadMeterGUI::Update( unsigned long count )
9090 * received from the repository host, so that this method may
9191 * refresh the progress counters in the dialogue box.
9292 */
93- char size_buf[12];
93+ char buf[12];
9494
9595 /* First, we update the display of the actual byte count...
9696 */
97- SizeFormat( size_buf, count );
98- SendMessage( copy_size, WM_SETTEXT, 0, (LPARAM)(size_buf) );
97+ SizeFormat( buf, count );
98+ SendMessage( copy_size, WM_SETTEXT, 0, (LPARAM)(buf) );
9999
100100 /* ...then we convert that byte count to a percentage of
101101 * the anticipated file size, using the result to update
102102 * the percentage completed, and the progress bar.
103103 */
104104 count = (count * 100) / content_length;
105- if( snprintf( size_buf, sizeof( size_buf ), "%d %", count ) >= sizeof( size_buf ) )
106- strcpy( size_buf, "*** %" );
107- SendMessage( copy_frac, WM_SETTEXT, 0, (LPARAM)(size_buf) );
105+ if( snprintf( buf, sizeof( buf ), "%d %%", count ) >= sizeof( buf ) )
106+ strcpy( buf, "*** %" );
107+ SendMessage( copy_frac, WM_SETTEXT, 0, (LPARAM)(buf) );
108108 SendMessage( progress_bar, PBM_SETPOS, count, 0 );
109109 }
110110