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
May 2020
- 79 participants
- 1536 messages
[PATCH 5/7] comctl32/datetime: Use wide string literals.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/datetime.c | 63 ++++++++++++++++------------------------
1 file changed, 25 insertions(+), 38 deletions(-)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 51c20a7063..2ce3da591f 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -361,9 +361,6 @@ DATETIME_SetFormatA (DATETIME_INFO *infoPtr, LPCSTR lpszFormat)
static void
DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize)
{
- static const WCHAR fmt_dW[] = { '%', 'd', 0 };
- static const WCHAR fmt__2dW[] = { '%', '.', '2', 'd', 0 };
- static const WCHAR fmt__3sW[] = { '%', '.', '3', 's', 0 };
SYSTEMTIME date = infoPtr->date;
int spec;
WCHAR buffer[80];
@@ -395,10 +392,10 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
*result = 0;
break;
case ONEDIGITDAY:
- wsprintfW (result, fmt_dW, date.wDay);
+ wsprintfW (result, L"%d", date.wDay);
break;
case TWODIGITDAY:
- wsprintfW (result, fmt__2dW, date.wDay);
+ wsprintfW (result, L"%.2d", date.wDay);
break;
case THREECHARDAY:
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1+(date.wDayOfWeek+6)%7, result, 4);
@@ -414,7 +411,7 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
result[2] = 0;
}
else
- wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+ wsprintfW (result, L"%d", date.wHour - (date.wHour > 12 ? 12 : 0));
break;
case TWODIGIT12HOUR:
if (date.wHour == 0) {
@@ -423,35 +420,35 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
result[2] = 0;
}
else
- wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+ wsprintfW (result, L"%.2d", date.wHour - (date.wHour > 12 ? 12 : 0));
break;
case ONEDIGIT24HOUR:
- wsprintfW (result, fmt_dW, date.wHour);
+ wsprintfW (result, L"%d", date.wHour);
break;
case TWODIGIT24HOUR:
- wsprintfW (result, fmt__2dW, date.wHour);
+ wsprintfW (result, L"%.2d", date.wHour);
break;
case ONEDIGITSECOND:
- wsprintfW (result, fmt_dW, date.wSecond);
+ wsprintfW (result, L"%d", date.wSecond);
break;
case TWODIGITSECOND:
- wsprintfW (result, fmt__2dW, date.wSecond);
+ wsprintfW (result, L"%.2d", date.wSecond);
break;
case ONEDIGITMINUTE:
- wsprintfW (result, fmt_dW, date.wMinute);
+ wsprintfW (result, L"%d", date.wMinute);
break;
case TWODIGITMINUTE:
- wsprintfW (result, fmt__2dW, date.wMinute);
+ wsprintfW (result, L"%.2d", date.wMinute);
break;
case ONEDIGITMONTH:
- wsprintfW (result, fmt_dW, date.wMonth);
+ wsprintfW (result, L"%d", date.wMonth);
break;
case TWODIGITMONTH:
- wsprintfW (result, fmt__2dW, date.wMonth);
+ wsprintfW (result, L"%.2d", date.wMonth);
break;
case THREECHARMONTH:
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1, buffer, ARRAY_SIZE(buffer));
- wsprintfW (result, fmt__3sW, buffer);
+ wsprintfW (result, L"%s.3s", buffer);
break;
case FULLMONTH:
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1,
@@ -472,14 +469,14 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
result[1] = 0;
break;
case ONEDIGITYEAR:
- wsprintfW (result, fmt_dW, date.wYear % 10);
+ wsprintfW (result, L"%d", date.wYear % 10);
break;
case TWODIGITYEAR:
- wsprintfW (result, fmt__2dW, date.wYear % 100);
+ wsprintfW (result, L"%.2d", date.wYear % 100);
break;
case INVALIDFULLYEAR:
case FULLYEAR:
- wsprintfW (result, fmt_dW, date.wYear);
+ wsprintfW (result, L"%d", date.wYear);
break;
}
@@ -601,11 +598,6 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
{
/* fields are a fixed width, determined by the largest possible string */
/* presumably, these widths should be language dependent */
- static const WCHAR fld_d1W[] = { '2', 0 };
- static const WCHAR fld_d2W[] = { '2', '2', 0 };
- static const WCHAR fld_d4W[] = { '2', '2', '2', '2', 0 };
- static const WCHAR fld_am1[] = { 'A', 0 };
- static const WCHAR fld_am2[] = { 'A', 'M', 0 };
int spec;
WCHAR buffer[80];
LPCWSTR bufptr;
@@ -640,22 +632,17 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
case TWODIGITMINUTE:
case TWODIGITMONTH:
case TWODIGITYEAR:
- bufptr = fld_d2W;
+ bufptr = L"22";
break;
case INVALIDFULLYEAR:
case FULLYEAR:
- bufptr = fld_d4W;
+ bufptr = L"2222";
break;
case THREECHARMONTH:
case FULLMONTH:
case THREECHARDAY:
case FULLDAY:
{
- static const WCHAR fld_day[] = {'W','e','d','n','e','s','d','a','y',0};
- static const WCHAR fld_abbrday[] = {'W','e','d',0};
- static const WCHAR fld_mon[] = {'S','e','p','t','e','m','b','e','r',0};
- static const WCHAR fld_abbrmon[] = {'D','e','c',0};
-
const WCHAR *fall;
LCTYPE lctype;
INT i, max_count;
@@ -664,22 +651,22 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
/* choose locale data type and fallback string */
switch (spec) {
case THREECHARDAY:
- fall = fld_abbrday;
+ fall = L"Wed";
lctype = LOCALE_SABBREVDAYNAME1;
max_count = 7;
break;
case FULLDAY:
- fall = fld_day;
+ fall = L"Wednesday";
lctype = LOCALE_SDAYNAME1;
max_count = 7;
break;
case THREECHARMONTH:
- fall = fld_abbrmon;
+ fall = L"Dec";
lctype = LOCALE_SABBREVMONTHNAME1;
max_count = 12;
break;
default: /* FULLMONTH */
- fall = fld_mon;
+ fall = L"September";
lctype = LOCALE_SMONTHNAME1;
max_count = 12;
break;
@@ -704,13 +691,13 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
return cx;
}
case ONELETTERAMPM:
- bufptr = fld_am1;
+ bufptr = L"A";
break;
case TWOLETTERAMPM:
- bufptr = fld_am2;
+ bufptr = L"AM";
break;
default:
- bufptr = fld_d1W;
+ bufptr = L"2";
break;
}
}
--
2.26.2
May 1, 2020
[PATCH 4/7] comctl32/rebar: Use wide string literals.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/rebar.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 6bca2f1818..af35008b69 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -302,8 +302,7 @@ static const char * const band_maskname[] = {
"RBBIM_CHEVRONSTATE", /* 0x00002000 */
NULL };
-
-static const WCHAR themeClass[] = { 'R','e','b','a','r',0 };
+static const WCHAR themeClass[] = L"Rebar";
static CHAR *
REBAR_FmtStyle(char *buffer, UINT style)
@@ -1010,7 +1009,6 @@ REBAR_ForceResize (REBAR_INFO *infoPtr)
static VOID
REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
{
- static const WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
REBAR_BAND *lpBand;
WCHAR szClassName[40];
UINT i;
@@ -1047,7 +1045,7 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
}
GetClassNameW (lpBand->hwndChild, szClassName, ARRAY_SIZE(szClassName));
- if (!lstrcmpW (szClassName, strComboBox) ||
+ if (!lstrcmpW (szClassName, WC_COMBOBOXW) ||
!lstrcmpW (szClassName, WC_COMBOBOXEXW)) {
INT nEditHeight, yPos;
RECT rc;
--
2.26.2
May 1, 2020
[PATCH 3/7] comctl32/animate: Use wide string literals.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/animate.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c
index f8ba159779..f7ac28ae4c 100644
--- a/dlls/comctl32/animate.c
+++ b/dlls/comctl32/animate.c
@@ -94,12 +94,11 @@ static void ANIMATE_Notify(const ANIMATE_INFO *infoPtr, UINT notif)
static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpName)
{
- static const WCHAR aviW[] = { 'A', 'V', 'I', 0 };
HRSRC hrsrc;
MMIOINFO mminfo;
LPVOID lpAvi;
- hrsrc = FindResourceW(hInst, lpName, aviW);
+ hrsrc = FindResourceW(hInst, lpName, L"AVI");
if (!hrsrc)
return FALSE;
@@ -794,12 +793,11 @@ static BOOL ANIMATE_Stop(ANIMATE_INFO *infoPtr)
static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
{
- static const WCHAR msvfw32W[] = { 'm', 's', 'v', 'f', 'w', '3', '2', '.', 'd', 'l', 'l', 0 };
ANIMATE_INFO *infoPtr;
if (!fnIC.hModule)
{
- fnIC.hModule = LoadLibraryW(msvfw32W);
+ fnIC.hModule = LoadLibraryW(L"msvfw32.dll");
if (!fnIC.hModule) return FALSE;
fnIC.fnICOpen = (void*)GetProcAddress(fnIC.hModule, "ICOpen");
--
2.26.2
May 1, 2020
[PATCH 2/7] comctl32/ipaddress: Use wide string literals.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/ipaddress.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c
index d88cd88f31..c75a108565 100644
--- a/dlls/comctl32/ipaddress.c
+++ b/dlls/comctl32/ipaddress.c
@@ -59,8 +59,7 @@ typedef struct
IPPART_INFO Part[4];
} IPADDRESS_INFO;
-static const WCHAR IP_SUBCLASS_PROP[] =
- { 'C', 'C', 'I', 'P', '3', '2', 'S', 'u', 'b', 'c', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 };
+static const WCHAR IP_SUBCLASS_PROP[] = L"CCIP32SubclassInfo";
#define POS_DEFAULT 0
#define POS_LEFT 1
@@ -72,8 +71,6 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static void IPADDRESS_UpdateText (const IPADDRESS_INFO *infoPtr)
{
- static const WCHAR zero[] = {'0', 0};
- static const WCHAR dot[] = {'.', 0};
WCHAR field[4];
WCHAR ip[16];
INT i;
@@ -85,9 +82,9 @@ static void IPADDRESS_UpdateText (const IPADDRESS_INFO *infoPtr)
lstrcatW(ip, field);
else
/* empty edit treated as zero */
- lstrcatW(ip, zero);
+ lstrcatW(ip, L"0");
if (i != 3)
- lstrcatW(ip, dot);
+ lstrcatW(ip, L".");
}
SetWindowTextW(infoPtr->Self, ip);
@@ -140,7 +137,6 @@ static int IPADDRESS_GetPartIndex(const IPADDRESS_INFO *infoPtr, HWND hwnd)
static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
{
- static const WCHAR dotW[] = { '.', 0 };
RECT rect, rcPart;
COLORREF bgCol, fgCol;
HTHEME theme;
@@ -193,9 +189,9 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
rect.right = rcPart.left;
if (theme)
- DrawThemeText(theme, hdc, EP_EDITTEXT, state, dotW, 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, &rect);
+ DrawThemeText(theme, hdc, EP_EDITTEXT, state, L".", 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, &rect);
else
- DrawTextW(hdc, dotW, 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM);
+ DrawTextW(hdc, L".", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM);
}
if (theme)
@@ -360,20 +356,18 @@ static BOOL IPADDRESS_SetRange (IPADDRESS_INFO *infoPtr, int index, WORD range)
static void IPADDRESS_ClearAddress (const IPADDRESS_INFO *infoPtr)
{
- static const WCHAR nil[] = { 0 };
int i;
TRACE("\n");
for (i = 0; i < 4; i++)
- SetWindowTextW (infoPtr->Part[i].EditHwnd, nil);
+ SetWindowTextW (infoPtr->Part[i].EditHwnd, L"");
}
static LRESULT IPADDRESS_SetAddress (const IPADDRESS_INFO *infoPtr, DWORD ip_address)
{
WCHAR buf[20];
- static const WCHAR fmt[] = { '%', 'd', 0 };
int i;
TRACE("\n");
@@ -382,7 +376,7 @@ static LRESULT IPADDRESS_SetAddress (const IPADDRESS_INFO *infoPtr, DWORD ip_add
const IPPART_INFO* part = &infoPtr->Part[i];
int value = ip_address & 0xff;
if ( (value >= part->LowerLimit) && (value <= part->UpperLimit) ) {
- wsprintfW (buf, fmt, value);
+ wsprintfW (buf, L"%d", value);
SetWindowTextW (part->EditHwnd, buf);
IPADDRESS_Notify (infoPtr, EN_CHANGE);
}
@@ -405,7 +399,6 @@ static void IPADDRESS_SetFocusToField (const IPADDRESS_INFO *infoPtr, INT index)
static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int currentfield)
{
- static const WCHAR fmt[] = { '%', 'd', 0 };
const IPPART_INFO *part;
int curValue, newValue;
WCHAR field[10];
@@ -428,7 +421,7 @@ static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int current
if (newValue == curValue) return FALSE;
- wsprintfW (field, fmt, newValue);
+ wsprintfW (field, L"%d", newValue);
TRACE(" field=%s\n", debugstr_w(field));
return SetWindowTextW (part->EditHwnd, field);
}
--
2.26.2
May 1, 2020
[PATCH 1/7] comctl32/monthcal: Use wide string literals.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/monthcal.c | 39 ++++++++++++++-------------------------
1 file changed, 14 insertions(+), 25 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 1de13dab36..98c682df33 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -142,7 +142,7 @@ typedef struct
SIZE dim; /* [cx,cy] - dimensions of calendars matrix, row/column count */
} MONTHCAL_INFO, *LPMONTHCAL_INFO;
-static const WCHAR themeClass[] = { 'S','c','r','o','l','l','b','a','r',0 };
+static const WCHAR themeClass[] = L"Scrollbar";
/* empty SYSTEMTIME const */
static const SYSTEMTIME st_null;
@@ -782,7 +782,6 @@ static void MONTHCAL_CircleDay(const MONTHCAL_INFO *infoPtr, HDC hdc,
static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEMTIME *st,
int bold, const PAINTSTRUCT *ps)
{
- static const WCHAR fmtW[] = { '%','d',0 };
WCHAR buf[10];
RECT r, r_temp;
COLORREF oldCol = 0;
@@ -811,7 +810,7 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM
SelectObject(hdc, bold ? infoPtr->hBoldFont : infoPtr->hFont);
old_bkmode = SetBkMode(hdc, TRANSPARENT);
- wsprintfW(buf, fmtW, st->wDay);
+ wsprintfW(buf, L"%d", st->wDay);
DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
SetBkMode(hdc, old_bkmode);
@@ -862,12 +861,6 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direc
/* paint a title with buttons and month/year string */
static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
{
- static const WCHAR mmmmW[] = {'M','M','M','M',0};
- static const WCHAR mmmW[] = {'M','M','M',0};
- static const WCHAR mmW[] = {'M','M',0};
- static const WCHAR fmtyearW[] = {'%','l','d',0};
- static const WCHAR fmtmmW[] = {'%','0','2','d',0};
- static const WCHAR fmtmW[] = {'%','d',0};
RECT *title = &infoPtr->calendars[calIdx].title;
const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month;
WCHAR monthW[80], strW[80], fmtW[80], yearW[6] /* valid year range is 1601-30827 */;
@@ -887,18 +880,18 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
DrawTextW(hdc, strW, lstrlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, ARRAY_SIZE(fmtW));
- wsprintfW(yearW, fmtyearW, st->wYear);
+ wsprintfW(yearW, L"%ld", st->wYear);
/* month is trickier as it's possible to have different format pictures, we'll
test for M, MM, MMM, and MMMM */
- if (wcsstr(fmtW, mmmmW))
+ if (wcsstr(fmtW, L"MMMM"))
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW));
- else if (wcsstr(fmtW, mmmW))
+ else if (wcsstr(fmtW, L"MMM"))
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW));
- else if (wcsstr(fmtW, mmW))
- wsprintfW(monthW, fmtmmW, st->wMonth);
+ else if (wcsstr(fmtW, L"MM"))
+ wsprintfW(monthW, L"%02d", st->wMonth);
else
- wsprintfW(monthW, fmtmW, st->wMonth);
+ wsprintfW(monthW, L"%d", st->wMonth);
/* update hit boxes */
yearoffset = 0;
@@ -946,7 +939,6 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
{
const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month;
- static const WCHAR fmt_weekW[] = { '%','d',0 };
INT mindays, weeknum, weeknum1, startofprescal;
INT i, prev_month;
SYSTEMTIME st;
@@ -1032,15 +1024,15 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con
for(i = 0; i < 6; i++) {
if((i == 0) && (weeknum > 50))
{
- wsprintfW(buf, fmt_weekW, weeknum);
+ wsprintfW(buf, L"%d", weeknum);
weeknum = 0;
}
else if((i == 5) && (weeknum > 47))
{
- wsprintfW(buf, fmt_weekW, 1);
+ wsprintfW(buf, L"%d", 1);
}
else
- wsprintfW(buf, fmt_weekW, weeknum + i);
+ wsprintfW(buf, L"%d", weeknum + i);
DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
OffsetRect(&r, 0, infoPtr->height_increment);
@@ -1056,7 +1048,6 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con
/* bottom today date */
static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
{
- static const WCHAR fmt_todayW[] = { '%','s',' ','%','s',0 };
WCHAR buf_todayW[30], buf_dateW[20], buf[80];
RECT text_rect, box_rect;
HFONT old_font;
@@ -1075,7 +1066,7 @@ static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, cons
old_font = SelectObject(hdc, infoPtr->hBoldFont);
SetTextColor(hdc, infoPtr->colors[MCSC_TEXT]);
- wsprintfW(buf, fmt_todayW, buf_todayW, buf_dateW);
+ wsprintfW(buf, L"%s %s", buf_todayW, buf_dateW);
DrawTextW(hdc, buf, -1, &text_rect, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE);
DrawTextW(hdc, buf, -1, &text_rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
@@ -2484,7 +2475,6 @@ MONTHCAL_SetFocus(const MONTHCAL_INFO *infoPtr)
/* sets the size information */
static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
{
- static const WCHAR O0W[] = { '0','0',0 };
RECT *title=&infoPtr->calendars[0].title;
RECT *prev=&infoPtr->titlebtnprev;
RECT *next=&infoPtr->titlebtnnext;
@@ -2526,8 +2516,7 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
}
else /* locale independent fallback on failure */
{
- static const WCHAR sunW[] = { 'S','u','n' };
- GetTextExtentPoint32W(hdc, sunW, ARRAY_SIZE(sunW), &sz);
+ GetTextExtentPoint32W(hdc, L"Sun", 3, &sz);
day_width = sz.cx;
break;
}
@@ -2537,7 +2526,7 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
/* recalculate the height and width increments and offsets */
size.cx = 0;
- GetTextExtentPoint32W(hdc, O0W, 2, &size);
+ GetTextExtentPoint32W(hdc, L"00", 2, &size);
/* restore the originally selected font */
SelectObject(hdc, font);
--
2.26.2
May 1, 2020
Re: [PATCH v2] dmime: Parse lyric track data
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
On 4/30/20 8:41 AM, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
> ---
> dlls/dmime/lyricstrack.c | 93 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 91 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/dmime/lyricstrack.c b/dlls/dmime/lyricstrack.c
> index 49f44f52a34..64ce793cfa9 100644
> --- a/dlls/dmime/lyricstrack.c
> +++ b/dlls/dmime/lyricstrack.c
> @@ -37,6 +37,11 @@ static inline IDirectMusicLyricsTrack *impl_from_IDirectMusicTrack8(IDirectMusic
> return CONTAINING_RECORD(iface, IDirectMusicLyricsTrack, IDirectMusicTrack8_iface);
> }
>
> +static inline IDirectMusicLyricsTrack *impl_from_IPersistStream(IPersistStream *iface)
> +{
> + return CONTAINING_RECORD(iface, IDirectMusicLyricsTrack, dmobj.IPersistStream_iface);
> +}
> +
> static HRESULT WINAPI lyrics_track_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid,
> void **ret_iface)
> {
> @@ -236,10 +241,94 @@ static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
> lyrics_track_Join
> };
>
> +static HRESULT parse_lyrics_track_events(IDirectMusicLyricsTrack *This, IStream *stream,
> + struct chunk_entry *lyric)
> +{
> + struct chunk_entry chunk = {.parent = lyric};
> + HRESULT hr;
> + DMUS_IO_LYRICSTRACK_EVENTHEADER header;
> + WCHAR name[256];
> +
> + TRACE("Parsing segment form in %p: %s\n", stream, debugstr_chunk(lyric));
> +
> + while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
> + if (chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_LYRICSTRACKEVENT_LIST) {
> + struct chunk_entry child = {.parent = &chunk};
> +
> + if (FAILED(hr = stream_next_chunk(stream, &child)))
> + return hr;
> +
> + if (child.id != DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK)
> + return DMUS_E_UNSUPPORTED_STREAM;
> +
> + if (FAILED(hr = stream_chunk_get_data(stream, &child, &header, child.size))) {
> + WARN("Failed to read data of %s\n", debugstr_chunk(&child));
> + return hr;
> + }
> +
> + TRACE("Found DMUS_IO_LYRICSTRACK_EVENTHEADER\n");
> + TRACE(" - dwFlags 0x%08x\n", header.dwFlags);
> + TRACE(" - dwTimingFlags 0x%08x\n", header.dwTimingFlags);
> + TRACE(" - lTimeLogical %d\n", header.lTimeLogical);
> + TRACE(" - lTimePhysical %d\n", header.lTimePhysical);
> +
> + if (FAILED(hr = stream_next_chunk(stream, &child)))
> + return hr;
> +
> + if (child.id != DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK)
> + return DMUS_E_UNSUPPORTED_STREAM;;
> +
> + if (FAILED(hr = stream_chunk_get_data(stream, &child, &name, child.size))) {
> + WARN("Failed to read data of %s\n", debugstr_chunk(&child));
> + return hr;
> + }
> +
> + TRACE("Found DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK\n");
> + TRACE(" - name %s\n", debugstr_w(name));
> + }
> + }
> +
> + return SUCCEEDED(hr) ? S_OK : hr;
> +}
> +
> +static HRESULT parse_lyricstrack_list(IDirectMusicLyricsTrack *This, IStream *stream, struct chunk_entry *lyric)
> +{
> + HRESULT hr;
> + struct chunk_entry chunk = {.parent = lyric};
> +
> + TRACE("Parsing segment form in %p: %s\n", stream, debugstr_chunk(lyric));
> +
> + if (FAILED(hr = stream_next_chunk(stream, &chunk)))
> + return hr;
> +
> + if (chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_LYRICSTRACKEVENTS_LIST)
> + hr = parse_lyrics_track_events(This, stream, &chunk);
> + else
> + hr = DMUS_E_UNSUPPORTED_STREAM;
> +
> + return SUCCEEDED(hr) ? S_OK : hr;
> +}
> +
> static HRESULT WINAPI lyrics_IPersistStream_Load(IPersistStream *iface, IStream *stream)
> {
> - FIXME(": Loading not implemented yet\n");
> - return S_OK;
> + IDirectMusicLyricsTrack *This = impl_from_IPersistStream(iface);
> + HRESULT hr;
> + struct chunk_entry chunk = {0};
> +
> + TRACE("%p, %p\n", This, stream);
> +
> + if (!stream)
> + return E_POINTER;
> +
> + if ((hr = stream_get_chunk(stream, &chunk) != S_OK))
> + return hr;
> +
> + if (chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_LYRICSTRACK_LIST)
> + hr = parse_lyricstrack_list(This, stream, &chunk);
> + else
> + hr = DMUS_E_UNSUPPORTED_STREAM;
> +
> + return hr;
> }
>
> static const IPersistStreamVtbl persiststream_vtbl = {
>
May 1, 2020
[PATCH] include: Add missing GUIDs and CLSIDs to wincodecsdk.idl
by Vijay Kiran Kamuju
Supercedes 184632
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
May 1, 2020
Re: [PATCH] xaudio2: Avoid redefining several F3DAudio related constants.
by Andrew Eikum
On Fri, May 01, 2020 at 12:46:56AM +0200, Gerald Pfeifer wrote:
> On Thu, 30 Apr 2020, Andrew Eikum wrote:
> >> In file included from ../xaudio2_7/x3daudio.c:29:
> >> .../include/F3DAudio.h:69: warning: "SPEAKER_2POINT1" redefined
> > ../../include/x3daudio.h:127: note: this is the location of the previous definition
> >>
> >> Our own include/x3daudio.h tries to prevent that via
> >>
> >> #ifndef _SPEAKER_POSITIONS_
> >> #define _SPEAKER_POSITIONS_
> >>
> >> However, current it is included *before* the system provided F3DAudio.h,
> >> so this safety net falls short.
> >>
> >> Fixed thusly by changing the order of these two include files so that the
> >> system provided one comes first.
> > I'm not opposed to this, but I think there's a better solution. The
> > platform SDK and Wine's header both check for "#ifndef SPEAKER_MONO"
> > before defining the speaker arrangements symbols. However, FAudio's
> > header checks for "#ifndef _SPEAKER_COMBINATIONS_" instead. This
> > symbol doesn't occur in the platform SDK.
> >
> > Perhaps we should change FAudio's header to check for SPEAKER_MONO
> > instead, to match the platform SDK?
>
> Yes, that looks like a valid idea. Even if you can get such a change
> accepted, how long until the next release and how long until that spreads
> widely? And it looks like an implementation detail (subject to change)?
>
> So I suggest to go with my patch for Wine now, and if you can push for
> such a change in FAudio upstream on top, all the better!
>
I've opened a pull request for this:
https://github.com/FNA-XNA/FAudio/pull/187
FAudio makes a new release every month. If it's just fixing compiler
warnings, I'm not sure it's worth the change in Wine.
Andrew
May 1, 2020
[PATCH 5/5] wined3d: Submit the current command buffer in adapter_vk_flush_context().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 65850ab4ccc..f06cf30f273 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -1493,7 +1493,11 @@ static void adapter_vk_destroy_query(struct wined3d_query *query)
static void adapter_vk_flush_context(struct wined3d_context *context)
{
- TRACE("context %p.\n", context);
+ struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
+
+ TRACE("context_vk %p.\n", context_vk);
+
+ wined3d_context_vk_submit_command_buffer(context_vk, 0, NULL, NULL, 0, NULL);
}
static void adapter_vk_draw_primitive(struct wined3d_device *device,
--
2.20.1
May 1, 2020
[PATCH 4/5] wined3d: Add Vulkan format information for WINED3DFMT_B8G8R8X8_UNORM_SRGB.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/utils.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 222b3bf92c0..e7f04cbdf20 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4187,6 +4187,7 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format,
{WINED3DFMT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, },
{WINED3DFMT_B8G8R8A8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB, },
{WINED3DFMT_B8G8R8X8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, "XYZ1"},
+ {WINED3DFMT_B8G8R8X8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB, "XYZ1"},
{WINED3DFMT_BC1_UNORM, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, },
{WINED3DFMT_BC1_UNORM_SRGB, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, },
{WINED3DFMT_BC2_UNORM, VK_FORMAT_BC2_UNORM_BLOCK, },
--
2.20.1
May 1, 2020