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
68587234
Commit
68587234
authored
Apr 01, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Avoid using tolowerW/toupperW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30ad67dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
comm.c
dlls/kernel32/comm.c
+9
-2
editline.c
dlls/kernel32/editline.c
+5
-11
No files found.
dlls/kernel32/comm.c
View file @
68587234
...
@@ -95,20 +95,25 @@ static LPCWSTR COMM_ParseParity(LPCWSTR ptr, LPBYTE lpparity)
...
@@ -95,20 +95,25 @@ static LPCWSTR COMM_ParseParity(LPCWSTR ptr, LPBYTE lpparity)
member of DCB and not fParity even when parity is specified in the
member of DCB and not fParity even when parity is specified in the
device control string */
device control string */
switch
(
toupperW
(
*
ptr
++
)
)
switch
(
*
ptr
++
)
{
{
case
'e'
:
case
'E'
:
case
'E'
:
*
lpparity
=
EVENPARITY
;
*
lpparity
=
EVENPARITY
;
break
;
break
;
case
'm'
:
case
'M'
:
case
'M'
:
*
lpparity
=
MARKPARITY
;
*
lpparity
=
MARKPARITY
;
break
;
break
;
case
'n'
:
case
'N'
:
case
'N'
:
*
lpparity
=
NOPARITY
;
*
lpparity
=
NOPARITY
;
break
;
break
;
case
'o'
:
case
'O'
:
case
'O'
:
*
lpparity
=
ODDPARITY
;
*
lpparity
=
ODDPARITY
;
break
;
break
;
case
's'
:
case
'S'
:
case
'S'
:
*
lpparity
=
SPACEPARITY
;
*
lpparity
=
SPACEPARITY
;
break
;
break
;
...
@@ -239,7 +244,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
...
@@ -239,7 +244,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
{
{
device
++
;
device
++
;
while
(
*
device
==
' '
)
device
++
;
while
(
*
device
==
' '
)
device
++
;
if
(
*
device
)
last
=
toupperW
(
*
device
++
)
;
if
(
*
device
)
last
=
*
device
++
;
while
(
*
device
==
' '
)
device
++
;
while
(
*
device
==
' '
)
device
++
;
}
}
...
@@ -255,6 +260,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
...
@@ -255,6 +260,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
lpdcb
->
fDtrControl
=
DTR_CONTROL_ENABLE
;
lpdcb
->
fDtrControl
=
DTR_CONTROL_ENABLE
;
lpdcb
->
fRtsControl
=
RTS_CONTROL_ENABLE
;
lpdcb
->
fRtsControl
=
RTS_CONTROL_ENABLE
;
break
;
break
;
case
'x'
:
case
'X'
:
case
'X'
:
lpdcb
->
fInX
=
TRUE
;
lpdcb
->
fInX
=
TRUE
;
lpdcb
->
fOutX
=
TRUE
;
lpdcb
->
fOutX
=
TRUE
;
...
@@ -263,6 +269,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
...
@@ -263,6 +269,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
lpdcb
->
fDtrControl
=
DTR_CONTROL_ENABLE
;
lpdcb
->
fDtrControl
=
DTR_CONTROL_ENABLE
;
lpdcb
->
fRtsControl
=
RTS_CONTROL_ENABLE
;
lpdcb
->
fRtsControl
=
RTS_CONTROL_ENABLE
;
break
;
break
;
case
'p'
:
case
'P'
:
case
'P'
:
lpdcb
->
fInX
=
FALSE
;
lpdcb
->
fInX
=
FALSE
;
lpdcb
->
fOutX
=
FALSE
;
lpdcb
->
fOutX
=
FALSE
;
...
...
dlls/kernel32/editline.c
View file @
68587234
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "wincon.h"
#include "wincon.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "winnls.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -598,9 +599,7 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx)
...
@@ -598,9 +599,7 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx)
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
if
(
new_ofs
!=
ctx
->
ofs
)
if
(
new_ofs
!=
ctx
->
ofs
)
{
{
unsigned
int
i
;
CharLowerBuffW
(
ctx
->
line
+
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
for
(
i
=
ctx
->
ofs
;
i
<=
new_ofs
;
i
++
)
ctx
->
line
[
i
]
=
tolowerW
(
ctx
->
line
[
i
]);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
ctx
->
ofs
=
new_ofs
;
ctx
->
ofs
=
new_ofs
;
}
}
...
@@ -611,9 +610,7 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx)
...
@@ -611,9 +610,7 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx)
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
if
(
new_ofs
!=
ctx
->
ofs
)
if
(
new_ofs
!=
ctx
->
ofs
)
{
{
unsigned
int
i
;
CharUpperBuffW
(
ctx
->
line
+
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
for
(
i
=
ctx
->
ofs
;
i
<=
new_ofs
;
i
++
)
ctx
->
line
[
i
]
=
toupperW
(
ctx
->
line
[
i
]);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
ctx
->
ofs
=
new_ofs
;
ctx
->
ofs
=
new_ofs
;
}
}
...
@@ -624,11 +621,8 @@ static void WCEL_CapitalizeWord(WCEL_Context* ctx)
...
@@ -624,11 +621,8 @@ static void WCEL_CapitalizeWord(WCEL_Context* ctx)
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
unsigned
int
new_ofs
=
WCEL_GetRightWordTransition
(
ctx
,
ctx
->
ofs
);
if
(
new_ofs
!=
ctx
->
ofs
)
if
(
new_ofs
!=
ctx
->
ofs
)
{
{
unsigned
int
i
;
CharUpperBuffW
(
ctx
->
line
+
ctx
->
ofs
,
1
);
CharLowerBuffW
(
ctx
->
line
+
ctx
->
ofs
+
1
,
new_ofs
-
ctx
->
ofs
);
ctx
->
line
[
ctx
->
ofs
]
=
toupperW
(
ctx
->
line
[
ctx
->
ofs
]);
for
(
i
=
ctx
->
ofs
+
1
;
i
<=
new_ofs
;
i
++
)
ctx
->
line
[
i
]
=
tolowerW
(
ctx
->
line
[
i
]);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
WCEL_Update
(
ctx
,
ctx
->
ofs
,
new_ofs
-
ctx
->
ofs
+
1
);
ctx
->
ofs
=
new_ofs
;
ctx
->
ofs
=
new_ofs
;
}
}
...
...
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