Skip to content

Commit 2c2e307

Browse files
author
Maijin
authored
1 parent c59519d commit 2c2e307

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CONTRIBUTING.md

+14
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,20 @@ a = (b << 3) * 5;
144144
}
145145
```
146146
147+
* Why return int vs enum
148+
149+
The reason why many places in r2land functions return int instead of an enum type is because enums cant be OR'ed because it breaks the usage within a switch statement and also because swig cant handle that stuff.
150+
151+
```
152+
r_core_wrap.cxx:28612:60: error: assigning to 'RRegisterType' from incompatible type 'long'
153+
arg2 = static_cast< long >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail:
154+
^ ~~~~
155+
r_core_wrap.cxx:32103:61: error: assigning to 'RDebugReasonType' from incompatible type 'int'
156+
arg2 = static_cast< int >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail:
157+
^ ~~~~
158+
3 warnings and 2 errors generated.
159+
````
160+
147161
* Do not leave trailing whitespaces at the end of line
148162
149163
* Do not use C99 variable declaration

0 commit comments

Comments
 (0)