Skip to content

Instantly share code, notes, and snippets.

@kalineh
Created November 23, 2014 02:11
Show Gist options
  • Save kalineh/8ace180a98ef9de843a7 to your computer and use it in GitHub Desktop.
Save kalineh/8ace180a98ef9de843a7 to your computer and use it in GitHub Desktop.
const int bufferSize = 256;
const int numParams = a_thread->GetNumParams();
int len = 0;
int size = 0;
int ret = -1;
char* str = NULL;
char buffer[bufferSize] = { 0 };
gmMachine* machine = a_thread->GetMachine();
for (int i = 0; i < numParams; ++i)
{
gmVariable param = a_thread->Param(i);
const char* param_str = param.AsString(machine, buffer, bufferSize);
gmConcat(machine, str, len, size, param_str, 64);
if (str)
{
GM_ASSERT(len < size);
str[len++] = ' ';
str[len] = '\0';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment