vpinball / libdmdutil

A cross platform library for performing DMD tasks.
Other
2 stars 7 forks source link

avoid taking or passing std::string over library interface, fix wrong… #1

Closed toxieainc closed 8 months ago

toxieainc commented 8 months ago

… declaration of m_segData1/2, avoid duplicating NumericalLayout, (most likely) fix wrong detection of pixelcade magic code string

Please decide if the change from std::string to char* makes sense, but from all that i know, passing std::strings over API borders is always kinda tricky, unless one can guarantee that the string implementation will match exactly on both sides.

And please double check the pixelcade magic code detection.

jsm174 commented 8 months ago

This is absolute amazing! Thank you so much for running this!

The only thing I was worried about was delete pZeDMD, and delete pSerum. All this time I didn't know you could delete even if nullptr and not have to worry about a crash.

toxieainc commented 8 months ago

Back in the days this was more fuzzy i think, but nowadays delete'ing and free'ing nullptrs is simply ignored apparently.

toxieainc commented 8 months ago

See: https://en.cppreference.com/w/cpp/language/delete https://en.cppreference.com/w/c/memory/free