[gst-devel] Re: [gst-cvs] company gst-plugins: gst-plugins/gst/mpegstream/

Benjamin Otte in7y118 at public.uni-hamburg.de
Thu May 22 13:51:13 CEST 2003


On Thu, 22 May 2003, Ronald Bultje wrote:

I thought about that for a moment and decided against them because the
longest range would have been 32 entries and I was under the impression
that that would be worse then using nested ifs.
I don't care about it very much though, so feel free to change it.
Brian assured me that mpegdemux is the only plugin we have that uses this
btw.
So feel free to do it the other way if you prefer that, just don't use
ranges :)

Benjamin


> Hey Benjamin,
>
> At 03:42 AM 5/22/03 -0700, you wrote:
> >case ranges is a gcc extension, removing them
> [..]
> >+      } else if (stream_id >= 0xE0 && stream_id < 0xF0) {
> >-	case 0xE0 ... 0xEF:
> [etc.]
>
> This is... Hideous! Stop this, please. if/else things are
> meant for one- or two-order comparisons, not for full lists.
> Use multiple case statements instead:
>
> case 0xE0: case 0xE1:
> [etc.]
> case 0xEE: case 0xEF:
>   ..
>   break;
>
> That might be a few more lines of code, but it'll actually
> look good. multi-order if/else stuff looks *horrible*, imho.
>
> Ronald
>





More information about the gstreamer-devel mailing list