From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 9 Dec 2019 02:31:17 +0300 From: "Dmitry V. Levin" To: Aleksei Nikiforov Message-ID: <20191208233117.GD30742@altlinux.org> References: <20191206131606.83061-1-darktemplar@altlinux.org> <20191206131606.83061-2-darktemplar@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WChQLJJJfbwij+9x" Content-Disposition: inline In-Reply-To: <20191206131606.83061-2-darktemplar@altlinux.org> Cc: ALT Devel discussion list Subject: Re: [devel] [PATCH for apt 2/2] Fix pointer arithmetics X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 23:31:19 -0000 Archived-At: List-Archive: List-Post: --WChQLJJJfbwij+9x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 06, 2019 at 04:16:06PM +0300, Aleksei Nikiforov wrote: [...] > diff --git a/apt/apt-pkg/rebase_pointer.h b/apt/apt-pkg/rebase_pointer.h > new file mode 100644 > index 0000000..efc4074 > --- /dev/null > +++ b/apt/apt-pkg/rebase_pointer.h > @@ -0,0 +1,16 @@ > +#ifndef PKGLIB_REBASE_POINTER_H > +#define PKGLIB_REBASE_POINTER_H > + > +template > +static inline T* RebasePointer(T *ptr, const void * const old_base, cons= t void * const new_base) > +{ > + return reinterpret_cast(reinterpret_cast(ptr) + (reinterpr= et_cast(new_base) - reinterpret_cast(old_base))); > +} > + > +template > +static inline const T* RebasePointer(const T *ptr, const void * const ol= d_base, const void * const new_base) > +{ > + return reinterpret_cast(reinterpret_cast(ptr) = + (reinterpret_cast(new_base) - reinterpret_cast(old_base))); This line is way too long - about twice longer than a normal line of code. Please break long lines. My edition of rebase_pointer.h had the maximum length of all lines within the traditional 80-symbol limit. --=20 ldv --WChQLJJJfbwij+9x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJd7YfEAAoJEAVFT+BVnCUIxFkP/3M50wTkgA4BENQcREMGss74 /AWTFEGDNxsNZtvJrS8pc/1fF0mssqoYcBP8TOB2SfLsSCtYst6d1P3iVmqgUYFv wqG/ijnj4S/k5X7X5zkbBehMeNFltVnby7/VIygaCBjv4C+V64AVkW7DiqZuNx8g +aT67FDzS6xMl04o+OqZ1CPZKnUlv6TxwXKfUPqNYXvsu8491SZOE8nCrokRow8t zHMgOW9UVgyFIL1jmFFRqiveENFGVkpuhCUxeJg1uKfVxao3jt1yfueMhupBF5tS RPpdfZuxURNCHPENvf1PIa8OP7hCGts109mAhnEr8RtoZxAkN1XXXYEttcHl0blh WSpiFNNox1ujHlj4FzXOJrmhhJpRJdu8cu7hKyyEPAv8rzJA56QhmfW9dqeKrBbx YvsWKuj8JumrRgbtZX/SfWVLsoJSQtQgPmiUKnvUhdDCo+386O2k6YlXfeHQIo0O KmtJlQs3GIK1NRpCxBMTzqoDN267YkxRoGiEBIR3NBJaWFuwN28q/ZncYcwCc2GN 87ouB1m2IFRgPbL+K3mg8tmikAQm7b+HQisBqUP8/qlAhMUBwlxUl2NU5P3vNKX5 PfP0TuycouvmerYVXnQi3JAuvHYeQ36eGif9wXca3hamPlIIKURDsbMYK0NB4+/r p+MpE8yBTVIaFQRYbpHm =LVPg -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x--