[PATCH 05/11] wmtop: Switch user variable from int to uid_t.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Fixes 'comparison between signed and unsigned integer expressions' compiler
warnings.
---
 wmtop/wmtop.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wmtop/wmtop.c b/wmtop/wmtop.c
index ac4bf33..a1409de 100644
--- a/wmtop/wmtop.c
+++ b/wmtop/wmtop.c
@@ -96,7 +96,7 @@
 /******************************************/
 
 regex_t *exclusion_expression = 0;
-int user = -1;
+uid_t user = (uid_t) -1;
 char *process_command = 0;
 /*
  * Default mode: zero=cpu one=memory
@@ -431,7 +431,7 @@ void wmtop_routine(int argc, char **argv) {
 			mode = !mode;
 #endif
 		    if (Event.xbutton.button==2) {
-			if (user==-1)
+			if (user==(uid_t)-1)
 			    user=getuid();
 			else
 			    user=-1;
@@ -478,7 +478,7 @@ int process_parse_procfs(struct process *process) {
     /*
      * Permissions of /proc filesystem are permissions of process too
      */
-    if (user>=0) {
+    if (user!=(uid_t)-1) {
 	stat(filename,&sbuf);
 	if (sbuf.st_uid!=user)
 	    return 1;
@@ -523,7 +523,7 @@ int process_parse_procfs(struct process *process) {
       /*
        * Permissions of /proc filesystem are permissions of process too
        */
-      if (user>=0) {
+      if (user!=(uid_t)-1) {
         stat(filename,&sbuf);
         if (sbuf.st_uid!=user)
             return 1;
-- 
2.5.0


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.