ntdll: fix a couple compiler warnings on OpenSolaris

Austin English austinenglish at gmail.com
Sun Mar 1 00:22:52 CST 2009


signal_i386.c: In function `wine_sigacthandler':
signal_i386.c:639: warning: assignment from incompatible pointer type
signal_i386.c: In function `init_handler':
signal_i386.c:675: warning: unused variable `thread_data'

-- 
-Austin
-------------- next part --------------
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 32db810..7044364 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -636,7 +636,7 @@ static void wine_sigacthandler( int signal, siginfo_t *siginfo, void *sigcontext
 
     __asm__ __volatile__("mov %ss,%ax; mov %ax,%ds; mov %ax,%es");
 
-    thread_data = get_current_teb()->SystemReserved2;
+    thread_data = (void *)get_current_teb()->SystemReserved2;
     wine_set_fs( thread_data->fs );
     wine_set_gs( thread_data->gs );
 
@@ -672,8 +672,14 @@ typedef void (WINAPI *raise_func)( EXCEPTION_RECORD *rec, CONTEXT *context );
 static inline void *init_handler( const SIGCONTEXT *sigcontext, WORD *fs, WORD *gs )
 {
     TEB *teb = get_current_teb();
+
+#ifndef __sun  /* see above for Solaris handling */
     struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SystemReserved2;
 
+    wine_set_fs( thread_data->fs );
+    wine_set_gs( thread_data->gs );
+#endif
+
     /* get %fs and %gs at time of the fault */
 #ifdef FS_sig
     *fs = LOWORD(FS_sig(sigcontext));
@@ -686,11 +692,6 @@ static inline void *init_handler( const SIGCONTEXT *sigcontext, WORD *fs, WORD *
     *gs = wine_get_gs();
 #endif
 
-#ifndef __sun  /* see above for Solaris handling */
-    wine_set_fs( thread_data->fs );
-    wine_set_gs( thread_data->gs );
-#endif
-
     if (!wine_ldt_is_system(CS_sig(sigcontext)) ||
         !wine_ldt_is_system(SS_sig(sigcontext)))  /* 16-bit mode */
     {


More information about the wine-patches mailing list