Click here to Skip to main content
15,911,360 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: IMHO Pin
led mike4-Oct-07 9:43
led mike4-Oct-07 9:43 
QuestionRe: IMHO Pin
Maximilien4-Oct-07 9:55
Maximilien4-Oct-07 9:55 
AnswerRe: IMHO Pin
marc.bellario4-Oct-07 10:32
marc.bellario4-Oct-07 10:32 
AnswerRe: IMHO Pin
Hamid_RT4-Oct-07 10:09
Hamid_RT4-Oct-07 10:09 
GeneralRe: IMHO Pin
ThatsAlok4-Oct-07 19:21
ThatsAlok4-Oct-07 19:21 
GeneralRe: IMHO Pin
marc.bellario5-Oct-07 4:52
marc.bellario5-Oct-07 4:52 
AnswerRe: IMHO Pin
ThatsAlok4-Oct-07 19:21
ThatsAlok4-Oct-07 19:21 
QuestionJust a matter of style.. [modified] Pin
bigdenny2004-Oct-07 8:36
bigdenny2004-Oct-07 8:36 
Hey guys,

I encountered this code at one great CP article.
BOOL CAESEncRegKey::SetKey(const BYTE *cbKey, UINT nLength)
{
    BOOL bResult = FALSE;

    ASSERT( CryptoPP::AES::DEFAULT_KEYLENGTH == nLength );
    ASSERT( NULL != cbKey );

    if( CryptoPP::AES::DEFAULT_KEYLENGTH == nLength && NULL != cbKey ) {
    
        _EncKey = cbKey;

        bResult = TRUE;
    }

    return bResult;
}

I just wonder whether rewriting it in the following style, looks better ?

BOOL CAESEncRegKey::SetKey(const BYTE *cbKey, UINT nLength)
{  
    if( CryptoPP::AES::DEFAULT_KEYLENGTH != nLength || NULL == cbKey ) 
    {
      ASSERT(FALSE);
      return false;
    } 

    _EncKey = cbKey;
    return true;
}


What do you think ? Any comments..


-- modified at 15:08 Thursday 4th October, 2007
AnswerRe: Just a matter of style.. Pin
Maximilien4-Oct-07 8:54
Maximilien4-Oct-07 8:54 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 9:09
bigdenny2004-Oct-07 9:09 
AnswerRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 9:17
Mark Salsbery4-Oct-07 9:17 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 9:32
bigdenny2004-Oct-07 9:32 
GeneralRe: Just a matter of style.. Pin
David Crow4-Oct-07 10:21
David Crow4-Oct-07 10:21 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 10:38
bigdenny2004-Oct-07 10:38 
GeneralRe: Just a matter of style.. Pin
led mike4-Oct-07 9:42
led mike4-Oct-07 9:42 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 9:47
Mark Salsbery4-Oct-07 9:47 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 10:11
bigdenny2004-Oct-07 10:11 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 10:22
Mark Salsbery4-Oct-07 10:22 
GeneralRe: Just a matter of style.. [modified] Pin
bigdenny2004-Oct-07 10:39
bigdenny2004-Oct-07 10:39 
GeneralRe: Just a matter of style.. Pin
El Corazon4-Oct-07 10:51
El Corazon4-Oct-07 10:51 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 11:00
Mark Salsbery4-Oct-07 11:00 
GeneralRe: Just a matter of style.. Pin
El Corazon4-Oct-07 13:34
El Corazon4-Oct-07 13:34 
AnswerRe: Just a matter of style.. Pin
David Crow4-Oct-07 9:21
David Crow4-Oct-07 9:21 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 9:31
bigdenny2004-Oct-07 9:31 
GeneralRe: Just a matter of style.. Pin
David Crow4-Oct-07 9:46
David Crow4-Oct-07 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.