changeset 31829:43566b0aec59

Avoid some more compiler warnings.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 21 Sep 2000 20:54:57 +0000
parents c6cdd9deac21
children cf1b4094811a
files src/alloc.c src/data.c src/dired.c src/emacs.c src/fileio.c src/indent.c src/insdel.c src/keymap.c src/macros.c src/minibuf.c src/search.c src/term.c src/window.c src/xmenu.c src/xrdb.c
diffstat 15 files changed, 62 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/alloc.c	Thu Sep 21 20:54:57 2000 +0000
@@ -2934,6 +2934,9 @@
 		}
 	    }
 	  break;
+
+	case Lisp_Int:
+	  break;
 	}
 
       if (mark_p)
@@ -3138,7 +3141,7 @@
 mark_stack ()
 {
   jmp_buf j;
-  int stack_grows_down_p = (char *) &j > (char *) stack_base;
+  volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
   void *end;
 
   /* This trick flushes the register windows so that all the state of
@@ -3362,8 +3365,8 @@
     }
   else if (MARKERP (obj))
     error ("Attempt to copy a marker to pure storage");
-  else
-    return obj;
+
+  return obj;
 }
 
 
--- a/src/data.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/data.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1751,6 +1751,8 @@
     {
       Lisp_Object val;
 
+      val = Qnil;
+
       if (idxval < 0)
 	args_out_of_range (array, idx);
       if (idxval < CHAR_TABLE_ORDINARY_SLOTS)
@@ -1821,7 +1823,7 @@
     }
   else
     {
-      int size;
+      int size = 0;
       if (VECTORP (array))
 	size = XVECTOR (array)->size;
       else if (COMPILEDP (array))
@@ -2010,7 +2012,7 @@
      Lisp_Object num1, num2;
      enum comparison comparison;
 {
-  double f1, f2;
+  double f1 = 0, f2 = 0;
   int floatp = 0;
 
   CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1, 0);
--- a/src/dired.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/dired.c	Thu Sep 21 20:54:57 2000 +0000
@@ -131,7 +131,7 @@
   Lisp_Object list, name, dirfilename;
   Lisp_Object encoded_directory;
   Lisp_Object handler;
-  struct re_pattern_buffer *bufp;
+  struct re_pattern_buffer *bufp = NULL;
   int needsep = 0;
   struct gcpro gcpro1, gcpro2;
 
@@ -389,7 +389,7 @@
 {
   DIR *d;
   DIRENTRY *dp;
-  int bestmatchsize, skip;
+  int bestmatchsize = 0, skip;
   register int compare, matchsize;
   unsigned char *p1, *p2;
   int matchcount = 0;
@@ -402,6 +402,8 @@
   int count = specpdl_ptr - specpdl;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
 
+  elt = Qnil;
+
 #ifdef VMS
   extern DIRENTRY * readdirver ();
 
--- a/src/emacs.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/emacs.c	Thu Sep 21 20:54:57 2000 +0000
@@ -604,7 +604,7 @@
      char **valptr;
      int *skipptr;
 {
-  char *p;
+  char *p = NULL;
   int arglen;
   char *arg;
 
@@ -1506,6 +1506,7 @@
   /* Enter editor command loop.  This never returns.  */
   Frecursive_edit ();
   /* NOTREACHED */
+  return 0;
 }
 
 /* Sort the args so we can find the most important ones
--- a/src/fileio.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/fileio.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1973,7 +1973,7 @@
   unsigned char *nm;
 
   register unsigned char *s, *p, *o, *x, *endp;
-  unsigned char *target;
+  unsigned char *target = NULL;
   int total = 0;
   int substituted = 0;
   unsigned char *xnm;
@@ -2180,6 +2180,7 @@
 
   /* NOTREACHED */
 #endif /* not VMS */
