]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix most compiler warnings on Windows
authornomennescio <nomennescio@factorcode.org>
Fri, 19 Jan 2024 16:51:43 +0000 (17:51 +0100)
committernomennescio <nomennescio@factorcode.org>
Mon, 22 Jan 2024 10:28:56 +0000 (11:28 +0100)
vm/os-windows.cpp
vm/vm.cpp

index 320b5dcee6d6201693c18a7c26332e3de5b0c849..cb32d8626c113c217490ab83f3936e31b94173f9 100644 (file)
@@ -250,7 +250,7 @@ static void wake_up_thread(HANDLE thread) {
     // CancelSynchronousIo() didn't find anything to cancel, let's try
     // with QueueUserAPC() instead.
     if (err == ERROR_NOT_FOUND) {
-      if (!QueueUserAPC(&dummy_cb, thread, NULL)) {
+      if (!QueueUserAPC(&dummy_cb, thread, 0)) {
         fatal_error("QueueUserAPC() failed", GetLastError());
       }
     } else {
@@ -351,6 +351,9 @@ cell get_thread_pc(THREADHANDLE th) {
 
   suscount = ResumeThread(th);
   FACTOR_ASSERT(suscount == 1);
+
+  (void)suscount, (void)context_ok; // use all variables
+
   return context.EIP;
 }
 
@@ -382,6 +385,9 @@ void factor_vm::sampler_thread_loop() {
     cell pc = get_thread_pc(thread);
     enqueue_samples(samples, pc, false);
   }
+
+  (void)ok; // use all variables
+
 }
 
 static DWORD WINAPI sampler_thread_entry(LPVOID parent_vm) {
index bf4037962bf33720db1197a9fd33313bb13b5b96..cfe544ac21381c144422043779427cafe7fd04c7 100644 (file)
--- a/vm/vm.cpp
+++ b/vm/vm.cpp
@@ -7,10 +7,6 @@ factor_vm::factor_vm(THREADHANDLE thread)
       nursery(0, 0),
       faulting_p(false),
       thread(thread),
-#if defined(WINDOWS)
-      thread_id(GetCurrentThreadId()),
-      ctrl_break_thread(NULL),
-#endif
       callback_id(0),
       c_to_factor_func(NULL),
       sampling_profiler_p(false),
@@ -31,7 +27,13 @@ factor_vm::factor_vm(THREADHANDLE thread)
       last_nano_count(0),
       signal_callstack_seg(NULL),
       safepoint_fep_p(false),
-      stop_on_ctrl_break(false) {
+      stop_on_ctrl_break(false)
+#if defined(WINDOWS)
+      ,
+      thread_id(GetCurrentThreadId()),
+      ctrl_break_thread(NULL)
+#endif
+{
   primitive_reset_dispatch_stats();
 }