You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+14
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,20 @@ a = (b << 3) * 5;
144
144
}
145
145
```
146
146
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
+
147
161
* Do not leave trailing whitespaces at the end of line
0 commit comments