Subject: Re: bug#71159: [PATCH] Stipple support for MS Windows

From: Eli Zaretskii <[email-masked]>
Date: Sun, 02 Jun 2024 07:54:34 +0300

> From: "Elijah G." <[email-masked]>
> Cc: Po Lu <[email-masked]>,  [email-masked],  Eli Zaretskii
>  <[email-masked]>
> Date: Sat, 01 Jun 2024 12:54:22 -0600
> 
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -2827,6 +2827,9 @@ thumbnail images and show them in the thumbnail buffer.  Unlike with
>  using 'convert', this fallback method is synchronous, so Emacs will wait
>  until all the thumbnails are created and displayed, before showing them.
>  
> +---
> +*** Emacs on MS-Windows now supports the :stipple face attribute

This should end with a period, and :stipple should be quoted as
':stipple'.

> +  Emacs_Pixmap stipple, bitmap;
>    bitmap = CreateBitmap (width, height,
> -			 FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes,
> -			 FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits,
> +			 dpyinfo->n_planes,
> +			 dpyinfo->n_cbits,
>  			 bits);

Please rewrite this as follows:

  Emacs_Pixmap stipple;
  Emacs_Pixmap bitmap = CreateBitmap (width, height, dpyinfo->n_planes,
				      dpyinfo->n_cbits, bits);

> +  {
> +    char *invertedBits;
> +    int nbytes, i;
> +
> +    invertedBits = bits;
> +    nbytes = (width + CHAR_BIT - 1) / CHAR_BIT * height;

Also here, please initialize the local variables where appropriate:

  {
    char invertedBits = bits;
    int nbytes = (width + CHAR_BIT - 1) / CHAR_BIT * height, i;

Thanks.