[FFmpeg-devel] [PATCH] provide AV_BASE64_SIZE() macro
Fri Jun 4 00:00:49 CEST 2010
Michael Niedermayer <michaelni at gmx.at> writes:
> On Thu, Jun 03, 2010 at 10:39:52PM +0100, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> > On Thu, Jun 03, 2010 at 01:50:06PM -0700, Howard Chu wrote:
>> >> Just for convenience...
>> > IMHO this is making the code harder to understand
>> How so? It's an obscure calculation repeated multiple times. That is
>> exactly the kind of situation functions and macros were invented for.
> to me the calculation is clear,
Because you happen to know exactly how base64 encoding works. This is
IMO not a reasonable requirement to place on users of the interface.
Besides, the same rather complex calculation repeated numerous times
is a recipe for trouble. Sooner or later, someone will get it wrong
in one place. Then people will copy it from there, and the error will
spread. It's much better to put it all in a macro.
> the macro name is less clear to me.
Feel free to propose a better name.
mans at mansr.com
More information about the ffmpeg-devel