[PATCH 06/15] programs/conhost: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Fri Jan 28 10:58:12 CST 2022



---
 programs/conhost/Makefile.in |    1 -
 programs/conhost/conhost.c   |   18 +++++++++---------
 programs/conhost/window.c    |   10 +++++-----
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/programs/conhost/Makefile.in b/programs/conhost/Makefile.in
index 69559c668ad..2a407006697 100644
--- a/programs/conhost/Makefile.in
+++ b/programs/conhost/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 MODULE    = conhost.exe
 IMPORTS   = user32 gdi32 advapi32
 DELAYIMPORTS = comctl32
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 78f6e345170..52363f72aac 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -158,7 +158,7 @@ static void tty_flush( struct console *console )
     TRACE("%s\n", debugstr_an(console->tty_buffer, console->tty_buffer_count));
     if (!WriteFile( console->tty_output, console->tty_buffer, console->tty_buffer_count,
                     NULL, NULL ))
-        WARN( "write failed: %u\n", GetLastError() );
+        WARN( "write failed: %lu\n", GetLastError() );
     console->tty_buffer_count = 0;
 }
 
@@ -176,7 +176,7 @@ static void tty_write( struct console *console, const char *buffer, size_t size
     {
         assert( !console->tty_buffer_count );
         if (!WriteFile( console->tty_output, buffer, size, NULL, NULL ))
-            WARN( "write failed: %u\n", GetLastError() );
+            WARN( "write failed: %lu\n", GetLastError() );
     }
 }
 
@@ -457,7 +457,7 @@ static NTSTATUS read_complete( struct console *console, NTSTATUS status, const v
         status = wine_server_call( req );
     }
     SERVER_END_REQ;
-    if (status && (console->read_ioctl || status != STATUS_INVALID_HANDLE)) ERR( "failed: %#x\n", status );
+    if (status && (console->read_ioctl || status != STATUS_INVALID_HANDLE)) ERR( "failed: %#lx\n", status );
     console->signaled = signal;
     console->read_ioctl = 0;
     console->pending_read = 0;
@@ -468,7 +468,7 @@ static NTSTATUS read_console_input( struct console *console, size_t out_size )
 {
     size_t count = min( out_size / sizeof(INPUT_RECORD), console->record_count );
 
-    TRACE("count %u\n", count);
+    TRACE("count %Iu\n", count);
 
     read_complete( console, STATUS_SUCCESS, console->records, count * sizeof(*console->records),
                    console->record_count > count );
@@ -1267,7 +1267,7 @@ static NTSTATUS process_console_input( struct console *console )
 
         if (ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) continue;
 
-        TRACE( "key code=%02x scan=%02x char=%02x state=%08x\n",
+        TRACE( "key code=%02x scan=%02x char=%02x state=%08lx\n",
                ir.Event.KeyEvent.wVirtualKeyCode, ir.Event.KeyEvent.wVirtualScanCode,
                ir.Event.KeyEvent.uChar.UnicodeChar, ir.Event.KeyEvent.dwControlKeyState );
 
@@ -1634,7 +1634,7 @@ static DWORD WINAPI tty_input( void *param )
         unsigned int h = condrv_handle( console->tty_input );
         status = NtDeviceIoControlFile( console->server, NULL, NULL, NULL, &io, IOCTL_CONDRV_SETUP_INPUT,
                                         &h, sizeof(h), NULL, 0 );
-        if (status) ERR( "input setup failed: %#x\n", status );
+        if (status) ERR( "input setup failed: %#lx\n", status );
     }
 
     event = CreateEventW( NULL, TRUE, FALSE, NULL );
@@ -1691,7 +1691,7 @@ static DWORD WINAPI tty_input( void *param )
         LeaveCriticalSection( &console_section );
     }
 
-    TRACE( "NtReadFile failed: %#x\n", status );
+    TRACE( "NtReadFile failed: %#lx\n", status );
 
 done:
     EnterCriticalSection( &console_section );
@@ -1701,7 +1701,7 @@ done:
         unsigned int h = 0;
         status = NtDeviceIoControlFile( console->server, NULL, NULL, NULL, &io, IOCTL_CONDRV_SETUP_INPUT,
                                         &h, sizeof(h), NULL, 0 );
-        if (status) ERR( "input restore failed: %#x\n", status );
+        if (status) ERR( "input restore failed: %#lx\n", status );
     }
     CloseHandle( console->input_thread );
     console->input_thread = NULL;
@@ -2628,7 +2628,7 @@ static NTSTATUS process_console_ioctls( struct console *console )
         }
         if (status)
         {
-            TRACE( "failed to get next request: %#x\n", status );
+            TRACE( "failed to get next request: %#lx\n", status );
             return status;
         }
 
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index 7ad0d48effd..db04ba120e4 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -110,8 +110,8 @@ static const char *debugstr_config( const struct console_config *config )
 
 static const char *debugstr_logfont( const LOGFONTW *lf, unsigned int ft )
 {
-    return wine_dbg_sprintf( "%s%s%s%s  lfHeight=%d lfWidth=%d lfEscapement=%d "
-                             "lfOrientation=%d lfWeight=%d lfItalic=%u lfUnderline=%u "
+    return wine_dbg_sprintf( "%s%s%s%s  lfHeight=%ld lfWidth=%ld lfEscapement=%ld "
+                             "lfOrientation=%ld lfWeight=%ld lfItalic=%u lfUnderline=%u "
                              "lfStrikeOut=%u lfCharSet=%u lfPitchAndFamily=%u lfFaceName=%s",
                              (ft & RASTER_FONTTYPE) ? "raster" : "",
                              (ft & TRUETYPE_FONTTYPE) ? "truetype" : "",
@@ -124,8 +124,8 @@ static const char *debugstr_logfont( const LOGFONTW *lf, unsigned int ft )
 
 static const char *debugstr_textmetric( const TEXTMETRICW *tm, unsigned int ft )
 {
-        return wine_dbg_sprintf( "%s%s%s%s tmHeight=%d tmAscent=%d tmDescent=%d "
-                                 "tmAveCharWidth=%d tmMaxCharWidth=%d tmWeight=%d "
+        return wine_dbg_sprintf( "%s%s%s%s tmHeight=%ld tmAscent=%ld tmDescent=%ld "
+                                 "tmAveCharWidth=%ld tmMaxCharWidth=%ld tmWeight=%ld "
                                  "tmPitchAndFamily=%u tmCharSet=%u",
                                  (ft & RASTER_FONTTYPE) ? "raster" : "",
                                  (ft & TRUETYPE_FONTTYPE) ? "truetype" : "",
@@ -2453,7 +2453,7 @@ static LRESULT WINAPI window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
             break;
         case IDS_SCROLL:
         case IDS_SEARCH:
-            FIXME( "Unhandled yet command: %lx\n", wparam );
+            FIXME( "Unhandled yet command: %Ix\n", wparam );
             break;
         default:
             return DefWindowProcW( hwnd, msg, wparam, lparam );




More information about the wine-devel mailing list