[FFmpeg-devel] [PATCH] remove unused and broken test program in libavutil/base64.c
Bobby Bingham
uhmmmm
Thu Jan 29 20:59:28 CET 2009
On Thu, 29 Jan 2009 01:20:02 -0800
Baptiste Coudurier <baptiste.coudurier at gmail.com> wrote:
> Hi,
>
> Marc Mason wrote:
> > Michael Niedermayer wrote:
> >
> >> Stefano Sabatini wrote:
> >>
> >>> if (strcmp(encoded, t->encoded) != 0) {
> >> superflous != 0
> >
> > Redundant (or superfluous) information sometimes make the code or
> > the coder's intention clearer.
>
> Could you please give an example ?
> I'm really used to read "!strcmp" to match, and when I don't see the
> '!', I know this means "don't match"
>
> In this case, I also think != 0 is redundant and useless.
>
> >>> printf("\n");
> >>> printf("Encoding/decoding tests on random data\n");
> >> can be merged
> >
> > For what gain? Cosmetic or computational?
>
> I also find the merge better.
>
> > GCC is likely to merge the two statements.
>
> Does it, or not ?
>
Doesn't here (gcc 4.3.3, amd64):
printf.c:
#include <stdio.h>
int main()
{
printf("\n");
printf("Hello world!\n");
return 0;
}
relevant output from gcc -O3 -S printf.c:
.LC0:
.string "Hello world!"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB24:
subq $8, %rsp
.LCFI0:
movl $10, %edi
call putchar
movl $.LC0, %edi
call puts
xorl %eax, %eax
addq $8, %rsp
ret
--
Bobby Bingham
Never trust atoms. Or anything made of atoms.
??????????????????????
More information about the ffmpeg-devel
mailing list