Commit 68587234 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Avoid using tolowerW/toupperW().

parent 30ad67dc
...@@ -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;
......
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment