Re: [PATCH 02/23] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions
On Thu, May 6, 2021 at 1:13 AM Philippe Mathieu-Daudé wrote: > Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Marc-André Lureau > --- > chardev/baum.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/chardev/baum.c b/chardev/baum.c > index 5deca778bc4..adc3d7b3b56 100644 > --- a/chardev/baum.c > +++ b/chardev/baum.c > @@ -87,6 +87,9 @@ > > #define BUF_SIZE 256 > > +#define X_MAX 84 > +#define Y_MAX 1 > + > struct BaumChardev { > Chardev parent; > > @@ -244,11 +247,11 @@ static int baum_deferred_init(BaumChardev *baum) > brlapi_perror("baum: brlapi__getDisplaySize"); > return 0; > } > -if (baum->y > 1) { > -baum->y = 1; > +if (baum->y > Y_MAX) { > +baum->y = Y_MAX; > } > -if (baum->x > 84) { > -baum->x = 84; > +if (baum->x > X_MAX) { > +baum->x = X_MAX; > } > > con = qemu_console_lookup_by_index(0); > -- > 2.26.3 > > > -- Marc-André Lureau
Re: [PATCH 02/23] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions
Philippe Mathieu-Daudé, le mer. 05 mai 2021 23:10:26 +0200, a ecrit: > Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Samuel Thibault > --- > chardev/baum.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/chardev/baum.c b/chardev/baum.c > index 5deca778bc4..adc3d7b3b56 100644 > --- a/chardev/baum.c > +++ b/chardev/baum.c > @@ -87,6 +87,9 @@ > > #define BUF_SIZE 256 > > +#define X_MAX 84 > +#define Y_MAX 1 > + > struct BaumChardev { > Chardev parent; > > @@ -244,11 +247,11 @@ static int baum_deferred_init(BaumChardev *baum) > brlapi_perror("baum: brlapi__getDisplaySize"); > return 0; > } > -if (baum->y > 1) { > -baum->y = 1; > +if (baum->y > Y_MAX) { > +baum->y = Y_MAX; > } > -if (baum->x > 84) { > -baum->x = 84; > +if (baum->x > X_MAX) { > +baum->x = X_MAX; > } > > con = qemu_console_lookup_by_index(0); > -- > 2.26.3 >
[PATCH 02/23] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions
Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daudé --- chardev/baum.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc4..adc3d7b3b56 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -87,6 +87,9 @@ #define BUF_SIZE 256 +#define X_MAX 84 +#define Y_MAX 1 + struct BaumChardev { Chardev parent; @@ -244,11 +247,11 @@ static int baum_deferred_init(BaumChardev *baum) brlapi_perror("baum: brlapi__getDisplaySize"); return 0; } -if (baum->y > 1) { -baum->y = 1; +if (baum->y > Y_MAX) { +baum->y = Y_MAX; } -if (baum->x > 84) { -baum->x = 84; +if (baum->x > X_MAX) { +baum->x = X_MAX; } con = qemu_console_lookup_by_index(0); -- 2.26.3