Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
db55e070
Commit
db55e070
authored
Nov 18, 2020
by
Charles Davis
Committed by
Alexandre Julliard
Nov 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Make locale name string refcounted for C locale.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f71f1631
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
37 deletions
+33
-37
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+11
-31
locale.c
dlls/msvcrt/locale.c
+22
-6
No files found.
dlls/msvcr90/tests/msvcr90.c
View file @
db55e070
...
@@ -2036,15 +2036,11 @@ static void test__get_current_locale(void)
...
@@ -2036,15 +2036,11 @@ static void test__get_current_locale(void)
"same locale name pointers for LC_COLLATE
\n
"
);
"same locale name pointers for LC_COLLATE
\n
"
);
ok
(
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
!=
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
,
ok
(
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
!=
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
,
"same refcount pointers for LC_COLLATE
\n
"
);
"same refcount pointers for LC_COLLATE
\n
"
);
ok
(
!!
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
,
"null refcount pointer for LC_COLLATE
\n
"
);
if
(
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
)
ok
(
*
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
==
1
,
"refcount = %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
);
ok
(
!!
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
,
"null refcount pointer for LC_COLLATE
\n
"
);
if
(
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
)
ok
(
*
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
==
2
,
"refcount = %d
\n
"
,
ok
(
*
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
==
2
,
"refcount = %d
\n
"
,
*
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
);
*
l2
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
);
}
}
ok
(
*
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
==
1
,
"refcount = %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
LC_COLLATE
].
refcount
);
for
(
i
=
LC_CTYPE
;
i
<=
LC_MAX
;
i
++
)
{
for
(
i
=
LC_CTYPE
;
i
<=
LC_MAX
;
i
++
)
{
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
"different locale name pointers for category %d
\n
"
,
i
);
"different locale name pointers for category %d
\n
"
,
i
);
...
@@ -2107,15 +2103,11 @@ static void test__get_current_locale(void)
...
@@ -2107,15 +2103,11 @@ static void test__get_current_locale(void)
"same locale name pointers for category %d
\n
"
,
i
);
"same locale name pointers for category %d
\n
"
,
i
);
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"same refcount pointers for category %d
\n
"
,
i
);
"same refcount pointers for category %d
\n
"
,
i
);
ok
(
!!
l
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
ok
(
!!
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l2
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
for
(
i
=
LC_MONETARY
;
i
<=
LC_MAX
;
i
++
)
{
for
(
i
=
LC_MONETARY
;
i
<=
LC_MAX
;
i
++
)
{
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
...
@@ -2186,15 +2178,11 @@ static void test__get_current_locale(void)
...
@@ -2186,15 +2178,11 @@ static void test__get_current_locale(void)
"same locale name pointers for category %d
\n
"
,
i
);
"same locale name pointers for category %d
\n
"
,
i
);
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"same refcount pointers for category %d
\n
"
,
i
);
"same refcount pointers for category %d
\n
"
,
i
);
ok
(
!!
l
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
ok
(
!!
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l2
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
for
(
i
=
LC_NUMERIC
;
i
<=
LC_MAX
;
i
++
)
{
for
(
i
=
LC_NUMERIC
;
i
<=
LC_MAX
;
i
++
)
{
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
==
l2
->
locinfo
->
lc_category
[
i
].
locale
,
...
@@ -2273,15 +2261,11 @@ static void test__get_current_locale(void)
...
@@ -2273,15 +2261,11 @@ static void test__get_current_locale(void)
"same locale name pointers for category %d
\n
"
,
i
);
"same locale name pointers for category %d
\n
"
,
i
);
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"same refcount pointers for category %d
\n
"
,
i
);
"same refcount pointers for category %d
\n
"
,
i
);
ok
(
!!
l
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
ok
(
!!
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l2
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
ok
(
l
->
locinfo
->
lc_category
[
LC_TIME
].
locale
==
l2
->
locinfo
->
lc_category
[
LC_TIME
].
locale
,
ok
(
l
->
locinfo
->
lc_category
[
LC_TIME
].
locale
==
l2
->
locinfo
->
lc_category
[
LC_TIME
].
locale
,
"different locale name pointers for LC_TIME
\n
"
);
"different locale name pointers for LC_TIME
\n
"
);
...
@@ -2353,21 +2337,17 @@ static void test__get_current_locale(void)
...
@@ -2353,21 +2337,17 @@ static void test__get_current_locale(void)
ok
(
l2
->
locinfo
->
refcount
==
2
,
"refcount = %d
\n
"
,
l2
->
locinfo
->
refcount
);
ok
(
l2
->
locinfo
->
refcount
==
2
,
"refcount = %d
\n
"
,
l2
->
locinfo
->
refcount
);
}
}
todo_wine
{
for
(
i
=
LC_MIN
+
1
;
i
<=
LC_MAX
;
i
++
)
{
for
(
i
=
LC_MIN
+
1
;
i
<=
LC_MAX
;
i
++
)
{
todo_wine
{
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
!=
l2
->
locinfo
->
lc_category
[
i
].
locale
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
locale
!=
l2
->
locinfo
->
lc_category
[
i
].
locale
,
"same locale name pointers for category %d
\n
"
,
i
);
"same locale name pointers for category %d
\n
"
,
i
);
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
ok
(
l
->
locinfo
->
lc_category
[
i
].
refcount
!=
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"same refcount pointers for category %d
\n
"
,
i
);
"same refcount pointers for category %d
\n
"
,
i
);
ok
(
!!
l
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
ok
(
!!
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
"null refcount pointer for category %d
\n
"
,
i
);
if
(
l2
->
locinfo
->
lc_category
[
i
].
refcount
)
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
ok
(
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
==
2
,
"refcount = %d for category %d
\n
"
,
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
*
l2
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
ok
(
*
l
->
locinfo
->
lc_category
[
i
].
refcount
==
1
,
"refcount = %d for category %d
\n
"
,
*
l
->
locinfo
->
lc_category
[
i
].
refcount
,
i
);
}
}
todo_wine
{
todo_wine
{
...
...
dlls/msvcrt/locale.c
View file @
db55e070
...
@@ -1247,8 +1247,12 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
...
@@ -1247,8 +1247,12 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
free_locinfo
(
locinfo
);
free_locinfo
(
locinfo
);
return
NULL
;
return
NULL
;
}
}
}
else
}
else
{
locinfo
->
lc_category
[
MSVCRT_LC_COLLATE
].
locale
=
MSVCRT__strdup
(
"C"
);
if
(
!
init_category_name
(
"C"
,
1
,
locinfo
,
MSVCRT_LC_COLLATE
))
{
free_locinfo
(
locinfo
);
return
NULL
;
}
}
if
(
locale_name
[
MSVCRT_LC_CTYPE
]
&&
if
(
locale_name
[
MSVCRT_LC_CTYPE
]
&&
!
init_category_name
(
locale_name
[
MSVCRT_LC_CTYPE
],
!
init_category_name
(
locale_name
[
MSVCRT_LC_CTYPE
],
...
@@ -1325,7 +1329,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
...
@@ -1325,7 +1329,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
locinfo
->
lc_clike
=
1
;
locinfo
->
lc_clike
=
1
;
locinfo
->
mb_cur_max
=
1
;
locinfo
->
mb_cur_max
=
1
;
locinfo
->
pctype
=
MSVCRT__ctype
+
1
;
locinfo
->
pctype
=
MSVCRT__ctype
+
1
;
locinfo
->
lc_category
[
MSVCRT_LC_CTYPE
].
locale
=
MSVCRT__strdup
(
"C"
);
if
(
!
init_category_name
(
"C"
,
1
,
locinfo
,
MSVCRT_LC_CTYPE
))
{
free_locinfo
(
locinfo
);
return
NULL
;
}
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
if
(
locinfo
->
pctype
[
i
]
&
MSVCRT__LEADBYTE
)
if
(
locinfo
->
pctype
[
i
]
&
MSVCRT__LEADBYTE
)
...
@@ -1617,7 +1624,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
...
@@ -1617,7 +1624,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
locinfo
->
lconv
->
_W_negative_sign
[
0
]
=
'\0'
;
locinfo
->
lconv
->
_W_negative_sign
[
0
]
=
'\0'
;
#endif
#endif
locinfo
->
lc_category
[
MSVCRT_LC_MONETARY
].
locale
=
MSVCRT__strdup
(
"C"
);
if
(
!
init_category_name
(
"C"
,
1
,
locinfo
,
MSVCRT_LC_MONETARY
))
{
free_locinfo
(
locinfo
);
return
NULL
;
}
}
}
if
(
locale_name
[
MSVCRT_LC_NUMERIC
]
&&
if
(
locale_name
[
MSVCRT_LC_NUMERIC
]
&&
...
@@ -1735,7 +1745,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
...
@@ -1735,7 +1745,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
locinfo
->
lconv
->
_W_thousands_sep
[
0
]
=
'\0'
;
locinfo
->
lconv
->
_W_thousands_sep
[
0
]
=
'\0'
;
#endif
#endif
locinfo
->
lc_category
[
MSVCRT_LC_NUMERIC
].
locale
=
MSVCRT__strdup
(
"C"
);
if
(
!
init_category_name
(
"C"
,
1
,
locinfo
,
MSVCRT_LC_NUMERIC
))
{
free_locinfo
(
locinfo
);
return
NULL
;
}
}
}
if
(
locale_name
[
MSVCRT_LC_TIME
]
&&
if
(
locale_name
[
MSVCRT_LC_TIME
]
&&
...
@@ -1767,7 +1780,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
...
@@ -1767,7 +1780,10 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
return
NULL
;
return
NULL
;
}
}
}
else
{
}
else
{
locinfo
->
lc_category
[
MSVCRT_LC_TIME
].
locale
=
MSVCRT__strdup
(
"C"
);
if
(
!
init_category_name
(
"C"
,
1
,
locinfo
,
MSVCRT_LC_TIME
))
{
free_locinfo
(
locinfo
);
return
NULL
;
}
locinfo
->
lc_time_curr
=
&
cloc_time_data
;
locinfo
->
lc_time_curr
=
&
cloc_time_data
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment