kernel32: Avoid using tolowerW/toupperW().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Alexandre Julliard 2020-04-01 10:28:01 +02:00
parent 30ad67dc14
commit 68587234bf
2 changed files with 14 additions and 13 deletions

View File

@ -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
device control string */
switch(toupperW(*ptr++))
switch(*ptr++)
{
case 'e':
case 'E':
*lpparity = EVENPARITY;
break;
case 'm':
case 'M':
*lpparity = MARKPARITY;
break;
case 'n':
case 'N':
*lpparity = NOPARITY;
break;
case 'o':
case 'O':
*lpparity = ODDPARITY;
break;
case 's':
case 'S':
*lpparity = SPACEPARITY;
break;
@ -239,7 +244,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
{
device++;
while(*device == ' ') device++;
if(*device) last = toupperW(*device++);
if(*device) last = *device++;
while(*device == ' ') device++;
}
@ -255,6 +260,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
lpdcb->fDtrControl = DTR_CONTROL_ENABLE;
lpdcb->fRtsControl = RTS_CONTROL_ENABLE;
break;
case 'x':
case 'X':
lpdcb->fInX = TRUE;
lpdcb->fOutX = TRUE;
@ -263,6 +269,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb)
lpdcb->fDtrControl = DTR_CONTROL_ENABLE;
lpdcb->fRtsControl = RTS_CONTROL_ENABLE;
break;
case 'p':
case 'P':
lpdcb->fInX = FALSE;
lpdcb->fOutX = FALSE;

View File

@ -27,6 +27,7 @@
#include "windef.h"
#include "winbase.h"
#include "wincon.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "wine/debug.h"
@ -598,9 +599,7 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx)
unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs);
if (new_ofs != ctx->ofs)
{
unsigned int i;
for (i = ctx->ofs; i <= new_ofs; i++)
ctx->line[i] = tolowerW(ctx->line[i]);
CharLowerBuffW( ctx->line + ctx->ofs, new_ofs - ctx->ofs + 1 );
WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1);
ctx->ofs = new_ofs;
}
@ -611,9 +610,7 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx)
unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs);
if (new_ofs != ctx->ofs)
{
unsigned int i;
for (i = ctx->ofs; i <= new_ofs; i++)
ctx->line[i] = toupperW(ctx->line[i]);
CharUpperBuffW( ctx->line + ctx->ofs, new_ofs - ctx->ofs + 1 );
WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1);
ctx->ofs = new_ofs;
}
@ -624,11 +621,8 @@ static void WCEL_CapitalizeWord(WCEL_Context* ctx)
unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs);
if (new_ofs != ctx->ofs)
{
unsigned int i;
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]);
CharUpperBuffW( ctx->line + ctx->ofs, 1 );
CharLowerBuffW( ctx->line + ctx->ofs + 1, new_ofs - ctx->ofs );
WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1);
ctx->ofs = new_ofs;
}