On Wed, 19 Aug 2009, Gustavo Sverzut Barbieri wrote:
> On Wed, Aug 19, 2009 at 9:36 AM, Cedric BAIL<[email protected]> wrote: >> On Wed, Aug 19, 2009 at 12:23 PM, Vincent Torri<[email protected]> wrote: >>> On Wed, 19 Aug 2009, Cedric BAIL wrote: >>>> On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri<[email protected]> >>>> wrote: >>>>> On Wed, 19 Aug 2009, Cedric BAIL wrote: >>>>>> On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri<[email protected]> >>>>>> wrote: >>>>>>> On Wed, 19 Aug 2009, Vincent Torri wrote: >>>>>>>> >>>>>>>> Hey, >>>>>>>> >>>>>>>> in eina_fixed_bitmap.c, lines 68, 88 and 160, offsets are computed and >>>>>>>> stored in an int. But, if I'm not mistaken, on 64 bits arch, offsets >>>>>>>> are >>>>>>>> 64 bits long. >>>>>>>> >>>>>>>> Shouldn't we store them in long instead of int ? >>>>>>> >>>>>>> and technically speaking, we should cast to char * (it seems that, for >>>>>>> gcc, sizeof(void) == 1) >>>>>> >>>>>> And sizeof(void*) ? :-) >>>>> >>>>> if you have : >>>>> >>>>> type *a = ... >>>>> type *b = ... >>>>> >>>>> a - b is equal to (the address of a - the address of b) / sizeof (type) >>>>> >>>>> and not >>>>> >>>>> (the address of a - the address of b) / sizeof (type *) >>>> >>>> Does your compile handle void* arithmetic or not ? I guess your are >>>> porting to some kind of strange compiler that don't support pointer >>>> arithmetic with void* ? I am right ? >>> >>> it supports of course pointer arithmetic, but i think that you don't >>> understand the problem, or you didn't read carefully what i just wrote >>> above. >>> >>> You MUST know the size of 'type'. gcc is stating that void is a type of size >>> 1, it's a gcc feature that is specific to it. suncc does not state that >>> (size of void is undefined in the standard). >> >> It's not gcc specific other decent compiler support this feature. But >> apparently not suncc, so you can patch if needed. > > if i understand correctly, suncc does handle void* arithmetic, as one > unit ("byte") that's the contrary. It does not support that Vincent > and, similar to cast to char* and as I far as I tested > it's the same thing in GCC as well, try the following code: > > #include <stdio.h> > int main(void) { > struct x { char a[4], b[4]; } x = {"abc", "123"}; > struct y { int a[4], b[4]; } y = {{1, 2, 3, 4}, {10, 20, 30, 40}}; > > printf("x: char b - a: %2ld ( 4)\n", (char *)x.b - (char *)x.a); > printf("x: void b - a: %2ld ( ?)\n", (void *)x.b - (void *)x.a); > printf("y: char b - a: %2ld (16)\n", (char *)y.b - (char *)y.a); > printf("y: void b - a: %2ld ( ?)\n", (void *)y.b - (void *)y.a); > printf("y: int b - a: %2ld ( 4)\n", y.b - y.a); > return 0; > } > > here all char and void report the same, first "?" is 4, second is 16. > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems > -------------------------------------- > MSN: [email protected] > Skype: gsbarbieri > Mobile: +55 (19) 9225-2202 > > -- > Ce message a ?t? v?rifi? par MailScanner > pour des virus ou des polluriels et rien de > suspect n'a ?t? trouv?. > Message d?livr? par le serveur de messagerie de l'Universit? d'Evry. > > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