+  return Qnil;
 }
 
 /* A slightly faster and more convenient way to get
@@ -3421,7 +3422,7 @@
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   Lisp_Object handler, val, insval, orig_filename;
   Lisp_Object p;
-  int total;
+  int total = 0;
   int not_regular = 0;
   unsigned char read_buf[READ_BUF_SIZE];
   struct coding_system coding;
@@ -4397,7 +4398,7 @@
 {
   register int desc;
   int failure;
-  int save_errno;
+  int save_errno = 0;
   unsigned char *fn;
   struct stat st;
   int tem;
--- a/src/indent.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/indent.c	Thu Sep 21 20:54:57 2000 +0000
@@ -835,8 +835,8 @@
   register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
 
   Lisp_Object val;
-  int prev_col;
-  int c;
+  int prev_col = 0;
+  int c = 0;
   int next_boundary;
 
   int pos_byte, end_byte, next_boundary_byte;
@@ -1053,7 +1053,7 @@
 
   register int pos;
   int pos_byte;
-  register int c;
+  register int c = 0;
   register int tab_width = XFASTINT (current_buffer->tab_width);
   register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
   register struct Lisp_Char_Table *dp = window_display_table (win);
--- a/src/insdel.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/insdel.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1347,6 +1347,7 @@
   CHECK_MARKERS ();
 
   GCPRO1 (new);
+  deletion = Qnil;
 
   if (prepare)
     {
--- a/src/keymap.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/keymap.c	Thu Sep 21 20:54:57 2000 +0000
@@ -269,8 +269,7 @@
  end:
   if (error)
     wrong_type_argument (Qkeymapp, object);
-  else
-    return Qnil;
+  return Qnil;
 }
 
 
@@ -1775,10 +1774,10 @@
   (keys)
      Lisp_Object keys;
 {
-  int len;
+  int len = 0;
   int i, i_byte;
   Lisp_Object sep;
-  Lisp_Object *args;
+  Lisp_Object *args = NULL;
 
   if (STRINGP (keys))
     {
@@ -2021,6 +2020,7 @@
     return Fcopy_sequence (key);
   else
     error ("KEY must be an integer, cons, symbol, or string");
+  return Qnil;
 }
 
 char *
@@ -2846,6 +2846,8 @@
   int first = 1;
   struct gcpro gcpro1, gcpro2, gcpro3;
 
+  suppress = Qnil;
+
   if (!NILP (keys) && XFASTINT (Flength (keys)) > 0)
     {
       /* Call Fkey_description first, to avoid GC bug for the other string.  */
@@ -3027,6 +3029,8 @@
   int character;
   int starting_i;
 
+  suppress = Qnil;
+
   if (indices == 0)
     indices = (int *) alloca (3 * sizeof (int));
 
--- a/src/macros.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/macros.c	Thu Sep 21 20:54:57 2000 +0000
@@ -213,6 +213,7 @@
   ()
 {
   current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end;
+  return Qnil;
 }
 
 DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event,
--- a/src/minibuf.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/minibuf.c	Thu Sep 21 20:54:57 2000 +0000
@@ -281,6 +281,7 @@
   fprintf (stdout, "%s", XSTRING (prompt)->data);
   fflush (stdout);
 
+  val = Qnil;
   size = 100;
   len = 0;
   line = (char *) xmalloc (size * sizeof *line);
@@ -1046,11 +1047,11 @@
 {
   Lisp_Object bestmatch, tail, elt, eltstring;
   /* Size in bytes of BESTMATCH.  */
-  int bestmatchsize;
+  int bestmatchsize = 0;
   /* These are in bytes, too.  */
   int compare, matchsize;
   int list = CONSP (alist) || NILP (alist);
-  int index, obsize;
+  int index = 0, obsize = 0;
   int matchcount = 0;
   Lisp_Object bucket, zero, end, tem;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -1059,7 +1060,7 @@
   if (!list && !VECTORP (alist))
     return call3 (alist, string, predicate, Qnil);
 
-  bestmatch = Qnil;
+  bestmatch = bucket = Qnil;
 
   /* If ALIST is not a list, set TAIL just for gc pro.  */
   tail = alist;
@@ -1299,7 +1300,7 @@
   Lisp_Object tail, elt, eltstring;
   Lisp_Object allmatches;
   int list = CONSP (alist) || NILP (alist);
-  int index, obsize;
+  int index = 0, obsize = 0;
   Lisp_Object bucket, tem;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
@@ -1308,7 +1309,7 @@
     {
       return call3 (alist, string, predicate, Qt);
     }
-  allmatches = Qnil;
+  allmatches = bucket = Qnil;
 
   /* If ALIST is not a list, set TAIL just for gc pro.  */
   tail = alist;
@@ -1809,7 +1810,7 @@
       return Qnil;
     }
  exit:
-  Fthrow (Qexit, Qnil);
+  return Fthrow (Qexit, Qnil);
   /* NOTREACHED */
 }
 
