Blame view

src/NOTES 1.82 KB
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  
  
  Example of debug command with valgrind:
  in matrix/
   valgrind  ./matrix-lib-test
  
  # or if there are errors the following options may be useful:
   valgrind  --leak-check=full --db-attach=yes ./matrix-lib-test
  
  The easiest way to run valgrind, however, is "make valgrind" which automatically
  runs all the tests.  It will fail if valgrind is not happy.  Then you should
  manually run valgrind on whichever one failed (which you can figure out by
  looking at valgrind.out in the last directory, and looking for the last
  filename *-test that was printed).
  
  
  ---
   For emacs users:
    ensure proper indentation it may be helpful to copy
       http://google-styleguide.googlecode.com/svn/trunk/google-c-style.el
    to your home directory as ".google-c-style.el", and add to your .emacs file the lines:
  \verbatim
    (load-file "~/.google-c-style.el")
    (add-hook 'c-mode-common-hook 'google-set-c-style)
    (add-hook 'c-mode-common-hook 'google-make-newline-indent)
  \endverbatim
  
  --
  Fixing commas with no spaces, and some other simple style violations.
  for x in */*.{h,cc}; do cp $x tmpf; cat tmpf | perl -ane 'if(!m/["'\'']/ && !m://: && !m/_\{/) { s/,(\S)/, $1/g; s/if\(/if (/; s/while\(/while (/; s/switch\(/switch (/; } print; ' > $x; done
  
  # add a space after comment-begin //
  for x in */*.{h,cc}; do cp $x tmpf; cat tmpf | perl -ane 's:(^|[^\:])//([^ 
  /<!]):$1// $2:; print; ' > $x; done
  
  # make it so declarations with * and & have the * or & as part of the type:
  
  for x in */*.{h,cc}; do cp $x tmpf; cat tmpf | perl -ane ' if (! m:^\s*(//|/\*): && !m:determinized\*: && !m:([a-z]+ ){5}:) { for($x=1;$x<=10;$x++){ s|([^&/ ])([*&]) ([a-z])|$1 $2$3|g; }} print; ' > $x; done
  
  # Remove unnecessary parentheses in single-line "return" expressions.
  
  for x in */*.{h,cc}; do cp $x tmpf; cat tmpf | perl -ane ' s/return\s*\(([^()|?]+)\)\s*;/return $1;/; print; ' | diff - $x; done