// assert, even though it is a perfectly legal use.
if ( am )
{
- if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
*am = wxString(buffer);
else
*am = wxString();
if ( pm )
{
tm.tm_hour = 13;
- if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
*pm = wxString(buffer);
else
*pm = wxString();
int count;
va_list argptr;
va_start(argptr, szFormat);
- buf[sizeof(buf)/sizeof(wxChar)-1] = _T('\0');
+ buf[WXSIZEOF(buf)-1] = _T('\0');
// keep 3 bytes for a \r\n\0
- count = wxVsnprintf(buf, sizeof(buf)/sizeof(wxChar)-3, szFormat, argptr);
+ count = wxVsnprintf(buf, WXSIZEOF(buf)-3, szFormat, argptr);
if ( count < 0 )
- count = sizeof(buf)/sizeof(wxChar)-3;
+ count = WXSIZEOF(buf)-3;
buf[count]=_T('\r');
buf[count+1]=_T('\n');
buf[count+2]=_T('\0');
kATSUQDCondensedTag ,
kATSUQDExtendedTag ,
};
- ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ByteCount atsuSizes[WXSIZEOF(atsuTags)] =
{
sizeof( ATSUFontID ) ,
sizeof( Fixed ) ,
Fixed atsuSize = IntToFixed( m_info.m_pointSize );
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
FMFontStyle addQDStyle = m_info.m_atsuAdditionalQDStyles;
- ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ATSUAttributeValuePtr atsuValues[WXSIZEOF(atsuTags)] =
{
&m_info.m_atsuFontID ,
&atsuSize ,
status = ::ATSUSetAttributes(
(ATSUStyle)m_macATSUStyle,
- sizeof(atsuTags) / sizeof(ATSUAttributeTag) ,
+ WXSIZEOF(atsuTags),
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") );
kATSUSizeTag ,
kATSUColorTag ,
};
- ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ByteCount atsuSizes[WXSIZEOF(atsuTags)] =
{
sizeof( Fixed ) ,
sizeof( RGBColor ) ,
};
- ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ATSUAttributeValuePtr atsuValues[WXSIZEOF(atsuTags)] =
{
&atsuSize ,
&atsuColor ,
};
status = ::ATSUSetAttributes(
- m_macATSUIStyle, sizeof(atsuTags) / sizeof(ATSUAttributeTag) ,
+ m_macATSUIStyle, WXSIZEOF(atsuTags),
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") );
{
kATSULineRotationTag ,
};
- ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ByteCount atsuSizes[WXSIZEOF(atsuTags)] =
{
sizeof( Fixed ) ,
};
- ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ATSUAttributeValuePtr atsuValues[WXSIZEOF(atsuTags)] =
{
&atsuAngle ,
};
- status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags) / sizeof(ATSUAttributeTag),
+ status = ::ATSUSetLayoutControls(atsuLayout , WXSIZEOF(atsuTags),
atsuTags, atsuSizes, atsuValues );
}
{
kATSUCGContextTag ,
};
- ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ByteCount atsuSizes[WXSIZEOF(atsuTags)] =
{
sizeof( CGContextRef ) ,
};
- ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ ATSUAttributeValuePtr atsuValues[WXSIZEOF(atsuTags)] =
{
&m_cgContext ,
};
- status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags) / sizeof(ATSUAttributeTag),
+ status = ::ATSUSetLayoutControls(atsuLayout , WXSIZEOF(atsuTags),
atsuTags, atsuSizes, atsuValues );
}
} ;
err = TXNSetTypeAttributes(
- m_txn, sizeof(typeAttr) / sizeof(TXNTypeAttributes),
+ m_txn, WXSIZEOF(typeAttr),
typeAttr, kTXNStartOffset, kTXNEndOffset );
verify_noerr( err );
{
// Insert items into subset combo
int i;
- for (i = 0; i < (int) (sizeof(g_UnicodeSubsetTable)/sizeof(g_UnicodeSubsetTable[0])); i++)
+ for (i = 0; i < (int) WXSIZEOF(g_UnicodeSubsetTable); i++)
{
m_subsetCtrl->Append(g_UnicodeSubsetTable[i].m_name);
}
{
// Need to make the subset selection reflect the current symbol
int i;
- for (i = 0; i < (int) (sizeof(g_UnicodeSubsetTable)/sizeof(g_UnicodeSubsetTable[0])); i++)
+ for (i = 0; i < (int) WXSIZEOF(g_UnicodeSubsetTable); i++)
{
if (sel >= g_UnicodeSubsetTable[i].m_low && sel <= g_UnicodeSubsetTable[i].m_high)
{