diff options
| author | trustable-code <krauter.simon@arcor.de> | 2019-09-10 21:58:38 +0200 |
|---|---|---|
| committer | trustable-code <krauter.simon@arcor.de> | 2019-09-10 21:58:38 +0200 |
| commit | 35e52e458ecc6002cdc65afb1d0cae41ce1a04e9 (patch) | |
| tree | b76f2664892e102f2eb71e22a3344d869ee973bd /src | |
| parent | 03a3402ccba414132ea3f2486fa9cdc01c0aee6d (diff) | |
| download | NiGui-35e52e458ecc6002cdc65afb1d0cae41ce1a04e9.tar.gz NiGui-35e52e458ecc6002cdc65afb1d0cae41ce1a04e9.zip | |
Cleanup: Remove variable initializations, since Nim initializes variables to zero
Diffstat (limited to 'src')
| -rwxr-xr-x | src/nigui.nim | 2 | ||||
| -rwxr-xr-x | src/nigui/private/windows/platform_impl.nim | 12 |
2 files changed, 1 insertions, 13 deletions
diff --git a/src/nigui.nim b/src/nigui.nim index c9dd0a9..ead4f6b 100755 --- a/src/nigui.nim +++ b/src/nigui.nim @@ -2340,7 +2340,6 @@ proc newButton(text = ""): Button = proc init(button: Button) = button.ControlImpl.init() - button.fOnClick = nil button.fWidthMode = WidthMode_Auto button.fHeightMode = HeightMode_Auto button.minWidth = 15.scaleToDpi @@ -2386,7 +2385,6 @@ proc newCheckbox(text = ""): Checkbox = proc init(checkbox: Checkbox) = checkbox.ControlImpl.init() - checkbox.fOnClick = nil checkbox.fWidthMode = WidthMode_Auto checkbox.fHeightMode = HeightMode_Auto checkbox.enabled = true diff --git a/src/nigui/private/windows/platform_impl.nim b/src/nigui/private/windows/platform_impl.nim index 4984628..a912aff 100755 --- a/src/nigui/private/windows/platform_impl.nim +++ b/src/nigui/private/windows/platform_impl.nim @@ -156,12 +156,8 @@ proc pEnableVisualStyles() = actCtx.cbSize = ActCtx.sizeof.int32 actCtx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID or ACTCTX_FLAG_SET_PROCESS_DEFAULT or ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID actCtx.lpSource = "shell32.dll" - actCtx.wProcessorArchitecture = 0 - actCtx.wLangId = 0 actCtx.lpAssemblyDirectory = dir actCtx.lpResourceName = cast[cstring](124) - actCtx.lpApplicationName = nil - actCtx.hModule = nil var context = CreateActCtxA(actCtx.addr) if context == INVALID_HANDLE_VALUE: pRaiseLastOSError() # has no effect: @@ -174,14 +170,8 @@ proc pRegisterWindowClass(className: cstring, wndProc: pointer, style: int32 = 0 class.lpszClassName = className class.lpfnWndProc = wndProc class.style = style - class.cbClsExtra = 0 - class.cbWndExtra = 0 - class.hInstance = nil - class.hIcon = nil class.hCursor = LoadCursorA(nil, cast[cstring](IDC_ARROW)) class.hbrBackground = CreateSolidBrush(GetSysColor(COLOR_BTNFACE)) # default background - class.lpszMenuName = nil - class.hIconSm = nil if RegisterClassExA(class) == 0: pRaiseLastOSError() proc pCommonWndProc(hWnd: pointer, uMsg: int32, wParam, lParam: pointer): pointer {.cdecl.} = @@ -375,7 +365,7 @@ proc pCheckGdiplusStatus(status: int32, msg = "") = proc pInitGdiplus() = var input: GdiplusStartupInput input.GdiplusVersion = 1 - var gidplus: pointer = nil + var gidplus: pointer pCheckGdiplusStatus(GdiplusStartup(gidplus, input, nil)) proc pGdipCreateBitmapFromFileWrapped(filename: string, bitmap: var pointer) = |
