No need to store information about line number in ph7_class struct.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-05 17:42:10 +02:00
parent 894dbe47d6
commit ae79cb57de
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 4 additions and 6 deletions

View File

@ -3710,7 +3710,7 @@ static sxi32 PH7_CompileClassInterface(ph7_gen_state *pGen) {
/* Advance the stream cursor */
pGen->pIn++;
/* Obtain a raw class */
pClass = PH7_NewRawClass(pGen->pVm, pName, nLine);
pClass = PH7_NewRawClass(pGen->pVm, pName);
if(pClass == 0) {
PH7_GenCompileError(pGen, E_ERROR, nLine, "Fatal, PH7 is running out of memory");
return SXERR_ABORT;
@ -3947,7 +3947,7 @@ static sxi32 PH7_GenStateCompileClass(ph7_gen_state *pGen, sxi32 iFlags) {
/* Advance the stream cursor */
pGen->pIn++;
/* Obtain a raw class */
pClass = PH7_NewRawClass(pGen->pVm, pName, nLine);
pClass = PH7_NewRawClass(pGen->pVm, pName);
if(pClass == 0) {
PH7_GenCompileError(pGen, E_ERROR, nLine, "Fatal, PH7 is running out of memory");
return SXERR_ABORT;

View File

@ -46,7 +46,7 @@ PH7_PRIVATE ph7_class_info *PH7_NewClassInfo(ph7_vm *pVm, const SyString *pName)
* Create an empty class.
* Return a pointer to a raw class (ph7_class instance) on success. NULL otherwise.
*/
PH7_PRIVATE ph7_class *PH7_NewRawClass(ph7_vm *pVm, const SyString *pName, sxu32 nLine) {
PH7_PRIVATE ph7_class *PH7_NewRawClass(ph7_vm *pVm, const SyString *pName) {
ph7_class *pClass;
char *zName;
/* Allocate a new instance */
@ -68,7 +68,6 @@ PH7_PRIVATE ph7_class *PH7_NewRawClass(ph7_vm *pVm, const SyString *pName, sxu32
SyHashInit(&pClass->hAttr, &pVm->sAllocator, 0, 0);
SyHashInit(&pClass->hDerived, &pVm->sAllocator, 0, 0);
SySetInit(&pClass->aInterface, &pVm->sAllocator, sizeof(ph7_class *));
pClass->nLine = nLine;
/* All done */
return pClass;
}

View File

@ -1054,7 +1054,6 @@ struct ph7_class {
sxi32 iFlags; /* Class configuration flags [i.e: final, interface, virtual, etc.] */
SyHash hAttr; /* Class attributes [i.e: variables and constants] */
SyHash hMethod; /* Class methods */
sxu32 nLine; /* Line number on which this class was declared */
SySet aInterface; /* Implemented interface container */
};
/* Class configuration flags */
@ -1769,7 +1768,7 @@ PH7_PRIVATE sxi32 PH7_ParseIniString(ph7_context *pCtx, const char *zIn, sxu32 n
#endif
/* oo.c function prototypes */
PH7_PRIVATE ph7_class_info *PH7_NewClassInfo(ph7_vm *pVm, const SyString *pName);
PH7_PRIVATE ph7_class *PH7_NewRawClass(ph7_vm *pVm, const SyString *pName, sxu32 nLine);
PH7_PRIVATE ph7_class *PH7_NewRawClass(ph7_vm *pVm, const SyString *pName);
PH7_PRIVATE ph7_class_attr *PH7_NewClassAttr(ph7_vm *pVm, const SyString *pName, sxu32 nLine, sxi32 iProtection, sxi32 iFlags);
PH7_PRIVATE ph7_class_method *PH7_NewClassMethod(ph7_vm *pVm, ph7_class *pClass, const SyString *pName, sxu32 nLine,
sxi32 iProtection, sxi32 iFlags, sxi32 iFuncFlags);