diff options
author | fluxgen <fluxgen> | 2006-04-02 21:37:44 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2006-04-02 21:37:44 (GMT) |
commit | 894a7148be8ac88f7f1e98917f33088ab301bf60 (patch) | |
tree | b9c3bd9fa04a64babc749a319a5610caabea9479 /src/Container.cc | |
parent | 0ca3754d683b862762695d1be891c98410f439ac (diff) | |
download | fluxbox-894a7148be8ac88f7f1e98917f33088ab301bf60.zip fluxbox-894a7148be8ac88f7f1e98917f33088ab301bf60.tar.bz2 |
size_t fixes, thanks Semushin Slava aka php-coder
Diffstat (limited to 'src/Container.cc')
-rw-r--r-- | src/Container.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Container.cc b/src/Container.cc index 1a7ea34..6f811ef 100644 --- a/src/Container.cc +++ b/src/Container.cc | |||
@@ -127,7 +127,7 @@ void Container::insertItem(Item item, int pos) { | |||
127 | void Container::moveItem(Item item, int movement) { | 127 | void Container::moveItem(Item item, int movement) { |
128 | 128 | ||
129 | int index = find(item); | 129 | int index = find(item); |
130 | const int size = m_item_list.size(); | 130 | const size_t size = m_item_list.size(); |
131 | 131 | ||
132 | if (index < 0 || (movement % size) == 0) { | 132 | if (index < 0 || (movement % size) == 0) { |
133 | return; | 133 | return; |
@@ -286,7 +286,7 @@ void Container::setMaxTotalSize(unsigned int size) { | |||
286 | // this is a bit of duplication from repositionItems | 286 | // this is a bit of duplication from repositionItems |
287 | // for when we are allowed to grow ourself | 287 | // for when we are allowed to grow ourself |
288 | Alignment align = alignment(); | 288 | Alignment align = alignment(); |
289 | unsigned int num_items = m_item_list.size(); | 289 | size_t num_items = m_item_list.size(); |
290 | if (m_max_total_size && (align == RIGHT || align == LEFT) && | 290 | if (m_max_total_size && (align == RIGHT || align == LEFT) && |
291 | num_items) { | 291 | num_items) { |
292 | unsigned int max_width_per_client = maxWidthPerClient(); | 292 | unsigned int max_width_per_client = maxWidthPerClient(); |
@@ -377,7 +377,7 @@ void Container::repositionItems() { | |||
377 | 377 | ||
378 | unsigned int max_width_per_client = maxWidthPerClient(); | 378 | unsigned int max_width_per_client = maxWidthPerClient(); |
379 | unsigned int borderW = m_item_list.front()->borderWidth(); | 379 | unsigned int borderW = m_item_list.front()->borderWidth(); |
380 | unsigned int num_items = m_item_list.size(); | 380 | size_t num_items = m_item_list.size(); |
381 | 381 | ||
382 | unsigned int total_width; | 382 | unsigned int total_width; |
383 | unsigned int cur_width; | 383 | unsigned int cur_width; |
@@ -480,18 +480,17 @@ unsigned int Container::maxWidthPerClient() const { | |||
480 | return m_max_size_per_client; | 480 | return m_max_size_per_client; |
481 | break; | 481 | break; |
482 | case RELATIVE: | 482 | case RELATIVE: |
483 | int count = size(); | 483 | if (size() == 0) |
484 | if (count == 0) | ||
485 | return width(); | 484 | return width(); |
486 | else { | 485 | else { |
487 | int borderW = m_item_list.front()->borderWidth(); | 486 | int borderW = m_item_list.front()->borderWidth(); |
488 | // there're count-1 borders to fit in with the windows | 487 | // there're count-1 borders to fit in with the windows |
489 | // -> 1 per window plus end | 488 | // -> 1 per window plus end |
490 | unsigned int w = width(); | 489 | unsigned int w = width(); |
491 | if (w < (count-1)*borderW) | 490 | if (w < (size()-1)*borderW) |
492 | return 1; | 491 | return 1; |
493 | else | 492 | else |
494 | return (w - (count - 1) * borderW) / count; | 493 | return (w - (size() - 1) * borderW) / size(); |
495 | } | 494 | } |
496 | break; | 495 | break; |
497 | } | 496 | } |
@@ -502,8 +501,8 @@ unsigned int Container::maxWidthPerClient() const { | |||
502 | 501 | ||
503 | void Container::for_each(std::mem_fun_t<void, FbTk::FbWindow> function) { | 502 | void Container::for_each(std::mem_fun_t<void, FbTk::FbWindow> function) { |
504 | std::for_each(m_item_list.begin(), | 503 | std::for_each(m_item_list.begin(), |
505 | m_item_list.end(), | 504 | m_item_list.end(), |
506 | function); | 505 | function); |
507 | } | 506 | } |
508 | 507 | ||
509 | void Container::setAlpha(unsigned char alpha) { | 508 | void Container::setAlpha(unsigned char alpha) { |