From 019994548cc0c58fec9e1131410973f2d4db7744 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 13 Apr 2003 18:14:01 +0000 Subject: [PATCH] Fixed problem with type casting void* to int. --- cmd/synergyc/synergyc.cpp | 9 +++++---- cmd/synergys/synergys.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/synergyc/synergyc.cpp b/cmd/synergyc/synergyc.cpp index 095b62ea..4f72a6bd 100644 --- a/cmd/synergyc/synergyc.cpp +++ b/cmd/synergyc/synergyc.cpp @@ -246,16 +246,17 @@ realMain(void) static void -realMainEntry(void*) +realMainEntry(void* vresult) { - CThread::exit(reinterpret_cast(realMain())); + *reinterpret_cast(vresult) = realMain(); } static int runMainInThread(void) { - CThread appThread(new CFunctionJob(&realMainEntry)); + int result; + CThread appThread(new CFunctionJob(&realMainEntry, &result)); try { #if WINDOWS_LIKE MSG msg; @@ -272,7 +273,7 @@ runMainInThread(void) #else appThread.wait(-1.0); #endif - return reinterpret_cast(appThread.getResult()); + return result; } catch (XThread&) { appThread.cancel(); diff --git a/cmd/synergys/synergys.cpp b/cmd/synergys/synergys.cpp index 3adc9f0d..d85c4c6b 100644 --- a/cmd/synergys/synergys.cpp +++ b/cmd/synergys/synergys.cpp @@ -268,16 +268,17 @@ realMain(void) static void -realMainEntry(void*) +realMainEntry(void* vresult) { - CThread::exit(reinterpret_cast(realMain())); + *reinterpret_cast(vresult) = realMain(); } static int runMainInThread(void) { - CThread appThread(new CFunctionJob(&realMainEntry)); + int result; + CThread appThread(new CFunctionJob(&realMainEntry, &result)); try { #if WINDOWS_LIKE MSG msg; @@ -292,7 +293,7 @@ runMainInThread(void) #else appThread.wait(-1.0); #endif - return reinterpret_cast(appThread.getResult()); + return result; } catch (XThread&) { appThread.cancel();