I'm all for that actually for lots of reasons. I'm going to look into making this change tonight and tomorrow. I don't suppose it would be too bad either.
> Hey Pat, > > If I'm honest, the array stuff in Bongo always slightly scared me due to > its bare-metal macros implementation. > > Is there much of a reason to not use the Glib versions? I got the > impression that many of our data structures were basically nicked > wholesale from there in the first place anyway, and the APIs are > probably so similar it may not be much tougher than a bit of find and > replace refactoring.... > > Cheers > > Alex. > > On 09/07/09 13:17, [email protected] wrote: >> as soon as my head hit the pillow i realized i forgot one set of parens >> and cound simplify a bit.... >> >> array->data + (array->len * array->elemSize) - (array->data + (i >> *array->elemSize) + elemSize) >> >> which simplifies to >> >> (array->len * array->elemSize) - (i * array->elemSize) - elemSize >> >> >>> I've done some test cases on paper and think that the comment here is >>> the >>> right way. /me would like a double check on the logic before >>> committing... >>> >>> mail memmgr-glib # svn diff >>> Index: src/libs/bongoutil/array.c >>> =================================================================== >>> --- src/libs/bongoutil/array.c (revision 1098) >>> +++ src/libs/bongoutil/array.c (working copy) >>> @@ -149,6 +149,9 @@ >>> return; >>> } >>> >>> + /* i belive the byte count should be >>> + * array->data + (array->len * array->elemSize) - array->data + (i >>> * >>> array->elemSize) + elemSize >>> + */ >>> memmove((char *)array->data + (i * array->elemSize), >>> (char*)array->data + ((i + 1) * array->elemSize), >>> (array->elemSize * (array->len - i))); >>> mail memmgr-glib # >>> >>> >>> _______________________________________________ >>> Bongo-devel mailing list >>> [email protected] >>> https://mail.gna.org/listinfo/bongo-devel >>> >>> >> >> >> >> _______________________________________________ >> Bongo-devel mailing list >> [email protected] >> https://mail.gna.org/listinfo/bongo-devel >> > > > _______________________________________________ > Bongo-devel mailing list > [email protected] > https://mail.gna.org/listinfo/bongo-devel > > _______________________________________________ Bongo-devel mailing list [email protected] https://mail.gna.org/listinfo/bongo-devel
