Skip to content

Commit

Permalink
Replaced unsigned int with size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneUJi committed Sep 2, 2009
1 parent 39f3b99 commit 6c3cae0
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 94 deletions.
148 changes: 74 additions & 74 deletions crtmfcpatch.h
Expand Up @@ -57,38 +57,38 @@ class CrtMfcPatch
static void* __cdecl crtd__calloc_dbg (size_t num, size_t size, int type, char const *file, int line);
static void* __cdecl crtd__malloc_dbg (size_t size, int type, const char *file, int line);
static void* __cdecl crtd__realloc_dbg (void *mem, size_t size, int type, char const *file, int line);
static void* __cdecl crtd__scalar_new_dbg (unsigned int size, int type, char const *file, int line);
static void* __cdecl crtd__vector_new_dbg (unsigned int size, int type, char const *file, int line);
static void* __cdecl crtd__scalar_new_dbg (size_t size, int type, char const *file, int line);
static void* __cdecl crtd__vector_new_dbg (size_t size, int type, char const *file, int line);
static void* __cdecl crtd_calloc (size_t num, size_t size);
static void* __cdecl crtd_malloc (size_t size);
static void* __cdecl crtd_realloc (void *mem, size_t size);
static void* __cdecl crtd_scalar_new (unsigned int size);
static void* __cdecl crtd_vector_new (unsigned int size);
static void* __cdecl crtd_scalar_new (size_t size);
static void* __cdecl crtd_vector_new (size_t size);

template<char const *procname>
static void* __cdecl crtd_new_dbg (SIZE_T fp, unsigned int size, int type, char const *file, int line);
static void* __cdecl crtd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line);
template<char const *procname>
static void* __cdecl crtd_new (SIZE_T fp, unsigned int size);

static void* __cdecl mfcd_vector_new (unsigned int size);
static void* __cdecl mfcd__vector_new_dbg_4p (unsigned int size, int type, char const *file, int line);
static void* __cdecl mfcd__vector_new_dbg_3p (unsigned int size, char const *file, int line);
static void* __cdecl mfcd_scalar_new (unsigned int size);
static void* __cdecl mfcd__scalar_new_dbg_4p (unsigned int size, int type, char const *file, int line);
static void* __cdecl mfcd__scalar_new_dbg_3p (unsigned int size, char const *file, int line);
static void* __cdecl mfcud_vector_new (unsigned int size);
static void* __cdecl mfcud__vector_new_dbg_4p (unsigned int size, int type, char const *file, int line);
static void* __cdecl mfcud__vector_new_dbg_3p (unsigned int size, char const *file, int line);
static void* __cdecl mfcud_scalar_new (unsigned int size);
static void* __cdecl mfcud__scalar_new_dbg_4p (unsigned int size, int type, char const *file, int line);
static void* __cdecl mfcud__scalar_new_dbg_3p (unsigned int size, char const *file, int line);
static void* __cdecl crtd_new (SIZE_T fp, size_t size);

static void* __cdecl mfcd_vector_new (size_t size);
static void* __cdecl mfcd__vector_new_dbg_4p (size_t size, int type, char const *file, int line);
static void* __cdecl mfcd__vector_new_dbg_3p (size_t size, char const *file, int line);
static void* __cdecl mfcd_scalar_new (size_t size);
static void* __cdecl mfcd__scalar_new_dbg_4p (size_t size, int type, char const *file, int line);
static void* __cdecl mfcd__scalar_new_dbg_3p (size_t size, char const *file, int line);
static void* __cdecl mfcud_vector_new (size_t size);
static void* __cdecl mfcud__vector_new_dbg_4p (size_t size, int type, char const *file, int line);
static void* __cdecl mfcud__vector_new_dbg_3p (size_t size, char const *file, int line);
static void* __cdecl mfcud_scalar_new (size_t size);
static void* __cdecl mfcud__scalar_new_dbg_4p (size_t size, int type, char const *file, int line);
static void* __cdecl mfcud__scalar_new_dbg_3p (size_t size, char const *file, int line);

