<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Bitfields</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>Recent changes to Bitfields</description><atom:link href="https://sourceforge.net/p/asil/wiki/Bitfields/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 14 Feb 2014 05:26:52 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/asil/wiki/Bitfields/feed" rel="self" type="application/rss+xml"/><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -17,7 +17,7 @@
     ~ ' Add this to the end to cause the compiler to pad the bitfield out to use whole words
 ~~~~

-With the first declaration, you access the fields inside it using &lt;code&gt;identifier.field&lt;/code&gt;.  However, fields inside &lt;code&gt;MyStruct2&lt;/code&gt; can be access directly.
+With the first declaration, you access the fields inside it using &lt;code&gt;identifier.field&lt;/code&gt;.  However, fields inside &lt;code&gt;MyStruct2&lt;/code&gt; can be accessed directly.

 ~~~~
 :::text
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Fri, 14 Feb 2014 05:26:52 -0000</pubDate><guid>https://sourceforge.netaa280caef789cb4f96de49084afef80e9061e7fc</guid></item><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,11 +1,29 @@
-ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [Nested type-less named structs].  However, bitfields don't have an identifier for the bitfield itself.
+ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [Nested type-less named structs].  However, many bitfields don't need an identifier for the bitfield itself.

 Bitfields start with the **[bitfield](keywords-bitfield)** keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% \[boolean\] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.

 ~~~~
-struct MyStruct
+:::text
+struct MyStruct1
+  bitfield identifier
+    public 1 boolean bMyBool ' A boolean that's just a single bit long
+    public 3 iMyInt ' An unsigned integer 3 bits long
+    ~ ' Add this to the end to cause the compiler to pad the bitfield out to use whole words
+    
+struct MyStruct2
   bitfield
     public 1 boolean bMyBool ' A boolean that's just a single bit long
     public 3 iMyInt ' An unsigned integer 3 bits long
     ~ ' Add this to the end to cause the compiler to pad the bitfield out to use whole words
 ~~~~
+
+With the first declaration, you access the fields inside it using &lt;code&gt;identifier.field&lt;/code&gt;.  However, fields inside &lt;code&gt;MyStruct2&lt;/code&gt; can be access directly.
+
+~~~~
+:::text
+var MyStruct1 firstInstance = new MyStruct1
+var MyStruct2 secondInstance = new MyStruct2
+
+firstInstance.identifier.bMyBool = false
+secondInstance.bMyBool = true
+~~~~
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Fri, 14 Feb 2014 05:25:43 -0000</pubDate><guid>https://sourceforge.netd745a0d113ec417730cba30e6fe1542478f2bff8</guid></item><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,6 +1,6 @@
 ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [Nested type-less named structs].  However, bitfields don't have an identifier for the bitfield itself.

-Bitfields start with the [**bitfield**] keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% \[boolean\] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.
+Bitfields start with the **[bitfield](keywords-bitfield)** keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% \[boolean\] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.

 ~~~~
 struct MyStruct
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Fri, 14 Feb 2014 05:09:57 -0000</pubDate><guid>https://sourceforge.nete4f93f54e782bb0e753ff020702034b6cf0c7d54</guid></item><item><title>Discussion for Bitfields page</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Should bitfields allow signed fields?  I could use feedback here.  The problem is the number of different ways to represent a signed integer.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 11:57:32 -0000</pubDate><guid>https://sourceforge.net8c419cb1fbf8037558a7b2e8a7954d663da382a7</guid></item><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,4 +1,4 @@
-ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [[Nested type-less named structs]].  However, bitfields don't have an identifier for the bitfield itself.
+ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [Nested type-less named structs].  However, bitfields don't have an identifier for the bitfield itself.

 Bitfields start with the [**bitfield**] keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% \[boolean\] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 07:56:22 -0000</pubDate><guid>https://sourceforge.net53e9ed6ce8618175df2e247cdabbf99e1cdbe114</guid></item><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,4 +1,4 @@
-ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [Type-less named structures].  However, bitfields don't have an identifier for the bitfield itself.
+ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in [[Nested type-less named structs]].  However, bitfields don't have an identifier for the bitfield itself.

 Bitfields start with the [**bitfield**] keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% \[boolean\] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 07:55:00 -0000</pubDate><guid>https://sourceforge.net0585439bc1e088c78912b5bf4b15474b09520ab3</guid></item><item><title>Bitfields modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Bitfields/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;ASIL's version of the old fashioned C bitfield are fairly simple.  A bitfield in ASIL can be a member of any structure, but not a class.  They're a variation of the type-less named structs discussed in &lt;span&gt;[Type-less named structures]&lt;/span&gt;.  However, bitfields don't have an identifier for the bitfield itself.&lt;/p&gt;
&lt;p&gt;Bitfields start with the &lt;span&gt;[&lt;strong&gt;bitfield&lt;/strong&gt;]&lt;/span&gt; keyword.    Each member is either an unsigned integer or a boolean.  Each field uses the syntax &lt;code&gt;(public|protected|private) var length% [boolean] identifier&lt;/code&gt; where &lt;code&gt;length%&lt;/code&gt; is the number of bits needed for that field.  If the "boolean" portion is present, the field is a boolean.  Otherwise, the field is an unsigned int based on the word type.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;MyStruct&lt;/span&gt;
  &lt;span class="n"&gt;bitfield&lt;/span&gt;
    &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;bMyBool&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="n"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="n"&gt;just&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;single&lt;/span&gt; &lt;span class="n"&gt;bit&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;
    &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;iMyInt&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;An&lt;/span&gt; &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="n"&gt;integer&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;bits&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;
    &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Add&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;cause&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;compiler&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pad&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;bitfield&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;whole&lt;/span&gt; &lt;span class="n"&gt;words&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 07:52:58 -0000</pubDate><guid>https://sourceforge.net1af8bc356b53ebb5d8156ed36ff003b124df222a</guid></item></channel></rss>