1
1

Fix a compiler warning and do some slightly-smarter unsigned int

checks.

This commit was SVN r21341.
Этот коммит содержится в:
Jeff Squyres 2009-06-01 14:12:46 +00:00
родитель df7c387155
Коммит 2f810a1e5e

Просмотреть файл

@ -53,8 +53,8 @@ using namespace ompi_info;
// Private variables - set some reasonable screen size defaults // Private variables - set some reasonable screen size defaults
// //
static int centerpoint = 24; static unsigned int centerpoint = 24;
static int screen_width = 78; static unsigned int screen_width = 78;
// //
// Prints the passed strings in a pretty or parsable format. // Prints the passed strings in a pretty or parsable format.
@ -121,9 +121,8 @@ void ompi_info::out(const string& pretty_message, const string &plain_message,
string v = local_value; string v = local_value;
string filler; string filler;
int num_spaces = (int)(centerpoint - pretty_message.length()); if (centerpoint > pretty_message.length()) {
if (num_spaces > 0) { spaces = string(centerpoint - pretty_message.length(), ' ');
spaces = string(num_spaces, ' ');
} }
max_value_width = screen_width - spaces.length() - max_value_width = screen_width - spaces.length() -