All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] User definable terminfo support
Date: Mon, 02 Jan 2006 21:43:47 +0100	[thread overview]
Message-ID: <87vex2icn0.fsf@xs4all.nl> (raw)
In-Reply-To: <43B98B57.3@omniflux.com> (omniflux+lists@omniflux.com's message of "Mon, 02 Jan 2006 13:21:43 -0700")

Omniflux <omniflux+lists@omniflux.com> writes:

> Marco Gerards wrote:
>> Here is the review of the code that I promised.  Please see my other
>> email about generic comments.
>
> What is the subject line of this message? I sadly do not read all
> messages on this list.

You just answered it, so I guess you found it. ;-)

>> You can put the string on a new line.  If the string is still too long
>> you can make two strings out of it, like:
>> grub_error (FOO,
>>             "bar"
>>             "baz");
>
> grub_error (FOO, "bar" "baz");
> No operator or separator between strings?

Right.  That will concatenate them and result in the string "barbaz".

>>>+          ti->name   = grub_strdup (args[0]);
>> Typo.
>
> Can you be more specific? This looks correct to me...

Can you change that to:

ti->name = grub_strdup (args[0]);

(So only one space before `=')

>>>+static void
>>>+setup_defaults (void)
>>>+{
>>>+  terminfo_t *ti;
>>>+
>>>+  ti = (terminfo_t *) grub_malloc (sizeof (terminfo_t));
>>>+  /* Do I need to test if malloc succeeded here? What do I do if it did not? */
>> Good one :-)
>> In that case default could be set to NULL, if that is allowed?
>
> I think in this case, there will be many other problems. I think the
> best thing in this case will be, as you suggest, to set the definition
> to NULL and have all terminfo functions return their strings
> unmodified.
>
> The only consequence to this I can think of is loss of menu support on
> terminals which depend on terminfo (serial), and should be a rare case
> even there.

Another thing you could do is not malloc'ing memory, but using a
pointer to a pre-defined struct instead.  When free'ing you need a
special case to check if it is this pre-defined struct.

--
Marco




      reply	other threads:[~2006-01-02 20:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-28  0:34 [PATCH] User definable terminfo support Omniflux
2005-12-31 17:02 ` Marco Gerards
2006-01-02 19:53   ` Omniflux
2006-01-02 20:37     ` Marco Gerards
2006-01-02 21:33       ` Omniflux
2006-01-02 21:43         ` Marco Gerards
2006-01-02 19:44 ` Marco Gerards
2006-01-02 20:21   ` Omniflux
2006-01-02 20:43     ` Marco Gerards [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vex2icn0.fsf@xs4all.nl \
    --to=mgerards@xs4all.nl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.