Jump to content

get_flag versus get_sdf


Niemand

Recommended Posts

Some while ago we had a discussion of the usage of these two supposedly identical calls. There was some feeling that get_sdf was somehow less trustworthy, although I was not able to identify why. Does anyone know of any actual differences between them, or are they really just the same as they should be?

Link to comment
Share on other sites

For consistency, I'd use get_flag, because there is no set_sdf or inc_sdf, just set_flag and inc_flag. I think JV just uses get_flag.

 

EDIT: According to the Wikibook reference:

Quote:
short get_flag(short a,short B)

Identical to get_sdf.

 

short get_sdf(short a,short B)

Returns SDF(a,B).

So I'm guessing JV just had get_sdf to begin with, then added get_flag for consistency, leaving get_sdf just in case some of his code still referenced it.

 

--------------------

Do not use for drying pets.

- Warning label on a microwave

Link to comment
Share on other sites

I'd never heard of (or experienced) problems with get_sdf. Then again I've never used it or seen anyone else use it. I've used get_flag from the start, pretty much for the reasons Dintiradan just said-- using set_flag and get_sdf is just stupid (Plus for some reason flag seems easier to type than sdf. Which makes no sense since it has an extra character-- maybe it's more natural for me since it's a real word?)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...