[FFmpeg-devel] [PATCH] added expr evaluation to drawtext - fontsize

Nicolas George george at nsup.org
Fri Sep 2 15:20:37 EEST 2016


Le septidi 17 fructidor, an CCXXIV, Moritz Barsnick a écrit :
> Sorry, probably makes sense, equal to
>          if ((ret = update_fontsize(ctx)) != 0) {
> 
> I'm still not *really* sure whether the second set of brackets is
> required to have "if" check the assigned ret (I thought not). I'll let
> someone else judge.

You mean the parentheses? Well, if you are not sure, then the parentheses
are necessary. We are not playing golf, we want code that is readable and
robust.

For reference, comparisons have precedence over assignments. That means
"a = b < c" is equivalent to "a = (b < c)", not "(a = b) < c". Therefore,
the parentheses are necessary even for golf.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160902/9f316e04/attachment.sig>


More information about the ffmpeg-devel mailing list