On Mon, 15 Feb 2010 19:14:57 +0100 Michal Suchanek <hramr...@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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel