Hey guys, I am trying to write a wrapper for this function:
Here is the definition for the function:
So I believe a "wrapper" is just a function that basically points to another function, correct? On that note, after importing the header for the above function into my header file, I wrote this:
and in the C++ file I created this definition:
which obviously gives me this warning:
Semantic Issue
175:3: warning: all paths through this function will call itself
Which means it's trying to call itself. Which I get, but am I just supposed to rename this "wrapper"? Is that how "wrappers" work?
Code:
BOOL8 GetOwnerNo(UCHAR* pItemNoStr, UINT16 maxLen)
{
strncpy(reinterpret_cast<char*>(pItemNoStr), GetOwnerNoString(), maxLen - 1);
pItemNoStr[maxLen - 1] = 0;
return ValidData;
}
Here is the definition for the function:
Code:
extern BOOL8 GetOwnerNo( UCHAR* pItemNoStr, UINT16 maxLen );
So I believe a "wrapper" is just a function that basically points to another function, correct? On that note, after importing the header for the above function into my header file, I wrote this:
Code:
virtual BOOL8 GetOwnerNo(UCHAR* pItemNoStr, UINT16 maxLen);
and in the C++ file I created this definition:
Code:
BOOL8 ConsoleManager::GetOwnerNo(UCHAR* pItemNoStr, UINT16 maxLen)
{
return GetOwnerNo(pItemNoStr, maxLen);
}
which obviously gives me this warning:
Semantic Issue
175:3: warning: all paths through this function will call itself
Which means it's trying to call itself. Which I get, but am I just supposed to rename this "wrapper"? Is that how "wrappers" work?
Last edited: