Skip to content

Commit

Permalink
change member variable names in Forward class
Browse files Browse the repository at this point in the history
  • Loading branch information
hollacs committed Jun 28, 2024
1 parent d3f7011 commit f840781
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions inc/oo_forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace oo
{
public:
Forward(AMX *amx, cell *params, const HookChain *pre, const HookChain *post, ObjectHash _this, const ArgTypeList* args, int start_param)
: amx(amx), params(params), start_param(start_param), arg_list(args), pre(pre), post(post), _this(_this)
: m_amx(amx), m_params(params), m_start_param(start_param), m_arg_list(args), m_pre(pre), m_post(post), m_this(_this)
{}

static AmxxForward Create(AMX *amx, const char *callback, const ArgTypeList *args=nullptr);
Expand All @@ -163,13 +163,13 @@ namespace oo
cell Call(AmxxForward fwd);

private:
AMX *amx;
cell *params;
int start_param;
const ArgTypeList *arg_list;
const HookChain *pre;
const HookChain *post;
ObjectHash _this;
AMX *m_amx;
cell *m_params;
int m_start_param;
const ArgTypeList *m_arg_list;
const HookChain *m_pre;
const HookChain *m_post;
ObjectHash m_this;
};
}

Expand Down
32 changes: 16 additions & 16 deletions src/oo_forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,28 @@ namespace oo

void Forward::CollectArgDataList(ArgDataList *data)
{
int num_args = (arg_list == nullptr) ? 0 : arg_list->length();
int num_args = (m_arg_list == nullptr) ? 0 : m_arg_list->length();

for (int i = 0; i < num_args; i++)
{
int p = i + start_param;
int p = i + m_start_param;

auto type = arg_list->at(i);
auto type = m_arg_list->at(i);
switch (type)
{
case OO_CELL:
data->append(ArgData(MF_GetAmxAddr(amx, params[p])[0]));
data->append(ArgData(MF_GetAmxAddr(m_amx, m_params[p])[0]));
break;

case OO_BYREF:
data->append(ArgData(&MF_GetAmxAddr(amx, params[p])[0]));
data->append(ArgData(&MF_GetAmxAddr(m_amx, m_params[p])[0]));
break;

case OO_STRING:
case OO_STRING_EX:
{
int len = 0;
char *str = MF_GetAmxString(amx, params[p], 0, &len);
char *str = MF_GetAmxString(m_amx, m_params[p], 0, &len);
len = (type == OO_STRING_EX && len < 256) ? 256 : len + 1;
data->append(ArgData(str, (size_t)len));
break;
Expand All @@ -149,7 +149,7 @@ namespace oo
{
if (type > OO_CELL)
{
cell *arr = MF_GetAmxAddr(amx, params[p]);
cell *arr = MF_GetAmxAddr(m_amx, m_params[p]);
data->append(ArgData(arr));
}
break;
Expand All @@ -175,14 +175,14 @@ namespace oo

cell Forward::Call(AmxxForward fwd)
{
PushCall(_this, arg_list);
PushCall(m_this, m_arg_list);
CollectArgDataList(&GetCall()->arg_data);

cell result = 0;
if (ExecuteHooks(pre) < OO_SUPERCEDE)
if (ExecuteHooks(m_pre) < OO_SUPERCEDE)
{
result = Execute(fwd);
ExecuteHooks(post);
ExecuteHooks(m_post);
}
else
{
Expand All @@ -198,7 +198,7 @@ namespace oo
{
auto arg_data = &GetCall()->arg_data;

int num_args = (arg_list == nullptr) ? 0 : arg_list->length();
int num_args = (m_arg_list == nullptr) ? 0 : m_arg_list->length();
int start = num_args - 1;
int end = 0;

Expand All @@ -207,8 +207,8 @@ namespace oo

for (int i = start; i >= end; i--)
{
int p = i + start_param;
auto type = arg_list->at(i);
int p = i + m_start_param;
auto type = m_arg_list->at(i);
auto data = &arg_data->at(i);

switch (type)
Expand Down Expand Up @@ -255,14 +255,14 @@ namespace oo

for (int i = 0; i < num_args; i++)
{
int p = i + start_param;
auto type = arg_list->at(i);
int p = i + m_start_param;
auto type = m_arg_list->at(i);
auto data = &arg_data->at(i);

switch (type)
{
case OO_STRING_EX:
MF_SetAmxString(amx, params[p], data->ToString(), data->GetStringSize());
MF_SetAmxString(m_amx, m_params[p], data->ToString(), data->GetStringSize());
break;
}
}
Expand Down

0 comments on commit f840781

Please sign in to comment.