From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 To: devel@lists.altlinux.org References: <20191206131606.83061-1-darktemplar@altlinux.org> <20191206131606.83061-2-darktemplar@altlinux.org> <20191208233117.GD30742@altlinux.org> From: Aleksei Nikiforov Message-ID: <8cece78f-09ea-620d-55f0-0bebd22c93a4@altlinux.org> Date: Mon, 9 Dec 2019 10:09:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191208233117.GD30742@altlinux.org> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Language: ru Content-Transfer-Encoding: 8bit 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: Mon, 09 Dec 2019 07:10:36 -0000 Archived-At: List-Archive: List-Post: 09.12.2019 2:31, Dmitry V. Levin пишет: > 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, const void * const new_base) >> +{ >> + return reinterpret_cast(reinterpret_cast(ptr) + (reinterpret_cast(new_base) - reinterpret_cast(old_base))); >> +} >> + >> +template >> +static inline const T* RebasePointer(const T *ptr, const void * const old_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. > > Sure, I'll update this code. > > _______________________________________________ > Devel mailing list > Devel@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/devel >