MCPcopy Create free account
hub / github.com/WheretIB/nullc / SuperCalcRun

Function SuperCalcRun

SuperCalc.cpp:1786–1854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1784 }
1785}
1786void SuperCalcRun(bool debug)
1787{
1788 if(!runRes.finished)
1789 {
1790 TerminateThread(calcThread, 0);
1791 ShowWindow(hContinue, SW_HIDE);
1792 SetWindowText(hButtonCalc, "Run");
1793 runRes.finished = true;
1794 return;
1795 }
1796 unsigned int id = TabbedFiles::GetCurrentTab(hTabs);
1797 if(id == richEdits.size())
1798 return;
1799 HWND wnd = TabbedFiles::GetTabInfo(hTabs, id).window;
1800 mainCodeWnd = wnd;
1801 const char *source = RichTextarea::GetAreaText(wnd);
1802 RichTextarea::ResetLineStyle(wnd);
1803
1804 for(unsigned int i = 0; i < richEdits.size(); i++)
1805 {
1806 if(!TabbedFiles::GetTabInfo(hTabs, i).dirty)
1807 continue;
1808 if(SaveFileFromTab(TabbedFiles::GetTabInfo(hTabs, i).name, RichTextarea::GetAreaText(TabbedFiles::GetTabInfo(hTabs, i).window), TabbedFiles::GetTabInfo(hTabs, i).window))
1809 {
1810 TabbedFiles::GetTabInfo(hTabs, i).dirty = false;
1811 RichTextarea::ResetUpdate(TabbedFiles::GetTabInfo(hTabs, i).window);
1812 InvalidateRect(hTabs, NULL, true);
1813 }
1814 }
1815#ifndef _DEBUG
1816 FreeConsole();
1817#endif
1818
1819 // Remove all non-base modules
1820 id = 0;
1821 while(const char* moduleName = nullcEnumerateModules(id))
1822 {
1823 if(std::find(baseModules.begin(), baseModules.end(), GetStringHash(moduleName)) == baseModules.end())
1824 {
1825 nullcRemoveModule(moduleName);
1826 }else{
1827 id++;
1828 }
1829 }
1830
1831 SetWindowText(hCode, "");
1832 SetWindowText(hResult, "");
1833
1834 nullcSetExecutor(Button_GetCheck(hJITEnabled) ? NULLC_X86 : NULLC_VM);
1835
1836 nullres good = nullcBuild(source);
1837 nullcSaveListing("asm.txt");
1838
1839 if(!good)
1840 {
1841 SetWindowText(hCode, nullcGetLastError());
1842 TabbedFiles::SetCurrentTab(hDebugTabs, 0);
1843 }else{

Callers 1

WndProcFunction · 0.85

Calls 12

SaveFileFromTabFunction · 0.85
nullcEnumerateModulesFunction · 0.85
nullcRemoveModuleFunction · 0.85
nullcSetExecutorFunction · 0.85
nullcBuildFunction · 0.85
nullcSaveListingFunction · 0.85
nullcGetLastErrorFunction · 0.85
SuperCalcSetBreakpointsFunction · 0.85
GetStringHashFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected