diff --git a/ChangeLog b/ChangeLog index 4b14490c92..c8274e4d29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-10-25 Lars Gullik Bjønnes + + * src/support/filetools.C (MakeRelPath): change some types to + string::size_type + + * src/frontends/ButtonPolicies.h (operator<<): new operator for + ButtonPolicy::SMInput and ButtonPolicy::State. + + * src/FontLoader.C (reset): small cleanup + (unload): small cleanup + + * src/FontInfo.C (getFontname): initialize error to 10000.0 + 2000-10-24 Angus Leeming * src/frontends/xforms/FormPreferences.[Ch]: diff --git a/src/FontInfo.C b/src/FontInfo.C index 406c885902..db2b5b6e9a 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -32,7 +32,7 @@ string const FontInfo::getFontname(int size) return string(); int closestind = -1; - double error = 100000; + double error = 100000.0; for (int i = 0; i < matches; ++i) { if (sizes[i] == 0) { diff --git a/src/FontLoader.C b/src/FontLoader.C index 2ad5688af0..fafb7110b9 100644 --- a/src/FontLoader.C +++ b/src/FontLoader.C @@ -58,11 +58,11 @@ void FontLoader::update() void FontLoader::reset() { // Clear font infos, font structs and font metrics - for (int i1 = 0; i1<4; i1++) - for (int i2 = 0; i2<2; i2++) - for (int i3 = 0; i3<4; i3++) { + for (int i1 = 0; i1 < 4; ++i1) + for (int i2 = 0; i2 < 2; ++i2) + for (int i3 = 0; i3 < 4; ++i3) { fontinfo[i1][i2][i3] = 0; - for (int i4 = 0; i4<10; i4++) { + for (int i4 = 0; i4<10; ++i4) { fontstruct[i1][i2][i3][i4] = 0; } } @@ -72,14 +72,14 @@ void FontLoader::reset() void FontLoader::unload() { // Unload all fonts - for (int i1 = 0; i1<4; i1++) - for (int i2 = 0; i2<2; i2++) - for (int i3 = 0; i3<4; i3++) { + for (int i1 = 0; i1 < 4; ++i1) + for (int i2 = 0; i2 < 2; ++i2) + for (int i3 = 0; i3 < 4; ++i3) { if (fontinfo[i1][i2][i3]) { delete fontinfo[i1][i2][i3]; fontinfo[i1][i2][i3] = 0; } - for (int i4 = 0; i4<10; i4++) { + for (int i4 = 0; i4 < 10; ++i4) { if (fontstruct[i1][i2][i3][i4]) { XFreeFont(fl_get_display(), fontstruct[i1][i2][i3][i4]); fontstruct[i1][i2][i3][i4] = 0; diff --git a/src/frontends/ButtonPolicies.h b/src/frontends/ButtonPolicies.h index d4d48534bd..047d680ec4 100644 --- a/src/frontends/ButtonPolicies.h +++ b/src/frontends/ButtonPolicies.h @@ -159,6 +159,20 @@ public: }; +inline +ostream & operator<<(ostream & os, ButtonPolicy::SMInput smi) +{ + os << int(smi); + return os; +} + +inline +ostream & operator<<(ostream & os, ButtonPolicy::State st) +{ + os << int(st); + return os; +} + //--------------------- Actual Policy Classes ----------------------------- /** Ok and Cancel buttons for dialogs with read-only operation. diff --git a/src/support/filetools.C b/src/support/filetools.C index fdd8bef9e8..9a5d52474b 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -857,7 +857,7 @@ string const MakeRelPath(string const & abspath0, string const & basepath0) string::size_type const baselen = basepath.length(); // Find first different character - int i = 0; + string::size_type i = 0; while (i < abslen && i < baselen && abspath[i] == basepath[i]) ++i; // Go back to last / @@ -877,7 +877,7 @@ string const MakeRelPath(string const & abspath0, string const & basepath0) // Count how many dirs there are in basepath above match // and append as many '..''s into relpath string buf; - int j = i; + string::size_type j = i; while (j < baselen) { if (basepath[j] == '/') { if (j + 1 == baselen) break;