]> code.delx.au - gnu-emacs/commitdiff
Avoid some more compiler warnings.
authorGerd Moellmann <gerd@gnu.org>
Thu, 21 Sep 2000 20:54:57 +0000 (20:54 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 21 Sep 2000 20:54:57 +0000 (20:54 +0000)
15 files changed:
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

index 678bdfa42526ec4dd8a2481699e1383b7c6978fa..75466a787c70c66eb08624ffffcbd23473f9bbe0 100644 (file)
@@ -2934,6 +2934,9 @@ mark_maybe_object (obj)
                }
            }
          break;
+
+       case Lisp_Int:
+         break;
        }
 
       if (mark_p)
@@ -3138,7 +3141,7 @@ static void
 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 @@ Does not copy symbols.  Copies strings without text properties.")
     }
   else if (MARKERP (obj))
     error ("Attempt to copy a marker to pure storage");
-  else
-    return obj;
+
+  return obj;
 }
 
 
index 0e393bf450da26ceb5942fca19d52aa8a15d7c69..c85e5485d6945e8ac4ab09e3a6f09fa41c8ecbe7 100644 (file)
@@ -1751,6 +1751,8 @@ or a byte-code object.  IDX starts at 0.")
     {
       Lisp_Object val;
 
+      val = Qnil;
+
       if (idxval < 0)
        args_out_of_range (array, idx);
       if (idxval < CHAR_TABLE_ORDINARY_SLOTS)
@@ -1821,7 +1823,7 @@ or a byte-code object.  IDX starts at 0.")
     }
   else
     {
-      int size;
+      int size = 0;
       if (VECTORP (array))
        size = XVECTOR (array)->size;
       else if (COMPILEDP (array))
@@ -2010,7 +2012,7 @@ arithcompare (num1, num2, comparison)
      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);
index bedda2a7f13233847034e886247d928e6d23acc6..e0dce3ae46ed4bd666d50a73fb32b9c10a4394e8 100644 (file)
@@ -131,7 +131,7 @@ directory_files_internal (directory, full, match, nosort, attrs)
   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 @@ file_name_completion (file, dirname, all_flag, ver_flag)
 {
   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 @@ file_name_completion (file, dirname, all_flag, ver_flag)
   int count = specpdl_ptr - specpdl;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
 
+  elt = Qnil;
+
 #ifdef VMS
   extern DIRENTRY * readdirver ();
 
index 47aadd866d8b1cde5433e46f962dc1c4eb790602..9c2645f361f1585b4dde259949fc8d17f4597c65 100644 (file)
@@ -604,7 +604,7 @@ argmatch (argv, argc, sstr, lstr, minlen, valptr, skipptr)
      char **valptr;
      int *skipptr;
 {
-  char *p;
+  char *p = NULL;
   int arglen;
   char *arg;
 
@@ -1506,6 +1506,7 @@ main (argc, argv, envp)
   /* Enter editor command loop.  This never returns.  */
   Frecursive_edit ();
   /* NOTREACHED */
+  return 0;
 }
 \f
 /* Sort the args so we can find the most important ones
index b8c50d0f505200025a74129a5bdf4e4fa2673514..a07ea27b1de34dae2b12c9033408affc983419f0 100644 (file)
@@ -1973,7 +1973,7 @@ duplicates what `expand-file-name' does.")
   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 @@ duplicates what `expand-file-name' does.")
 
   /* NOTREACHED */
 #endif /* not VMS */
+  return Qnil;
 }
 \f
 /* A slightly faster and more convenient way to get
@@ -3421,7 +3422,7 @@ actually used.")
   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 @@ This does code conversion according to the value of\n\
 {
   register int desc;
   int failure;
-  int save_errno;
+  int save_errno = 0;
   unsigned char *fn;
   struct stat st;
   int tem;
index 7a7be2fe3018021f66029b8bb291a8df52c2bee6..f5f44d93c4049ac582775be9fb8a98bc9b5cd162 100644 (file)
@@ -835,8 +835,8 @@ The return value is the current column.")
   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 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
 
   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);
index acc1d47395d7b1b0ce0d68f7a08f01802a429e2a..4229fb6abb531c72be1fd986194ab00ce0b83983 100644 (file)
@@ -1347,6 +1347,7 @@ replace_range (from, to, new, prepare, inherit, markers)
   CHECK_MARKERS ();
 
   GCPRO1 (new);
+  deletion = Qnil;
 
   if (prepare)
     {
index 26659410227fed0d7a3d90f48f528db4a03a1296..864c860db5c4d122b6283c6940701cdbffbbd4cf 100644 (file)
@@ -269,8 +269,7 @@ get_keymap_1 (object, error, autoload)
  end:
   if (error)
     wrong_type_argument (Qkeymapp, object);
-  else
-    return Qnil;
+  return Qnil;
 }
 
 
@@ -1775,10 +1774,10 @@ spaces are put between sequence elements, etc.")
   (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 @@ around function keys and event symbols.")
     return Fcopy_sequence (key);
   else
     error ("KEY must be an integer, cons, symbol, or string");
+  return Qnil;
 }
 
 char *
@@ -2846,6 +2846,8 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu)
   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 @@ describe_vector (vector, elt_prefix, elt_describer,
   int character;
   int starting_i;
 
+  suppress = Qnil;
+
   if (indices == 0)
     indices = (int *) alloca (3 * sizeof (int));
 
index 5c37f0daa3da737b714ad767e8cca19390698ce2..3c6e0b33edbda170feee5e0b18bd0e331502252c 100644 (file)
@@ -213,6 +213,7 @@ DEFUN ("cancel-kbd-macro-events", Fcancel_kbd_macro_events,
   ()
 {
   current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end;
+  return Qnil;
 }
 
 DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event,
index 740f73cbd4e9986ef1a9f826cb7cfc9373b5d462..8df082bc195120342f52b6315dbcc700de3b34b0 100644 (file)
@@ -281,6 +281,7 @@ read_minibuf_noninteractive (map, initial, prompt, backup_n, expflag,
   fprintf (stdout, "%s", XSTRING (prompt)->data);
   fflush (stdout);
 
+  val = Qnil;
   size = 100;
   len = 0;
   line = (char *) xmalloc (size * sizeof *line);
@@ -1046,11 +1047,11 @@ is used to further constrain the set of candidates.")
 {
   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 @@ is used to further constrain the set of candidates.")
   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 @@ are ignored unless STRING itself starts with a space.")
   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 @@ are ignored unless STRING itself starts with a space.")
     {
       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 @@ a repetition of this command will exit.")
       return Qnil;
     }
  exit:
-  Fthrow (Qexit, Qnil);
+  return Fthrow (Qexit, Qnil);
   /* NOTREACHED */
 }
 
