made [Input | Output]Formats() better handle the case where out_count is NULL and made the functions better handle the cas

e when the number of input or output formats changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2315 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2002-12-29 14:57:27 +00:00
parent d4dd380232
commit 32898e2a71
1 changed files with 12 additions and 8 deletions

View File

@ -234,10 +234,12 @@ TGATranslator::TranslatorVersion() const
const translation_format *
TGATranslator::InputFormats(int32 *out_count) const
{
if (out_count)
*out_count = 2;
return gInputFormats;
if (out_count) {
*out_count = sizeof(gInputFormats) /
sizeof(translation_format);
return gInputFormats;
} else
return NULL;
}
// ---------------------------------------------------------------
@ -258,10 +260,12 @@ TGATranslator::InputFormats(int32 *out_count) const
const translation_format *
TGATranslator::OutputFormats(int32 *out_count) const
{
if (out_count)
*out_count = 2;
return gOutputFormats;
if (out_count) {
*out_count = sizeof(gOutputFormats) /
sizeof(translation_format);
return gOutputFormats;
} else
return NULL;
}
// ---------------------------------------------------------------