type fix: replaced int type with proper wchar_t type for several functions (tsk, tsk, tsk)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1647 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -33,43 +33,46 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stub multibyte character functions.
|
* Stub multibyte character functions.
|
||||||
* This cheezy implementation is fixed to the native single-byte
|
* This cheezy implementation is fixed to the native single-byte
|
||||||
* character set.
|
* character set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
mblen(s, n)
|
mblen(const char *s, size_t n)
|
||||||
const char *s;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
if (s == NULL || *s == '\0')
|
if (s == NULL || *s == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
mbtowc(pwc, s, n)
|
mbtowc(wchar_t *pwc, const char *s, size_t n)
|
||||||
int *pwc;
|
|
||||||
const char *s;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (pwc)
|
if (pwc)
|
||||||
*pwc = (int) *s;
|
*pwc = (wchar_t) *s;
|
||||||
|
|
||||||
return (*s != '\0');
|
return (*s != '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
wctomb(char *s, int wchar)
|
wctomb(char *s, wchar_t wchar)
|
||||||
{
|
{
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -78,18 +81,15 @@ wctomb(char *s, int wchar)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
size_t
|
size_t
|
||||||
mbstowcs(pwcs, s, n)
|
mbstowcs(wchar_t *pwcs, const char *s, size_t n)
|
||||||
int *pwcs;
|
|
||||||
const char *s;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (n != 0) {
|
if (n != 0) {
|
||||||
do {
|
do {
|
||||||
if ((*pwcs++ = (int) *s++) == 0)
|
if ((*pwcs++ = (wchar_t) *s++) == 0)
|
||||||
break;
|
break;
|
||||||
count++;
|
count++;
|
||||||
} while (--n != 0);
|
} while (--n != 0);
|
||||||
@@ -98,12 +98,9 @@ mbstowcs(pwcs, s, n)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
size_t
|
size_t
|
||||||
wcstombs(s, pwcs, n)
|
wcstombs(char *s, const wchar_t *pwcs, size_t n)
|
||||||
char *s;
|
|
||||||
const int *pwcs;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user