@@ -2028,6 +2029,8 @@ It can find the completion buffer in `standard-output'.")
          int length;
          Lisp_Object startpos, endpos;
 
+         startpos = Qnil;
+
          elt = Fcar (tail);
          /* Compute the length of this element.  */
          if (CONSP (elt))
@@ -2202,14 +2205,14 @@ DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0,
   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,
index 3ba413ae8c28dcdf23f2535ed733e6f5913bc4c3..48528bea12123f0642872ab64f4f745195dfaa40 100644 (file)
@@ -1527,7 +1527,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
 {
   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 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
   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 @@ since only regular expressions have distinguished subexpressions.")
          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 @@ to hold all the values, and if INTEGERS is non-nil, no consing is done.")
   if (NILP (last_thing_searched))
     return Qnil;
 
+  prev = Qnil;
+
   data = (Lisp_Object *) alloca ((2 * search_regs.num_regs)
                                 * sizeof (Lisp_Object));
 
index 07e633fec6223d48fd60a520e6096eb277cbb7c2..e704f0db0bbdc34557f795c65f26ed12eadb6d83 100644 (file)
@@ -1146,7 +1146,7 @@ insert_glyphs (start, len)
      register int len;
 {
   char *buf;
-  struct glyph *glyph;
+  struct glyph *glyph = NULL;
   struct frame *f, *sf;
 
   if (len <= 0)
index d9c807ccf93d0022f87430272303625e3fb60c4b..6cdf2943e60e5d4d43a3a689bf3f519defe1ba90 100644 (file)
@@ -1770,6 +1770,9 @@ window_loop (type, obj, mini, frames)
                && NILP (XBUFFER (w->buffer)->name))
              abort ();
            break;
+
+         case WINDOW_LOOP_UNUSED:
+           break;
          }
     }
 
@@ -3476,6 +3479,8 @@ shrink_window_lowest_first (w, height)
       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
index 07e050018f813b6bb09feb6482a6985d3cc10f35..fa7c352cc88558911fdaa21b0f4067c1259830ba 100644 (file)
@@ -691,11 +691,11 @@ cached information about equivalent key sequences.")
      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 @@ on the left of the dialog box and all following items on the right.\n\
   (position, contents)
      Lisp_Object position, contents;
 {
-  FRAME_PTR f;
+  struct frame * f = NULL;
   Lisp_Object window;
 
   check_x ();
@@ -1247,6 +1247,7 @@ menubar_selection_callback (widget, id, client_data)
 
   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 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
     {
       Lisp_Object prefix, entry;
 
-      prefix = Qnil;
+      prefix = entry = Qnil;
       i = 0;
       while (i < menu_items_used)
        {
index 82603c75feda9495813aebb952e7f222c9ad354d..830610945a196a5e20e428c8a9cfeda45e58f9fa 100644 (file)
@@ -180,7 +180,7 @@ magic_file_p (string, string_len, class, escaped_suffix, suffix)
   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 == '%')