зеркало из https://github.com/mozilla/pjs.git
eliminates 107 nsCRT::memset calls to use memset instead. removed nsCRT::memset() function. bug 118135 r=dp sr=brendan
This commit is contained in:
Родитель
363ca922c1
Коммит
bf3e08eb5f
|
@ -45,7 +45,7 @@ void* nsCSSRule::operator new(size_t size)
|
|||
nsCSSRule* rv = (nsCSSRule*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -57,7 +57,7 @@ void* nsCSSRule::operator new(size_t size, nsIArena* aArena)
|
|||
nsCSSRule* rv = (nsCSSRule*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -1688,7 +1688,7 @@ void* CSSStyleSheetImpl::operator new(size_t size)
|
|||
CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -1700,7 +1700,7 @@ void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -920,7 +920,7 @@ void* HTMLAttributesImpl::operator new(size_t size)
|
|||
HTMLAttributesImpl* rv = (HTMLAttributesImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -932,7 +932,7 @@ void* HTMLAttributesImpl::operator new(size_t size, nsIArena* aArena)
|
|||
HTMLAttributesImpl* rv = (HTMLAttributesImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -291,7 +291,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size)
|
|||
HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -303,7 +303,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -666,7 +666,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size)
|
|||
HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -678,7 +678,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -238,7 +238,7 @@ void nsStyleCoord::ToString(nsString& aBuffer) const
|
|||
|
||||
nsStyleSides::nsStyleSides(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
#define COMPARE_SIDE(side) \
|
||||
|
@ -268,7 +268,7 @@ PRBool nsStyleSides::operator==(const nsStyleSides& aOther) const
|
|||
|
||||
void nsStyleSides::Reset(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
void nsStyleSides::AppendToString(nsString& aBuffer) const
|
||||
|
|
|
@ -4415,7 +4415,7 @@ AHTC_WriteFunc(nsIInputStream * in,
|
|||
if (!headersBuf) {
|
||||
return NS_BASE_STREAM_WOULD_BLOCK;
|
||||
}
|
||||
nsCRT::memset(headersBuf, nsnull, headersBufLen + 1);
|
||||
memset(headersBuf, nsnull, headersBufLen + 1);
|
||||
}
|
||||
else {
|
||||
// data has been read, reallocate
|
||||
|
|
|
@ -1439,7 +1439,7 @@ nsFontMetricsWin::GetFontCCMAP(HDC aDC, const char* aShortName, eFontType& aFont
|
|||
}
|
||||
|
||||
PRUint32 map[UCS2_MAP_LEN];
|
||||
nsCRT::memset(map, 0, sizeof(map));
|
||||
memset(map, 0, sizeof(map));
|
||||
PRUint8* p = buf + sizeof(PRUint16); // skip version, move to numberSubtables
|
||||
PRUint16 n = GET_SHORT(p); // get numberSubtables
|
||||
p += sizeof(PRUint16); // skip numberSubtables, move to the encoding subtables
|
||||
|
@ -1495,7 +1495,7 @@ nsFontMetricsWin::GetFontCCMAP(HDC aDC, const char* aShortName, eFontType& aFont
|
|||
if (eTTFormat12SegmentedCoverage == keepFormat) {
|
||||
PRUint32* extMap[EXTENDED_UNICODE_PLANES+1];
|
||||
extMap[0] = map;
|
||||
nsCRT::memset(extMap+1, 0, sizeof(PRUint32*)*EXTENDED_UNICODE_PLANES);
|
||||
memset(extMap+1, 0, sizeof(PRUint32*)*EXTENDED_UNICODE_PLANES);
|
||||
ReadCMAPTableFormat12(buf+keepOffset, len-keepOffset, extMap);
|
||||
ccmap = MapToCCMapExt(map, extMap+1, EXTENDED_UNICODE_PLANES);
|
||||
for (i = 1; i <= EXTENDED_UNICODE_PLANES; ++i) {
|
||||
|
@ -3885,7 +3885,7 @@ nsFontWinSubstitute::nsFontWinSubstitute(LOGFONT* aLogFont, HFONT aFont,
|
|||
PRUint16* aCCMap, PRBool aDisplayUnicode) : nsFontWin(aLogFont, aFont, aCCMap)
|
||||
{
|
||||
mDisplayUnicode = aDisplayUnicode;
|
||||
nsCRT::memset(mRepresentableCharMap, 0, sizeof(mRepresentableCharMap));
|
||||
memset(mRepresentableCharMap, 0, sizeof(mRepresentableCharMap));
|
||||
}
|
||||
|
||||
nsFontWinSubstitute::~nsFontWinSubstitute()
|
||||
|
@ -4102,7 +4102,7 @@ GenerateDefault(nsCharsetInfo* aSelf)
|
|||
{
|
||||
PRUint32 map[UCS2_MAP_LEN];
|
||||
|
||||
nsCRT::memset(map, 0xff, sizeof(map));
|
||||
memset(map, 0xff, sizeof(map));
|
||||
return MapToCCMap(map);
|
||||
}
|
||||
|
||||
|
@ -4114,7 +4114,7 @@ GenerateSingleByte(nsCharsetInfo* aSelf)
|
|||
PRUint16 wc[256];
|
||||
int i;
|
||||
|
||||
nsCRT::memset(map, 0, sizeof(map));
|
||||
memset(map, 0, sizeof(map));
|
||||
for (i = 0; i < 256; ++i) {
|
||||
mb[i] = i;
|
||||
}
|
||||
|
@ -4139,7 +4139,7 @@ static PRUint16*
|
|||
GenerateMultiByte(nsCharsetInfo* aSelf)
|
||||
{
|
||||
PRUint32 map[UCS2_MAP_LEN];
|
||||
nsCRT::memset(map, 0, sizeof(map));
|
||||
memset(map, 0, sizeof(map));
|
||||
for (PRUint16 c = 0; c < 0xFFFF; ++c) {
|
||||
BOOL defaulted = FALSE;
|
||||
WideCharToMultiByte(aSelf->mCodePage, 0, &c, 1, nsnull, 0, nsnull,
|
||||
|
@ -4743,7 +4743,7 @@ nsFontMetricsWinA::FindGlobalFont(HDC aDC, PRUnichar c)
|
|||
nsFontWinSubstituteA::nsFontWinSubstituteA(LOGFONT* aLogFont, HFONT aFont,
|
||||
PRUint16* aCCMap) : nsFontWinA(aLogFont, aFont, aCCMap)
|
||||
{
|
||||
nsCRT::memset(mRepresentableCharMap, 0, sizeof(mRepresentableCharMap));
|
||||
memset(mRepresentableCharMap, 0, sizeof(mRepresentableCharMap));
|
||||
}
|
||||
|
||||
nsFontWinSubstituteA::~nsFontWinSubstituteA()
|
||||
|
|
|
@ -476,7 +476,7 @@ nsresult nsDateTimeFormatMac::FormatPRExplodedTime(nsILocale* locale,
|
|||
nsString& stringOut)
|
||||
{
|
||||
struct tm tmTime;
|
||||
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||
memset( &tmTime, 0, sizeof(tmTime) );
|
||||
|
||||
tmTime.tm_yday = explodedTime->tm_yday;
|
||||
tmTime.tm_wday = explodedTime->tm_wday;
|
||||
|
|
|
@ -125,7 +125,7 @@ NS_IMETHODIMP nsScriptableDateFormat::FormatDateTime(
|
|||
struct tm tmTime;
|
||||
time_t timetTime;
|
||||
|
||||
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||
memset( &tmTime, 0, sizeof(tmTime) );
|
||||
tmTime.tm_year = year - 1900;
|
||||
tmTime.tm_mon = month - 1;
|
||||
tmTime.tm_mday = day;
|
||||
|
|
|
@ -190,7 +190,7 @@ nsresult nsDateTimeFormatOS2::FormatPRExplodedTime(nsILocale* locale,
|
|||
* when tmTime is passed to strftime() with garbage bad things may happen.
|
||||
* see bug #10412
|
||||
*/
|
||||
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||
memset( &tmTime, 0, sizeof(tmTime) );
|
||||
|
||||
tmTime.tm_yday = explodedTime->tm_yday;
|
||||
tmTime.tm_wday = explodedTime->tm_wday;
|
||||
|
|
|
@ -304,7 +304,7 @@ nsresult nsDateTimeFormatUnix::FormatPRExplodedTime(nsILocale* locale,
|
|||
* when tmTime is passed to strftime() with garbage bad things may happen.
|
||||
* see bug #10412
|
||||
*/
|
||||
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||
memset( &tmTime, 0, sizeof(tmTime) );
|
||||
|
||||
tmTime.tm_yday = explodedTime->tm_yday;
|
||||
tmTime.tm_wday = explodedTime->tm_wday;
|
||||
|
|
|
@ -268,7 +268,7 @@ nsresult nsDateTimeFormatWin::FormatPRExplodedTime(nsILocale* locale,
|
|||
nsString& stringOut)
|
||||
{
|
||||
struct tm tmTime;
|
||||
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||
memset( &tmTime, 0, sizeof(tmTime) );
|
||||
|
||||
tmTime.tm_yday = explodedTime->tm_yday;
|
||||
tmTime.tm_wday = explodedTime->tm_wday;
|
||||
|
|
|
@ -121,7 +121,7 @@ void nsGBKConvUtil::InitToGBKTable()
|
|||
PRUnichar unicode;
|
||||
PRUnichar i;
|
||||
// zap it to zero first
|
||||
nsCRT::memset(gUnicodeToGBKTable,0, sizeof(gUnicodeToGBKTable));
|
||||
memset(gUnicodeToGBKTable,0, sizeof(gUnicodeToGBKTable));
|
||||
|
||||
for ( i=0; i<MAX_GBK_LENGTH; i++ )
|
||||
{
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -556,7 +556,7 @@ FrameArena::FrameArena(PRUint32 aArenaSize)
|
|||
PL_INIT_ARENA_POOL(&mPool, "FrameArena", aArenaSize);
|
||||
|
||||
// Zero out the recyclers array
|
||||
nsCRT::memset(mRecyclers, 0, sizeof(mRecyclers));
|
||||
memset(mRecyclers, 0, sizeof(mRecyclers));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ nsAutoIndexBuffer::nsAutoIndexBuffer()
|
|||
: mBuffer(mAutoBuffer),
|
||||
mBufferLen(TEXT_BUF_SIZE)
|
||||
{
|
||||
nsCRT::memset(mAutoBuffer, 0, sizeof(mAutoBuffer));
|
||||
memset(mAutoBuffer, 0, sizeof(mAutoBuffer));
|
||||
}
|
||||
|
||||
nsAutoIndexBuffer::~nsAutoIndexBuffer()
|
||||
|
@ -170,7 +170,7 @@ nsAutoIndexBuffer::GrowTo(PRInt32 aAtLeast)
|
|||
if (!newBuffer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsCRT::memset(newBuffer, 0, sizeof(PRInt32) * newSize);
|
||||
memset(newBuffer, 0, sizeof(PRInt32) * newSize);
|
||||
memcpy(newBuffer, mBuffer, sizeof(PRInt32) * mBufferLen);
|
||||
if (mBuffer != mAutoBuffer) {
|
||||
delete [] mBuffer;
|
||||
|
|
|
@ -556,7 +556,7 @@ FrameArena::FrameArena(PRUint32 aArenaSize)
|
|||
PL_INIT_ARENA_POOL(&mPool, "FrameArena", aArenaSize);
|
||||
|
||||
// Zero out the recyclers array
|
||||
nsCRT::memset(mRecyclers, 0, sizeof(mRecyclers));
|
||||
memset(mRecyclers, 0, sizeof(mRecyclers));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ nsAutoIndexBuffer::nsAutoIndexBuffer()
|
|||
: mBuffer(mAutoBuffer),
|
||||
mBufferLen(TEXT_BUF_SIZE)
|
||||
{
|
||||
nsCRT::memset(mAutoBuffer, 0, sizeof(mAutoBuffer));
|
||||
memset(mAutoBuffer, 0, sizeof(mAutoBuffer));
|
||||
}
|
||||
|
||||
nsAutoIndexBuffer::~nsAutoIndexBuffer()
|
||||
|
@ -170,7 +170,7 @@ nsAutoIndexBuffer::GrowTo(PRInt32 aAtLeast)
|
|||
if (!newBuffer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsCRT::memset(newBuffer, 0, sizeof(PRInt32) * newSize);
|
||||
memset(newBuffer, 0, sizeof(PRInt32) * newSize);
|
||||
memcpy(newBuffer, mBuffer, sizeof(PRInt32) * mBufferLen);
|
||||
if (mBuffer != mAutoBuffer) {
|
||||
delete [] mBuffer;
|
||||
|
|
|
@ -93,7 +93,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
|
|||
|
||||
nscoord* colWidths = new PRBool[numCols];
|
||||
if (!colWidths) return PR_FALSE;
|
||||
nsCRT::memset(colWidths, WIDTH_NOT_SET, numCols*sizeof(nscoord));
|
||||
memset(colWidths, WIDTH_NOT_SET, numCols*sizeof(nscoord));
|
||||
|
||||
nscoord* propInfo = new PRBool[numCols];
|
||||
if (!propInfo) {
|
||||
|
@ -103,7 +103,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
|
|||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
|
||||
nsCRT::memset(propInfo, 0, numCols*sizeof(nscoord));
|
||||
memset(propInfo, 0, numCols*sizeof(nscoord));
|
||||
nscoord propTotal = 0;
|
||||
nscoord percTotal = 0;
|
||||
// for every column, determine its specified width
|
||||
|
|
|
@ -132,7 +132,7 @@ nsStyleCoord nsTableColFrame::GetStyleWidth() const
|
|||
|
||||
void nsTableColFrame::ResetSizingInfo()
|
||||
{
|
||||
nsCRT::memset(mWidths, WIDTH_NOT_SET, NUM_WIDTHS * sizeof(PRInt32));
|
||||
memset(mWidths, WIDTH_NOT_SET, NUM_WIDTHS * sizeof(PRInt32));
|
||||
SetConstraint(eNoConstraint);
|
||||
}
|
||||
|
||||
|
|
|
@ -4646,7 +4646,7 @@ void DebugGetIndent(const nsIFrame* aFrame,
|
|||
parent->GetParent(&parent);
|
||||
}
|
||||
PRInt32 indent = INDENT_PER_LEVEL * numLevels;
|
||||
nsCRT::memset (aBuf, ' ', indent);
|
||||
memset (aBuf, ' ', indent);
|
||||
aBuf[indent] = 0;
|
||||
}
|
||||
|
||||
|
@ -4764,7 +4764,7 @@ void DebugReflowPrint(nsReflowTimer& aTimer,
|
|||
// set up the indentation
|
||||
char indentChar[128];
|
||||
PRInt32 indent = INDENT_PER_LEVEL * aLevel;
|
||||
nsCRT::memset (indentChar, ' ', indent);
|
||||
memset (indentChar, ' ', indent);
|
||||
indentChar[indent] = 0;
|
||||
|
||||
// get the frame type
|
||||
|
@ -5146,7 +5146,7 @@ void DumpTableFramesRecur(nsIPresContext* aPresContext,
|
|||
PRUint32 aIndent)
|
||||
{
|
||||
char indent[MAX_SIZE + 1];
|
||||
nsCRT::memset (indent, ' ', aIndent + MIN_INDENT);
|
||||
memset (indent, ' ', aIndent + MIN_INDENT);
|
||||
indent[aIndent + MIN_INDENT] = 0;
|
||||
|
||||
char fName[MAX_SIZE];
|
||||
|
|
|
@ -620,7 +620,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext,
|
|||
if (numRows > 0) {
|
||||
rowInfo = new RowInfo[numRows];
|
||||
if (!rowInfo) return;
|
||||
nsCRT::memset (rowInfo, 0, numRows*sizeof(RowInfo));
|
||||
memset (rowInfo, 0, numRows*sizeof(RowInfo));
|
||||
}
|
||||
else return;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ void* nsCSSRule::operator new(size_t size)
|
|||
nsCSSRule* rv = (nsCSSRule*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -57,7 +57,7 @@ void* nsCSSRule::operator new(size_t size, nsIArena* aArena)
|
|||
nsCSSRule* rv = (nsCSSRule*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -1688,7 +1688,7 @@ void* CSSStyleSheetImpl::operator new(size_t size)
|
|||
CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -1700,7 +1700,7 @@ void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -291,7 +291,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size)
|
|||
HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -303,7 +303,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -666,7 +666,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size)
|
|||
HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 1;
|
||||
|
@ -678,7 +678,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena)
|
|||
HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsnull != rv) {
|
||||
nsCRT::memset(rv, 0xEE, size);
|
||||
memset(rv, 0xEE, size);
|
||||
}
|
||||
#endif
|
||||
rv->mInHeap = 0;
|
||||
|
|
|
@ -238,7 +238,7 @@ void nsStyleCoord::ToString(nsString& aBuffer) const
|
|||
|
||||
nsStyleSides::nsStyleSides(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
#define COMPARE_SIDE(side) \
|
||||
|
@ -268,7 +268,7 @@ PRBool nsStyleSides::operator==(const nsStyleSides& aOther) const
|
|||
|
||||
void nsStyleSides::Reset(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
void nsStyleSides::AppendToString(nsString& aBuffer) const
|
||||
|
|
|
@ -93,7 +93,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
|
|||
|
||||
nscoord* colWidths = new PRBool[numCols];
|
||||
if (!colWidths) return PR_FALSE;
|
||||
nsCRT::memset(colWidths, WIDTH_NOT_SET, numCols*sizeof(nscoord));
|
||||
memset(colWidths, WIDTH_NOT_SET, numCols*sizeof(nscoord));
|
||||
|
||||
nscoord* propInfo = new PRBool[numCols];
|
||||
if (!propInfo) {
|
||||
|
@ -103,7 +103,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
|
|||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
|
||||
nsCRT::memset(propInfo, 0, numCols*sizeof(nscoord));
|
||||
memset(propInfo, 0, numCols*sizeof(nscoord));
|
||||
nscoord propTotal = 0;
|
||||
nscoord percTotal = 0;
|
||||
// for every column, determine its specified width
|
||||
|
|
|
@ -132,7 +132,7 @@ nsStyleCoord nsTableColFrame::GetStyleWidth() const
|
|||
|
||||
void nsTableColFrame::ResetSizingInfo()
|
||||
{
|
||||
nsCRT::memset(mWidths, WIDTH_NOT_SET, NUM_WIDTHS * sizeof(PRInt32));
|
||||
memset(mWidths, WIDTH_NOT_SET, NUM_WIDTHS * sizeof(PRInt32));
|
||||
SetConstraint(eNoConstraint);
|
||||
}
|
||||
|
||||
|
|
|
@ -4646,7 +4646,7 @@ void DebugGetIndent(const nsIFrame* aFrame,
|
|||
parent->GetParent(&parent);
|
||||
}
|
||||
PRInt32 indent = INDENT_PER_LEVEL * numLevels;
|
||||
nsCRT::memset (aBuf, ' ', indent);
|
||||
memset (aBuf, ' ', indent);
|
||||
aBuf[indent] = 0;
|
||||
}
|
||||
|
||||
|
@ -4764,7 +4764,7 @@ void DebugReflowPrint(nsReflowTimer& aTimer,
|
|||
// set up the indentation
|
||||
char indentChar[128];
|
||||
PRInt32 indent = INDENT_PER_LEVEL * aLevel;
|
||||
nsCRT::memset (indentChar, ' ', indent);
|
||||
memset (indentChar, ' ', indent);
|
||||
indentChar[indent] = 0;
|
||||
|
||||
// get the frame type
|
||||
|
@ -5146,7 +5146,7 @@ void DumpTableFramesRecur(nsIPresContext* aPresContext,
|
|||
PRUint32 aIndent)
|
||||
{
|
||||
char indent[MAX_SIZE + 1];
|
||||
nsCRT::memset (indent, ' ', aIndent + MIN_INDENT);
|
||||
memset (indent, ' ', aIndent + MIN_INDENT);
|
||||
indent[aIndent + MIN_INDENT] = 0;
|
||||
|
||||
char fName[MAX_SIZE];
|
||||
|
|
|
@ -620,7 +620,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext,
|
|||
if (numRows > 0) {
|
||||
rowInfo = new RowInfo[numRows];
|
||||
if (!rowInfo) return;
|
||||
nsCRT::memset (rowInfo, 0, numRows*sizeof(RowInfo));
|
||||
memset (rowInfo, 0, numRows*sizeof(RowInfo));
|
||||
}
|
||||
else return;
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ NS_IMETHODIMP nsAbSync::AddSyncListener(nsIAbSyncListener *aListener)
|
|||
if (!mListenerArray)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsCRT::memset(mListenerArray, 0, (sizeof(nsIAbSyncListener *) * mListenerArrayCount));
|
||||
memset(mListenerArray, 0, (sizeof(nsIAbSyncListener *) * mListenerArrayCount));
|
||||
|
||||
mListenerArray[0] = aListener;
|
||||
NS_ADDREF(mListenerArray[0]);
|
||||
|
@ -1260,7 +1260,7 @@ nsAbSync::AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *director
|
|||
else
|
||||
{
|
||||
// Init the memory!
|
||||
nsCRT::memset(mCrashTable, 0, (mCrashTableSize * sizeof(syncMappingRecord)) );
|
||||
memset(mCrashTable, 0, (mCrashTableSize * sizeof(syncMappingRecord)) );
|
||||
nsString tProtLine;
|
||||
|
||||
rv = NS_OK;
|
||||
|
@ -1342,7 +1342,7 @@ nsAbSync::AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *director
|
|||
}
|
||||
|
||||
// Init the memory!
|
||||
nsCRT::memset(mOldSyncMapingTable, 0, mOldTableSize);
|
||||
memset(mOldSyncMapingTable, 0, mOldTableSize);
|
||||
|
||||
// Now get the number of records in the table size!
|
||||
mOldTableSize /= sizeof(syncMappingRecord);
|
||||
|
@ -1394,7 +1394,7 @@ nsAbSync::AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *director
|
|||
}
|
||||
|
||||
// Init the memory!
|
||||
nsCRT::memset(mNewSyncMapingTable, 0, (mNewTableSize * sizeof(syncMappingRecord)) );
|
||||
memset(mNewSyncMapingTable, 0, (mNewTableSize * sizeof(syncMappingRecord)) );
|
||||
|
||||
rv = NS_OK;
|
||||
workCounter =0;
|
||||
|
@ -2767,7 +2767,7 @@ nsAbSync::AddNewUsers()
|
|||
|
||||
if (isNewCard)
|
||||
{
|
||||
nsCRT::memset(newSyncRecord, 0, sizeof(syncMappingRecord));
|
||||
memset(newSyncRecord, 0, sizeof(syncMappingRecord));
|
||||
newSyncRecord->CRC = GetCRC(tLine);
|
||||
newSyncRecord->serverID = serverID;
|
||||
newSyncRecord->localID = localID;
|
||||
|
|
|
@ -567,7 +567,7 @@ NS_IMETHODIMP nsAbSyncPostEngine::AddPostListener(nsIAbSyncPostListener *aListen
|
|||
if (!mListenerArray)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsCRT::memset(mListenerArray, 0, (sizeof(nsIAbSyncPostListener *) * mListenerArrayCount));
|
||||
memset(mListenerArray, 0, (sizeof(nsIAbSyncPostListener *) * mListenerArrayCount));
|
||||
|
||||
mListenerArray[0] = aListener;
|
||||
NS_ADDREF(mListenerArray[0]);
|
||||
|
|
|
@ -1784,7 +1784,7 @@ nsSaveMsgListener::OnDataAvailable(nsIRequest* request,
|
|||
{
|
||||
if (maxReadCount > available)
|
||||
maxReadCount = available;
|
||||
nsCRT::memset(m_dataBuffer, 0, FOUR_K+1);
|
||||
memset(m_dataBuffer, 0, FOUR_K+1);
|
||||
rv = inStream->Read(m_dataBuffer, maxReadCount, &readCount);
|
||||
|
||||
// rhp:
|
||||
|
|
|
@ -722,7 +722,7 @@ nsMsgI18NGetAcceptLanguage(void)
|
|||
{
|
||||
nsXPIDLString prefValue;
|
||||
|
||||
nsCRT::memset(lang, 0, sizeof(lang));
|
||||
memset(lang, 0, sizeof(lang));
|
||||
res = prefs->GetLocalizedUnicharPref("intl.accept_languages", getter_Copies(prefValue));
|
||||
if (NS_SUCCEEDED(res) && prefValue)
|
||||
{
|
||||
|
|
|
@ -95,7 +95,7 @@ PRBool nsUInt32Array::SetSize(PRUint32 nSize,
|
|||
// The new size is within the current maximum size, make sure new
|
||||
// elements are to initialized to zero
|
||||
if (nSize > m_nSize)
|
||||
nsCRT::memset(&m_pData[m_nSize], 0, (nSize - m_nSize) * sizeof(PRUint32));
|
||||
memset(&m_pData[m_nSize], 0, (nSize - m_nSize) * sizeof(PRUint32));
|
||||
|
||||
m_nSize = nSize;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ PRBool nsUInt32Array::SetSize(PRUint32 nSize,
|
|||
memcpy(pNewData, m_pData, m_nSize * sizeof(PRUint32));
|
||||
|
||||
// Zero out the remaining elements
|
||||
nsCRT::memset(&pNewData[m_nSize], 0, (nSize - m_nSize) * sizeof(PRUint32));
|
||||
memset(&pNewData[m_nSize], 0, (nSize - m_nSize) * sizeof(PRUint32));
|
||||
m_nSize = nSize;
|
||||
m_nMaxSize = nMaxSize;
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void nsUint8Array::SetSize(PRInt32 nNewSize, PRInt32 nGrowBy)
|
|||
{
|
||||
// initialize the new elements
|
||||
|
||||
nsCRT::memset(&m_pData[m_nSize], 0, (nNewSize-m_nSize) * sizeof(PRUint8));
|
||||
memset(&m_pData[m_nSize], 0, (nNewSize-m_nSize) * sizeof(PRUint8));
|
||||
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ void nsUint8Array::SetSize(PRInt32 nNewSize, PRInt32 nGrowBy)
|
|||
|
||||
NS_ASSERTION(nNewSize > m_nSize, "did't grow size");
|
||||
|
||||
nsCRT::memset(&pNewData[m_nSize], 0, (nNewSize-m_nSize) * sizeof(PRUint8));
|
||||
memset(&pNewData[m_nSize], 0, (nNewSize-m_nSize) * sizeof(PRUint8));
|
||||
|
||||
delete[] (PRUint8*)m_pData;
|
||||
m_pData = pNewData;
|
||||
|
@ -172,7 +172,7 @@ nsresult nsUint8Array::InsertAt(PRInt32 nIndex, PRUint8 newElement, PRInt32 nCou
|
|||
|
||||
// re-init slots we copied from
|
||||
|
||||
nsCRT::memset(&m_pData[nIndex], 0, nCount * sizeof(PRUint8));
|
||||
memset(&m_pData[nIndex], 0, nCount * sizeof(PRUint8));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ int ap_decode_init(
|
|||
PRBool write_as_binhex,
|
||||
void *closure)
|
||||
{
|
||||
nsCRT::memset(p_ap_decode_obj, 0, sizeof(appledouble_decode_object));
|
||||
memset(p_ap_decode_obj, 0, sizeof(appledouble_decode_object));
|
||||
|
||||
/* presume first buff starts a line */
|
||||
p_ap_decode_obj->uu_starts_line = TRUE;
|
||||
|
|
|
@ -115,7 +115,7 @@ int ap_encode_init( appledouble_encode_object *p_ap_encode_obj,
|
|||
return -1;
|
||||
|
||||
fspec = mySpec.GetFSSpec();
|
||||
nsCRT::memset(p_ap_encode_obj, 0, sizeof(appledouble_encode_object));
|
||||
memset(p_ap_encode_obj, 0, sizeof(appledouble_encode_object));
|
||||
|
||||
/*
|
||||
** Fill out the source file inforamtion.
|
||||
|
|
|
@ -892,7 +892,7 @@ nsMsgAttachmentHandler::LoadDataFromFile(nsFileSpec& fSpec, nsString &sigData, P
|
|||
readBuf = (char *)PR_Malloc(readSize + 1);
|
||||
if (!readBuf)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
nsCRT::memset(readBuf, 0, readSize + 1);
|
||||
memset(readBuf, 0, readSize + 1);
|
||||
|
||||
readSize = tempFile.read(readBuf, readSize);
|
||||
tempFile.close();
|
||||
|
|
|
@ -223,7 +223,7 @@ int binhex_encode_init(binhex_encode_object *p_bh_encode_obj)
|
|||
/*
|
||||
** init all the status.
|
||||
*/
|
||||
nsCRT::memset(p_bh_encode_obj, 0, sizeof(binhex_encode_object));
|
||||
memset(p_bh_encode_obj, 0, sizeof(binhex_encode_object));
|
||||
|
||||
p_bh_encode_obj->line_length = 1;
|
||||
|
||||
|
@ -500,7 +500,7 @@ static char binhex_decode[256] =
|
|||
int binhex_decode_init (
|
||||
binhex_decode_object *p_bh_decode_obj)
|
||||
{
|
||||
nsCRT::memset(p_bh_decode_obj, 0, sizeof(binhex_decode_object));
|
||||
memset(p_bh_decode_obj, 0, sizeof(binhex_decode_object));
|
||||
|
||||
p_bh_decode_obj->octetin = 26;
|
||||
p_bh_decode_obj->donepos = 3;
|
||||
|
|
|
@ -1881,8 +1881,8 @@ mime_gen_content_id(PRUint32 aPartNum, const char *aEmailAddress)
|
|||
const char *domain = nsnull;
|
||||
const char *defaultDomain = "@netscape.com";
|
||||
|
||||
nsCRT::memset(rand_buf1, 0, randLen-1);
|
||||
nsCRT::memset(rand_buf2, 0, randLen-1);
|
||||
memset(rand_buf1, 0, randLen-1);
|
||||
memset(rand_buf2, 0, randLen-1);
|
||||
|
||||
GenerateGlobalRandomBytes(rand_buf1, randLen);
|
||||
GenerateGlobalRandomBytes(rand_buf2, randLen);
|
||||
|
|
|
@ -2819,7 +2819,7 @@ nsMsgCompose::LoadDataFromFile(nsFileSpec& fSpec, nsString &sigData)
|
|||
readSize = fSpec.GetFileSize();
|
||||
ptr = readBuf = (char *)PR_Malloc(readSize + 1); if (!readBuf)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
nsCRT::memset(readBuf, 0, readSize + 1);
|
||||
memset(readBuf, 0, readSize + 1);
|
||||
|
||||
while (readSize) {
|
||||
nGot = tempFile.read(ptr, readSize);
|
||||
|
|
|
@ -1637,13 +1637,13 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
|
|||
domSaveArray = (domSaveStruct *)PR_MALLOC(sizeof(domSaveStruct) * multipartCount);
|
||||
if (!domSaveArray)
|
||||
return NS_ERROR_MIME_MPART_ATTACHMENT_ERROR;
|
||||
nsCRT::memset(domSaveArray, 0, sizeof(domSaveStruct) * multipartCount);
|
||||
memset(domSaveArray, 0, sizeof(domSaveStruct) * multipartCount);
|
||||
}
|
||||
|
||||
for (i = mPreloadedAttachmentCount; i < (mPreloadedAttachmentCount + multipartCount); i++)
|
||||
{
|
||||
// Reset this structure to null!
|
||||
nsCRT::memset(&attachment, 0, sizeof(nsMsgAttachmentData));
|
||||
memset(&attachment, 0, sizeof(nsMsgAttachmentData));
|
||||
|
||||
// MUST set this to get placed in the correct part of the message
|
||||
m_attachments[i].mMHTMLPart = PR_TRUE;
|
||||
|
@ -2330,7 +2330,7 @@ nsMsgComposeAndSend::HackAttachments(const nsMsgAttachmentData *attachments,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// clear this new memory...
|
||||
nsCRT::memset(m_attachments, 0, (sizeof(nsMsgAttachmentHandler) * m_attachment_count));
|
||||
memset(m_attachments, 0, (sizeof(nsMsgAttachmentHandler) * m_attachment_count));
|
||||
PRUint32 i; // counter for location in attachment array...
|
||||
|
||||
//
|
||||
|
@ -3795,7 +3795,7 @@ BuildURLAttachmentData(nsIURI *url)
|
|||
else
|
||||
theName++;
|
||||
|
||||
nsCRT::memset(attachments, 0, sizeof(nsMsgAttachmentData) * attachCount);
|
||||
memset(attachments, 0, sizeof(nsMsgAttachmentData) * attachCount);
|
||||
attachments[0].url = url; // The URL to attach. This should be 0 to signify "end of list".
|
||||
attachments[0].real_name = (char *)PL_strdup(theName); // The original name of this document, which will eventually show up in the
|
||||
|
||||
|
|
|
@ -1134,7 +1134,7 @@ nsMsgSendLater::AddListener(nsIMsgSendLaterListener *aListener)
|
|||
if (!mListenerArray)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsCRT::memset(mListenerArray, 0, (sizeof(nsIMsgSendLaterListener *) * mListenerArrayCount));
|
||||
memset(mListenerArray, 0, (sizeof(nsIMsgSendLaterListener *) * mListenerArrayCount));
|
||||
|
||||
mListenerArray[0] = aListener;
|
||||
NS_ADDREF(mListenerArray[0]);
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
void* nsMsgZapIt::operator new(size_t size, const char *file, size_t line) {
|
||||
void* rv = ::operator new(size, file, line);
|
||||
if (rv) {
|
||||
nsCRT::memset(rv, 0, size);
|
||||
memset(rv, 0, size);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ void* nsMsgZapIt::operator new(size_t size, const char *file, size_t line) {
|
|||
void* nsMsgZapIt::operator new(size_t size) {
|
||||
void* rv = ::operator new(size);
|
||||
if (rv) {
|
||||
nsCRT::memset(rv, 0, size);
|
||||
memset(rv, 0, size);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -871,7 +871,7 @@ PRInt32 nsSmtpProtocol::AuthLoginUsername()
|
|||
char plain_string[512];
|
||||
int len = 1; /* first <NUL> char */
|
||||
|
||||
nsCRT::memset(plain_string, 0, 512);
|
||||
memset(plain_string, 0, 512);
|
||||
PR_snprintf(&plain_string[1], 510, "%s", (const char*)username);
|
||||
len += PL_strlen(username);
|
||||
len++; /* second <NUL> char */
|
||||
|
|
|
@ -113,7 +113,7 @@ nsImapFlagAndUidState::nsImapFlagAndUidState(PRInt32 numberOfMessages, PRUint16
|
|||
fFlags = (imapMessageFlagsType*) PR_Malloc(sizeof(imapMessageFlagsType) * fNumberOfMessageSlotsAllocated); // new imapMessageFlagsType[fNumberOfMessageSlotsAllocated];
|
||||
|
||||
fUids.SetSize(fNumberOfMessageSlotsAllocated);
|
||||
nsCRT::memset(fFlags, 0, sizeof(imapMessageFlagsType) * fNumberOfMessageSlotsAllocated);
|
||||
memset(fFlags, 0, sizeof(imapMessageFlagsType) * fNumberOfMessageSlotsAllocated);
|
||||
fSupportedUserFlags = flags;
|
||||
fNumberDeleted = 0;
|
||||
NS_INIT_REFCNT();
|
||||
|
|
|
@ -4517,7 +4517,7 @@ void nsImapProtocol::AuthLogin(const char *userName, const char *password, eIMAP
|
|||
{
|
||||
char plainstr[512]; // placeholder for "<NUL>userName<NUL>password"
|
||||
int len = 1; // count for first <NUL> char
|
||||
nsCRT::memset(plainstr, 0, 512);
|
||||
memset(plainstr, 0, 512);
|
||||
PR_snprintf(&plainstr[1], 510, "%s", userName);
|
||||
len += PL_strlen(userName);
|
||||
len++; // count for second <NUL> char
|
||||
|
|
|
@ -538,7 +538,7 @@ nsMsgAttachedFile * nsEudoraCompose::GetLocalAttachments( void)
|
|||
nsMsgAttachedFile *a = (nsMsgAttachedFile *) new nsMsgAttachedFile[count + 1];
|
||||
if (!a)
|
||||
return( nsnull);
|
||||
nsCRT::memset(a, 0, sizeof(nsMsgAttachedFile) * (count + 1));
|
||||
memset(a, 0, sizeof(nsMsgAttachedFile) * (count + 1));
|
||||
|
||||
nsresult rv;
|
||||
char * urlStr;
|
||||
|
|
|
@ -961,7 +961,7 @@ nsresult nsEudoraMac::GetAttachmentInfo( const char *pFileName, nsIFileSpec *pSp
|
|||
return( NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsCRT::memset( &spec, 0, sizeof( spec));
|
||||
memset( &spec, 0, sizeof( spec));
|
||||
err = FSpResolveFileIDRef( nil, vRefNum, (long) fNum, &spec);
|
||||
if (err != noErr) {
|
||||
IMPORT_LOG1( "\t*** Error, cannot resolve fileIDRef: %ld\n", (long) err);
|
||||
|
|
|
@ -1600,7 +1600,7 @@ void CMapiFolderList::DumpList( void)
|
|||
depth *= 2;
|
||||
if (depth > 255)
|
||||
depth = 255;
|
||||
nsCRT::memset( prefix, ' ', depth);
|
||||
memset( prefix, ' ', depth);
|
||||
prefix[depth] = 0;
|
||||
#ifdef MAPI_DEBUG
|
||||
char *ansiStr = ToNewCString(str);
|
||||
|
|
|
@ -536,7 +536,7 @@ nsMsgAttachedFile * nsOutlookCompose::GetLocalAttachments( void)
|
|||
nsMsgAttachedFile *a = (nsMsgAttachedFile *) new nsMsgAttachedFile[count + 1];
|
||||
if (!a)
|
||||
return( nsnull);
|
||||
nsCRT::memset(a, 0, sizeof(nsMsgAttachedFile) * (count + 1));
|
||||
memset(a, 0, sizeof(nsMsgAttachedFile) * (count + 1));
|
||||
|
||||
nsresult rv;
|
||||
char * urlStr;
|
||||
|
|
|
@ -771,12 +771,12 @@ void nsImportModuleList::AddModule( const nsCID& cid, const char *pSupports, con
|
|||
m_alloc = 10;
|
||||
m_pList = new ImportModuleDesc *[m_alloc];
|
||||
m_count = 0;
|
||||
nsCRT::memset( m_pList, 0, sizeof( ImportModuleDesc *) * m_alloc);
|
||||
memset( m_pList, 0, sizeof( ImportModuleDesc *) * m_alloc);
|
||||
}
|
||||
|
||||
if (m_count == m_alloc) {
|
||||
ImportModuleDesc **pList = new ImportModuleDesc *[m_alloc + 10];
|
||||
nsCRT::memset( &(pList[m_alloc]), 0, sizeof( ImportModuleDesc *) * 10);
|
||||
memset( &(pList[m_alloc]), 0, sizeof( ImportModuleDesc *) * 10);
|
||||
memcpy( pList, m_pList, sizeof( ImportModuleDesc *) * m_alloc);
|
||||
delete [] m_pList;
|
||||
m_pList = pList;
|
||||
|
|
|
@ -185,7 +185,7 @@ MimeInlineTextVCard_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
|||
}
|
||||
|
||||
linestring = (char *) PR_MALLOC (length + 1);
|
||||
nsCRT::memset(linestring, 0, (length + 1));
|
||||
memset(linestring, 0, (length + 1));
|
||||
|
||||
if (linestring)
|
||||
{
|
||||
|
@ -1729,7 +1729,7 @@ FindCharacterSet(MimeObject *obj)
|
|||
if (!workString)
|
||||
return nsnull;
|
||||
|
||||
nsCRT::memset(workString, 0, obj->headers->all_headers_size + 1);
|
||||
memset(workString, 0, obj->headers->all_headers_size + 1);
|
||||
memcpy(workString, obj->headers->all_headers, obj->headers->all_headers_size);
|
||||
|
||||
char *cTypePtr = (char *) PL_strcasestr(workString, HEADER_CONTENT_TYPE);
|
||||
|
|
|
@ -1388,7 +1388,7 @@ mime_parse_stream_complete (nsMIMESession *stream)
|
|||
body = (char *)PR_MALLOC (bodyLen + 1);
|
||||
if (body)
|
||||
{
|
||||
nsCRT::memset (body, 0, bodyLen+1);
|
||||
memset (body, 0, bodyLen+1);
|
||||
|
||||
nsInputFileStream inputFile(*(mdd->messageBody->file_spec));
|
||||
if (inputFile.is_open())
|
||||
|
@ -1753,7 +1753,7 @@ mime_decompose_file_init_fn ( void *stream_closure, MimeHeaders *headers )
|
|||
}
|
||||
|
||||
newAttachment = attachments + nAttachments;
|
||||
nsCRT::memset ( newAttachment, 0, sizeof (nsMsgAttachedFile) * 2 );
|
||||
memset ( newAttachment, 0, sizeof (nsMsgAttachedFile) * 2 );
|
||||
}
|
||||
|
||||
char *workURLSpec = nsnull;
|
||||
|
|
|
@ -131,7 +131,7 @@ ProcessBodyAsAttachment(MimeObject *obj, nsMsgAttachmentData **data)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
tmp = *data;
|
||||
nsCRT::memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
|
||||
memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
|
||||
tmp->real_type = child->content_type ? nsCRT::strdup(child->content_type) : NULL;
|
||||
tmp->real_encoding = child->encoding ? nsCRT::strdup(child->encoding) : NULL;
|
||||
disp = MimeHeaders_get(child->headers, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);
|
||||
|
@ -521,7 +521,7 @@ MimeGetAttachmentList(MimeObject *tobj, const char *aMessageURL, nsMsgAttachment
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
attIndex = 0;
|
||||
nsCRT::memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
|
||||
memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
|
||||
|
||||
// Now, build the list!
|
||||
return BuildAttachmentList((MimeObject *) cobj, *data, aMessageURL, PR_FALSE);
|
||||
|
@ -1617,7 +1617,7 @@ mime_bridge_create_display_stream(
|
|||
return 0;
|
||||
}
|
||||
|
||||
nsCRT::memset (stream, 0, sizeof (*stream));
|
||||
memset (stream, 0, sizeof (*stream));
|
||||
stream->name = "MIME Conversion Stream";
|
||||
stream->complete = mime_display_stream_complete;
|
||||
stream->abort = mime_display_stream_abort;
|
||||
|
|
|
@ -183,7 +183,7 @@ MimeObject_parse_begin (MimeObject *obj)
|
|||
|
||||
obj->options->state = PR_NEW(MimeParseStateObject);
|
||||
if (!obj->options->state) return MIME_OUT_OF_MEMORY;
|
||||
nsCRT::memset(obj->options->state, 0, sizeof(*obj->options->state));
|
||||
memset(obj->options->state, 0, sizeof(*obj->options->state));
|
||||
obj->options->state->root = obj;
|
||||
obj->options->state->separator_suppressed_p = PR_TRUE; /* no first sep */
|
||||
}
|
||||
|
|
|
@ -460,7 +460,7 @@ NS_METHOD nsBMPDecoder::ProcessData(const char* aBuffer, PRUint32 aCount)
|
|||
|
||||
void nsBMPDecoder::ProcessFileHeader()
|
||||
{
|
||||
nsCRT::memset(&mBFH, 0, sizeof(mBFH));
|
||||
memset(&mBFH, 0, sizeof(mBFH));
|
||||
DOCOPY(&mBFH.signature, mRawBuf);
|
||||
DOCOPY(&mBFH.filesize, mRawBuf + 2);
|
||||
DOCOPY(&mBFH.reserved, mRawBuf + 6);
|
||||
|
@ -475,7 +475,7 @@ void nsBMPDecoder::ProcessFileHeader()
|
|||
|
||||
void nsBMPDecoder::ProcessInfoHeader()
|
||||
{
|
||||
nsCRT::memset(&mBIH, 0, sizeof(mBIH));
|
||||
memset(&mBIH, 0, sizeof(mBIH));
|
||||
if (mBFH.bihsize == 12) { // OS/2 Bitmap
|
||||
memcpy(&mBIH.width, mRawBuf, 2);
|
||||
memcpy(&mBIH.height, mRawBuf + 2, 2);
|
||||
|
|
|
@ -445,7 +445,7 @@ nsresult nsICODecoder::ProcessData(const char* aBuffer, PRUint32 aCount) {
|
|||
delete []mRow;
|
||||
mRow = new PRUint8[rowSize];
|
||||
mAlphaBuffer = new PRUint8[mDirEntry.mHeight*rowSize];
|
||||
nsCRT::memset(mAlphaBuffer, 0xff, mDirEntry.mHeight*rowSize);
|
||||
memset(mAlphaBuffer, 0xff, mDirEntry.mHeight*rowSize);
|
||||
}
|
||||
|
||||
PRUint32 toCopy;
|
||||
|
@ -487,7 +487,7 @@ nsresult nsICODecoder::ProcessData(const char* aBuffer, PRUint32 aCount) {
|
|||
void
|
||||
nsICODecoder::ProcessDirEntry()
|
||||
{
|
||||
nsCRT::memset(&mDirEntry, 0, sizeof(mDirEntry));
|
||||
memset(&mDirEntry, 0, sizeof(mDirEntry));
|
||||
DOCOPY(&mDirEntry.mWidth, mDirEntryArray);
|
||||
DOCOPY(&mDirEntry.mHeight, mDirEntryArray+1);
|
||||
DOCOPY(&mDirEntry.mColorCount, mDirEntryArray+2);
|
||||
|
@ -507,7 +507,7 @@ nsICODecoder::ProcessDirEntry()
|
|||
}
|
||||
|
||||
void nsICODecoder::ProcessInfoHeader() {
|
||||
nsCRT::memset(&mBIH, 0, sizeof(mBIH));
|
||||
memset(&mBIH, 0, sizeof(mBIH));
|
||||
// Ignoring the size; it should always be 40 for icons, anyway
|
||||
|
||||
DOCOPY(&mBIH.width, mBIHraw + 4);
|
||||
|
|
|
@ -214,7 +214,7 @@ short nsPluginFile::OpenPluginResource()
|
|||
nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info)
|
||||
{
|
||||
// clear out the info, except for the first field.
|
||||
nsCRT::memset(&info.fName, 0, sizeof(info) - sizeof(PRUint32));
|
||||
memset(&info.fName, 0, sizeof(info) - sizeof(PRUint32));
|
||||
|
||||
// need to open the plugin's resource file and read some resources.
|
||||
short refNum = OpenPluginResource();
|
||||
|
|
|
@ -76,7 +76,7 @@ StressTest(nsILocalFile * localFile, PRInt32 testNumber, PRBool readWrite)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
nsCRT::memset(writeBuf[i], i, 256 * i);
|
||||
memset(writeBuf[i], i, 256 * i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -716,10 +716,10 @@ main(void)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
nsCRT::memset(one, 1, 256);
|
||||
nsCRT::memset(two, 2, 256 * 2);
|
||||
nsCRT::memset(three, 3, 256 * 3);
|
||||
nsCRT::memset(four, 4, 256 * 4);
|
||||
memset(one, 1, 256);
|
||||
memset(two, 2, 256 * 2);
|
||||
memset(three, 3, 256 * 3);
|
||||
memset(four, 4, 256 * 4);
|
||||
|
||||
startBlock = blockFile->AllocateBlocks(1);
|
||||
if (startBlock != 0) {
|
||||
|
|
|
@ -1341,11 +1341,11 @@ nsCreateReqFromKeyPairs(nsKeyPairInfo *keyids, PRInt32 numRequests,
|
|||
CRMFCertRequest *certReq;
|
||||
if (!certReqMsgs)
|
||||
return nsnull;
|
||||
nsCRT::memset(certReqMsgs, 0, sizeof(CRMFCertReqMsg*)*(1+numRequests));
|
||||
memset(certReqMsgs, 0, sizeof(CRMFCertReqMsg*)*(1+numRequests));
|
||||
SECStatus srv;
|
||||
nsresult rv;
|
||||
CRMFCertReqMessages messages;
|
||||
nsCRT::memset(&messages, 0, sizeof(messages));
|
||||
memset(&messages, 0, sizeof(messages));
|
||||
messages.messages = certReqMsgs;
|
||||
SECItem *encodedReq;
|
||||
char *retString;
|
||||
|
@ -1516,7 +1516,7 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMFObject** aReturn)
|
|||
JS_ReportError(cx, "%s\n", JS_ERROR_INTERNAL);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsCRT::memset(keyids, 0, sizeof(nsKeyPairInfo)*numRequests);
|
||||
memset(keyids, 0, sizeof(nsKeyPairInfo)*numRequests);
|
||||
int keyInfoIndex;
|
||||
PRUint32 i;
|
||||
PK11SlotInfo *slot = nsnull;
|
||||
|
@ -1885,7 +1885,7 @@ nsCrypto::ImportUserCertificates(const nsAReadableString& aNickname,
|
|||
if (!certArr)
|
||||
aDoForcedBackup = PR_FALSE;
|
||||
|
||||
nsCRT::memset(certArr, 0, sizeof(nsIX509Cert*)*numResponses);
|
||||
memset(certArr, 0, sizeof(nsIX509Cert*)*numResponses);
|
||||
}
|
||||
for (i=0; i<numResponses; i++) {
|
||||
currResponse = CMMF_CertRepContentGetResponseAtIndex(certRepContent,i);
|
||||
|
|
|
@ -467,7 +467,7 @@ NS_NewGenericModule(const char* moduleName,
|
|||
nsIModule* *result)
|
||||
{
|
||||
nsModuleInfo info;
|
||||
nsCRT::memset(&info, 0, sizeof(info));
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
info.mVersion = NS_MODULEINFO_VERSION;
|
||||
info.mModuleName = moduleName;
|
||||
|
|
|
@ -43,7 +43,7 @@ ArenaImpl::ArenaImpl(void)
|
|||
: mInitialized(PR_FALSE)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCRT::memset(&mPool, 0, sizeof(PLArenaPool));
|
||||
memset(&mPool, 0, sizeof(PLArenaPool));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -129,10 +129,10 @@ public:
|
|||
::memmove(aDest, aSrc, (size_t)aCount);
|
||||
}
|
||||
|
||||
static void memset(void* aDest, PRUint8 aByte, PRUint32 aCount) {
|
||||
NS_ASSERTION((aDest != NULL) || (aCount == 0), "Invalid NULL argument");
|
||||
::memset(aDest, aByte, aCount);
|
||||
}
|
||||
/****
|
||||
**** nsCRT::memset() is no longer supported.
|
||||
**** Please use memset from standard C instead.
|
||||
****/
|
||||
|
||||
/****
|
||||
**** nsCRT::zero() is no longer supported.
|
||||
|
|
|
@ -131,7 +131,7 @@ nsFixedSizeAllocator::Alloc(size_t aSize)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
nsCRT::memset(next, 0xc8, aSize);
|
||||
memset(next, 0xc8, aSize);
|
||||
#endif
|
||||
|
||||
return next;
|
||||
|
@ -145,7 +145,7 @@ nsFixedSizeAllocator::Free(void* aPtr, size_t aSize)
|
|||
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(bucket && bucket->mSize == aSize, "ack! corruption! bucket->mSize != aSize!");
|
||||
nsCRT::memset(aPtr, 0xd8, bucket->mSize);
|
||||
memset(aPtr, 0xd8, bucket->mSize);
|
||||
#endif
|
||||
|
||||
entry->mNext = bucket->mFirst;
|
||||
|
|
|
@ -513,7 +513,7 @@ PRBool nsVoidArray::ReplaceElementAt(void* aElement, PRInt32 aIndex)
|
|||
// For example, if mCount is 2, and we do a ReplaceElementAt for
|
||||
// element[5], then we need to set three entries ([2], [3], and [4])
|
||||
// to 0.
|
||||
nsCRT::memset(&mImpl->mArray[mImpl->mCount], 0,
|
||||
memset(&mImpl->mArray[mImpl->mCount], 0,
|
||||
(aIndex - mImpl->mCount) * sizeof(mImpl->mArray[0]));
|
||||
}
|
||||
|
||||
|
|
|
@ -467,7 +467,7 @@ NS_NewGenericModule(const char* moduleName,
|
|||
nsIModule* *result)
|
||||
{
|
||||
nsModuleInfo info;
|
||||
nsCRT::memset(&info, 0, sizeof(info));
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
info.mVersion = NS_MODULEINFO_VERSION;
|
||||
info.mModuleName = moduleName;
|
||||
|
|
|
@ -86,7 +86,7 @@ nsSegmentedBuffer::AppendNewSegment()
|
|||
mSegmentArray = (char**)nsMemory::Alloc(bytes);
|
||||
if (mSegmentArray == nsnull)
|
||||
return nsnull;
|
||||
nsCRT::memset(mSegmentArray, 0, bytes);
|
||||
memset(mSegmentArray, 0, bytes);
|
||||
}
|
||||
|
||||
if (IsFull()) {
|
||||
|
@ -102,13 +102,13 @@ nsSegmentedBuffer::AppendNewSegment()
|
|||
memcpy(&mSegmentArray[mSegmentArrayCount],
|
||||
mSegmentArray,
|
||||
mLastSegmentIndex * sizeof(char*));
|
||||
nsCRT::memset(mSegmentArray, 0, mLastSegmentIndex * sizeof(char*));
|
||||
memset(mSegmentArray, 0, mLastSegmentIndex * sizeof(char*));
|
||||
mLastSegmentIndex += mSegmentArrayCount;
|
||||
nsCRT::memset(&mSegmentArray[mLastSegmentIndex], 0,
|
||||
memset(&mSegmentArray[mLastSegmentIndex], 0,
|
||||
(newArraySize - mLastSegmentIndex) * sizeof(char*));
|
||||
}
|
||||
else {
|
||||
nsCRT::memset(&mSegmentArray[mLastSegmentIndex], 0,
|
||||
memset(&mSegmentArray[mLastSegmentIndex], 0,
|
||||
(newArraySize - mLastSegmentIndex) * sizeof(char*));
|
||||
}
|
||||
mSegmentArrayCount = newArraySize;
|
||||
|
|
Загрузка…
Ссылка в новой задаче