Browse Source

added gentoo patches (-Wall fixes)

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@107 7c53e7cc-98ea-0310-8f1f-a0b24da60408
sip 17 years ago
parent
commit
42a5f9585a
4 changed files with 20 additions and 9 deletions
  1. 2 2
      cfg.cpp
  2. 2 2
      image.cpp
  3. 14 3
      panel.cpp
  4. 2 2
      switchuser.cpp

+ 2 - 2
cfg.cpp

@@ -154,7 +154,7 @@ string Cfg::Trim( const string& s ) {
     }
     int pos = 0;
     string line = s;
-    string::size_type len = line.length();
+    int len = line.length();
     while ( pos < len && isspace( line[pos] ) ) {
         ++pos;
     }
@@ -240,7 +240,7 @@ string Cfg::nextSession(string current) {
     if (sessions.size() <= 1)
         return current;
 
-    for (int i=0; i<sessions.size()-1; i++) {
+    for (int i=0; i<(int)sessions.size()-1; i++) {
         if (current == sessions[i]) {
             return sessions[i+1];
         }

+ 2 - 2
image.cpp

@@ -391,7 +391,7 @@ void Image::Crop(const int x, const int y, const int w, const int h) {
 void Image::Center(const int w, const int h, const char *hex) {
 
     unsigned long packed_rgb;
-    sscanf(hex, "%x", &packed_rgb);  
+    sscanf(hex, "%lx", &packed_rgb);  
 
     unsigned long r = packed_rgb>>16;
     unsigned long g = packed_rgb>>8 & 0xff;
@@ -471,7 +471,7 @@ void Image::Center(const int w, const int h, const char *hex) {
 void Image::Plain(const int w, const int h, const char *hex) {
 
     unsigned long packed_rgb;
-    sscanf(hex, "%x", &packed_rgb);  
+    sscanf(hex, "%lx", &packed_rgb);  
 
     unsigned long r = packed_rgb>>16;
     unsigned long g = packed_rgb>>8 & 0xff;

+ 14 - 3
panel.cpp

@@ -239,7 +239,7 @@ unsigned long Panel::GetColor(const char* colorname) {
 
 void Panel::Cursor(int visible) {
     char* text;
-    int xx, yy, x2,y2, cheight;
+    int xx, yy, y2, cheight;
     char* txth = "Wj"; // used to get cursor height
 
     switch(In->GetField()) {
@@ -254,6 +254,12 @@ void Panel::Cursor(int visible) {
             xx = input_name_x;
             yy = input_name_y;
             break;
+
+		default: /* Origin & NULL string as default values. */
+			text = (char *)NULL;
+			xx = (int)0;
+			yy = (int)0;
+			break;
     }
 
 
@@ -347,7 +353,7 @@ void Panel::OnKeyPress(XEvent* event) {
     del = In->Key(buffer, keysym, singleInputMode);
     Action = In->GetAction();
 
-    XGlyphInfo extents, delextents;
+    XGlyphInfo extents;
     XftDraw *draw = XftDrawCreate(Dpy, Win,
                                   DefaultVisual(Dpy, Scr), DefaultColormap(Dpy, Scr));
 
@@ -397,6 +403,12 @@ void Panel::OnKeyPress(XEvent* event) {
             xx = input_name_x;
             yy = input_name_y;
             break;
+
+		default: /* Origin & NULL string as default values. */
+			text = (char *)NULL;
+			xx = (int)0;
+			yy = (int)0;
+			break;
     }
 
     char* txth = "Wj"; // get proper maximum height ?
@@ -431,7 +443,6 @@ void Panel::OnKeyPress(XEvent* event) {
 // Draw welcome and "enter username" message
 void Panel::ShowText(){
     string cfgX, cfgY;
-    int n=-1;
     XGlyphInfo extents;
 
     bool singleInputMode =

+ 2 - 2
switchuser.cpp

@@ -14,8 +14,8 @@
 using namespace std;
 
 SwitchUser::SwitchUser(struct passwd *pw, Cfg *c, const string& display)
-    : Pw(pw),
-      cfg(c),
+    : cfg(c),
+      Pw(pw),
       displayName(display)
 {
 }