Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2022
- 86 participants
- 2418 messages
[PATCH 02/15] programs/attrib: enable compilation with long types
by Eric Pouech
---
programs/attrib/Makefile.in | 1 -
programs/attrib/attrib.c | 6 +++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/programs/attrib/Makefile.in b/programs/attrib/Makefile.in
index 128ecf91e32..2c2eade6b69 100644
--- a/programs/attrib/Makefile.in
+++ b/programs/attrib/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = attrib.exe
IMPORTS = user32
diff --git a/programs/attrib/attrib.c b/programs/attrib/attrib.c
index f8257461fe2..4344200b3ec 100644
--- a/programs/attrib/attrib.c
+++ b/programs/attrib/attrib.c
@@ -33,7 +33,7 @@ static WCHAR *ATTRIB_LoadMessage(UINT id)
static WCHAR msg[MAXSTRING];
if (!LoadStringW(GetModuleHandleW(NULL), id, msg, ARRAY_SIZE(msg))) {
- WINE_FIXME("LoadString failed with %d\n", GetLastError());
+ WINE_FIXME("LoadString failed with %ld\n", GetLastError());
lstrcpyW(msg, L"Failed!");
}
return msg;
@@ -75,7 +75,7 @@ static int WINAPIV ATTRIB_wprintf(const WCHAR *format, ...)
MAX_WRITECONSOLE_SIZE/sizeof(*output_bufW), &parms);
va_end(parms);
if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) {
- WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(format));
+ WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(format));
return 0;
}
@@ -143,7 +143,7 @@ static BOOL ATTRIB_processdirectory(const WCHAR *rootdir, const WCHAR *filespec,
WIN32_FIND_DATAW fd;
WCHAR flags[] = L" ";
- WINE_TRACE("Processing dir '%s', spec '%s', %d,%x,%x\n",
+ WINE_TRACE("Processing dir '%s', spec '%s', %d,%lx,%lx\n",
wine_dbgstr_w(rootdir), wine_dbgstr_w(filespec),
recurse, attrib_set, attrib_clear);
Jan. 28, 2022
[PATCH 01/15] include/msvcrt: add attribute((format)) to printf and scanf -like APIs
by Eric Pouech
fix a bunch of warnings generated by this patch and the migration of
GUID.Data1 to long in ae2693e2c4079edcc719c08abed5ad58ba7aace7
---
dlls/compobj.dll16/compobj.c | 2 -
dlls/crypt32/sip.c | 2 -
dlls/iphlpapi/iphlpapi_main.c | 2 -
dlls/iphlpapi/tests/iphlpapi.c | 4 +-
dlls/msdmo/tests/msdmo.c | 2 -
dlls/mshtml/main.c | 2 -
dlls/oleaut32/oleaut.c | 2 -
dlls/oleaut32/typelib.c | 2 -
dlls/rpcrt4/rpcrt4_main.c | 4 +-
dlls/shell32/classes.c | 2 -
dlls/shell32/debughlp.c | 2 -
dlls/shell32/shfldr.h | 2 -
dlls/shlwapi/ordinal.c | 2 -
dlls/typelib.dll16/typelib.c | 2 -
dlls/webservices/writer.c | 4 +-
include/msvcrt/corecrt.h | 8 ++++
include/msvcrt/crtdbg.h | 2 -
include/msvcrt/stdio.h | 90 +++++++++++++++++++++++++++-------------
programs/winetest/main.c | 2 -
19 files changed, 88 insertions(+), 50 deletions(-)
diff --git a/dlls/compobj.dll16/compobj.c b/dlls/compobj.dll16/compobj.c
index a634ebe6374..831d62d25ee 100644
--- a/dlls/compobj.dll16/compobj.c
+++ b/dlls/compobj.dll16/compobj.c
@@ -657,7 +657,7 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid)
*/
INT16 WINAPI StringFromGUID216(REFGUID id, char *str, INT16 cmax)
{
- static const char format[] = "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}";
+ static const char format[] = "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}";
if (!id || cmax < CHARS_IN_GUID) return 0;
sprintf( str, format, id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
diff --git a/dlls/crypt32/sip.c b/dlls/crypt32/sip.c
index 3642e94e799..82eb87c16bf 100644
--- a/dlls/crypt32/sip.c
+++ b/dlls/crypt32/sip.c
@@ -40,7 +40,7 @@ static void CRYPT_guid2wstr( const GUID *guid, LPWSTR wstr )
{
char str[40];
- sprintf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ sprintf(str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index c94f869c9f9..949fed1fb3e 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -59,7 +59,7 @@ static const NPI_MODULEID *ip_module_id( USHORT family )
DWORD WINAPI ConvertGuidToStringA( const GUID *guid, char *str, DWORD len )
{
if (len < CHARS_IN_GUID) return ERROR_INSUFFICIENT_BUFFER;
- sprintf( str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ sprintf( str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2],
guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
return ERROR_SUCCESS;
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index c725730c063..be50cc0b476 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -1409,7 +1409,7 @@ static void testGetAdaptersInfo(void)
GetIfEntry( &row );
ConvertInterfaceIndexToLuid( ptr->Index, &luid );
ConvertInterfaceLuidToGuid( &luid, &guid );
- sprintf( name, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ sprintf( name, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
guid.Data4[6], guid.Data4[7] );
@@ -1671,7 +1671,7 @@ static void test_GetAdaptersAddresses(void)
status = ConvertInterfaceLuidToGuid(&aa->Luid, &guid);
ok(!status, "got %u\n", status);
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ sprintf(buf, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
guid.Data4[6], guid.Data4[7]);
diff --git a/dlls/msdmo/tests/msdmo.c b/dlls/msdmo/tests/msdmo.c
index 41e6d57d2eb..9b261d369fc 100644
--- a/dlls/msdmo/tests/msdmo.c
+++ b/dlls/msdmo/tests/msdmo.c
@@ -31,7 +31,7 @@ static const GUID GUID_wmp1 = {0x13a7995e,0x7d8f,0x45b4,{0x9c,0x77,0x81,0x92,0x6
static const char *guid_to_string(const GUID *guid)
{
static char buffer[50];
- sprintf(buffer, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ sprintf(buffer, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c
index 959d2d66214..f2a255d265a 100644
--- a/dlls/mshtml/main.c
+++ b/dlls/mshtml/main.c
@@ -627,7 +627,7 @@ static HRESULT register_server(BOOL do_register)
for(i=0; i < ARRAY_SIZE(pse); i++) {
pse[i].pszValue = heap_alloc(39);
- sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ sprintf(pse[i].pszValue, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 043face3459..c29e64a4091 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -832,7 +832,7 @@ static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
BOOL is_wow64;
HKEY ikey;
- sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
+ sprintf( interfacekey, "Interface\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
iid->Data1, iid->Data2, iid->Data3,
iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 97b6786feff..7dcc8d815a3 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -3660,7 +3660,7 @@ static BOOL TLB_GUIDFromString(const char *str, GUID *guid)
int i;
short s;
- if(sscanf(str, "%x-%hx-%hx-%hx", &guid->Data1, &guid->Data2, &guid->Data3, &s) != 4) {
+ if(sscanf(str, "%lx-%hx-%hx-%hx", &guid->Data1, &guid->Data2, &guid->Data3, &s) != 4) {
FIXME("Can't parse guid %s\n", debugstr_guid(guid));
return FALSE;
}
diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c
index d5ba8c82c05..a1848ef28e5 100644
--- a/dlls/rpcrt4/rpcrt4_main.c
+++ b/dlls/rpcrt4/rpcrt4_main.c
@@ -543,7 +543,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR* StringUuid)
if (!Uuid) Uuid = &uuid_nil;
- sprintf( (char*)*StringUuid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ sprintf( (char*)*StringUuid, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Uuid->Data1, Uuid->Data2, Uuid->Data3,
Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
@@ -566,7 +566,7 @@ RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR* StringUuid)
if (!Uuid) Uuid = &uuid_nil;
- sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ sprintf(buf, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Uuid->Data1, Uuid->Data2, Uuid->Data3,
Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
diff --git a/dlls/shell32/classes.c b/dlls/shell32/classes.c
index 84784733853..10870b70ab9 100644
--- a/dlls/shell32/classes.c
+++ b/dlls/shell32/classes.c
@@ -200,7 +200,7 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP
static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
{
char xriid[50];
- sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
diff --git a/dlls/shell32/debughlp.c b/dlls/shell32/debughlp.c
index a7ae616923a..c988bab481b 100644
--- a/dlls/shell32/debughlp.c
+++ b/dlls/shell32/debughlp.c
@@ -247,7 +247,7 @@ void _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
else if (( riid = _dbg_ILGetGUIDPointer(pidl) ))
{
if (szOut)
- sprintf( szOut, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ sprintf( szOut, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
diff --git a/dlls/shell32/shfldr.h b/dlls/shell32/shfldr.h
index e176d82de2f..163bf0517d3 100644
--- a/dlls/shell32/shfldr.h
+++ b/dlls/shell32/shfldr.h
@@ -61,7 +61,7 @@ BOOL trash_file( const WCHAR *path ) DECLSPEC_HIDDEN;
static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
{
- return sprintf(str, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ return sprintf(str, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c
index bdd9da0c67b..e35ecd77644 100644
--- a/dlls/shlwapi/ordinal.c
+++ b/dlls/shlwapi/ordinal.c
@@ -461,7 +461,7 @@ INT WINAPI SHStringFromGUIDA(REFGUID guid, LPSTR lpszDest, INT cchMax)
TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
- sprintf(xguid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ sprintf(xguid, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
diff --git a/dlls/typelib.dll16/typelib.c b/dlls/typelib.dll16/typelib.c
index 50354a51de2..4787010354c 100644
--- a/dlls/typelib.dll16/typelib.c
+++ b/dlls/typelib.dll16/typelib.c
@@ -82,7 +82,7 @@ QueryPathOfRegTypeLib16(
TRACE("\n");
if (HIWORD(guid)) {
- sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%x\\win16",
+ sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%x\\win16",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],
diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c
index c9e443b0e80..044351f6094 100644
--- a/dlls/webservices/writer.c
+++ b/dlls/webservices/writer.c
@@ -1041,7 +1041,7 @@ static ULONG format_datetime( const WS_DATETIME *ptr, unsigned char *buf )
static ULONG format_guid( const GUID *ptr, unsigned char *buf )
{
- static const char fmt[] = "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
+ static const char fmt[] = "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
return sprintf( (char *)buf, fmt, ptr->Data1, ptr->Data2, ptr->Data3,
ptr->Data4[0], ptr->Data4[1], ptr->Data4[2], ptr->Data4[3],
ptr->Data4[4], ptr->Data4[5], ptr->Data4[6], ptr->Data4[7] );
@@ -1049,7 +1049,7 @@ static ULONG format_guid( const GUID *ptr, unsigned char *buf )
static ULONG format_urn( const GUID *ptr, unsigned char *buf )
{
- static const char fmt[] = "urn:uuid:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
+ static const char fmt[] = "urn:uuid:%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
return sprintf( (char *)buf, fmt, ptr->Data1, ptr->Data2, ptr->Data3,
ptr->Data4[0], ptr->Data4[1], ptr->Data4[2], ptr->Data4[3],
ptr->Data4[4], ptr->Data4[5], ptr->Data4[6], ptr->Data4[7] );
diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h
index e61a22dccd7..aba9bc9422e 100644
--- a/include/msvcrt/corecrt.h
+++ b/include/msvcrt/corecrt.h
@@ -334,4 +334,12 @@ typedef struct threadlocaleinfostruct {
#define _THREADLOCALEINFO
#endif
+#if !defined(__WINE_USE_MSVCRT) || defined(__MINGW32__)
+#define __WINE_CRT_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
+#define __WINE_CRT_SCANF_ATTR(fmt,args) __attribute__((format (scanf,fmt,args)))
+#else
+#define __WINE_CRT_PRINTF_ATTR(fmt,args)
+#define __WINE_CRT_SCANF_ATTR(fmt,args)
+#endif
+
#endif /* __WINE_CORECRT_H */
diff --git a/include/msvcrt/crtdbg.h b/include/msvcrt/crtdbg.h
index dc56eb883f5..a8cf739cc53 100644
--- a/include/msvcrt/crtdbg.h
+++ b/include/msvcrt/crtdbg.h
@@ -88,7 +88,7 @@ extern int _crtDbgFlag;
_ACRTIMP int __cdecl _CrtCheckMemory(void);
_ACRTIMP int WINAPIV _CrtDbgReport(int reportType, const char *filename, int linenumber,
- const char *moduleName, const char *format, ...);
+ const char *moduleName, const char *format, ...) __WINE_CRT_PRINTF_ATTR(5, 6);
_ACRTIMP int __cdecl _CrtDumpMemoryLeaks(void);
_ACRTIMP int __cdecl _CrtSetBreakAlloc(int);
_ACRTIMP int __cdecl _CrtSetDbgFlag(int);
diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
index daefcd03a74..e53929b94bc 100644
--- a/include/msvcrt/stdio.h
+++ b/include/msvcrt/stdio.h
@@ -161,6 +161,7 @@ _ACRTIMP int __cdecl __stdio_common_vsscanf(unsigned __int64,char const*,size_t,
#if defined(_UCRT) && !defined(_NO_CRT_STDIO_INLINE)
+static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
@@ -168,6 +169,7 @@ static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *forma
return ret < 0 ? -1 : ret;
}
+static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
@@ -175,12 +177,14 @@ static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *form
return ret < 0 ? -1 : ret;
}
+static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(4, 0);
static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args)
{
int ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
return ret < 0 ? -1 : ret;
}
+static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...) __WINE_CRT_PRINTF_ATTR(4, 5);
static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...)
{
int ret;
@@ -192,6 +196,7 @@ static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, c
return ret;
}
+static inline int __cdecl _vscprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int __cdecl _vscprintf(const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
@@ -199,6 +204,7 @@ static inline int __cdecl _vscprintf(const char *format, va_list args)
return ret < 0 ? -1 : ret;
}
+static inline int WINAPIV _scprintf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV _scprintf(const char *format, ...)
{
int ret;
@@ -211,6 +217,7 @@ static inline int WINAPIV _scprintf(const char *format, ...)
return ret;
}
+static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
@@ -218,12 +225,14 @@ static inline int __cdecl vsprintf(char *buffer, const char *format, va_list arg
return ret < 0 ? -1 : ret;
}
+static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
return ret < 0 ? -1 : ret;
}
+static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...)
{
int ret;
@@ -235,17 +244,20 @@ static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *forma
return ret;
}
+static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args)
{
int ret = __stdio_common_vsprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
return ret < 0 ? -1 : ret;
}
+static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args)
{
return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
}
+static inline int WINAPIV fprintf(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
{
int ret;
@@ -257,11 +269,13 @@ static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
return ret;
}
+static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args)
{
return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
}
+static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
{
int ret;
@@ -273,11 +287,13 @@ static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
return ret;
}
+static inline int vprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int vprintf(const char *format, va_list args)
{
return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
}
+static inline int WINAPIV printf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV printf(const char *format, ...)
{
int ret;
@@ -289,11 +305,13 @@ static inline int WINAPIV printf(const char *format, ...)
return ret;
}
+static inline int vprintf_s(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int vprintf_s(const char *format, va_list args)
{
return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
}
+static inline int WINAPIV printf_s(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV printf_s(const char *format, ...)
{
int ret;
@@ -305,6 +323,7 @@ static inline int WINAPIV printf_s(const char *format, ...)
return ret;
}
+static inline int WINAPIV sscanf(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
{
int ret;
@@ -316,6 +335,7 @@ static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
return ret;
}
+static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
{
int ret;
@@ -327,6 +347,7 @@ static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
return ret;
}
+static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(3, 5);
static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...)
{
int ret;
@@ -338,6 +359,7 @@ static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char
return ret;
}
+static inline int WINAPIV fscanf(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
{
int ret;
@@ -349,6 +371,7 @@ static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
return ret;
}
+static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
{
int ret;
@@ -360,6 +383,7 @@ static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
return ret;
}
+static inline int WINAPIV scanf(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
static inline int WINAPIV scanf(const char *format, ...)
{
int ret;
@@ -371,6 +395,7 @@ static inline int WINAPIV scanf(const char *format, ...)
return ret;
}
+static inline int WINAPIV scanf_s(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
static inline int WINAPIV scanf_s(const char *format, ...)
{
int ret;
@@ -384,33 +409,35 @@ static inline int WINAPIV scanf_s(const char *format, ...)
#else /* _UCRT && !_NO_CRT_STDIO_INLINE */
-_ACRTIMP int WINAPIV _scprintf(const char *,...);
-_ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...);
-_ACRTIMP int __cdecl _vscprintf(const char*,va_list);
-_ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list);
-_ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list);
-_ACRTIMP int WINAPIV fprintf(FILE*,const char*,...);
-_ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...);
-_ACRTIMP int WINAPIV printf(const char*,...);
-_ACRTIMP int WINAPIV printf_s(const char*,...);
-_ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...);
-_ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list);
-_ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list);
-_ACRTIMP int __cdecl vprintf(const char*,va_list);
-_ACRTIMP int __cdecl vprintf_s(const char*,va_list);
-_ACRTIMP int __cdecl vsprintf(char*,const char*,va_list);
-_ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list);
-
-_ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list);
-static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
-
-_ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...);
-_ACRTIMP int WINAPIV fscanf(FILE*,const char*,...);
-_ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...);
-_ACRTIMP int WINAPIV scanf(const char*,...);
-_ACRTIMP int WINAPIV scanf_s(const char*,...);
-_ACRTIMP int WINAPIV sscanf(const char*,const char*,...);
-_ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...);
+_ACRTIMP int WINAPIV _scprintf(const char *,...) __WINE_CRT_PRINTF_ATTR(1, 2);
+_ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(4, 5);
+_ACRTIMP int __cdecl _vscprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
+_ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(4, 0);
+_ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
+_ACRTIMP int WINAPIV fprintf(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
+_ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
+_ACRTIMP int WINAPIV printf(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
+_ACRTIMP int WINAPIV printf_s(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
+_ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
+_ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
+_ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
+_ACRTIMP int __cdecl vprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
+_ACRTIMP int __cdecl vprintf_s(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
+_ACRTIMP int __cdecl vsprintf(char*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
+_ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
+
+_ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
+static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
+static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args)
+{ return _vsnprintf(buffer,size,format,args); }
+
+_ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(3, 5);
+_ACRTIMP int WINAPIV fscanf(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
+_ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
+_ACRTIMP int WINAPIV scanf(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
+_ACRTIMP int WINAPIV scanf_s(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
+_ACRTIMP int WINAPIV sscanf(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
+_ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
#endif /* _UCRT && !_NO_CRT_STDIO_INLINE */
@@ -435,6 +462,7 @@ static inline int unlink(const char* path) { return _unlink(path); }
#if !defined(_NO_CRT_STDIO_INLINE)
+static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...)
{
int ret;
@@ -446,6 +474,7 @@ static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format
return ret;
}
+static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...)
{
int ret;
@@ -457,6 +486,7 @@ static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *forma
return ret;
}
+static inline int WINAPIV sprintf(char *buffer, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
{
int ret;
@@ -470,9 +500,9 @@ static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
#else /* !_NO_CRT_STDIO_INLINE */
-_ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...);
-_ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...);
-_ACRTIMP int WINAPIV sprintf(char*,const char*,...);
+_ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
+_ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
+_ACRTIMP int WINAPIV sprintf(char*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
#endif /* !_NO_CRT_STDIO_INLINE */
diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 3ed514f73e2..3ffb0185052 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -865,7 +865,7 @@ static HMODULE load_com_dll(const char *name, char **path, char *filename)
if(!get_main_clsid(name, &clsid)) return NULL;
- sprintf(keyname, "CLSID\\{%08x-%04x-%04x-%02x%2x-%02x%2x%02x%2x%02x%2x}\\InprocServer32",
+ sprintf(keyname, "CLSID\\{%08lx-%04x-%04x-%02x%2x-%02x%2x%02x%2x%02x%2x}\\InprocServer32",
clsid.Data1, clsid.Data2, clsid.Data3, clsid.Data4[0], clsid.Data4[1],
clsid.Data4[2], clsid.Data4[3], clsid.Data4[4], clsid.Data4[5],
clsid.Data4[6], clsid.Data4[7]);
Jan. 28, 2022
[PATCH 00/15] Enabling compilation with long types
by Eric Pouech
There are 745 modules to be migrated to using long types.
Start by enabling also attribute(format) on msvcrt APIs (for
printf and scanf -like APIs)
And continue by migration some modules in programs.
FWI, I've scripted the migration. Between 80 and 90% of the modules can be
done automatically (ie fully migrated without warnings); for the remaining
modules, again 80 to 90% of the warnings are fixed automatically.
The remaining must be done manually. Regular items to be looked into:
- "complex" format strings (multi-line, in static variable, embedded inside
macros...)
- long/int mismatch (in pointer as argument, in proto vs definition of
function...). Here the fix must be decided on a case by case basis.
- multi-directories modules (like d3d, msvcrt, atl to name a few). Likely,
requires migrating several modules at once.
If you're interested at looking into your favorite module, don't hesitate
to go back to me (I can provide the raw automated changes if this can help
you).
The plan is to start to migrate programs/*. Then likely dlls/*. The
[dlls/programs]/tests/* shall wait for Fabian to finish the gcc11 todo
fixes.
A+
--
Eric Pouech (15):
include/msvcrt: add attribute((format)) to printf and scanf -like APIs
programs/attrib: enable compilation with long types
programs/cabarc: enable compilation with long types
programs/chcp.com: enable compilation with long types
programs/cmd: enable compilation with long types
programs/conhost: enable compilation with long types
programs/[cw]script: enable compilation with long types
programs/dxdiag: enable compilation with long types
programs/eject: enable compilation with long types
programs/explorer: enable compilation with long types
programs/fsutil: enable compilation with long types
programs/msiexec: enable compilation with long types
programs/net: enable compilation with long types
programs/netstat: enable compilation with long types
programs/ping: enable compilation with long types
dlls/compobj.dll16/compobj.c | 2 +-
dlls/crypt32/sip.c | 2 +-
dlls/iphlpapi/iphlpapi_main.c | 2 +-
dlls/iphlpapi/tests/iphlpapi.c | 4 +-
dlls/msdmo/tests/msdmo.c | 2 +-
dlls/mshtml/main.c | 2 +-
dlls/oleaut32/oleaut.c | 2 +-
dlls/oleaut32/typelib.c | 2 +-
dlls/rpcrt4/rpcrt4_main.c | 4 +-
dlls/shell32/classes.c | 2 +-
dlls/shell32/debughlp.c | 2 +-
dlls/shell32/shfldr.h | 2 +-
dlls/shlwapi/ordinal.c | 2 +-
dlls/typelib.dll16/typelib.c | 2 +-
dlls/webservices/writer.c | 4 +-
include/msvcrt/corecrt.h | 8 +++
include/msvcrt/crtdbg.h | 2 +-
include/msvcrt/stdio.h | 90 ++++++++++++++++++++++------------
programs/attrib/Makefile.in | 1 -
programs/attrib/attrib.c | 6 +--
programs/cabarc/Makefile.in | 1 -
programs/cabarc/cabarc.c | 2 +-
programs/chcp.com/Makefile.in | 1 -
programs/chcp.com/main.c | 4 +-
programs/cmd/Makefile.in | 1 -
programs/cmd/builtins.c | 20 ++++----
programs/cmd/directory.c | 4 +-
programs/cmd/wcmdmain.c | 14 +++---
programs/conhost/Makefile.in | 1 -
programs/conhost/conhost.c | 18 +++----
programs/conhost/window.c | 10 ++--
programs/cscript/Makefile.in | 2 +-
programs/dxdiag/Makefile.in | 1 -
programs/dxdiag/information.c | 2 +-
programs/dxdiag/output.c | 6 +--
programs/eject/Makefile.in | 1 -
programs/eject/eject.c | 6 +--
programs/explorer/Makefile.in | 1 -
programs/explorer/appbar.c | 2 +-
programs/explorer/desktop.c | 52 ++++++++++----------
programs/explorer/explorer.c | 4 +-
programs/explorer/systray.c | 2 +-
programs/fsutil/Makefile.in | 1 -
programs/fsutil/main.c | 2 +-
programs/msiexec/Makefile.in | 1 -
programs/msiexec/msiexec.c | 12 ++---
programs/msiexec/service.c | 4 +-
programs/net/Makefile.in | 1 -
programs/net/net.c | 4 +-
programs/netstat/Makefile.in | 1 -
programs/netstat/netstat.c | 2 +-
programs/ping/Makefile.in | 1 -
programs/ping/ping_main.c | 2 +-
programs/winetest/main.c | 2 +-
programs/wscript/Makefile.in | 1 -
programs/wscript/arguments.c | 8 +--
programs/wscript/host.c | 10 ++--
programs/wscript/main.c | 6 +--
58 files changed, 190 insertions(+), 166 deletions(-)
Jan. 28, 2022
Re: Arbitrary DOS device name
by Stefan Dösinger
Am Freitag, 28. Jänner 2022, 12:03:22 EAT schrieb Daniel Kucera:
> Good news!
>
> I have been able to fix configure and mutex issue by removing
> -mno-cygwin option from Makefile.in
> The other linker issue I fixed by specifying the lib name as:
> IMPORTS = ntoskrnl usb-1.0.
> this removes the last dot and anything behind.
>
> The driver works and I can run my scope app on wine!
Gratulations! You got what you set out to do, although getting the original
Windows driver to work would be nice to have too.
> My last question is how to build the driver off the tree? Is there any
> example/guide?
https://wiki.winehq.org/Winelib_User%27s_Guide is probably a starting point,
although it is more about converting existing Windows software than writing
something new and possibly outdated.
Look at the winegcc and winebuild invocations that the build system does with
your in-tree driver. Also have a look at tools/winemaker.
Jan. 28, 2022
Re: [PATCH 1/3] wined3d: Use wined3d_buffer_load_location() in wined3d_buffer_get_memory().
by Zebediah Figura (she/her)
On 1/28/22 05:12, Henri Verbeet wrote:
> On Fri, 28 Jan 2022 at 12:08, Henri Verbeet <hverbeet(a)gmail.com> wrote:
>> On Fri, 28 Jan 2022 at 03:23, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
>>> @@ -653,14 +653,12 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_co
>>> if (locations & WINED3D_LOCATION_DISCARDED)
>>> {
>>> locations = ((buffer->flags & WINED3D_BUFFER_USE_BO) ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM);
>>> - if (!wined3d_buffer_prepare_location(buffer, context, locations))
>>> + if (!wined3d_buffer_load_location(buffer, context, locations))
>>> {
>>> data->buffer_object = 0;
>>> data->addr = NULL;
>>> return 0;
>>> }
>>> - wined3d_buffer_validate_location(buffer, locations);
>>> - wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_DISCARDED);
>>> }
>> Where would we load the contents from if the buffer has been discarded?
>
> Or well, I suppose the point of the patch is that
> wined3d_buffer_load_location() will essentially do the same thing as
> the code it replaces in this case; I guess that makes sense.
Yes. I suppose it looks odd by itself, but I started writing the case
for WINED3D_LOCATION_CLEARED here and then realized that I was
open-coding wined3d_buffer_load_location().
Jan. 28, 2022
Re: [PATCH vkd3d v4 3/6] vkd3d-shader/hlsl: Write SM4 unsigned multiplication instructions.
by Francisco Casas
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
January 28, 2022 5:03 AM, "Giovanni Mascellani" <gmascellani(a)codeweavers.com> wrote:
> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
> ---
> v2:
> * Rename to write_sm4_binary_op_with_two_destinations().
> * Fix writemask mapping (before it always used the writemask from
> destination 1, but of course it has to use dst_idx).
> v3:
> * Rebased onto master.
> v4:
> * Really rebase onto master. I mean, use calls that are available in
> master.
> ---
> libs/vkd3d-shader/hlsl_sm4.c | 31 ++++++++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
> index 4eebd583..58d7aef7 100644
> --- a/libs/vkd3d-shader/hlsl_sm4.c
> +++ b/libs/vkd3d-shader/hlsl_sm4.c
> @@ -786,7 +786,7 @@ struct sm4_instruction
> {
> struct sm4_register reg;
> unsigned int writemask;
> - } dsts[1];
> + } dsts[2];
> unsigned int dst_count;
>
> struct sm4_src_register
> @@ -1266,6 +1266,28 @@ static void write_sm4_binary_op(struct vkd3d_bytecode_buffer *buffer, enum
> vkd3d
> write_sm4_instruction(buffer, &instr);
> }
>
> +static void write_sm4_binary_op_with_two_destinations(struct vkd3d_bytecode_buffer *buffer,
> + enum vkd3d_sm4_opcode opcode, const struct hlsl_ir_node *dst, unsigned dst_idx,
> + const struct hlsl_ir_node *src1, const struct hlsl_ir_node *src2)
> +{
> + struct sm4_instruction instr;
> +
> + memset(&instr, 0, sizeof(instr));
> + instr.opcode = opcode;
> +
> + sm4_dst_from_node(&instr.dsts[dst_idx], dst);
> + instr.dsts[1 - dst_idx].reg.type = VKD3D_SM4_RT_NULL;
> + instr.dsts[1 - dst_idx].reg.dim = VKD3D_SM4_DIMENSION_NONE;
> + instr.dsts[1 - dst_idx].reg.idx_count = 0;
> + instr.dst_count = 2;
> +
> + sm4_src_from_node(&instr.srcs[0], src1, instr.dsts[dst_idx].writemask);
> + sm4_src_from_node(&instr.srcs[1], src2, instr.dsts[dst_idx].writemask);
> + instr.src_count = 2;
> +
> + write_sm4_instruction(buffer, &instr);
> +}
> +
> static void write_sm4_constant(struct hlsl_ctx *ctx,
> struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_constant *constant)
> {
> @@ -1578,6 +1600,13 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
> write_sm4_binary_op(buffer, VKD3D_SM4_OP_UMIN, &expr->node, arg1, arg2);
> break;
>
> + case HLSL_OP2_MUL:
> + /* Using IMUL instead of UMUL because we're taking
> + * the low bits, and the native compiler generates
> + * IMUL. */
> + write_sm4_binary_op_with_two_destinations(buffer, VKD3D_SM4_OP_IMUL, &expr->node, 1, arg1, arg2);
> + break;
> +
> default:
> hlsl_fixme(ctx, &expr->node.loc, "SM4 uint \"%s\" expression.\n", debug_hlsl_expr_op(expr->op));
> break;
> --
> 2.34.1
Jan. 28, 2022
Re: [PATCH vkd3d v2 2/2] vkd3d: Replace atomic_add_fetch() by InterlockedAdd().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Jan. 28, 2022
Re: [PATCH vkd3d v2 1/2] vkd3d: Always use _BitScanReverse on Windows.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Jan. 28, 2022
[PATCH vkd3d v2 2/2] vkd3d: Replace atomic_add_fetch() by InterlockedAdd().
by Alexandre Julliard
By analogy with InterlockedIncrement. It avoids the need for a
configure check on Windows platforms.
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
v2: make enqueued_fence_count a LONG as well
---
include/private/vkd3d_common.h | 13 ++++---------
libs/vkd3d/command.c | 6 +++---
libs/vkd3d/vkd3d_private.h | 2 +-
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h
index d22c26c098c7..1e19758abc40 100644
--- a/include/private/vkd3d_common.h
+++ b/include/private/vkd3d_common.h
@@ -201,6 +201,10 @@ static inline LONG InterlockedIncrement(LONG volatile *x)
{
return __sync_add_and_fetch(x, 1);
}
+static inline LONG InterlockedAdd(LONG volatile *x, LONG val)
+{
+ return __sync_add_and_fetch(x, val);
+}
# else
# error "InterlockedIncrement() not implemented for this platform"
# endif /* HAVE_SYNC_ADD_AND_FETCH */
@@ -215,15 +219,6 @@ static inline LONG InterlockedDecrement(LONG volatile *x)
# endif
#endif /* _WIN32 */
-#if HAVE_SYNC_ADD_AND_FETCH
-# define atomic_add_fetch(ptr, val) __sync_add_and_fetch(ptr, val)
-#elif defined(_MSC_VER)
-/* InterlockedAdd returns value after increment, like add_and_fetch. */
-# define atomic_add_fetch(ptr, val) InterlockedAdd(ptr, val)
-#else
-# error "atomic_add_fetch() not implemented for this platform"
-#endif /* HAVE_SYNC_ADD_AND_FETCH */
-
static inline void vkd3d_parse_version(const char *version, int *major, int *minor)
{
*major = atoi(version);
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 2cf1eba23d94..f1ec6be3fd20 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -288,7 +288,7 @@ static void vkd3d_fence_worker_remove_fence(struct vkd3d_fence_worker *worker, s
LONG count;
int rc;
- if (!(count = atomic_add_fetch(&fence->pending_worker_operation_count, 0)))
+ if (!(count = InterlockedAdd(&fence->pending_worker_operation_count, 0)))
return;
WARN("Waiting for %u pending fence operations (fence %p).\n", count, fence);
@@ -299,7 +299,7 @@ static void vkd3d_fence_worker_remove_fence(struct vkd3d_fence_worker *worker, s
return;
}
- while ((count = atomic_add_fetch(&fence->pending_worker_operation_count, 0)))
+ while ((count = InterlockedAdd(&fence->pending_worker_operation_count, 0)))
{
TRACE("Still waiting for %u pending fence operations (fence %p).\n", count, fence);
@@ -410,7 +410,7 @@ static void *vkd3d_fence_worker_main(void *arg)
{
vkd3d_wait_for_gpu_fences(worker);
- if (!worker->fence_count || atomic_add_fetch(&worker->enqueued_fence_count, 0))
+ if (!worker->fence_count || InterlockedAdd(&worker->enqueued_fence_count, 0))
{
if ((rc = pthread_mutex_lock(&worker->mutex)))
{
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 136b020330a9..d21cd411ec8a 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -192,7 +192,7 @@ struct vkd3d_fence_worker
bool should_exit;
bool pending_fence_destruction;
- size_t enqueued_fence_count;
+ LONG enqueued_fence_count;
struct vkd3d_enqueued_fence
{
VkFence vk_fence;
--
2.34.1
Jan. 28, 2022
[PATCH vkd3d v2 1/2] vkd3d: Always use _BitScanReverse on Windows.
by Alexandre Julliard
Use ULONG instead of unsigned long for non-Mingw msvcrt builds.
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
v2: unchanged
---
include/private/vkd3d_common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h
index b7ce9ae4046a..d22c26c098c7 100644
--- a/include/private/vkd3d_common.h
+++ b/include/private/vkd3d_common.h
@@ -88,10 +88,10 @@ static inline bool vkd3d_bitmask_is_contiguous(unsigned int mask)
/* Undefined for x == 0. */
static inline unsigned int vkd3d_log2i(unsigned int x)
{
-#ifdef _MSC_VER
+#ifdef _WIN32
/* _BitScanReverse returns the index of the highest set bit,
* unlike clz which is 31 - index. */
- unsigned long result;
+ ULONG result;
_BitScanReverse(&result, x);
return (unsigned int)result;
#elif defined(HAVE_BUILTIN_CLZ)
--
2.34.1
Jan. 28, 2022