aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-03-23 15:14:45 (GMT)
committerfluxgen <fluxgen>2002-03-23 15:14:45 (GMT)
commit8daa080d11a6bf9e6ed208563e738a02c9eb6cf8 (patch)
tree4d9f68180a4bc0f1574f03b48897233b43791899 /src/Screen.cc
parente133cf83a332a72ca42be5e223834d4e6aa0a2e8 (diff)
downloadfluxbox-8daa080d11a6bf9e6ed208563e738a02c9eb6cf8.zip
fluxbox-8daa080d11a6bf9e6ed208563e738a02c9eb6cf8.tar.bz2
some signed/unsigned stuff
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 3c7f4a9..816c869 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.37 2002/03/19 14:30:42 fluxgen Exp $ 25// $Id: Screen.cc,v 1.38 2002/03/23 15:14:45 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -728,11 +728,11 @@ void BScreen::removeIcon(FluxboxWindow *w) {
728} 728}
729 729
730 730
731FluxboxWindow *BScreen::getIcon(int index) { 731FluxboxWindow *BScreen::getIcon(unsigned int index) {
732 if (index >= 0 && index < iconList.size()) 732 if (index < iconList.size())
733 return iconList[index]; 733 return iconList[index];
734 734
735 return (FluxboxWindow *) 0; 735 return 0;
736} 736}
737 737
738 738
@@ -782,8 +782,8 @@ int BScreen::removeLastWorkspace(void) {
782} 782}
783 783
784 784
785void BScreen::changeWorkspaceID(int id) { 785void BScreen::changeWorkspaceID(unsigned int id) {
786 if (! current_workspace || id >= workspacesList.size() || id < 0) 786 if (! current_workspace || id >= workspacesList.size())
787 return; 787 return;
788 788
789 if (id != current_workspace->getWorkspaceID()) { 789 if (id != current_workspace->getWorkspaceID()) {
@@ -819,13 +819,10 @@ void BScreen::changeWorkspaceID(int id) {
819 updateNetizenCurrentWorkspace(); 819 updateNetizenCurrentWorkspace();
820} 820}
821 821
822void BScreen::sendToWorkspace(int id) {
823 BScreen::sendToWorkspace(id, true);
824}
825 822
826void BScreen::sendToWorkspace(int id, bool changeWS) { 823void BScreen::sendToWorkspace(unsigned int id, bool changeWS) {
827 FluxboxWindow *win; 824 FluxboxWindow *win;
828 if (! current_workspace || id >= workspacesList.size() || id < 0) 825 if (! current_workspace || id >= workspacesList.size())
829 return; 826 return;
830 827
831 if (id != current_workspace->getWorkspaceID()) { 828 if (id != current_workspace->getWorkspaceID()) {
@@ -1084,9 +1081,9 @@ void BScreen::addWorkspaceName(char *name) {
1084} 1081}
1085 1082
1086 1083
1087void BScreen::getNameOfWorkspace(int id, char **name) { 1084void BScreen::getNameOfWorkspace(unsigned int workspace, char **name) {
1088 if (id >= 0 && id < workspaceNames.size()) { 1085 if (workspace < workspaceNames.size()) {
1089 const char *wkspc_name = workspaceNames[id].c_str(); 1086 const char *wkspc_name = workspaceNames[workspace].c_str();
1090 1087
1091 if (wkspc_name) 1088 if (wkspc_name)
1092 *name = StringUtil::strdup(wkspc_name); 1089 *name = StringUtil::strdup(wkspc_name);
@@ -1095,10 +1092,10 @@ void BScreen::getNameOfWorkspace(int id, char **name) {
1095} 1092}
1096 1093
1097 1094
1098void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_sticky) { 1095void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) {
1099 if (! w) return; 1096 if (! w) return;
1100 1097
1101 if (wkspc_id == -1) 1098 if (wkspc_id >= workspaceNames.size())
1102 wkspc_id = current_workspace->getWorkspaceID(); 1099 wkspc_id = current_workspace->getWorkspaceID();
1103 1100
1104 if (w->getWorkspaceNumber() == wkspc_id) 1101 if (w->getWorkspaceNumber() == wkspc_id)
@@ -1807,7 +1804,7 @@ void BScreen::rightWorkspace(const int delta) {
1807// Goes to the workspace "left" of the current 1804// Goes to the workspace "left" of the current
1808//-------------------------------------------- 1805//--------------------------------------------
1809void BScreen::leftWorkspace(const int delta) { 1806void BScreen::leftWorkspace(const int delta) {
1810 if (getCurrentWorkspaceID() >= delta) 1807 if (getCurrentWorkspaceID() >= static_cast<unsigned int>(delta))
1811 changeWorkspaceID(getCurrentWorkspaceID()-delta); 1808 changeWorkspaceID(getCurrentWorkspaceID()-delta);
1812} 1809}
1813 1810