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
I'm programming part of my gamemode, and realised I can prevent code repetition if I use a function, however, I prefer using inline functions to keep everything together.
The problem i'm facing is I can't find how to directly call a inline function that was defined on the same stack.
Example:
stock SomeStock()
{
inline const SomeFunction(value)
{
printf("Argument: %d", value);
}
print("Reached Before"); //Prints correctly
//Call code here (see below my attempts)
print("Reached After"); // Never Prints
}
Compiler warning: function is deprecated (symbol "CallStoredFunction") Use '@.func(params);'.
Compiler warning: warning 213: tag mismatch: expected tag "F@_@", but found "F@_@i"
Also the implementation contains some Inline_Call functions, all of which are also deprecated. Maybe this is a use for them?
I did see the FAQ issue for warning 234: function is deprecated (symbol "CallStoredFunction") Use '@.func(params);'.
Which is about what I want, but it still isn't a one-liner. And also doesn't work:
Attempt 1:
new Func:f<i> = GetLocalFunction(&SomeFunction<i>);
@.f(1);
Compiler warning: warning 204: symbol is assigned a value that is never used: "SomeFunction" (on the inline const SomeFunction line)
Function is never called, but doesn't hang
Attempt 2:
new Func:f<i> = GetLocalFunction(using inline SomeFunction);
@.f(1);
Compiler error: error 035: argument type mismatch (argument 1)
Compiler error: warning 213: tag mismatch: expected tag "F@_@i", but found "F@_@"
How can I make that direct call, without having to pass the inline to a different top-level function (as shown in all the examples), is this currently something that can be achieved in y_inline without warnings?
@Y-Less (sorry for the mention, but I belive you're the only one who can answer this)
The text was updated successfully, but these errors were encountered:
I'm programming part of my gamemode, and realised I can prevent code repetition if I use a function, however, I prefer using inline functions to keep everything together.
The problem i'm facing is I can't find how to directly call a inline function that was defined on the same stack.
Example:
All tested on the following environment:
Attempts (Copy directly to the line with the comment):
@.SomeFunction(1);
Callback_Call(using inline SomeFunction, 1);
argument type mismatch (argument 1)
Indirect_Call(_:(using inline SomeFunction), _:0, 1);
CallStoredFunction(using inline SomeFunction, 1);
function is deprecated (symbol "CallStoredFunction") Use '@.func(params);'.
warning 213: tag mismatch: expected tag "F@_@", but found "F@_@i"
Also the implementation contains some
Inline_Call
functions, all of which are also deprecated. Maybe this is a use for them?I did see the FAQ issue for
warning 234: function is deprecated (symbol "CallStoredFunction") Use '@.func(params);'
.Which is about what I want, but it still isn't a one-liner. And also doesn't work:
Attempt 1:
warning 204: symbol is assigned a value that is never used: "SomeFunction"
(on theinline const SomeFunction
line)Attempt 2:
error 035: argument type mismatch (argument 1)
213: tag mismatch: expected tag "F@_@i", but found "F@_@"
How can I make that direct call, without having to pass the inline to a different top-level function (as shown in all the examples), is this currently something that can be achieved in
y_inline
without warnings?@Y-Less (sorry for the mention, but I belive you're the only one who can answer this)
The text was updated successfully, but these errors were encountered: