@@ -631,9 +631,6 @@ func win_window_proc(hwnd : HWND, msg : UINT, wp : WPARAM, lp : LPARAM) : LRESUL
631631// ===========================================================================
632632
633633public func window_create (w : *mut Window) : std:: Result <std:: Unit, WindowError> {
634- if (w == null) {
635- return std.Result .Err (WindowError.InvalidState (string ("window_create: null window" )))
636- }
637634 if (w.created) {
638635 return std.Result .Err (WindowError.InvalidState (string ("window_create: window already created" )))
639636 }
@@ -704,9 +701,6 @@ public func window_create(w : *mut Window) : std::Result<std::Unit, WindowError>
704701}
705702
706703public func window_destroy (w : *mut Window) {
707- if (w == null) {
708- return
709- }
710704 if (w.hwnd != null) {
711705 DestroyWindow (w.hwnd)
712706 w.hwnd = null
@@ -716,9 +710,6 @@ public func window_destroy(w : *mut Window) {
716710}
717711
718712public func window_is_created (w : *mut Window) : bool {
719- if (w == null) {
720- return false
721- }
722713 return w.created && w.hwnd != null
723714}
724715
@@ -729,7 +720,6 @@ public func window_title(w : *mut Window) : string {
729720}
730721
731722public func window_set_title (w : *mut Window, title : *char) {
732- if (w == null) { return }
733723 w.title = string ("" )
734724 if (title != null) {
735725 w.title.append_char_ptr (title)
@@ -759,7 +749,6 @@ public func window_client_size(w : *mut Window) : Size {
759749}
760750
761751public func window_set_size (w : *mut Window, width : int, height : int) {
762- if (w == null) { return }
763752 w.width = width
764753 w.height = height
765754 if (w.hwnd == null) {
@@ -797,7 +786,6 @@ public func window_position(w : *mut Window) : Position {
797786}
798787
799788public func window_set_position (w : *mut Window, x : int, y : int) {
800- if (w == null) { return }
801789 w.x = x
802790 w.y = y
803791 if (w.hwnd != null) {
@@ -918,7 +906,6 @@ public func window_close(w : *mut Window) {
918906// --- visual ---
919907
920908public func window_set_cursor (w : *mut Window, cursor : int) {
921- if (w == null) { return }
922909 w.cursor = cursor
923910 SetCursor (cursor_for_kind (cursor))
924911}
@@ -944,7 +931,6 @@ public func window_set_icon(w : *mut Window, path : *char) {
944931}
945932
946933public func window_set_opacity (w : *mut Window, opacity : double) {
947- if (w == null) { return }
948934 w.opacity = opacity
949935 if (w.hwnd == null) {
950936 return
@@ -961,7 +947,6 @@ public func window_set_opacity(w : *mut Window, opacity : double) {
961947}
962948
963949public func window_set_always_on_top (w : *mut Window, on_top : bool) {
964- if (w == null) { return }
965950 w.always_on_top = on_top
966951 if (w.hwnd != null) {
967952 if (on_top) {
@@ -973,7 +958,6 @@ public func window_set_always_on_top(w : *mut Window, on_top : bool) {
973958}
974959
975960public func window_set_decorated (w : *mut Window, decorated : bool) {
976- if (w == null) { return }
977961 if (decorated == w.decorated) {
978962 return
979963 }
0 commit comments