diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-23 10:19:23 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-23 10:19:23 -0700 |
commit | 90560d7194f3e451ddab9d4033c98d2e6aec977b (patch) | |
tree | f74dc3401501eda0090b23c9a4d7a12d748c3581 /html/001help.cc.html | |
parent | 63b94083336684c011e2fcdd23226043d0cf6bb7 (diff) | |
download | mu-90560d7194f3e451ddab9d4033c98d2e6aec977b.tar.gz |
2062
Diffstat (limited to 'html/001help.cc.html')
-rw-r--r-- | html/001help.cc.html | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/html/001help.cc.html b/html/001help.cc.html index d82d1685..3802c699 100644 --- a/html/001help.cc.html +++ b/html/001help.cc.html @@ -13,13 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } -.SalientComment { color: #00ffff; } -.Constant { color: #00a0a0; } .cSpecial { color: #008000; } .PreProc { color: #c000c0; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Constant { color: #00a0a0; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } +.SalientComment { color: #00ffff; } .Identifier { color: #804000; } --> </style> @@ -36,7 +35,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment">//: This should give you a sense for what to look forward to in later layers.</span> <span class="Delimiter">:(before "End Commandline Parsing")</span> -<span class="Normal">if</span> <span class="Delimiter">(</span>argc <= <span class="Constant">1</span> || is_equal<span class="Delimiter">(</span>argv[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">"--help"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> +if <span class="Delimiter">(</span>argc <= <span class="Constant">1</span> || is_equal<span class="Delimiter">(</span>argv[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">"--help"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// this is the functionality later layers will provide</span> <span class="Comment">// currently no automated tests for commandline arg parsing</span> cerr << <span class="Constant">"To load files and run 'main':</span><span class="cSpecial">\n</span><span class="Constant">"</span> @@ -59,7 +58,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment">//: way, our makefile contains a little command to automatically generate</span> <span class="Comment">//: declarations for them.</span> <span class="Delimiter">:(code)</span> -<span class="Normal">bool</span> is_equal<span class="Delimiter">(</span><span class="Normal">char</span>* s<span class="Delimiter">,</span> <span class="Normal">const</span> <span class="Normal">char</span>* lit<span class="Delimiter">)</span> <span class="Delimiter">{</span> +bool is_equal<span class="Delimiter">(</span>char* s<span class="Delimiter">,</span> const char* lit<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Identifier">return</span> strncmp<span class="Delimiter">(</span>s<span class="Delimiter">,</span> lit<span class="Delimiter">,</span> strlen<span class="Delimiter">(</span>lit<span class="Delimiter">))</span> == <span class="Constant">0</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -112,7 +111,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment">// yadda-yadda. Instead use this macro below to perform an unsafe cast to</span> <span class="Comment">// signed. We'll just give up immediately if a container's every too large.</span> <span class="Delimiter">:(before "End Includes")</span> -<span class="PreProc">#define SIZE(X) (assert(X</span><span class="Delimiter">.</span><span class="PreProc">size() < (</span><span class="Constant">1LL</span><span class="PreProc"><<(</span><span class="Normal">sizeof</span><span class="PreProc">(</span><span class="Normal">long</span><span class="PreProc"> </span><span class="Normal">long</span><span class="PreProc"> </span><span class="Normal">int</span><span class="PreProc">)*</span><span class="Constant">8</span><span class="PreProc">-</span><span class="Constant">2</span><span class="PreProc">)))</span><span class="Delimiter">,</span><span class="PreProc"> </span><span class="Normal">static_cast</span><span class="PreProc"><</span><span class="Normal">long</span><span class="PreProc"> </span><span class="Normal">long</span><span class="PreProc"> </span><span class="Normal">int</span><span class="PreProc">>(X</span><span class="Delimiter">.</span><span class="PreProc">size()))</span> +<span class="PreProc">#define SIZE(X) (assert(X</span><span class="Delimiter">.</span><span class="PreProc">size() < (</span><span class="Constant">1LL</span><span class="PreProc"><<(</span>sizeof<span class="PreProc">(</span>long<span class="PreProc"> </span>long<span class="PreProc"> </span>int<span class="PreProc">)*</span><span class="Constant">8</span><span class="PreProc">-</span><span class="Constant">2</span><span class="PreProc">)))</span><span class="Delimiter">,</span><span class="PreProc"> </span>static_cast<span class="PreProc"><</span>long<span class="PreProc"> </span>long<span class="PreProc"> </span>int<span class="PreProc">>(X</span><span class="Delimiter">.</span><span class="PreProc">size()))</span> <span class="Comment">//</span> <span class="Comment">// 5. Integer overflow is still impossible to guard against. Maybe after</span> <span class="Comment">// reading <a href="http://www.cs.utah.edu/~regehr/papers/overflow12.pdf">http://www.cs.utah.edu/~regehr/papers/overflow12.pdf</a></span> @@ -121,16 +120,16 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="PreProc">#include</span><span class="Constant"><assert.h></span> <span class="PreProc">#include</span><span class="Constant"><iostream></span> -<span class="Normal">using</span> std::istream<span class="Delimiter">;</span> -<span class="Normal">using</span> std::ostream<span class="Delimiter">;</span> -<span class="Normal">using</span> std::iostream<span class="Delimiter">;</span> -<span class="Normal">using</span> std::cin<span class="Delimiter">;</span> -<span class="Normal">using</span> std::cout<span class="Delimiter">;</span> -<span class="Normal">using</span> std::cerr<span class="Delimiter">;</span> +using std::istream<span class="Delimiter">;</span> +using std::ostream<span class="Delimiter">;</span> +using std::iostream<span class="Delimiter">;</span> +using std::cin<span class="Delimiter">;</span> +using std::cout<span class="Delimiter">;</span> +using std::cerr<span class="Delimiter">;</span> <span class="PreProc">#include</span><span class="Constant"><cstring></span> <span class="PreProc">#include</span><span class="Constant"><string></span> -<span class="Normal">using</span> std::string<span class="Delimiter">;</span> +using std::string<span class="Delimiter">;</span> </pre> </body> </html> |