MESSAGE
DATE | 2016-12-06 |
FROM | Ruben Safir
|
SUBJECT | Re: [Learn] [png-mng-implement] 4 byte length storage
|
From learn-bounces-at-nylxs.com Tue Dec 6 14:24:54 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id C98E8161314; Tue, 6 Dec 2016 14:24:53 -0500 (EST) X-Original-To: learn-at-www.mrbrklyn.com Delivered-To: learn-at-www.mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 1000) id C12EE161311; Tue, 6 Dec 2016 14:24:50 -0500 (EST) Resent-From: Ruben Safir Resent-Date: Tue, 6 Dec 2016 14:24:50 -0500 Resent-Message-ID: <20161206192450.GF29134-at-www.mrbrklyn.com> Resent-To: learn-at-mrbrklyn.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by mrbrklyn.com (Postfix) with ESMTP id 7F6C4160E77 for ; Tue, 6 Dec 2016 14:24:37 -0500 (EST) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cELLU-0001Av-Nl; Tue, 06 Dec 2016 19:24:08 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cELLT-0001Aj-9R for png-mng-implement-at-lists.sourceforge.net; Tue, 06 Dec 2016 19:24:07 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of mrbrklyn.com designates 96.57.23.82 as permitted sender) client-ip=96.57.23.82; envelope-from=ruben-at-mrbrklyn.com; helo=mrbrklyn.com; Received: from www.mrbrklyn.com ([96.57.23.82] helo=mrbrklyn.com) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1cELLP-0002Mq-Qe for png-mng-implement-at-lists.sourceforge.net; Tue, 06 Dec 2016 19:24:07 +0000 Received: by mrbrklyn.com (Postfix, from userid 1000) id 56DDB161311; Tue, 6 Dec 2016 14:23:58 -0500 (EST) Date: Tue, 6 Dec 2016 14:23:58 -0500 From: Ruben Safir To: PNG/MNG implementation discussion list Message-ID: <20161206192358.GE29134-at-www.mrbrklyn.com> References: <17705460-c78b-6310-807f-417193dc4f6b-at-mrbrklyn.com> <70068FB4-D738-4BA5-9BD0-4AB9D47D84B4-at-gmx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <70068FB4-D738-4BA5-9BD0-4AB9D47D84B4-at-gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Helo-Check: bad, Forged Random Domain (mrbrklyn.com) X-Spam-Score: -4.0 (----) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.5 VA_HELO_CHECK Host Used Invalid or Forged HELO/EHLO -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -3.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1cELLP-0002Mq-Qe X-BeenThere: png-mng-implement-at-lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Subject: Re: [Learn] [png-mng-implement] 4 byte length storage X-BeenThere: learn-at-nylxs.com Reply-To: PNG/MNG implementation discussion list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
On Tue, Dec 06, 2016 at 07:04:46PM +0100, Andreas Kleinert wrote: > In theory (and future, or past) much might (have) be(en) possible. Probably it is a science on its own to become 100% rocksolid under any possible potential circumstances, and to test & prove that. However such specific env. conditions just might easily break other more sophisticated code parts of the same library elsewhere. Thus if sizeof(uint32_t) does not equal 4 I would consider this a good reason to stop compiling ;-) > > Von meinem iPhone gesendet
I suppose that is what autoconf is for. I don't otherwise know how to say, give me a single variable worth 4 bytes or 8 bits
> > > Am 06.12.2016 um 18:32 schrieb John Bowler : > > > > On Tue, Dec 6, 2016 at 8:55 AM, Andreas Kleinert > > wrote: > >> I have not really checked your code in detail, but are you sure it is not just big vs. little endian conversion...?! > > > > That's why '13' (0x0000000D) appears as 218103808 (0x0D000000), but > > there are other issues in the code that are perhaps best covered by an > > online tutorial such as this one: > > > > https://isocpp.org/wiki/faq/serialization > > > > (That's C++ specific). > > > > One issue is that the code relies on uint32_t being a four byte > > quantity, CHUNK is a typedef of uint32_t: > > > > char * cur = get_index(); > > CHUNK * tmp = reinterpret_cast(cur); > > > > Certainly uint32_t is required to have exactly 32 bits and therefore > > behave as a 32-bit value for modular arithmetic (per the ANSI C spec), > > however I don't know that the representation is constrained to be 4 > > bytes. I would be surprised if C89 (which formalized the type) had > > done that and so far as I can see the above code has undefined > > behavior. > > > > The general rule for serialization is to either use well-defined > > primitives or to do it yourself; the code is not exactly difficult to > > write, though it can be difficult to get right sometimes ;-) > > > > John Bowler > > > > ------------------------------------------------------------------------------ > > Developer Access Program for Intel Xeon Phi Processors > > Access to Intel Xeon Phi processor-based developer platforms. > > With one year of Intel Parallel Studio XE. > > Training and support from Colfax. > > Order your platform today.http://sdm.link/xeonphi > > _______________________________________________ > > png-mng-implement mailing list > > png-mng-implement-at-lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/png-mng-implement > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today.http://sdm.link/xeonphi > _______________________________________________ > png-mng-implement mailing list > png-mng-implement-at-lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/png-mng-implement
-- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013
------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/xeonphi _______________________________________________ png-mng-implement mailing list png-mng-implement-at-lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/png-mng-implement _______________________________________________ Learn mailing list Learn-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/learn
|
|