Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-20 Thread Gustavo Sverzut Barbieri
On Thu, Aug 20, 2009 at 8:51 AM, Vincent Torri wrote: > > > On Thu, 20 Aug 2009, Gustavo Sverzut Barbieri wrote: > >> I'd say it's good as is, if the other is fewer lines of code, then >> better. But please cast to const char*  to avoid possible mistakes and >> writing to that pointer. > > that one

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-20 Thread Vincent Torri
On Thu, 20 Aug 2009, Gustavo Sverzut Barbieri wrote: I'd say it's good as is, if the other is fewer lines of code, then better. But please cast to const char* to avoid possible mistakes and writing to that pointer. that one is smaller: Index: src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-20 Thread Gustavo Sverzut Barbieri
I'd say it's good as is, if the other is fewer lines of code, then better. But please cast to const char* to avoid possible mistakes and writing to that pointer. On Thu, Aug 20, 2009 at 3:18 AM, Vincent Torri wrote: > > here is a patch. Another patch would be to cast when computing the > delta's.

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
here is a patch. Another patch would be to cast when computing the delta's. Which one do you prefer ? Vincent Index: eina_fixed_bitmap.c === --- eina_fixed_bitmap.c (revision 41856) +++ eina_fixed_bitmap.c (working copy) @@ -62,8 +

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Gustavo Sverzut Barbieri
On Wed, Aug 19, 2009 at 10:07 AM, Joerg Sonnenberger wrote: > On Wed, Aug 19, 2009 at 02:36:54PM +0200, Cedric BAIL wrote: >> It's not gcc specific other decent compiler support this feature. But >> apparently not suncc, so you can patch if needed. > > void arithmetic is NOT a feature. It is a hist

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Joerg Sonnenberger
On Wed, Aug 19, 2009 at 02:36:54PM +0200, Cedric BAIL wrote: > It's not gcc specific other decent compiler support this feature. But > apparently not suncc, so you can patch if needed. void arithmetic is NOT a feature. It is a historic accident and bug. Code using it is simply broken. Nothing less

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
On Wed, 19 Aug 2009, Gustavo Sverzut Barbieri wrote: > On Wed, Aug 19, 2009 at 9:36 AM, Cedric BAIL wrote: >> On Wed, Aug 19, 2009 at 12:23 PM, Vincent Torri wrote: >>> On Wed, 19 Aug 2009, Cedric BAIL wrote: On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri wrote: > On Wed, 19 Aug 2

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Gustavo Sverzut Barbieri
On Wed, Aug 19, 2009 at 9:36 AM, Cedric BAIL wrote: > On Wed, Aug 19, 2009 at 12:23 PM, Vincent Torri wrote: >> On Wed, 19 Aug 2009, Cedric BAIL wrote: >>> On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri >>> wrote: On Wed, 19 Aug 2009, Cedric BAIL wrote: > On Wed, Aug 19, 2009 at 10:40 AM,

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Cedric BAIL
On Wed, Aug 19, 2009 at 12:23 PM, Vincent Torri wrote: > On Wed, 19 Aug 2009, Cedric BAIL wrote: >> On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri >> wrote: >>> On Wed, 19 Aug 2009, Cedric BAIL wrote: On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri wrote: > On Wed, 19 Aug 2009, Vince

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
On Wed, 19 Aug 2009, Cedric BAIL wrote: > On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri wrote: >> On Wed, 19 Aug 2009, Cedric BAIL wrote: >>> On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri >>> wrote: On Wed, 19 Aug 2009, Vincent Torri wrote: > > Hey, > > in eina_fixe

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Cedric BAIL
On Wed, Aug 19, 2009 at 12:04 PM, Vincent Torri wrote: > On Wed, 19 Aug 2009, Cedric BAIL wrote: >> On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri >> wrote: >>> >>> On Wed, 19 Aug 2009, Vincent Torri wrote: Hey, in eina_fixed_bitmap.c, lines 68, 88 and 160, offsets are computed

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
On Wed, 19 Aug 2009, Cedric BAIL wrote: > On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri 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, o

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread The Rasterman
On Wed, 19 Aug 2009 11:59:50 +0200 Cedric BAIL said: > On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri 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, o

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Cedric BAIL
On Wed, Aug 19, 2009 at 10:40 AM, Vincent Torri 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 sto

Re: [E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
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,

[E-devel] possible truncation of variable values in eina_fixed_bitmap.c on 64 bits

2009-08-19 Thread Vincent Torri
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 ? Vincent