From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 9CAFB4765E3 for ; Mon, 28 Dec 2020 04:44:12 +0300 (MSK) Date: Mon, 28 Dec 2020 04:43:26 +0300 From: Sergey Kaplun Message-ID: <20201228014326.GG14702@root> References: <20201226142225.GH5396@tarantool.org> <20201226152615.GX9101@root> <20201226193741.GY9101@root> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201226193741.GY9101@root> Subject: Re: [Tarantool-patches] [PATCH luajit v2 2/7] core: introduce write buffer module List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich , tarantool-patches@dev.tarantool.org Fixed warning "pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]" Changed naming. See iterative patch below. Branch will be force-pushed later with v3 series. =================================================================== diff --git a/src/lj_wbuf.c b/src/lj_wbuf.c index ef46545..897ef08 100644 --- a/src/lj_wbuf.c +++ b/src/lj_wbuf.c @@ -90,7 +90,7 @@ void lj_wbuf_addn(struct lj_wbuf *buf, const void *src, size_t n) memcpy(buf->pos, src, left); buf->pos += (ptrdiff_t)left; lj_wbuf_flush(buf); - src += (ptrdiff_t)left; + src = (uint8_t *)src + (ptrdiff_t)left; n -= left; } @@ -120,7 +120,7 @@ void LJ_FASTCALL lj_wbuf_flush(struct lj_wbuf *buf) written = buf->writer((const void **)&buf->buf, len, buf->ctx); if (LJ_UNLIKELY(written < len)) { - wbuf_set_flag(buf, STREAM_ERR_IO); + wbuf_set_flag(buf, STREAM_ERRIO); wbuf_save_errno(buf); } if (LJ_UNLIKELY(buf->buf == NULL)) { diff --git a/src/lj_wbuf.h b/src/lj_wbuf.h index 77a7cf4..9eaa5e5 100644 --- a/src/lj_wbuf.h +++ b/src/lj_wbuf.h @@ -28,7 +28,7 @@ */ /* Stream errors. */ -#define STREAM_ERR_IO 0x1 +#define STREAM_ERRIO 0x1 #define STREAM_STOP 0x2 /* =================================================================== -- Best regards, Sergey Kaplun