All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin D Bennett <colin@gibibit.com>
To: Michal Suchanek <hramrach@centrum.cz>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us
Date: Mon, 15 Feb 2010 10:35:16 -0800	[thread overview]
Message-ID: <20100215103516.56c60815@svelte> (raw)
In-Reply-To: <a5d587fb1002151014j36dc86f9q3b3ad43342b03aa2@mail.gmail.com>

On Mon, 15 Feb 2010 19:14:57 +0100
Michal Suchanek <hramrach@centrum.cz> wrote:

> What is left unsigned is the framebuffer size in mode info and it
> indeed requires some casts and causes trouble. It made me change one
> of the transform routines to asymmetric types because it is used
> (almost) exclusively on the mode info structure. The members of
> mode_info should not ever become negative, though and the unsigned
> type is probably meant to make that clear. I can't say if making that
> clear outweights the possible issues when using the values in
> calculations.

I think it is obvious that width and height values are never negative.
Since the data type (unsigned) is only visible the to programmer in the
declaration of the struct, not in uses of its members, I think it would
be just as effective to declare such values as signed types with a
comment at the declaration like "/* Nonnegative */" to make it clear,
and this would avoid signed/unsigned conversion/comparision problems.

Regards,
Colin



  reply	other threads:[~2010-02-15 18:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28  8:03 [RFC] Framebuffer rotation patch Michal Suchanek
2009-08-29 10:24 ` Michal Suchanek
2010-02-11  2:46 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-11 10:19   ` Michal Suchanek
2010-02-11 10:52     ` Michal Suchanek
2010-02-11 16:11       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-11 16:08     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-13 17:29       ` Michal Suchanek
2010-02-15 17:05         ` [RFC] Framebuffer rotation patch, or why 'unsigned' fails us Colin D Bennett
2010-02-15 18:14           ` Michal Suchanek
2010-02-15 18:35             ` Colin D Bennett [this message]
2010-02-16 12:35             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 20:53               ` Michal Suchanek
2010-02-16 12:32         ` [RFC] Framebuffer rotation patch Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 15:52           ` Michal Suchanek
2010-02-16 18:03             ` Isaac Dupree
2010-02-16 18:15               ` richardvoigt
2010-02-16 18:47                 ` [Off-topic] C++ enums Isaac Dupree
2010-02-16 16:08   ` [RFC] Framebuffer rotation patch Michal Suchanek
2010-02-16 16:21     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 21:05       ` Michal Suchanek
2010-02-16 21:14         ` richardvoigt
2010-02-16 23:19           ` Michal Suchanek
2010-02-16 21:53         ` Michal Suchanek

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=20100215103516.56c60815@svelte \
    --to=colin@gibibit.com \
    --cc=grub-devel@gnu.org \
    --cc=hramrach@centrum.cz \
    /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.