comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Ada Examples and Problems
Date: Wed, 11 Apr 2001 18:43:57 +0100
Date: 2001-04-11T18:43:57+01:00	[thread overview]
Message-ID: <aJ0B6.4405$FD1.520353@news6-win.server.ntlworld.com> (raw)
In-Reply-To: sl0B6.3907$Ow3.824242@news2-win.server.ntlworld.com

I'm not impressed.  I've spent 2 or 3 days on this and it's drove me nuts.
2 minutes after i read your post I got it working.

The size of the record dog_type is 56 but the size of it's contents is 53.
Just 3 bytes of padding and 3 bytes that drove me nuts.

This is something i'm going to have to watch out for in future.  I've got an
idea about how to limit the chances of me running into this again.  I'm
going to put a function for every type i might write to a stream (that's not
dynamic in size) that gives the size of it's contents.

-- a function that returns the total size of all fields in type X;
--
function size_of_fields(t : in X) return natural;

Not the best option but certainly better than hardwiring it into the
file/stream handling routines.


Thanks to Ted and everyone else who's helped me with this.

Regards,
Chris





  reply	other threads:[~2001-04-11 17:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 13:38 Ada Examples and Problems chris.danx
2001-04-10 17:53 ` chris.danx
2001-04-10 17:57   ` chris.danx
     [not found] ` <ERFA6.2041$FY5.146015@www.newsranger.com>
2001-04-11  9:51   ` chris.danx
2001-04-11 15:34     ` Ted Dennison
2001-04-11 17:18       ` chris.danx
2001-04-11 17:43         ` chris.danx [this message]
2001-04-11 19:01           ` Marc A. Criley
2001-04-11 19:56             ` chris.danx
2001-04-12  1:41               ` tmoran
2001-04-12 15:28         ` Ted Dennison
2001-04-12 18:56           ` chris.danx
2001-04-12 19:01             ` chris.danx
2001-04-12 21:47             ` Ted Dennison
2001-04-13  8:40               ` chris.danx
2001-04-12  1:41     ` tmoran
2001-04-12 10:15       ` chris.danx
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox