Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #18551

Re: What is the right way to do this simple thing

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: What is the right way to do this simple thing
Date 2012-03-12 10:01 +1300
Message-ID <9s4i5jFa8vU3@mid.individual.net> (permalink)
References (4 earlier) <4f5bf4f9.1965115079@text.giganews.com> <9s2cmhFf52U1@mid.individual.net> <4f5c2af2.1978932789@text.giganews.com> <9s360cFa8vU1@mid.individual.net> <4f5cd861.2023333794@text.giganews.com>

Show all headers | View raw


On 03/12/12 06:23 AM, Richard Harter wrote:
> On Sun, 11 Mar 2012 21:27:56 +1300, Ian Collins wrote:
>> On 03/11/12 05:46 PM, Richard Harter wrote:
>
>>> The point of the second bit of code that I did is that it does take
>>> care of alignment and doesn't drag in stuff from all other
>>> serializations.
>>
>> ?
>
> Did you read that code?  It's pretty simple.  The key is that
> different packages can have different offsets for the deliverable
> data; all that is really required is that the payload is correctly
> aligned and that the package specifies where it starts.
>
> The issue with it is where the code for doing the load lives.

I see.  Well the generic union approach Ben quoted will take care of 
alignment issues.

I use JSON for passing objects unless there is proven performance issue.

If I have to serialise a selection of types as binary, I use something 
other than C to define the types (usually XML) and generate the struct 
definitions and serialisation code.

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-10 19:26 +0000
  Re: What is the right way to do this simple thing Don Y <this@isnotme.com> - 2012-03-10 12:57 -0700
  Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-10 14:12 -0800
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-10 23:31 +0000
      Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 13:06 +1300
        Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 00:44 +0000
          Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 14:15 +1300
            Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 04:46 +0000
              Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 21:27 +1300
                Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 17:23 +0000
                Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-12 10:01 +1300
                Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:18 +0000
                Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-14 10:23 +1300
              Re: What is the right way to do this simple thing Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-11 11:59 +0000
                Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:51 +0000
                Re: What is the right way to do this simple thing Gene <gene.ressler@gmail.com> - 2012-03-13 07:32 -0700
                Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:46 +0000
      Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-12 07:28 -0700
        Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-12 08:13 -0700
        Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:51 +0000
  Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-10 14:21 -0800
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 01:40 +0000
      Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-11 14:11 -0700
        Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:56 +0000
          Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-14 14:55 -0700
            Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-15 21:55 +0000
              Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-19 13:33 -0700
  Re: What is the right way to do this simple thing Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-03-10 15:21 -0800
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 00:47 +0000
  Re: What is the right way to do this simple thing Philip Lantz <prl@canterey.us> - 2012-03-11 01:07 -0800
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:14 +0000
  Re: What is the right way to do this simple thing Markus Wichmann <nullplan@gmx.net> - 2012-03-11 13:47 +0100
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:24 +0000
  Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 21:01 +0000
    Re: What is the right way to do this simple thing Anders Wegge Keller <wegge@wegge.dk> - 2012-03-12 00:05 +0100
      Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:57 +0000
    Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 23:06 +0000
      Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-11 17:34 -0700
        Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 22:00 +0000
          Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-13 18:12 -0700
            Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-14 03:38 +0000
              Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-14 00:49 -0700

csiph-web