]> code.delx.au - gnu-emacs/blobdiff - src/xfaces.c
Port --enable-gcc-warnings to GCC 6.1
[gnu-emacs] / src / xfaces.c
index ac1370003dfaa4af6a68386fe81f13468d6206d1..c42e55333cf4056817d0a0c5357ec65ef8773ca4 100644 (file)
@@ -3694,7 +3694,7 @@ Default face attributes override any local face attributes.  */)
   if (EQ (face, Qdefault))
     {
       struct face_cache *c = FRAME_FACE_CACHE (f);
-      struct face *newface, *oldface = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+      struct face *newface, *oldface = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
       Lisp_Object attrs[LFACE_VECTOR_SIZE];
 
       /* This can be NULL (e.g., in batch mode).  */
@@ -3777,7 +3777,7 @@ return the font name used for CHARACTER.  */)
     {
       struct frame *f = decode_live_frame (frame);
       int face_id = lookup_named_face (f, face, true);
-      struct face *fface = FACE_FROM_ID (f, face_id);
+      struct face *fface = FACE_OPT_FROM_ID (f, face_id);
 
       if (! fface)
        return Qnil;
@@ -4429,15 +4429,13 @@ lookup_named_face (struct frame *f, Lisp_Object symbol, bool signal_p)
 {
   Lisp_Object attrs[LFACE_VECTOR_SIZE];
   Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
-  struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+  struct face *default_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
 
   if (default_face == NULL)
     {
       if (!realize_basic_faces (f))
        return -1;
       default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
-      if (default_face == NULL)
-       emacs_abort (); /* realize_basic_faces must have set it up  */
     }
 
   if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
@@ -4600,9 +4598,6 @@ lookup_derived_face (struct frame *f, Lisp_Object symbol, int face_id,
   Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
   struct face *default_face = FACE_FROM_ID (f, face_id);
 
-  if (!default_face)
-    emacs_abort ();
-
   if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
     return -1;
 
@@ -4706,7 +4701,7 @@ x_supports_face_attributes_p (struct frame *f,
       merge_face_vectors (f, attrs, merged_attrs, 0);
 
       face_id = lookup_face (f, merged_attrs);
-      face = FACE_FROM_ID (f, face_id);
+      face = FACE_OPT_FROM_ID (f, face_id);
 
       if (! face)
        error ("Cannot make face");
@@ -4976,14 +4971,12 @@ face for italic.  */)
     attrs[i] = Qunspecified;
   merge_face_ref (f, attributes, attrs, true, 0);
 
-  def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+  def_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
   if (def_face == NULL)
     {
       if (! realize_basic_faces (f))
        error ("Cannot realize default face");
       def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
-      if (def_face == NULL)
-       emacs_abort ();  /* realize_basic_faces must have set it up  */
     }
 
   /* Dispatch to the appropriate handler.  */
@@ -5453,7 +5446,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
 
   /* Determine the font to use.  Most of the time, the font will be
      the same as the font of the default face, so try that first.  */
-  default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+  default_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
   if (default_face
       && lface_same_font_attributes_p (default_face->lface, attrs))
     {
@@ -6093,7 +6086,6 @@ face_at_string_position (struct window *w, Lisp_Object string,
     *endptr = -1;
 
   base_face = FACE_FROM_ID (f, base_face_id);
-  eassert (base_face);
 
   /* Optimize the default case that there is no face property.  */
   if (NILP (prop)
@@ -6140,7 +6132,7 @@ merge_faces (struct frame *f, Lisp_Object face_name, int face_id,
   Lisp_Object attrs[LFACE_VECTOR_SIZE];
   struct face *base_face;
 
-  base_face = FACE_FROM_ID (f, base_face_id);
+  base_face = FACE_OPT_FROM_ID (f, base_face_id);
   if (!base_face)
     return base_face_id;
 
@@ -6168,7 +6160,7 @@ merge_faces (struct frame *f, Lisp_Object face_name, int face_id,
       struct face *face;
       if (face_id < 0)
        return base_face_id;
-      face = FACE_FROM_ID (f, face_id);
+      face = FACE_OPT_FROM_ID (f, face_id);
       if (!face)
        return base_face_id;
       merge_face_vectors (f, face->lface, attrs, 0);
@@ -6288,7 +6280,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */)
     {
       struct face *face;
       CHECK_NUMBER (n);
-      face = FACE_FROM_ID (SELECTED_FRAME (), XINT (n));
+      face = FACE_OPT_FROM_ID (SELECTED_FRAME (), XINT (n));
       if (face == NULL)
        error ("Not a valid face");
       dump_realized_face (face);