diff options
author | Mathias Gumz <akira@fluxbox.org> | 2015-01-21 09:02:38 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2015-01-21 09:02:38 (GMT) |
commit | 8e92ad53e07922dfc9aabe6d7d53e6c6d22975ca (patch) | |
tree | c0fff06627d50b2d0d211e57e12f64f635f3e815 /src | |
parent | 2b70480b9740c36c50b69d87954c645217cd65cf (diff) | |
download | fluxbox-8e92ad53e07922dfc9aabe6d7d53e6c6d22975ca.zip fluxbox-8e92ad53e07922dfc9aabe6d7d53e6c6d22975ca.tar.bz2 |
Minor cosmetics
Diffstat (limited to 'src')
-rw-r--r-- | src/Keys.cc | 4 | ||||
-rw-r--r-- | src/Screen.cc | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/Keys.cc b/src/Keys.cc index 19689f7..172d913 100644 --- a/src/Keys.cc +++ b/src/Keys.cc | |||
@@ -355,9 +355,9 @@ void Keys::loadDefaults() { | |||
355 | 355 | ||
356 | bool Keys::addBinding(const string &linebuffer) { | 356 | bool Keys::addBinding(const string &linebuffer) { |
357 | 357 | ||
358 | vector<string> val; | ||
359 | // Parse arguments | 358 | // Parse arguments |
360 | FbTk::StringUtil::stringtok(val, linebuffer.c_str()); | 359 | vector<string> val; |
360 | FbTk::StringUtil::stringtok(val, linebuffer); | ||
361 | 361 | ||
362 | // must have at least 1 argument | 362 | // must have at least 1 argument |
363 | if (val.empty()) | 363 | if (val.empty()) |
diff --git a/src/Screen.cc b/src/Screen.cc index 1edcd93..9c0182b 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -361,13 +361,12 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
361 | m_configmenu->setInternalMenu(); | 361 | m_configmenu->setInternalMenu(); |
362 | 362 | ||
363 | // check which desktop we should start on | 363 | // check which desktop we should start on |
364 | unsigned int first_desktop = 0; | 364 | int first_desktop = 0; |
365 | if (m_restart) { | 365 | if (m_restart) { |
366 | bool exists; | 366 | bool exists; |
367 | unsigned int ret=static_cast<unsigned int>(rootWindow().cardinalProperty(atom_net_desktop, &exists)); | 367 | int ret = (rootWindow().cardinalProperty(atom_net_desktop, &exists)); |
368 | if (exists) { | 368 | if (exists) { |
369 | if (ret < static_cast<unsigned int>(nr_ws)) | 369 | first_desktop = FbTk::Util::clamp<int>(ret, 0, nr_ws); |
370 | first_desktop = ret; | ||
371 | } | 370 | } |
372 | } | 371 | } |
373 | 372 | ||
@@ -1431,7 +1430,7 @@ void BScreen::showPosition(int x, int y) { | |||
1431 | return; | 1430 | return; |
1432 | 1431 | ||
1433 | char buf[256]; | 1432 | char buf[256]; |
1434 | sprintf(buf, "X:%5d x Y:%5d", x, y); | 1433 | snprintf(buf, sizeof(buf), "X:%5d x Y:%5d", x, y); |
1435 | 1434 | ||
1436 | FbTk::BiDiString label(buf); | 1435 | FbTk::BiDiString label(buf); |
1437 | m_pos_window->showText(label); | 1436 | m_pos_window->showText(label); |
@@ -1449,7 +1448,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) { | |||
1449 | char buf[256]; | 1448 | char buf[256]; |
1450 | _FB_USES_NLS; | 1449 | _FB_USES_NLS; |
1451 | 1450 | ||
1452 | sprintf(buf, | 1451 | snprintf(buf, sizeof(buf), |
1453 | _FB_XTEXT(Screen, GeometryFormat, | 1452 | _FB_XTEXT(Screen, GeometryFormat, |
1454 | "W: %4d x H: %4d", | 1453 | "W: %4d x H: %4d", |
1455 | "Format for width and height window, %4d for width, and %4d for height").c_str(), | 1454 | "Format for width and height window, %4d for width, and %4d for height").c_str(), |
@@ -1518,7 +1517,7 @@ void BScreen::renderGeomWindow() { | |||
1518 | 1517 | ||
1519 | const std::string msg = _FB_XTEXT(Screen, GeometrySpacing, | 1518 | const std::string msg = _FB_XTEXT(Screen, GeometrySpacing, |
1520 | "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog"); | 1519 | "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog"); |
1521 | const int n = snprintf(buf, msg.size(), msg.c_str(), 0, 0); | 1520 | const int n = snprintf(buf, sizeof(buf), msg.c_str(), 0, 0); |
1522 | 1521 | ||
1523 | FbTk::BiDiString label(std::string(buf, n)); | 1522 | FbTk::BiDiString label(std::string(buf, n)); |
1524 | m_geom_window->resizeForText(label); | 1523 | m_geom_window->resizeForText(label); |