emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 212aa7748b: Fix more uses of opaque Visual structure


From: Po Lu
Subject: master 212aa7748b: Fix more uses of opaque Visual structure
Date: Tue, 8 Mar 2022 02:21:52 -0500 (EST)

branch: master
commit 212aa7748bab6621453136d1d5df1ef76f5c3194
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix more uses of opaque Visual structure
    
    * src/image.c (x_kill_gs_process):
    * src/xfaces.c (x_free_colors):
    (x_free_dpy_colors):
    * src/xfns.c (Fxw_display_color_p):
    (Fx_display_grayscale_p):
    (Fx_display_visual_class):
    * src/xterm.c (x_copy_color):
    * src/xterm.h (x_mutable_colormap): Stop using private fields of
    Visual.
---
 src/image.c  | 2 +-
 src/xfaces.c | 4 ++--
 src/xfns.c   | 6 +++---
 src/xterm.c  | 2 +-
 src/xterm.h  | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/image.c b/src/image.c
index e2ba744e0a..c412dc9029 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11160,7 +11160,7 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f)
   /* On displays with a mutable colormap, figure out the colors
      allocated for the image by looking at the pixels of an XImage for
      img->pixmap.  */
-  if (x_mutable_colormap (FRAME_X_VISUAL (f)))
+  if (x_mutable_colormap (FRAME_X_VISUAL_INFO (f)))
     {
       XImage *ximg;
 
diff --git a/src/xfaces.c b/src/xfaces.c
index 1d2e2489de..d7f1f4d96e 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -475,7 +475,7 @@ x_free_colors (struct frame *f, unsigned long *pixels, int 
npixels)
 {
   /* If display has an immutable color map, freeing colors is not
      necessary and some servers don't allow it.  So don't do it.  */
-  if (x_mutable_colormap (FRAME_X_VISUAL (f)))
+  if (x_mutable_colormap (FRAME_X_VISUAL_INFO (f)))
     {
 #ifdef DEBUG_X_COLORS
       unregister_colors (pixels, npixels);
@@ -500,7 +500,7 @@ x_free_dpy_colors (Display *dpy, Screen *screen, Colormap 
cmap,
 
   /* If display has an immutable color map, freeing colors is not
      necessary and some servers don't allow it.  So don't do it.  */
-  if (x_mutable_colormap (dpyinfo->visual))
+  if (x_mutable_colormap (&dpyinfo->visual_info))
     {
 #ifdef DEBUG_X_COLORS
       unregister_colors (pixels, npixels);
diff --git a/src/xfns.c b/src/xfns.c
index 9a445b2682..c71f2b025f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5028,7 +5028,7 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, 
Sxw_display_color_p, 0, 1, 0,
   if (dpyinfo->n_planes <= 2)
     return Qnil;
 
-  switch (dpyinfo->visual->class)
+  switch (dpyinfo->visual_info.class)
     {
     case StaticColor:
     case PseudoColor:
@@ -5055,7 +5055,7 @@ If omitted or nil, that stands for the selected frame's 
display.  */)
   if (dpyinfo->n_planes <= 1)
     return Qnil;
 
-  switch (dpyinfo->visual->class)
+  switch (dpyinfo->visual_info.class)
     {
     case StaticColor:
     case PseudoColor:
@@ -5335,7 +5335,7 @@ If omitted or nil, that stands for the selected frame's 
display.
   struct x_display_info *dpyinfo = check_x_display_info (terminal);
   Lisp_Object result;
 
-  switch (dpyinfo->visual->class)
+  switch (dpyinfo->visual_info.class)
     {
     case StaticGray:
       result = intern ("static-gray");
diff --git a/src/xterm.c b/src/xterm.c
index 52df2e9f04..fdecca3bcd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4010,7 +4010,7 @@ x_copy_color (struct frame *f, unsigned long pixel)
      necessary and some servers don't allow it.  Since we won't free a
      color once we've allocated it, we don't need to re-allocate it to
      maintain the server's reference count.  */
-  if (!x_mutable_colormap (FRAME_X_VISUAL (f)))
+  if (!x_mutable_colormap (FRAME_X_VISUAL_INFO (f)))
     return pixel;
 
   color.pixel = pixel;
diff --git a/src/xterm.h b/src/xterm.h
index 88949b3039..4875eabafe 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1381,7 +1381,7 @@ x_make_truecolor_pixel (struct x_display_info *dpyinfo, 
int r, int g, int b)
    also allows us to make other optimizations relating to server-side
    reference counts.  */
 INLINE bool
-x_mutable_colormap (Visual *visual)
+x_mutable_colormap (XVisualInfo *visual)
 {
   int class = visual->class;
   return (class != StaticColor && class != StaticGray && class != TrueColor);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]