Clean up some of the formatting in the rendered version.
This commit is contained in:
parent
03725d1e2b
commit
0dda9d7b0e
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=46528
1 changed files with 6 additions and 10 deletions
|
|
@ -649,11 +649,9 @@ struct in_addr {
|
|||
|
||||
<para>Suppose we coded something like this:</para>
|
||||
|
||||
<programlisting>
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13;
|
||||
sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18;
|
||||
</programlisting>
|
||||
<programlisting>sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13;
|
||||
sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18;</programlisting>
|
||||
|
||||
<para>What would the result look like?</para>
|
||||
|
||||
|
|
@ -838,11 +836,9 @@ struct in_addr {
|
|||
to <emphasis>reverse</emphasis> the values in our code:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13 << 8;
|
||||
sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192;
|
||||
</programlisting>
|
||||
<programlisting>sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13 << 8;
|
||||
sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192;</programlisting>
|
||||
|
||||
<para>This will <emphasis>trick</emphasis> our compiler
|
||||
into storing the data in the <emphasis>network byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue