armoha / euddraft

System for pluginizing eudplib codes.
Other
29 stars 4 forks source link

More _checkEPDAddr #48

Open armoha opened 2 years ago

armoha commented 2 years ago

Currently EPDOffsetMap has _checkEPDAddr, so const cunit = EPDOffsetMap(ptr); raises following warning:

E:\eudplib\eudplib\utils\eperror.py:49: EPWarning: EPD check warning. Don't use raw pointer address  
warnings.warn(message, EPWarning)
 File "E:\eudplib\tests\test_unittest.py", line 72, in <module>      
   f()
 File "E:\eudplib\tests\test_unittest.py", line 68, in f
   helper.test_runall("unittest") 
 File "E:\eudplib\tests\helper.py", line 188, in test_runall
   SaveMap("outputmap/test_%s.scx" % testname, _testmain)
 File "E:\eudplib\eudplib\maprw\savemap.py", line 68, in SaveMap     
   root = _MainStarter(rootf)     
 File "E:\eudplib\eudplib\maprw\injector\mainloop.py", line 55, in _MainStarter
   mf()
 File "E:\eudplib\eudplib\core\eudfunc\eudtypedfuncn.py", line 81, in __call__
   rets = super().__call__(*args, ret=ret)
 File "E:\eudplib\eudplib\core\eudfunc\eudfuncn.py", line 224, in __call__
   self._CreateFuncBody()
 File "E:\eudplib\eudplib\core\eudfunc\eudfuncn.py", line 124, in _CreateFuncBody
   final_rets = self._callerfunc(*self._fargs)
 File "E:\eudplib\eudplib\core\eudfunc\eudf.py", line 51, in caller  
   return fdecl_func(*args)       
 File "E:\eudplib\tests\helper.py", line 180, in _testmain
   testfunc()
 File "E:\eudplib\tests\unittests\test_ctypes.py", line 17, in test_ctypes
   a_ = t(a)
 File "E:\eudplib\eudplib\eudlib\epdoffsetmap.py", line 44, in __init__
   _checkEPDAddr(epd)
 File "E:\eudplib\eudplib\eudlib\epdoffsetmap.py", line 29, in _checkpdoffsetmap.py", line 29, in _checkEPDAddr
   traceback.print_stack()

Maybe we can apply this checking on more code.