about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
* defaults.apps: edit xml files with editorhut2010-04-091-1/+3
* partially fix tc_newkeyshut2010-04-094-61/+72
* tc_direction: fixedhut2010-04-081-1/+1
* Merge branch 'devel' into newkeyhut2010-04-0810-41/+29
|\
| * Merge branch 'master' into develhut2010-04-081-0/+2
| |\
| | * todo: updatehut2010-04-081-0/+2
| * | Merge branch 'master' into develhut2010-04-081-2/+1
| |\|
| | * defaults.keys: corrected docstringhut2010-04-071-1/+1
| | * defaults.keys: removed duplicate key definitionhut2010-04-071-1/+0
| | * make clean: fixedhut2010-04-071-1/+1
| | * defaults.keys: fixed hint for c-keyhut2010-04-071-1/+1
| | * defaults.keys: removed duplicate key definitionhut2010-04-071-2/+0
| | * core.actions: move dummy function to an extra sectionhutpre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 001help.cc</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v1">
<meta name="syntax" content="cpp">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color:| * | 
defaults.keys: use _basic_movement in initialize_commandshut2010-04-071-7/+3
| * | core.actions: Make fm FileManagerAwarehut2010-04-071-2/+2
| * | widgets.console: use Direction in move()hut2010-04-072-19/+31
| * | widgets.pager: re-added move_horizontal, displaying warning messagehut2010-04-071-0/+4
| * | dc_direction: added test_move()hut2010-04-072-2/+22
| * | added test case for ranger.ext.directionhut2010-04-071-0/+71
| * | core.actions: use Direction in move()hut2010-04-073-20/+11
| * | widgets.pager: use Direction object in move()hut2010-04-074-79/+71
| * | core.actions: more accurate checkshut2010-04-071-2/+2
| * | fixeshut2010-04-073-6/+6
| * | make clean: fixedhut2010-04-071-1/+1
| * | replace fm.move_pointer/move_right with fm.movehut2010-04-073-9/+9
| * | core.actions.move_right(): bugfixhut2010-04-072-2/+6
| * | defaults.keys: fixed hint for c-keyhut2010-04-071-1/+1
| * | core.actions: unified the movement functionshut2010-04-073-53/+106
| * | defaults.keys: removed duplicate key definitionhut2010-04-061-2/+0
| * | core.actions: move dummy function to an extra sectionhut2010-04-061-5/+9
"o">="Delimiter">,</span> <span class="Constant">&quot;--help&quot;</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 &lt;&lt; <span class="Constant">&quot;To load files and run 'main':</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <span class="Constant">&quot; mu file1.mu file2.mu ...</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <span class="Constant">&quot;To run all tests:</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <span class="Constant">&quot; mu test</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <span class="Constant">&quot;To load files and then run all tests:</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <span class="Constant">&quot; mu test file1.mu file2.mu ...</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> <span class="Delimiter">;</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="SalientComment">//:: Helper function used by the above fragment of code (and later layers too,</span> <span class="SalientComment">//:: who knows?).</span> <span class="Comment">//: The :(code) directive appends function definitions to the end of the</span> <span class="Comment">//: project. Regardless of where functions are defined, we can call them</span> <span class="Comment">//: anywhere we like as long as we format the function header in a specific</span> <span class="Comment">//: way: put it all on a single line without indent, end the line with ') {'</span> <span class="Comment">//: and no trailing whitespace. As long as functions uniformly start this</span> <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> <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> <span class="Comment">// I'll throw some style conventions here for want of a better place for them.</span> <span class="Comment">// As a rule I hate style guides. Do what you want, that's my motto. But since</span> <span class="Comment">// we're dealing with C/C++, the one big thing we want to avoid is undefined</span> <span class="Comment">// behavior. If a compiler ever encounters undefined behavior it can make</span> <span class="Comment">// your program do anything it wants.</span> <span class="Comment">//</span> <span class="Comment">// For reference, my checklist of undefined behaviors to watch out for:</span> <span class="Comment">// out-of-bounds access</span> <span class="Comment">// uninitialized variables</span> <span class="Comment">// use after free</span> <span class="Comment">// dereferencing invalid pointers: null, a new of size 0, others</span> <span class="Comment">//</span> <span class="Comment">// casting a large number to a type too small to hold it</span> <span class="Comment">//</span> <span class="Comment">// integer overflow</span> <span class="Comment">// division by zero and other undefined expressions</span> <span class="Comment">// left-shift by negative count</span> <span class="Comment">// shifting values by more than or equal to the number of bits they contain</span> <span class="Comment">// bitwise operations on signed numbers</span> <span class="Comment">//</span> <span class="Comment">// Converting pointers to types of different alignment requirements</span> <span class="Comment">// T* -&gt; void* -&gt; T*: defined</span> <span class="Comment">// T* -&gt; U* -&gt; T*: defined if non-function pointers and alignment requirements are same</span> <span class="Comment">// function pointers may be cast to other function pointers</span> <span class="Comment">//</span> <span class="Comment">// Casting a numeric value into a value that can't be represented by the target type (either directly or via static_cast)</span> <span class="Comment">//</span> <span class="Comment">// To guard against these, some conventions:</span> <span class="Comment">//</span> <span class="Comment">// 0. Initialize all primitive variables in functions and constructors.</span> <span class="Comment">//</span> <span class="Comment">// 1. Minimize use of pointers and pointer arithmetic. Avoid 'new' and</span> <span class="Comment">// 'delete' as far as possible. Rely on STL to perform memory management to</span> <span class="Comment">// avoid use-after-free issues (and memory leaks).</span> <span class="Comment">//</span> <span class="Comment">// 2. Avoid naked arrays to avoid out-of-bounds access. Never use operator[]</span> <span class="Comment">// except with map. Use at() with STL vectors and so on.</span> <span class="Comment">//</span> <span class="Comment">// 3. Valgrind all the things.</span> <span class="Comment">//</span> <span class="Comment">// 4. Avoid unsigned numbers. Not strictly an undefined-behavior issue, but</span> <span class="Comment">// the extra range doesn't matter, and it's one less confusing category of</span> <span class="Comment">// interaction gotchas to worry about.</span> <span class="Comment">//</span> <span class="Comment">// Corollary: don't use the size() method on containers, since it returns an</span> <span class="Comment">// unsigned and that'll cause warnings about mixing signed and unsigned,</span> <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 &quot;End Includes&quot;)</span> <span class="PreProc">#define SIZE(X) (assert(X</span><span class="Delimiter">.</span><span class="PreProc">size() &lt; (</span><span class="Constant">1LL</span><span class="PreProc">&lt;&lt;(</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">&lt;</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">&gt;(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> <span class="Delimiter">:(before &quot;End Includes&quot;)</span> <span class="PreProc">#include</span><span class="Constant">&lt;assert.h&gt;</span> <span class="PreProc">#include</span><span class="Constant">&lt;iostream&gt;</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> <span class="PreProc">#include</span><span class="Constant">&lt;cstring&gt;</span> <span class="PreProc">#include</span><span class="Constant">&lt;string&gt;</span> <span class="Normal">using</span> std::string<span class="Delimiter">;</span> </pre> </body> </html> <!-- vim: set foldmethod=manual : -->