[PATCH v2 7/9] ui/curses: Make control_characters[] array const

Philippe Mathieu-Daudé posted 9 patches 5 years, 7 months ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Jason Wang <jasowang@redhat.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>
[PATCH v2 7/9] ui/curses: Make control_characters[] array const
Posted by Philippe Mathieu-Daudé 5 years, 7 months ago
As we only use this array as input, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 ui/curses.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/curses.c b/ui/curses.c
index 3a1b71451c..3bafc10c1c 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -529,7 +529,7 @@ static void font_setup(void)
      * Control characters are normally non-printable, but VGA does have
      * well-known glyphs for them.
      */
-    static uint16_t control_characters[0x20] = {
+    static const uint16_t control_characters[0x20] = {
       0x0020,
       0x263a,
       0x263b,
-- 
2.21.1


Re: [PATCH v2 7/9] ui/curses: Make control_characters[] array const
Posted by Stefano Garzarella 5 years, 7 months ago
On Thu, Mar 05, 2020 at 01:45:23PM +0100, Philippe Mathieu-Daudé wrote:
> As we only use this array as input, make it const.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  ui/curses.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

> 
> diff --git a/ui/curses.c b/ui/curses.c
> index 3a1b71451c..3bafc10c1c 100644
> --- a/ui/curses.c
> +++ b/ui/curses.c
> @@ -529,7 +529,7 @@ static void font_setup(void)
>       * Control characters are normally non-printable, but VGA does have
>       * well-known glyphs for them.
>       */
> -    static uint16_t control_characters[0x20] = {
> +    static const uint16_t control_characters[0x20] = {
>        0x0020,
>        0x263a,
>        0x263b,
> -- 
> 2.21.1
>