From owner-svn-doc-all@FreeBSD.ORG Mon Apr 13 13:57:35 2015 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A744CF06; Mon, 13 Apr 2015 13:57:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B03DA8; Mon, 13 Apr 2015 13:57:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DDvZik007309; Mon, 13 Apr 2015 13:57:35 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DDvZji007308; Mon, 13 Apr 2015 13:57:35 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201504131357.t3DDvZji007308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 13 Apr 2015 13:57:35 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r46528 - head/en_US.ISO8859-1/books/developers-handbook/sockets X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 13:57:35 -0000 Author: brd Date: Mon Apr 13 13:57:34 2015 New Revision: 46528 URL: https://svnweb.freebsd.org/changeset/doc/46528 Log: Clean up some of the formatting in the rendered version. Modified: head/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.xml Modified: head/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.xml Mon Apr 13 11:31:26 2015 (r46527) +++ head/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.xml Mon Apr 13 13:57:34 2015 (r46528) @@ -649,11 +649,9 @@ struct in_addr { Suppose we coded something like this: - - sa.sin_family = AF_INET; - sa.sin_port = 13; - sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18; - + sa.sin_family = AF_INET; +sa.sin_port = 13; +sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18; What would the result look like? @@ -838,11 +836,9 @@ struct in_addr { to reverse the values in our code: - - sa.sin_family = AF_INET; - sa.sin_port = 13 << 8; - sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192; - + sa.sin_family = AF_INET; +sa.sin_port = 13 << 8; +sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192; This will trick our compiler into storing the data in the network byte