All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gfxterm clear_char
@ 2009-07-29  5:15 Joe Auricchio
  2009-07-29 22:15 ` Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Auricchio @ 2009-07-29  5:15 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 36 bytes --]

Hi,

Eine kleine gfxterm.c cleanup


[-- Attachment #2: gfxterm_clear_char.diff.txt --]
[-- Type: text/plain, Size: 2722 bytes --]

Index: src/term/gfxterm.c
===================================================================
--- src.orig/term/gfxterm.c	2009-07-22 16:54:01.000000000 -0700
+++ src/term/gfxterm.c	2009-07-24 17:15:15.000000000 -0700
@@ -151,6 +151,16 @@
 }
 
 static void
+clear_char(struct grub_colored_char *c)
+{
+    c->code = ' ';
+    c->fg_color = virtual_screen.fg_color;
+    c->bg_color = virtual_screen.bg_color;
+    c->width = 0;
+    c->index = 0;
+}
+
+static void
 grub_virtual_screen_free (void)
 {
   /* If virtual screen has been allocated, free it.  */
@@ -230,11 +240,7 @@
   /* Clear out text buffer. */
   for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
     {
-      virtual_screen.text_buffer[i].code = ' ';
-      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
-      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
-      virtual_screen.text_buffer[i].width = 0;
-      virtual_screen.text_buffer[i].index = 0;
+      clear_char (&(virtual_screen.text_buffer[i]));
     }
 
   return grub_errno;
@@ -581,11 +587,7 @@
        i < virtual_screen.columns * virtual_screen.rows;
        i++)
     {
-      virtual_screen.text_buffer[i].code = ' ';
-      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
-      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
-      virtual_screen.text_buffer[i].width = 0;
-      virtual_screen.text_buffer[i].index = 0;
+      clear_char (&(virtual_screen.text_buffer[i]));
     }
 
   /* Scroll physical screen.  */
@@ -801,11 +803,7 @@
 
   for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
     {
-      virtual_screen.text_buffer[i].code = ' ';
-      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
-      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
-      virtual_screen.text_buffer[i].width = 0;
-      virtual_screen.text_buffer[i].index = 0;
+      clear_char (&(virtual_screen.text_buffer[i]));
     }
 
   virtual_screen.cursor_x = virtual_screen.cursor_y = 0;
Index: src/ChangeLog
===================================================================
--- src.orig/ChangeLog	2009-07-24 17:15:24.000000000 -0700
+++ src/ChangeLog	2009-07-24 17:18:11.000000000 -0700
@@ -1,3 +1,10 @@
+2009-07-24  Joe Auricchio  <jauricchio@gmail.com>
+
+	* term/gfxterm.c (clear_char): New function.
+	(grub_virtual_screen_setup): Use clear_char.
+	(scroll_up): Likewise.
+	(grub_virtual_screen_cls): Likewise.
+
 2009-07-21  Vladimir Serbinenko  <phcoder@gmail.com>
 
 	UUID support for UFS

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gfxterm clear_char
  2009-07-29  5:15 [PATCH] gfxterm clear_char Joe Auricchio
@ 2009-07-29 22:15 ` Pavel Roskin
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Roskin @ 2009-07-29 22:15 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, 2009-07-28 at 22:15 -0700, Joe Auricchio wrote:

> Eine kleine gfxterm.c cleanup

Applied with formatting changes.

>  static void
> +clear_char(struct grub_colored_char *c)

Space is needed before the parenthesis.

> +{
> +    c->code = ' ';

Indentation should be 2 spaces, not 4.

>    for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
>      {

This brace is no longer needed.

> Index: src/ChangeLog

It would be more convenient if the ChangeLog entry is posted inline
rather than inside the patch.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-29 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29  5:15 [PATCH] gfxterm clear_char Joe Auricchio
2009-07-29 22:15 ` Pavel Roskin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.