From 221d817d32343ab6998e390c2b01a5a371b2b5f2 Mon Sep 17 00:00:00 2001 From: neroist Date: Sun, 7 Apr 2024 08:22:38 -0400 Subject: [PATCH] remove warnings when using Nim 2.0 --- uing.nim | 6 +++--- uing/rawui.nim | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/uing.nim b/uing.nim index bed8dda..bb563c6 100644 --- a/uing.nim +++ b/uing.nim @@ -630,7 +630,7 @@ proc color*(a: Attribute): tuple[r, g, b, alpha: float] = attributeColor(a.impl, addr r, addr g, addr b, addr alpha) result = (r: float r, g: float g, b: float b, alpha: float alpha) -proc newBackgroundColorAttribute*(r, g, b, a: float = 1.0): Attribute = +proc newBackgroundColorAttribute*(r, g, b: float; a: float = 1.0): Attribute = ## Creates a new Attribute that changes the background color ## of the text it is applied to. ## @@ -2445,7 +2445,7 @@ proc color*(c: ColorButton): tuple[r, g, b, a: float] = result = (r: float r, g: float g, b: float b, a: float a) -proc setColor*(c: ColorButton; r, g, b, alpha: 0.0..1.0 = 1.0) = +proc setColor*(c: ColorButton; r, g, b: float; alpha: float = 1.0) = ## Sets the color button color. ## ## :c: ColorButton instance. @@ -3395,7 +3395,7 @@ proc time*(d: DateTimePicker): DateTime = dateTimePickerTime(d.impl, addr tm) # dateTime was introduced in Nim version 1.6.0 - when NimMinor < 6: + when NimMinor < 6 and NimMajor < 2: result = initDateTime( int tm.tm_mday, Month(tm.tm_mon + 1), diff --git a/uing/rawui.nim b/uing/rawui.nim index ee94b3f..835ed39 100644 --- a/uing/rawui.nim +++ b/uing/rawui.nim @@ -129,7 +129,8 @@ type InitOptions* {.bycopy.} = object size*: csize_t -{.deadCodeElim: on.} +when NimMajor < 2: + {.deadCodeElim: on.} proc init*(options: ptr InitOptions): cstring {.cdecl, importc: "uiInit", libui.} proc uninit*() {.cdecl, importc: "uiUninit", libui.}