[Xcb] xcb flame, for fun

Barton C Massey bart at cs.pdx.edu
Sun Jan 1 01:23:07 PST 2006


Yes, of course include in the demos!  Great work---looks
pretty, and demonstrates that a port of an Xlib app needn't
be *too* onerous.  Passes -O4 -Wall, which is nice.

Thanks much for doing this!

	Bart

P.S.  If you want an easy fix, rename powerof() to ilog2()
or somesuch.  That function returns the floor of the log
base 2 of its argument.  Also, since it's not use in an
inner loop, let's use a simpler algorithm.  Even if it was,
the iterated-if-test code can't be fast on a modern
machine, and it doesn't exit early, so...

  int
  ilog2 (unsigned int n)
  {
    int p = -1;
    assert(n > 0);
    while(n > 0) {
      p++;
      n >>= 1;
    }
    return p;
  }

There are faster ways, but this one is good for this code.


In message <Pine.LNX.4.51.0512311228230.6754 at cartan.iecn.u-nancy.fr> you wrote:
>   This message is in MIME format.  The first part should be readable text,
>   while the remaining parts are likely unreadable without MIME-aware tools.
>   Send mail to mime at docserver.cac.washington.edu for more info.
> 
> --851511594-1261939651-1136028764=:6754
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> 
> 
> hey,
> 
> i was playing with xcb and xflames. Here is xcb flame :)
> 
> do you think it's interesting to put it in xcb-demo/test ? The prog needs
> some love, but it should work (in particular, it's not optimized at all,
> it does not use mit shm, i think that there are some unneeded variables,
> etc...)
> 
> Vincent
> --851511594-1261939651-1136028764=:6754
> Content-Type: TEXT/x-csrc; name="xcb_flame.c"
> Content-Transfer-Encoding: BASE64
> Content-ID: <Pine.LNX.4.51.0512311232440.6754 at cartan.iecn.u-nancy.fr>
> Content-Description: 
> Content-Disposition: attachment; filename="xcb_flame.c"
> 
> LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
> KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KLyogICAgICAg
> ICAgICAgICAgICAgICAgICAgICAgICAgICAgWENCRmxhbWUgICAgICAgICAg
> ICAgICAgICAgICAgICAgICAgICAgICAqLw0KLyoqKioqKioqKioqKioqKioq


More information about the Xcb mailing list