Commit 51fff9fa82

emekoi <emekankurumeh@outlook.com>
2018-11-27 18:43:59
fixed initializer and typos
1 parent 35d93d2
Changed files (2)
std
std/os/windows/kernel32.zig
@@ -261,3 +261,7 @@ pub const PINIT_ONCE_FN = ?extern fn(InitOnce: *RTL_RUN_ONCE, Parameter: ?PVOID,
 pub const RTL_RUN_ONCE = extern struct {
     Ptr: PVOID,
 };
+
+pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE {
+  .Ptr = null,
+};
\ No newline at end of file
std/mutex.zig
@@ -76,7 +76,7 @@ pub const Mutex = switch(builtin.os) {
         pub fn init() Mutex {
             return Mutex {
                 .lock = undefined,
-                .init_once = undefined,
+                .init_once = windows.INIT_ONCE_STATIC_INIT,
             };
         }
 
@@ -87,7 +87,7 @@ pub const Mutex = switch(builtin.os) {
         ) windows.BOOL {
             var lock = @ptrCast(
                 *windows.CRITICAL_SECTION,
-                @alignCast(@alignOf(*windows.CRITICAL_SECTION), ctx.?)
+                @alignCast(@alignOf(*windows.CRITICAL_SECTION), Context.?)
             );
             windows.InitializeCriticalSection(lock);
             return windows.TRUE;