Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"06-02-10 - Some random Win64 junk"

6 Comments -

1 – 6 of 6
Blogger Scott Graham said...

I think x64 cl is in the right place, the compiler is still a 32 bit app, it just cross-compiles to x64.

June 4, 2010 at 6:03 PM

Blogger Scott Graham said...

(And agreed that size_t unsigned is super fucking annoying)

June 4, 2010 at 6:06 PM

Blogger cbloom said...

"I think x64 cl is in the right place, the compiler is still a 32 bit app, it just cross-compiles to x64. "

I don't think so. The one in x86_amd64 is a cross-compiler. The one in "amd64" is native 64 bit.

June 4, 2010 at 9:37 PM

Anonymous Anonymous said...

Unsigned integers are wrong for just about anything except if you're doing bit operations.

My go-to demonstration of this is what happens when someone gives you an unsigned N and you want to do a for loop. for(uint x=0; x < N; ++x) does what you want for increasing, but for decreasing, for(uint x=N-1; x >= 0; --x) does not, instead you have to do crap with postdecrements in the comparison or something.

June 6, 2010 at 12:18 AM

Anonymous Anonymous said...

Which means you really want the loop index to be signed, which means you really want the variables you're comparing it to or initializing it from to be signed.

June 6, 2010 at 12:19 AM

Blogger castano said...

what about this?

for(uint x=N-1; x < N; --x)

one of the nice things about unsigned variables is that when the valid range is [0, N] you only have to do one comparison to check whether the value is inside.

June 6, 2010 at 10:50 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.