Commit cfad9c3d authored by Alexandre Julliard's avatar Alexandre Julliard

msvcp90: Add an msvcp-specific size_t to avoid casts in traces.

parent d74b339e
......@@ -85,12 +85,12 @@ MSVCP_bool ios_base_Sync = FALSE;
typedef struct _ios_base {
const vtable_ptr *vtable;
size_t stdstr;
MSVCP_size_t stdstr;
IOSB_iostate state;
IOSB_iostate except;
IOSB_fmtflags fmtfl;
size_t prec;
size_t wide;
MSVCP_size_t prec;
MSVCP_size_t wide;
IOS_BASE_iosarray *arr;
IOS_BASE_fnarray *calls;
locale *loc;
......@@ -484,16 +484,16 @@ MSVCP_long* __thiscall ios_base_iword(ios_base *this, int index)
/* ?precision@ios_base@std@@QAEHH@Z */
/* ?precision@ios_base@std@@QEAA_J_J@Z */
DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
size_t __thiscall ios_base_precision_set(ios_base *this, size_t precision)
MSVCP_size_t __thiscall ios_base_precision_set(ios_base *this, MSVCP_size_t precision)
{
FIXME("(%p %lu) stub\n", this, (unsigned long)precision);
FIXME("(%p %lu) stub\n", this, precision);
return 0;
}
/* ?precision@ios_base@std@@QBEHXZ */
/* ?precision@ios_base@std@@QEBA_JXZ */
DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
size_t __thiscall ios_base_precision_get(const ios_base *this)
MSVCP_size_t __thiscall ios_base_precision_get(const ios_base *this)
{
FIXME("(%p) stub\n", this);
return 0;
......@@ -584,16 +584,16 @@ void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
/* ?width@ios_base@std@@QAEHH@Z */
/* ?width@ios_base@std@@QEAA_J_J@Z */
DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
size_t __thiscall ios_base_width_set(ios_base *this, size_t width)
MSVCP_size_t __thiscall ios_base_width_set(ios_base *this, MSVCP_size_t width)
{
FIXME("(%p %lu) stub\n", this, (unsigned long)width);
FIXME("(%p %lu) stub\n", this, width);
return 0;
}
/* ?width@ios_base@std@@QBEHXZ */
/* ?width@ios_base@std@@QEBA_JXZ */
DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
size_t __thiscall ios_base_width_get(ios_base *this)
MSVCP_size_t __thiscall ios_base_width_get(ios_base *this)
{
FIXME("(%p) stub\n", this);
return 0;
......
......@@ -70,7 +70,7 @@ void* __thiscall MSVCP_allocator_char_assign(void *this, void *assign)
/* ?deallocate@?$allocator@D@std@@QAEXPADI@Z */
/* ?deallocate@?$allocator@D@std@@QEAAXPEAD_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12);
void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t size)
void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
......@@ -78,7 +78,7 @@ void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t si
/* ?allocate@?$allocator@D@std@@QAEPADI@Z */
/* ?allocate@?$allocator@D@std@@QEAAPEAD_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8);
char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count)
char* __thiscall MSVCP_allocator_char_allocate(void *this, MSVCP_size_t count)
{
return MSVCRT_operator_new(sizeof(char[count]));
}
......@@ -87,7 +87,7 @@ char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count)
/* ?allocate@?$allocator@D@std@@QEAAPEAD_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate_hint, 12);
char* __thiscall MSVCP_allocator_char_allocate_hint(void *this,
size_t count, const void *hint)
MSVCP_size_t count, const void *hint)
{
/* Native ignores hint */
return MSVCP_allocator_char_allocate(this, count);
......@@ -111,7 +111,7 @@ void __thiscall MSVCP_allocator_char_destroy(void *this, char *ptr)
/* ?max_size@?$allocator@D@std@@QBEIXZ */
/* ?max_size@?$allocator@D@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_max_size, 4);
size_t __thiscall MSVCP_allocator_char_max_size(void *this)
MSVCP_size_t __thiscall MSVCP_allocator_char_max_size(void *this)
{
return UINT_MAX/sizeof(char);
}
......@@ -162,7 +162,7 @@ void* __thiscall MSVCP_allocator_wchar_assign(void *this, void *assign)
/* ?deallocate@?$allocator@_W@std@@QEAAXPEA_W_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12)
void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
wchar_t *ptr, size_t size)
wchar_t *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
......@@ -170,7 +170,7 @@ void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
/* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */
/* ?allocate@?$allocator@_W@std@@QEAAPEA_W_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate, 8)
wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count)
wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, MSVCP_size_t count)
{
if(UINT_MAX/count < sizeof(wchar_t)) {
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
......@@ -184,7 +184,7 @@ wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count)
/* ?allocate@?$allocator@_W@std@@QEAAPEA_W_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate_hint, 12)
wchar_t* __thiscall MSVCP_allocator_wchar_allocate_hint(void *this,
size_t count, const void *hint)
MSVCP_size_t count, const void *hint)
{
return MSVCP_allocator_wchar_allocate(this, count);
}
......@@ -208,7 +208,7 @@ void __thiscall MSVCP_allocator_wchar_destroy(void *this, char *ptr)
/* ?max_size@?$allocator@_W@std@@QBEIXZ */
/* ?max_size@?$allocator@_W@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_max_size, 4)
size_t __thiscall MSVCP_allocator_wchar_max_size(void *this)
MSVCP_size_t __thiscall MSVCP_allocator_wchar_max_size(void *this)
{
return UINT_MAX/sizeof(wchar_t);
}
......@@ -260,7 +260,7 @@ void* __thiscall MSVCP_allocator_short_assign(void *this, void *assign)
/* ?deallocate@?$allocator@G@std@@QEAAXPEAG_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12)
void __thiscall MSVCP_allocator_short_deallocate(void *this,
unsigned short *ptr, size_t size)
unsigned short *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
......@@ -269,7 +269,7 @@ void __thiscall MSVCP_allocator_short_deallocate(void *this,
/* ?allocate@?$allocator@G@std@@QEAAPEAG_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate, 8)
unsigned short* __thiscall MSVCP_allocator_short_allocate(
void *this, size_t count)
void *this, MSVCP_size_t count)
{
if(UINT_MAX/count < sizeof(unsigned short)) {
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
......@@ -283,7 +283,7 @@ unsigned short* __thiscall MSVCP_allocator_short_allocate(
/* ?allocate@?$allocator@G@std@@QEAAPEAG_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate_hint, 12)
unsigned short* __thiscall MSVCP_allocator_short_allocate_hint(
void *this, size_t count, const void *hint)
void *this, MSVCP_size_t count, const void *hint)
{
return MSVCP_allocator_short_allocate(this, count);
}
......@@ -300,14 +300,14 @@ void __thiscall MSVCP_allocator_short_construct(void *this,
/* ?destroy@?$allocator@G@std@@QAEXPAG@Z */
/* ?destroy@?$allocator@G@std@@QEAAXPEAG@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_destroy, 8)
void __thiscall MSVCP_allocator_short_destroy(void *this, size_t *ptr)
void __thiscall MSVCP_allocator_short_destroy(void *this, MSVCP_size_t *ptr)
{
}
/* ?max_size@?$allocator@G@std@@QBEIXZ */
/* ?max_size@?$allocator@G@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_max_size, 4)
size_t __thiscall MSVCP_allocator_short_max_size(void *this)
MSVCP_size_t __thiscall MSVCP_allocator_short_max_size(void *this)
{
return UINT_MAX/sizeof(unsigned short);
}
......
......@@ -21,11 +21,12 @@
typedef unsigned char MSVCP_bool;
typedef int MSVCP_long;
typedef SIZE_T MSVCP_size_t;
void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
const wchar_t*, unsigned int, uintptr_t);
extern void* (__cdecl *MSVCRT_operator_new)(size_t);
extern void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*);
/* Copied from dlls/msvcrt/cpp.c */
......@@ -150,8 +151,8 @@ typedef struct _basic_string_char
char buf[BUF_SIZE_CHAR];
char *ptr;
} data;
size_t size;
size_t res;
MSVCP_size_t size;
MSVCP_size_t res;
} basic_string_char;
basic_string_char* __stdcall MSVCP_basic_string_char_ctor_cstr(basic_string_char*, const char*);
......@@ -167,14 +168,14 @@ typedef struct _basic_string_wchar
wchar_t buf[BUF_SIZE_WCHAR];
wchar_t *ptr;
} data;
size_t size;
size_t res;
MSVCP_size_t size;
MSVCP_size_t res;
} basic_string_wchar;
char* __stdcall MSVCP_allocator_char_allocate(void*, size_t);
void __stdcall MSVCP_allocator_char_deallocate(void*, char*, size_t);
wchar_t* __stdcall MSVCP_allocator_wchar_allocate(void*, size_t);
void __stdcall MSVCP_allocator_wchar_deallocate(void*, wchar_t*, size_t);
char* __stdcall MSVCP_allocator_char_allocate(void*, MSVCP_size_t);
void __stdcall MSVCP_allocator_char_deallocate(void*, char*, MSVCP_size_t);
wchar_t* __stdcall MSVCP_allocator_wchar_allocate(void*, MSVCP_size_t);
void __stdcall MSVCP_allocator_wchar_deallocate(void*, wchar_t*, MSVCP_size_t);
/* class locale */
typedef struct
......
......@@ -28,7 +28,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
void* (__cdecl *MSVCRT_operator_new)(size_t);
void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
void (__cdecl *MSVCRT_operator_delete)(void*);
static void init_cxx_funcs(void)
{
......
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