template<wchar_t const *mfcdll, int ordinal>
static void* __cdecl mfcd_new_dbg (SIZE_T fp, unsigned int size, int type, char const *file, int line);
static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line);
template<wchar_t const *mfcdll, int ordinal>
static void* __cdecl mfcd_new_dbg (SIZE_T fp, unsigned int size, char const *file, int line);
static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, char const *file, int line);
template<wchar_t const *mfcdll, int ordinal>
static void* __cdecl mfcd_new (SIZE_T fp, unsigned int size);
static void* __cdecl mfcd_new (SIZE_T fp, size_t size);
};


Expand Down Expand Up @@ -238,10 +238,10 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__realloc_dbg (void *mem,
// Returns the value returned by the CRT debug scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__scalar_new_dbg (unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__scalar_new_dbg (size_t size,
int type,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -266,10 +266,10 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__scalar_new_dbg (unsigned int size,
// Returns the value returned by the CRT debug vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__vector_new_dbg (unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd__vector_new_dbg (size_t size,
int type,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand Down Expand Up @@ -381,7 +381,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_realloc (void *mem, size_t size)
// Returns the value returned by the CRT scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_scalar_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_scalar_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -399,7 +399,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_scalar_new (unsigned int size)
// Returns the value returned by the CRT vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_vector_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_vector_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand Down Expand Up @@ -429,11 +429,11 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_vector_new (unsigned int size)
//
TEMPLATE_HEADER
template<char const *procname>
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new_dbg (SIZE_T fp,
unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new_dbg (SIZE_T fp,
size_t size,
int type,
char const *file,
int line)
{
static new_dbg_crt_t pcrtxxd_new_dbg = NULL;

Expand Down Expand Up @@ -464,7 +464,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new_dbg (SIZE_T fp,
//
TEMPLATE_HEADER
template<char const *procname>
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new (SIZE_T fp, unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new (SIZE_T fp, size_t size)
{
static new_t pcrtxxd_scalar_new = NULL;

Expand Down Expand Up @@ -503,7 +503,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::crtd_new (SIZE_T fp, unsigned int size)
// Returns the value returned by the MFC debug scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_4p (unsigned int size,
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_4p (size_t size,
int type,
char const *file,
int line)
Expand All @@ -530,7 +530,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_4p (unsigned int size,
// Returns the value returned by the MFC debug scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_3p (unsigned int size,
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_3p (size_t size,
char const *file,
int line)
{
Expand Down Expand Up @@ -558,7 +558,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__scalar_new_dbg_3p (unsigned int size,
// Returns the value returned by the MFC debug vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_4p (unsigned int size,
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_4p (size_t size,
int type,
char const *file,
int line)
Expand All @@ -585,7 +585,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_4p (unsigned int size,
// Returns the value returned by the MFC debug vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_3p (unsigned int size,
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_3p (size_t size,
char const *file,
int line)
{
Expand All @@ -606,7 +606,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd__vector_new_dbg_3p (unsigned int size,
// Returns the value returned by the MFC scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_scalar_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_scalar_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -624,7 +624,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_scalar_new (unsigned int size)
// Returns the value returned by the MFC vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_vector_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_vector_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -649,10 +649,10 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_vector_new (unsigned int size)
// Returns the value returned by the MFC debug scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_4p (unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_4p (size_t size,
int type,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -676,9 +676,9 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_4p (unsigned int size,
// Returns the value returned by the MFC debug scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_3p (unsigned int size,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_3p (size_t size,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -704,10 +704,10 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__scalar_new_dbg_3p (unsigned int size,
// Returns the value returned by the MFC debug vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_4p (unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_4p (size_t size,
int type,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -731,9 +731,9 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_4p (unsigned int size,
// Returns the value returned by the MFC debug vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_3p (unsigned int size,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_3p (size_t size,
char const *file,
int line)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -752,7 +752,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud__vector_new_dbg_3p (unsigned int size,
// Returns the value returned by the MFC scalar new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_scalar_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_scalar_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -770,7 +770,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_scalar_new (unsigned int size)
// Returns the value returned by the MFC vector new operator.
//
TEMPLATE_HEADER
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_vector_new (unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_vector_new (size_t size)
{
SIZE_T fp;
FRAMEPOINTER(fp);
Expand All @@ -780,8 +780,8 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_vector_new (unsigned int size)

// mfcd_new_dbg - A generic function for implementing patch functions to the MFC
// debug new operators:
// void* __cdecl operator new[](unsigned int size, int type, char const *file, int line)
// void* __cdecl operator new(unsigned int size, int type, char const *file, int line)
// void* __cdecl operator new[](size_t size, int type, char const *file, int line)
// void* __cdecl operator new(size_t size, int type, char const *file, int line)
//
// - mfcdll (IN): The name of the MFC DLL
//
Expand All @@ -802,11 +802,11 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcud_vector_new (unsigned int size)
//
TEMPLATE_HEADER
template<wchar_t const *mfcdll, int ordinal>
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
unsigned int size,
int type,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
size_t size,
int type,
char const *file,
int line)
{
static new_dbg_crt_t pmfcxxd__new_dbg = NULL;

Expand All @@ -824,8 +824,8 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,

// mfcd_new_dbg - A generic function for implementing patch functions to the MFC
// debug new operators:
// void* __cdecl operator new[](unsigned int size, char const *file, int line)
// void* __cdecl operator new(unsigned int size, char const *file, int line)
// void* __cdecl operator new[](size_t size, char const *file, int line)
// void* __cdecl operator new(size_t size, char const *file, int line)
//
// - mfcdll (IN): The name of the MFC DLL
//
Expand All @@ -844,10 +844,10 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
//
TEMPLATE_HEADER
template<wchar_t const *mfcdll, int ordinal>
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
unsigned int size,
char const *file,
int line)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
size_t size,
char const *file,
int line)
{
static new_dbg_mfc_t pmfcxxd__new_dbg = NULL;

Expand Down Expand Up @@ -878,7 +878,7 @@ void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new_dbg (SIZE_T fp,
//
TEMPLATE_HEADER
template<wchar_t const *mfcdll, int ordinal>
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new (SIZE_T fp, unsigned int size)
void* CrtMfcPatch<TEMPLATE_ARGS>::mfcd_new (SIZE_T fp, size_t size)
{
static new_t pmfcxxd_new = NULL;

Expand Down
10 changes: 4 additions & 6 deletions vld.cpp
Expand Up @@ -1647,9 +1647,7 @@ void *VisualLeakDetector::_malloc (malloc_t pmalloc, SIZE_T fp, size_t size)
//
// Returns the value returned by the specified CRT new operator.
//
void* VisualLeakDetector::_new (new_t pnew,
SIZE_T fp,
unsigned int size)
void* VisualLeakDetector::_new (new_t pnew, SIZE_T fp, size_t size)
{
void *block;
tls_t *tls = vld.gettls();
Expand Down Expand Up @@ -1853,7 +1851,7 @@ void* VisualLeakDetector::__malloc_dbg (_malloc_dbg_t p_malloc_dbg,
//
void* VisualLeakDetector::new_dbg_crt (new_dbg_crt_t pnew_dbg_crt,
SIZE_T fp,
unsigned int size,
size_t size,
int type,
char const *file,
int line)
Expand Down Expand Up @@ -1904,7 +1902,7 @@ void* VisualLeakDetector::new_dbg_crt (new_dbg_crt_t pnew_dbg_crt,
//
void* VisualLeakDetector::new_dbg_mfc (new_dbg_crt_t pnew_dbg,
SIZE_T fp,
unsigned int size,
size_t size,
int type,
char const *file,
int line)
Expand Down Expand Up @@ -1950,7 +1948,7 @@ void* VisualLeakDetector::new_dbg_mfc (new_dbg_crt_t pnew_dbg,
//
void* VisualLeakDetector::new_dbg_mfc (new_dbg_mfc_t pnew_dbg_mfc,
SIZE_T fp,
unsigned int size,
size_t size,
char const *file,
int line)
{
Expand Down

0 comments on commit 6c3cae0

Please sign in to comment.