On Fri, 10 Dec 2010, Enlightenment SVN wrote:
> Log: > fix void ptr math. odd that no warnings happened before with all my > warning flags on. just use -Wpointer-arith what about ading in all the EFL: m4_ifdef([v_rev], [ EFL_COMPILER_FLAG([-Wpointer-arith]) ]) to be sure we (that is not only you) don't miss them ? Vincent > > > > Author: raster > Date: 2010-12-10 19:57:05 -0800 (Fri, 10 Dec 2010) > New Revision: 55484 > Trac: http://trac.enlightenment.org/e/changeset/55484 > > Modified: > trunk/eina/src/lib/eina_strbuf_common.c > > Modified: trunk/eina/src/lib/eina_strbuf_common.c > =================================================================== > --- trunk/eina/src/lib/eina_strbuf_common.c 2010-12-11 03:44:33 UTC (rev > 55483) > +++ trunk/eina/src/lib/eina_strbuf_common.c 2010-12-11 03:57:05 UTC (rev > 55484) > @@ -195,14 +195,15 @@ > return EINA_FALSE; > > /* move the existing text */ > - memmove(buf->buf + ((len + pos) * csize), buf->buf + (pos * csize), > + memmove(((unsigned char *)(buf->buf)) + ((len + pos) * csize), > + ((unsigned char *)(buf->buf)) + (pos * csize), > (buf->len - pos) * csize); > > /* and now insert the given string */ > memcpy(buf->buf + (pos * csize), str, len * csize); > > buf->len += len; > - memset(buf->buf + (buf->len * csize), 0, csize); > + memset(((unsigned char *)(buf->buf)) + (buf->len * csize), 0, csize); > return EINA_TRUE; > } > > @@ -305,7 +306,8 @@ > if (EINA_UNLIKELY(!_eina_strbuf_common_grow(csize, buf, buf->len + len))) > return EINA_FALSE; > > - memcpy(buf->buf + (buf->len * csize), str, (len + 1) * csize); > + memcpy(((unsigned char *)(buf->buf)) + (buf->len * csize), str, > + (len + 1) * csize); > buf->len += len; > return EINA_TRUE; > } > @@ -346,9 +348,10 @@ > if (EINA_UNLIKELY(!_eina_strbuf_common_grow(csize, buf, buf->len + len))) > return EINA_FALSE; > > - memcpy(buf->buf + (buf->len * csize), str, len * csize); > + memcpy(((unsigned char *)(buf->buf)) + (buf->len * csize), str, > + len * csize); > buf->len += len; > - memset(buf->buf + (buf->len * csize), 0, csize); > + memset(((unsigned char *)(buf->buf)) + (buf->len * csize), 0, csize); > return EINA_TRUE; > } > > @@ -382,9 +385,10 @@ > if (EINA_UNLIKELY(!_eina_strbuf_common_grow(csize, buf, buf->len + > length))) > return EINA_FALSE; > > - memcpy(buf->buf + (buf->len * csize), str, length * csize); > + memcpy(((unsigned char *)(buf->buf)) + (buf->len * csize), str, > + length * csize); > buf->len += length; > - memset(buf->buf + (buf->len * csize), 0, csize); > + memset(((unsigned char *)(buf->buf)) + (buf->len * csize), 0, csize); > return EINA_TRUE; > } > > @@ -507,8 +511,8 @@ > if (EINA_UNLIKELY(!_eina_strbuf_common_grow(csize, buf, buf->len + 1))) > return EINA_FALSE; > > - memcpy(buf->buf + ((buf->len)++ *csize), c, csize); > - memset(buf->buf + (buf->len * csize), 0, csize); > + memcpy(((unsigned char *)(buf->buf)) + ((buf->len)++ *csize), c, csize); > + memset(((unsigned char *)(buf->buf)) + (buf->len * csize), 0, csize); > return EINA_TRUE; > } > > @@ -574,8 +578,8 @@ > } > > tail_len = buf->len - end + 1; /* includes '\0' */ > - memmove(buf->buf + (start * csize), > - buf->buf + (end * csize), > + memmove(((unsigned char *)(buf->buf)) + (start * csize), > + ((unsigned char *)(buf->buf)) + (end * csize), > tail_len * csize); > buf->len -= remove_len; > return _eina_strbuf_common_resize(csize, buf, buf->len); > @@ -747,14 +751,15 @@ > > } > > - memmove(buf->buf + pos + len2, buf->buf + pos + len1, > + memmove(((unsigned char *)(buf->buf)) + pos + len2, > + ((unsigned char *)(buf->buf)) + pos + len1, > buf->len - pos - len1); > } > > /* and now insert the given string */ > - memcpy(buf->buf + pos, with, len2); > + memcpy(((unsigned char *)(buf->buf)) + pos, with, len2); > buf->len += len2 - len1; > - memset((char *)buf->buf + buf->len, 0, 1); > + memset(((unsigned char *)(buf->buf)) + buf->len, 0, 1); > > return EINA_TRUE; > } > @@ -831,9 +836,11 @@ > } > > /* copy the untouched text */ > - memcpy(buf->buf + start, tmp_buf + start_tmp, pos - start); > + memcpy(((unsigned char *)(buf->buf)) + start, > + tmp_buf + start_tmp, pos - start); > /* copy the new string */ > - memcpy(buf->buf + pos, with, len2); > + memcpy(((unsigned char *)(buf->buf)) + pos, > + with, len2); > > /* calculate the next positions */ > start_tmp = pos_tmp + len1; > @@ -846,9 +853,10 @@ > pos = start + pos_tmp - start_tmp; > } > /* and now copy the rest of the text */ > - memcpy(buf->buf + start, tmp_buf + start_tmp, len - start); > + memcpy(((unsigned char *)(buf->buf)) + start, > + tmp_buf + start_tmp, len - start); > buf->len = len; > - memset((char *)buf->buf + buf->len, 0, 1); > + memset(((unsigned char *)(buf->buf)) + buf->len, 0, 1); > > free(tmp_buf); > > > > ------------------------------------------------------------------------------ > Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, > new data types, scalar functions, improved concurrency, built-in packages, > OCI, SQL*Plus, data movement tools, best practices and more. > http://p.sf.net/sfu/oracle-sfdev2dev > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > ------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel