Bad style…

This is a peculiar piece of code from the MiniSpy sample of the IFS kit…

SpyPostOperationCallback (
__in PVOID CompletionContext,


// Log reparse tag information if specified.

if (tagData = Data->TagData) {


It’s not a bug, but it would be much clearer to rewrite it as…

if (NULL != Data->TagData) {
tagData = Data->TagData;

This entry was posted in Programming. Bookmark the permalink.

2 Responses to Bad style…

  1. Rich says:

    Does tagData get initialized to NULL somewhere in the first ellipses or do you want to switch those two lines? Or is it only used inside the if clause…

    On another note, though I’m ever one to come to things late in the game, you’re right the mars volta is really good.

  2. Jeremy says:

    tagData doesn’t get initialized until the if() clause, and it’s not used outside that same clause after that.

    Some of the samples for that part of the DDK are pretty old so I think things like that are leftovers from someone having to write “optimized” code better than the compilers could at that point.

    And yeah, great band.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s