mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-21 21:27:06 +00:00
4494eac83f
* R_APIze r_config - Added r_config_swap - Fix a bug in r_config_set for bool types * Some more rules in doc/syntax * Some integration from r_core to r_meta - CC command is now working to add and remove comments - Make 'C' show help and 'C*' list metadata - CF is semi working * Show comments in disassembly 'asm.comments' * Added 'e!' command to toggle a eval variable value - e!asm.bytes ; for example * Drop arrow-debugging in r_core_visual - Added key ';' to add comments - Do not 's eip' on debug * Fix build of flags test program (thanks graz!) * Added r_str_chop_ro (read-only string chopping)
41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
Syntax coding style guidelines
|
|
==============================
|
|
|
|
I will try to not being a boring document like most of already available
|
|
coding style guidelines ;) Here'r some rules:
|
|
|
|
|
|
* Do not bypass 78 columns
|
|
|
|
* Use tabs instead of space based indentation
|
|
- The code should be smart enought to do not bypass 78 columns
|
|
using 5 space indentation.
|
|
|
|
* function opens brackets at next line
|
|
* do/for/if/while open brackets at same line
|
|
* Commas and keywords should be followed by a space. f.ex:
|
|
if (blabl)
|
|
foo(one, two);
|
|
|
|
* Do not use C99 variable declaration
|
|
- This way we reduce the number of local variables per function
|
|
and it's easier to find which variables are used, where and so on.
|
|
|
|
* Comments should be smart. Function names should be enought explicit
|
|
to not require a comment to explain what it does. If this is not
|
|
possible at all, we can still use a comment. But it is a bad idea
|
|
to relay on comment to make the code readable.
|
|
|
|
* Use 'R_API' define to mark exportable methods
|
|
|
|
* Try not using oneline comments '//'. Use /* */ instead
|
|
* To comment out some code use #if 0 (...) #endif
|
|
|
|
* Do not write ultra-large functions, split them into multiple or simplify
|
|
the algorithm, only external-copy-pasted-not-going-to-be-maintained code
|
|
can be accepted in this way (gnu code, external disassemblers, etc..)
|
|
|
|
VIM syntax configuration:
|
|
-------------------------
|
|
TODO:
|