• (cs)
    Alex Papadimoulis:
    SQWORD GetGlobalTime( const TCHAR* Filename )
    {
    //return greenwich mean time as expressed in nanoseconds since the
    //creation of the universe. time is expressed in meters, so
    //divide by the speed of light to obtain seconds. assumes the
    //speed of light in a vacuum is constant. the file specified by
    //Filename is assumed to be in your reference frame, otherwise you
    //must transform the result by the path integral of the minkowski
    //metric tensor in order to obtain the correct result.

    return Time;
    }


    this code comes from the unreal tournament source code.
     
  • tmmyk (unregistered) in reply to Delfi
    Delfi:

    this code comes from the unreal tournament source code.
     


    [image]
  • Alvie (unregistered) in reply to Mr Reuben Red
    Alex Papadimoulis:
    Now I'm scared. This morning I wrote:
    # Is this necessary?
    # probably not but what the hell
    # Better safe than sory
    $script = 0 unless ($script);



    This can be perfectly valid.

    Would be perfectly valid if:

        $script = 0 unless (defined($script));

    or

        $script||=0; #(to some extent)




  • imbrius (unregistered) in reply to marvin_rabbit

    Wait, Self-Documenting or self-deprecating?

  • Nobin (unregistered)
    void sysDraw::close()
    {
      // Is this necessary????
      // probably not but what the hell.
      // better safe than sorry
      if (!this) return;                 
      
      // ... snip ...
    }
    

    you can actually executed that return by:

    sysDraw* h = NULL:
    h->close()
    

    that will actually compile and run....

  • oksupra.com (unregistered)

    Supra shoes are so popular all over the world. Whatever you take on Supra being in the Supra Skytop Shoes market. Now Supra Strapped Shoes also very popular attention. It is nice that they actually took the time to make Supra Skate Shoes that work well. Supra shoes is a brand that has been inspired, designed and marketed by passionate individuals. We have brought to you the fullest selection of Supra footwear at cheapest price. Overload Skateshop carries a wide range of Supra Shoes to fit your 9-stair kickflips.

  • James Sweet (unregistered)

    Regarding the "if(!this)"... yes, it can happen in C++. If the function is not virtual, it will just be called, even if the object is a null pointer.

    Probably would be better to figure it out another way, but... If the developer has inherited a messy/buggy system, where sometimes close() gets called on a null pointer, that is a perfectly reasonable solution.

  • (cs) in reply to The BitShifter

    AAAAGH!

    You dont need any of that fancy stuff...

    T *p = NULL; p->func();

    This WILL properly call the member function [it will only be "broken" if func is virtual), so checking (this!=null) is actually valid

Leave a comment on “A Collection Of Comments”

Log In or post as a guest

Replying to comment #:

« Return to Article