Skip to content

Commit

Permalink
remove warnings when using Nim 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neroist committed Apr 7, 2024
1 parent 2ea3f3e commit 221d817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions uing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
##
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand Down
3 changes: 2 additions & 1 deletion uing/rawui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down

0 comments on commit 221d817

Please sign in to comment.