From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 75D216EC58; Sun, 1 Aug 2021 20:06:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 75D216EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627837588; bh=lmySX09oNljbqd07WoMDdV4iP4xp3jXK0XEjz2u+Rr0=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bKR8eykXV7WIpG/t94M5bWCptcfjimMa4aFDKeJeNkfSui2SFD5A+HcIemk2UP5jv 7K76LDHI39rOJe+fzV4wNld/mAoDG6URMQKXcuG0Qv9TMvkehUhdkBbo+bwG1jXAit kVNaaFGVQfbUwJR1eMhHg3Xe0xgkBPKNpFZcohrU= Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (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 057EA6EC58 for ; Sun, 1 Aug 2021 20:06:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 057EA6EC58 Received: by smtp16.mail.ru with esmtpa (envelope-from ) id 1mAEuw-0002Yc-DY; Sun, 01 Aug 2021 20:06:26 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) In-Reply-To: <030ca5d7-9dc9-84b6-0e4f-554629777b5b@tarantool.org> Date: Sun, 1 Aug 2021 20:06:25 +0300 Content-Transfer-Encoding: 7bit Message-Id: <769DAE87-9635-43D4-88E5-1DFB172FB79F@tarantool.org> References: <175f212fc092d0da8e5d773160042db5770fee2e.1627420835.git.v.shpilevoy@tarantool.org> <030ca5d7-9dc9-84b6-0e4f-554629777b5b@tarantool.org> To: Vladislav Shpilevoy X-Mailer: Apple Mail (2.3654.100.0.2.22) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C366EE405EC28A2001F8302D8429E0DE58182A05F538085040AA8BC3C1D98E1E219E61610A4D8D346F926B8374B43E90D0F0ED584CD4233DC3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77603ADE015AF816DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F3509D799AA74AD88638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BDA8653C35855D39D217E031B5C6E824117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6AC294AFEFA671E80089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A518CC06CC9433862E55B1F963D3D6BA1FB18436F520C73206D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA751B940EDA0DFB0535410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D8C933888226C8414052C18FA136511B99D3CD2A1359106B8836AC4EB2B95D989EE59F76EFF1E3EA1D7E09C32AA3244CEF878F91F495753E6979E6CFD71B98C89CA7333006C390A0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMCfuYI4PrecXzi7ynCOQGA== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81EF8CE7A4E0C5A6F13F3BE8B88E9C838B0F16D0C27979E9D13AD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 4/5] decimal: introduce decimal_to_string X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for updates! > > It is in the commit title already. I don't want to duplicate the title > in the message. > Sure, just missed it. >>> diff --git a/src/lib/core/decimal.c b/src/lib/core/decimal.c >>> index 4befbda37..6d2ccb96f 100644 >>> --- a/src/lib/core/decimal.c >>> +++ b/src/lib/core/decimal.c >>> @@ -175,6 +175,14 @@ decimal_str(const decimal_t *dec) >>> return buf; >>> } >>> >>> +void >>> +decimal_to_string(const decimal_t *dec, char *str) >>> +{ >>> + char *tmp = decNumberToString(dec, str); >>> + assert(str == tmp); >> >> Why? The decToString() doesn't touch original string pointer, working on >> a local copy. > > Yes, this is why there is the assertion. Also to be consistent with > decimal_str() which has the same assert. > I really doubt we need to assert something that has no chance to be wrong. Anyways, LGTM. Sergos