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:
Daniel Reinhold
2002-10-25 11:23:30 +00:00
parent 3b5b78dee6
commit afaca44046
+19 -22
View File
@@ -33,43 +33,46 @@
#include <stdlib.h>
/*
* Stub multibyte character functions.
* This cheezy implementation is fixed to the native single-byte
* character set.
*/
int
mblen(s, n)
const char *s;
size_t n;
mblen(const char *s, size_t n)
{
if (s == NULL || *s == '\0')
return 0;
if (n == 0)
return -1;
return 1;
}
/*ARGSUSED*/
int
mbtowc(pwc, s, n)
int *pwc;
const char *s;
size_t n;
mbtowc(wchar_t *pwc, const char *s, size_t n)
{
if (s == NULL)
return 0;
if (n == 0)
return -1;
if (pwc)
*pwc = (int) *s;
*pwc = (wchar_t) *s;
return (*s != '\0');
}
/*ARGSUSED*/
int
wctomb(char *s, int wchar)
wctomb(char *s, wchar_t wchar)
{
if (s == NULL)
return 0;
@@ -78,18 +81,15 @@ wctomb(char *s, int wchar)
return 1;
}
/*ARGSUSED*/
size_t
mbstowcs(pwcs, s, n)
int *pwcs;
const char *s;
size_t n;
mbstowcs(wchar_t *pwcs, const char *s, size_t n)
{
int count = 0;
if (n != 0) {
do {
if ((*pwcs++ = (int) *s++) == 0)
if ((*pwcs++ = (wchar_t) *s++) == 0)
break;
count++;
} while (--n != 0);
@@ -98,12 +98,9 @@ mbstowcs(pwcs, s, n)
return count;
}
/*ARGSUSED*/
size_t
wcstombs(s, pwcs, n)
char *s;
const int *pwcs;
size_t n;
wcstombs(char *s, const wchar_t *pwcs, size_t n)
{
int count = 0;