LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File xvkbd-3.0-compilerwarnings.diff of Package xvkbd (Project X11:Utilities)

Index: b/xvkbd.c
===================================================================
--- a/xvkbd.c
+++ b/xvkbd.c
@@ -449,11 +449,11 @@ static Window focused_window = None;
 static Window focused_subwindow = None;
 
 static Pixmap xvkbd_pixmap = None;
 
 static int AddKeysym(KeySym keysym, Boolean top);  /* forward */
-static void SendString(const unsigned char *str);
+static void SendString(const char *str);
 static void MakeKeyboard(Boolean remake);
 static void MakeKeypad(Widget form, Widget from_vert, Widget from_horiz);
 static void MakeSunFunctionKey(Widget form, Widget from_vert, Widget from_horiz);
 static void MakeDeadkeyPanel(Widget form);
 static void RefreshMainMenu(void);
@@ -1298,13 +1298,13 @@ static void PopupCompletionPanel(void)
  * Send given string to the focused window as if the string
  * is typed from a keyboard.
  */
 static void KeyPressed(Widget w, char *key, char *data);
 
-static void SendString(const unsigned char *str)
+static void SendString(const char *str)
 {
-  const unsigned char *cp, *cp2;  /* I remember "unsigned" might be required for some systems */
+  const char *cp, *cp2;  /* I remember "unsigned" might be required for some systems */
   char key[50];
   int len;
   int val;
   Window target_root, child, junk_w;
   int junk_i;
@@ -1971,11 +1971,13 @@ static void OpenRemoteDisplay(Widget w,
 static void MenuSelected(Widget w, char *key)
 {
   Widget form;
   
   if (strcmp(key, "man") == 0) {
-    if (!appres.secure) system(appres.show_manual_command);
+    if (!appres.secure) {
+      if (system(appres.show_manual_command) == -1) fprintf(stderr, "Error call: %s\n", appres.show_manual_command);
+    }
   } else if (strcmp(key, "about") == 0) {
     if (about_panel == None) {
       about_panel = XtVaCreatePopupShell("about_panel", transientShellWidgetClass,
 					  toplevel, NULL);
       XtVaCreateManagedWidget("message", labelWidgetClass, about_panel,
@@ -2154,11 +2156,13 @@ static void KeyPressed(Widget w, char *k
   value = FindFunctionKeyValue(key, TRUE);
   if (value != NULL) {
     if (appres.debug) fprintf(stderr, "Assigned string: %s\n", value);
     if (value[0] == '!') {
       if (appres.debug) fprintf(stderr, "Launching: %s\n", value + 1);
-      if (!appres.secure) system(value + 1);
+      if (!appres.secure) {
+        if (system(value + 1) == -1) fprintf(stderr, "Could not Launch: %s\n", value + 1);
+      }
     } else {
       if (value[0] == '\\') value = value + 1;
       if (appres.debug) fprintf(stderr, "Sending: %s\n", value);
       SendString(value);
     }
@@ -2318,13 +2322,17 @@ static void KeyPressed(Widget w, char *k
       AddToCompletionText(keysym);
 
       if ((cur_shift & ControlMask) && (cur_shift & alt_mask)) {
         if (strstr(XServerVendor(dpy), "XFree86") != NULL) {
           if (strcmp(key1, "KP_Add") == 0) {
-            if (!appres.secure) system("xvidtune -next");
+            if (!appres.secure) {
+              if (system("xvidtune -next") == -1) fprintf(stderr, "Error call system(xvidtune -next)\n");
+            }
           } else if (strcmp(key1, "KP_Subtract") == 0) {
-            if (!appres.secure) system("xvidtune -prev");
+            if (!appres.secure) {
+	      if (system("xvidtune -prev") == -1) fprintf(stderr, "Error call system(xvidtune -prev)\n");
+	    }
           }
         }
       }
     }
     if (!appres.shift_lock)
@@ -3223,11 +3231,11 @@ static void SetIconBitmap(Widget w)
  * when xvkbd window is hidden by other window.  ** EXPERIMENTAL **
  */
 static void VisibilityChanged(Widget w, XEvent *event,
 			      String *pars, Cardinal *n_pars)
 {
-  static cnt = 0;
+  static int cnt = 0;
   static time_t t1 = 0;
   time_t t2;
 
   if (!appres.always_on_top) return;