mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Fixed compiler warnings
svn path=/trunk/; revision=1114
This commit is contained in:
@@ -18,6 +18,6 @@ int _ismbclower( unsigned int c )
|
||||
if ( c >= 0x829A && c<= 0x829A )
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return isupper(c);
|
||||
|
||||
return islower(c);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <crtdll/mbctype.h>
|
||||
#include <crtdll/ctype.h>
|
||||
|
||||
int _ismbbkalnum( unsigned int c );
|
||||
|
||||
int _ismbbalpha(unsigned char c)
|
||||
{
|
||||
return (isalpha(c) ||_ismbbkalnum(c));
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include <crtdll/mbctype.h>
|
||||
#include <crtdll/ctype.h>
|
||||
|
||||
int _ismbbkalnum( unsigned int c );
|
||||
|
||||
int _ismbbalnum(unsigned char c)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
int _ismbbalpha(unsigned char c);
|
||||
int _ismbbalnum(unsigned char c);
|
||||
|
||||
int _ismbcalnum( unsigned int c )
|
||||
{
|
||||
if ((c & 0xFF00) != 0) {
|
||||
@@ -11,7 +14,7 @@ int _ismbcalnum( unsigned int c )
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int _ismbcalpha( unsigned int c )
|
||||
{
|
||||
if ((c & 0xFF00) != 0) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* 12/04/99: Created
|
||||
*/
|
||||
#include <crtdll/mbctype.h>
|
||||
#include <crtdll/ctype.h>
|
||||
|
||||
int _ismbbkalnum( unsigned int c )
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <crtdll/stdlib.h>
|
||||
#include <crtdll/mbctype.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
char _jctype[257] = {
|
||||
/*-1*/ ___,
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
#include <crtdll/mbctype.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
// iskanji2() : (0x40 <= c <= 0x7E 0x80 <= c <= 0xFC)
|
||||
|
||||
int _ismbbtrail(unsigned int c)
|
||||
|
||||
@@ -18,6 +18,6 @@ int _ismbcupper( unsigned int c )
|
||||
if ( c >= 0x8260 && c<= 0x8279 )
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return isupper(c);
|
||||
|
||||
return isupper(c);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
#include <crtdll/string.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
void _mbccpy(unsigned char *dst, const unsigned char *src)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <crtdll/string.h>
|
||||
|
||||
unsigned char * _mbscat(unsigned char *dst, const unsigned char *src)
|
||||
{
|
||||
return strcat(dst,src);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <crtdll/string.h>
|
||||
|
||||
unsigned char * _mbschr(const unsigned char *str, unsigned int c)
|
||||
{
|
||||
return strchr(str,c);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
#include <crtdll/string.h>
|
||||
|
||||
int _mbscmp(const unsigned char *str1, const unsigned char *str2)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
#include <crtdll/string.h>
|
||||
|
||||
unsigned char * _mbscpy(unsigned char *dst, const unsigned char *str)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
size_t _mbslen(const unsigned char *str)
|
||||
{
|
||||
int i = 0;
|
||||
@@ -8,6 +10,6 @@ size_t _mbslen(const unsigned char *str)
|
||||
if (str == 0)
|
||||
return 0;
|
||||
|
||||
for (s = (unsigned char *)str; *s; s+=_mbclen2(*s),i++);
|
||||
for (s = (unsigned char *)str; *s; s+=_mbclen2(*s),i++);
|
||||
return i;
|
||||
}
|
||||
@@ -9,13 +9,15 @@
|
||||
*/
|
||||
|
||||
#include <crtdll/mbstring.h>
|
||||
#include <crtdll/string.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
|
||||
{
|
||||
char *d = (char *)dst;
|
||||
char *s = (char *)src;
|
||||
if (n != 0) {
|
||||
char *d = (char *)dst;
|
||||
char *s = (char *)src;
|
||||
if (n != 0) {
|
||||
d = dst + strlen(dst); // get the end of string
|
||||
d += _mbclen2(*d); // move 1 or 2 up
|
||||
|
||||
@@ -25,19 +27,19 @@ unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
|
||||
while (--n != 0)
|
||||
*d++ = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!_ismbblead(*s) )
|
||||
n--;
|
||||
} while (n > 0);
|
||||
}
|
||||
return dst;
|
||||
} while (n > 0);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n)
|
||||
{
|
||||
char *d;
|
||||
char *s = (char *)src;
|
||||
if (n != 0) {
|
||||
char *s = (char *)src;
|
||||
if (n != 0) {
|
||||
d = dst + strlen(dst); // get the end of string
|
||||
d += _mbclen2(*d); // move 1 or 2 up
|
||||
|
||||
@@ -47,10 +49,10 @@ unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n
|
||||
while (--n != 0)
|
||||
*d++ = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !(n==1 && _ismbblead(*s)) )
|
||||
n--;
|
||||
} while (n > 0);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
} while (n > 0);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
unsigned int _mbbtoupper(unsigned int c);
|
||||
|
||||
int _mbsnicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
|
||||
{
|
||||
if (n == 0)
|
||||
@@ -10,14 +13,14 @@ int _mbsnicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
|
||||
*s1 += _mbclen2(*s1);
|
||||
*s2 += _mbclen2(*s2);
|
||||
|
||||
|
||||
if (*s1 == 0)
|
||||
break;
|
||||
if (!_ismbblead(*s1) )
|
||||
n--;
|
||||
n--;
|
||||
} while (n > 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _mbsnbicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
|
||||
{
|
||||
if (n == 0)
|
||||
@@ -28,10 +31,9 @@ int _mbsnbicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
|
||||
s1 += _mbclen2(*s1);
|
||||
s2 += _mbclen2(*s2);
|
||||
|
||||
|
||||
if (*s1 == 0)
|
||||
break;
|
||||
n--;
|
||||
} while (n > 0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,58 +9,56 @@
|
||||
*/
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
unsigned char * _mbsnset(unsigned char *src, unsigned int val, size_t count)
|
||||
{
|
||||
|
||||
|
||||
unsigned char *char_src = (unsigned char *)src;
|
||||
unsigned short *short_src = (unsigned short *)src;
|
||||
|
||||
|
||||
if ( _mbclen2(val) == 1 ) {
|
||||
|
||||
while(count > 0) {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
while(count > 0) {
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
unsigned char * _mbsnbset(unsigned char *src, unsigned int val, size_t count)
|
||||
{
|
||||
|
||||
unsigned char *char_src = (unsigned char *)src;
|
||||
unsigned short *short_src = (unsigned short *)src;
|
||||
|
||||
|
||||
if ( _mbclen2(val) == 1 ) {
|
||||
|
||||
while(count > 0) {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
while(count > 0) {
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -10,21 +10,21 @@
|
||||
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
unsigned char * _mbsrchr(const unsigned char *src, unsigned int val)
|
||||
{
|
||||
char *s = (char *)src;
|
||||
short cc = val;
|
||||
const char *sp=(char *)0;
|
||||
|
||||
char *s = src;
|
||||
short cc = val;
|
||||
const char *sp=(char *)0;
|
||||
|
||||
|
||||
while (*s)
|
||||
{
|
||||
if (*(short *)s == cc)
|
||||
sp = s;
|
||||
s+= _mbclen2(*s);
|
||||
}
|
||||
if (cc == 0)
|
||||
sp = s;
|
||||
return (char *)sp;
|
||||
}
|
||||
while (*s)
|
||||
{
|
||||
if (*(short *)s == cc)
|
||||
sp = s;
|
||||
s+= _mbclen2(*s);
|
||||
}
|
||||
if (cc == 0)
|
||||
sp = s;
|
||||
return (char *)sp;
|
||||
}
|
||||
|
||||
@@ -10,26 +10,28 @@
|
||||
|
||||
#include <crtdll/mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
unsigned char * _mbsset(unsigned char *src, unsigned int c)
|
||||
{
|
||||
unsigned char *char_src = src;
|
||||
unsigned short *short_src = src;
|
||||
|
||||
unsigned short *short_src = (unsigned short *)src;
|
||||
|
||||
if ( _mbclen2(c) == 1 ) {
|
||||
|
||||
while(*char_src != 0) {
|
||||
*char_src = c;
|
||||
char_src++;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
*char_src = c;
|
||||
char_src++;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
while(*short_src != 0) {
|
||||
*short_src = c;
|
||||
short_src++;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
*short_src = c;
|
||||
short_src++;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
@@ -10,5 +10,5 @@ unsigned char * _mbsspnp(const unsigned char *s1, const unsigned char *s2)
|
||||
for (spanp = s2; (sc = *spanp++) != 0;)
|
||||
if (sc == c)
|
||||
goto cont;
|
||||
return p;
|
||||
return (unsigned char *)p;
|
||||
}
|
||||
@@ -4,17 +4,17 @@
|
||||
unsigned char *_mbsstr(const unsigned char *src1,const unsigned char *src2)
|
||||
{
|
||||
int len;
|
||||
|
||||
|
||||
if(src2 ==NULL || *src2 == 0)
|
||||
return src1;
|
||||
|
||||
return (unsigned char *)src1;
|
||||
|
||||
len = _mbstrlen(src2);
|
||||
|
||||
while(*src1)
|
||||
{
|
||||
|
||||
while(*src1)
|
||||
{
|
||||
if((*src1 == *src2) && (_mbsncmp(src1,src2,len) == 0))
|
||||
return(src1);
|
||||
src1 = (unsigned char *)_mbsinc(src1);
|
||||
}
|
||||
return (unsigned char *)src1;
|
||||
src1 = (unsigned char *)_mbsinc(src1);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
size_t _mbstrlen( const char *string )
|
||||
{
|
||||
char *s = (char *)string;
|
||||
size_t i;
|
||||
size_t i = 0;
|
||||
|
||||
while ( *s != 0 ) {
|
||||
if ( _ismbblead(*s) )
|
||||
s++;
|
||||
|
||||
Reference in New Issue
Block a user