@@ -2028,6 +2029,8 @@
 	  int length;
 	  Lisp_Object startpos, endpos;
 
+	  startpos = Qnil;
+
 	  elt = Fcar (tail);
 	  /* Compute the length of this element.  */
 	  if (CONSP (elt))
@@ -2202,14 +2205,14 @@
   else
     bitch_at_user ();
 
-  Fthrow (Qexit, Qnil);
+  return Fthrow (Qexit, Qnil);
 }
 
 DEFUN ("exit-minibuffer", Fexit_minibuffer, Sexit_minibuffer, 0, 0, "",
   "Terminate this minibuffer argument.")
   ()
 {
-  Fthrow (Qexit, Qnil);
+  return Fthrow (Qexit, Qnil);
 }
 
 DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0,
--- a/src/search.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/search.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1527,7 +1527,7 @@
 {
   int direction = ((n > 0) ? 1 : -1);
   register int dirlen;
-  int infinity, limit, k, stride_for_teases;
+  int infinity, limit, k, stride_for_teases = 0;
   register int *BM_tab;
   int *BM_tab_base;
   register unsigned char *cursor, *p_limit;  
@@ -1536,8 +1536,8 @@
   int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
 
   unsigned char simple_translate[0400];
-  int translate_prev_byte;
-  int translate_anteprev_byte;
+  int translate_prev_byte = 0;
+  int translate_anteprev_byte = 0;
 
 #ifdef C_ALLOCA
   int BM_tab_space[0400];
@@ -2337,7 +2337,7 @@
 	  for (pos_byte = 0, pos = 0; pos_byte < length;)
 	    {
 	      int substart = -1;
-	      int subend;
+	      int subend = 0;
 	      int delbackslash = 0;
 
 	      FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
@@ -2633,6 +2633,8 @@
   if (NILP (last_thing_searched))
     return Qnil;
 
+  prev = Qnil;
+
   data = (Lisp_Object *) alloca ((2 * search_regs.num_regs)
 				 * sizeof (Lisp_Object));
 
--- a/src/term.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/term.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1146,7 +1146,7 @@
      register int len;
 {
   char *buf;
-  struct glyph *glyph;
+  struct glyph *glyph = NULL;
   struct frame *f, *sf;
 
   if (len <= 0)
--- a/src/window.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/window.c	Thu Sep 21 20:54:57 2000 +0000
@@ -1770,6 +1770,9 @@
 		&& NILP (XBUFFER (w->buffer)->name))
 	      abort ();
 	    break;
+
+	  case WINDOW_LOOP_UNUSED:
+	    break;
 	  }
     }
 
@@ -3476,6 +3479,8 @@
       Lisp_Object last_child;
       int delta = old_height - height;
       int last_top;
+
+      last_child = Qnil;
       
       /* Find the last child.  We are taking space from lowest windows
 	 first, so we iterate over children from the last child
--- a/src/xmenu.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/xmenu.c	Thu Sep 21 20:54:57 2000 +0000
@@ -691,11 +691,11 @@
      Lisp_Object position, menu;
 {
   Lisp_Object keymap, tem;
-  int xpos, ypos;
+  int xpos = 0, ypos = 0;
   Lisp_Object title;
   char *error_name;
   Lisp_Object selection;
-  FRAME_PTR f;
+  struct frame *f = NULL;
   Lisp_Object x, y, window;
   int keymaps = 0;
   int for_click = 0;
@@ -899,7 +899,7 @@
   (position, contents)
      Lisp_Object position, contents;
 {
-  FRAME_PTR f;
+  struct frame * f = NULL;
   Lisp_Object window;
 
   check_x ();
@@ -1247,6 +1247,7 @@
 
   if (!f)
     return;
+  entry = Qnil;
   subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object));
   vector = f->menu_bar_vector;
   prefix = Qnil;
@@ -2233,7 +2234,7 @@
     {
       Lisp_Object prefix, entry;
 
-      prefix = Qnil;
+      prefix = entry = Qnil;
       i = 0;
       while (i < menu_items_used)
 	{
--- a/src/xrdb.c	Thu Sep 21 20:15:55 2000 +0000
+++ b/src/xrdb.c	Thu Sep 21 20:54:57 2000 +0000
@@ -180,7 +180,7 @@
   while (p < string + string_len)
     {
       /* The chunk we're about to stick on the end of result.  */
-      char *next;
+      char *next = NULL;
       int next_len;
 
       if (*p == '%')