grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: play.c


From: Yoshinori K. Okuji
Subject: Re: play.c
Date: Sat, 5 Nov 2005 19:28:49 +0100
User-agent: KMail/1.7.2

On Saturday 05 November 2005 03:17 pm, Vincent Pelletier wrote:
> Here is the play command, along with some songs.

I point out some stylish mistakes.

> +struct note {
> +  short pitch;
> +  short duration;
> +};

You must put the starting brace character on next line:

struct note
{
  short pitch;
  short duration;
};

> +  while (grub_file_read (file, (void *) &buf, sizeof(struct note)) == 
sizeof(struct note) &&
> +         buf.pitch != T_FINE &&
> +         grub_checkkey () == -1)

The lines are folded incorrectly. You must insert new lines before logical 
operations. Also, please add a space character after sizeof:

while (grub_file_read (file, (void *) &buf, sizeof (struct note)) == sizeof 
(struct note)
          && buf.pitch != T_FINE
          && grub_checkkey () == -1)

> +      to = grub_get_rtc () + 120*buf.duration/tempo;

Insert space characters.

Okuji




reply via email to

[Prev in Thread] Current Thread [Next in Thread]