diff --git a/BeefLibs/corlib/src/FFI/Function.bf b/BeefLibs/corlib/src/FFI/Function.bf index 6e324d97..260f86e9 100644 --- a/BeefLibs/corlib/src/FFI/Function.bf +++ b/BeefLibs/corlib/src/FFI/Function.bf @@ -141,9 +141,13 @@ namespace System.FFI { NotSet = 0, StdCall = 1, +#unwarn ThisCall = 1, +#unwarn FastCall = 1, +#unwarn MS_CDecl = 1, +#unwarn Default = 1 } #else diff --git a/BeefLibs/corlib/src/Globalization/DateTimeFormatInfoScanner.bf b/BeefLibs/corlib/src/Globalization/DateTimeFormatInfoScanner.bf index 2c2020ed..276b5bb6 100644 --- a/BeefLibs/corlib/src/Globalization/DateTimeFormatInfoScanner.bf +++ b/BeefLibs/corlib/src/Globalization/DateTimeFormatInfoScanner.bf @@ -26,6 +26,7 @@ namespace System.Globalization TAIWANLUNISOLAR = 21, PERSIAN = 22, UMALQURA = 23, +#unwarn LAST_CALENDAR = 23 // Last calendar ID } diff --git a/BeefLibs/corlib/src/Type.bf b/BeefLibs/corlib/src/Type.bf index 1340df33..00c1c360 100644 --- a/BeefLibs/corlib/src/Type.bf +++ b/BeefLibs/corlib/src/Type.bf @@ -893,7 +893,9 @@ namespace System.Reflection // vtable layout mask - Use this mask to retrieve vtable attributes. VtableLayoutMask = 0x0100, +#unwarn ReuseSlot = 0x0000, // The default. +#unwarn NewSlot = 0x0100, // Method always gets a new slot in the vtable. // end vtable layout mask diff --git a/BeefLibs/corlib/src/Windows.bf b/BeefLibs/corlib/src/Windows.bf index 4bf8d024..4e0e62b8 100644 --- a/BeefLibs/corlib/src/Windows.bf +++ b/BeefLibs/corlib/src/Windows.bf @@ -32,6 +32,7 @@ namespace System ENABLE_AAA = 0x10000, FROM_DEFAULT_CONTEXT = 0x20000, ACTIVATE_X86_SERVER = 0x40000, +#unwarn ACTIVATE_32_BIT_SERVER = ACTIVATE_X86_SERVER, ACTIVATE_64_BIT_SERVER = 0x80000, ENABLE_CLOAKING = 0x100000, @@ -198,6 +199,8 @@ namespace System public const int32 KEY_ALL_ACCESS = 0x000f003f; + public const int32 MB_OK = 0; + public const int32 MB_OKCANCEL = 1; public const int32 MB_YESNO = 4; public const int32 MB_ICONHAND = 0x10; public const int32 MB_ICONQUESTION = 0x20; @@ -1361,16 +1364,16 @@ namespace System [CLink, StdCall] public static extern IntBool SetFileAttributesW(char16* name, int32 attribs); - [CLink, StdCall] + [Import("user32.lib"), CLink, StdCall] public static extern int32 MessageBoxA(HWnd hWnd, char8* text, char8* caption, int32 type); - [CLink, StdCall] + [Import("user32.lib"), CLink, StdCall] public static extern int32 MessageBoxW(HWnd hWnd, char16* text, char16* caption, int32 type); [CLink, StdCall] public static extern int32 SetErrorMode(int32 errorMode); - [CLink, StdCall] + [Import("user32.lib"), CLink, StdCall] public static extern HWnd GetActiveWindow(); [Import("user32.lib"), CLink, StdCall] diff --git a/BeefTools/TestDLL/TestDLL.cpp b/BeefTools/TestDLL/TestDLL.cpp index d087f672..db6e90d2 100644 --- a/BeefTools/TestDLL/TestDLL.cpp +++ b/BeefTools/TestDLL/TestDLL.cpp @@ -143,10 +143,34 @@ void TestMem() memcpy(cPtr, str, 3); } +void Test6() +{ + +} + +void Test5(int a, void* b, void* c) +{ + +} + +void Test4(int a, int b, int c) +{ + Test5(10, Test6, NULL); +} + +void Test3(int a) +{ + Test4(100, 200, 300); +} + // THIS IS VERSION 6. extern "C" __declspec(dllexport) void Test2(int aa, int bb, int cc, int dd) { + Test3(10); + + char* strP = "Hey yo"; + TestMem(); Zorq(); diff --git a/BeefTools/TestDLL/TestDLL.vcxproj b/BeefTools/TestDLL/TestDLL.vcxproj index ee501975..c4b1c718 100644 --- a/BeefTools/TestDLL/TestDLL.vcxproj +++ b/BeefTools/TestDLL/TestDLL.vcxproj @@ -88,6 +88,7 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true Console @@ -123,6 +124,7 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true Console @@ -140,6 +142,7 @@ true true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true Console diff --git a/IDE/BeefProj.toml b/IDE/BeefProj.toml index 37677892..3bb0bd29 100644 --- a/IDE/BeefProj.toml +++ b/IDE/BeefProj.toml @@ -25,7 +25,7 @@ OtherLinkFlags = "" TargetDirectory = "$(WorkspaceDir)/dist" TargetName = "BeefIDE_d" OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib" -DebugCommandArguments = "-workspace=C:\\Proj\\CycloBuddy" +DebugCommandArguments = "-proddir=C:\\proj\\CycloBuddy" DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest" EnvironmentVars = ["_NO_DEBUG_HEAP=1"] @@ -49,7 +49,7 @@ OtherLinkFlags = "" TargetDirectory = "$(WorkspaceDir)/dist" TargetName = "BeefIDE_d2" OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib" -DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests" +DebugCommandArguments = "-proddir=C:\\Beef\\ide\\mintest" DebugWorkingDirectory = "$(ProjectDir)\\dist" EnvironmentVars = ["_NO_DEBUG_HEAP=1"] diff --git a/IDE/mintest/src/main.bf b/IDE/mintest/src/main.bf index 9dde9452..3adfebbf 100644 --- a/IDE/mintest/src/main.bf +++ b/IDE/mintest/src/main.bf @@ -216,36 +216,23 @@ namespace Hey.Dude.Bro } } + public static void Florgs() + { + + } + public static int Main(String[] args) { - Int i = (.)123; - i = i + i; + function void() func = => Florgs; + int32 val = (int32)(int)(void*)func; - Zangles zang = scope .(); + //void* ptr = "Hey"; + //val = (int32)ptr; - Zangles.GetMe(zang, "hey"); - TypeCode tc = .Boolean; - - PrintF("Hey\n"); - - //Test2(1, 2, 3, 4); - - /*IHashable ih = (int32)TypeCode.Boolean; - let hashCode = ih.GetHashCode();*/ - - Object obj = new Object(); - - int* iPtr = scope .(); - int hash = GetHash(iPtr); - - - //Test2(1, 2, 3, 4); - + //Test2(1, 2, val, 4); Blurg.Hey(); - - return 1; } @@ -334,3 +321,10 @@ static static int gApsings = 123; } +/*namespace zSquarf +{ + class Zorf + { + + } +}*/ \ No newline at end of file diff --git a/IDE/mintest/src/main3.bf b/IDE/mintest/src/main3.bf index c4d99ccc..9cb29869 100644 --- a/IDE/mintest/src/main3.bf +++ b/IDE/mintest/src/main3.bf @@ -1,3 +1,5 @@ +//using Squarf; + //GORB #pragma warning disable 168 @@ -6,10 +8,19 @@ using System.Collections.Generic; using System.Diagnostics; using System.Threading; +enum EnumA +{ + Abo = 1, + Boop = _*2, + Croop = _*2, +} + struct Blurg { public static int32 Hey() { + int a = 123; + int* aPtr = &a; return (int32)123; } diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index d209ec16..67ac2600 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -4282,7 +4282,7 @@ namespace IDE return result; } - public void RecordHistoryLocation(bool includeLastActive = false, bool b = true) + public void RecordHistoryLocation(bool includeLastActive = false) { var sourceViewPanel = GetActiveSourceViewPanel(includeLastActive); if (sourceViewPanel != null) diff --git a/IDE/src/ui/BinaryDataWidget.bf b/IDE/src/ui/BinaryDataWidget.bf index 231eac64..5d5aa739 100644 --- a/IDE/src/ui/BinaryDataWidget.bf +++ b/IDE/src/ui/BinaryDataWidget.bf @@ -495,6 +495,7 @@ namespace IDE.ui public uint32 mDisplayColor; public bool mIsReg; public bool mIsVisible; + public Rect? mDrawRect; public this(BinaryDataWidget binaryDataWidget, StringView expr, int memStart, int size, StringView displayName, uint32 displayColor, bool isReg) { @@ -861,6 +862,9 @@ namespace IDE.ui { base.Draw(g); + for (var te in mTrackedExprs) + te.mDrawRect = null; + int barThickness = (int)GS!(1.5f); /* @@ -1429,6 +1433,8 @@ namespace IDE.ui } } + + for (var kvp in trackedRegYDict) { var te = kvp.key; @@ -1441,6 +1447,9 @@ namespace IDE.ui var useFont = IDEApp.sApp.mTinyCodeFont; float strWidth = useFont.GetWidth(te.mExpr); bool shortLine = trackedRegYShortLines[lineIdx]; + var useLineSpacing = useFont.GetLineSpacing(); + + te.mDrawRect = Rect(barX, barY, strWidth + GS!(2), useLineSpacing + GS!(2)); if (te.mDisplayName.StartsWith("$")) continue; @@ -1448,7 +1457,6 @@ namespace IDE.ui using (g.PushColor(te.mDisplayColor)) { var regsOnThisLine = trackedRegsByLine[lineIdx].Count; - var useLineSpacing = useFont.GetLineSpacing(); float barYAdj = barY + useLineSpacing*0.5f + GS!(1); float barGoalYAdj = barGoalY + useLineSpacing*0.5f + GS!(1); if (regsOnThisLine == 2) @@ -1699,6 +1707,18 @@ namespace IDE.ui var selection = GetSelectionForDisplayPosition(x, y, 1, 1); + if (selection == null) + { + for (var te in mTrackedExprs) + { + if ((var rect = te.mDrawRect) && (rect.Contains(x, y))) + { + SelectRange(te.mCurValue, 0); + break; + } + } + } + if (selection != null) { delete mCurKeyCursor; diff --git a/IDE/src/ui/ProjectPanel.bf b/IDE/src/ui/ProjectPanel.bf index f0ace8b5..52cf713d 100644 --- a/IDE/src/ui/ProjectPanel.bf +++ b/IDE/src/ui/ProjectPanel.bf @@ -687,7 +687,9 @@ namespace IDE.ui if (folder.mIncludeKind != .Auto) folder.mProject.SetChanged(); + gApp.RecordHistoryLocation(true); gApp.ShowProjectItem(projectSource); + gApp.RecordHistoryLocation(true); } int CompareListViewItem(ListViewItem left, ListViewItem right) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 90dd0454..6b65f424 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -7938,7 +7938,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp { if ((!ignoreErrors) && (!typedVal.mType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0)) { - Fail(StrFormat("Unable to cast direct from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode); + Fail(StrFormat("Unable to cast directly from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode); } auto toPrimitive = (BfPrimitiveType*)toType; @@ -7950,7 +7950,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp { if ((!ignoreErrors) && (!toType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0)) { - Fail(StrFormat("Unable to cast direct from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode); + Fail(StrFormat("Unable to cast directly from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode); } return mBfIRBuilder->CreateIntToPtr(typedVal.mValue, mBfIRBuilder->MapType(toType));