fix a bunch of warnings generated by this patch and the migration of GUID.Data1 to long in ae2693e2c4079edcc719c08abed5ad58ba7aace7
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- 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 387589cc03d..f96a5dc5fd1 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]);