[haiku-commits] Re: r33923 - haiku/trunk/src/apps/deskcalc

  • From: "Alexandre Deckner" <alex@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 06 Nov 2009 18:34:16 +0000

Concerning line braking and tabs, does function call parenthesis always
count as an expression level? Would the following examples be correct?
(using spaces for tabs intentionally for proper render in mail clients)
 
if (archive->FindData("rgbBaseColor", B_RGB_COLOR_TYPE,
        (const void**)&color, &size) < B_OK
    || size != sizeof(rgb_color)) {
    fBaseColor = (rgb_color){ 128, 128, 128, 255 };
    puts("Missing rgbBaseColor from CalcView archive!\n");
} else {
    fBaseColor = *color;
}

// Same but simpler condition

if (message->FindData("text/plain", B_MIME_TYPE,
        (const void**)&text, &numBytes) == B_OK) {
    BString temp;
    temp.Append(text, numBytes);
    fExpressionTextView->Insert(temp.String());
}

// In assignment

ret = archive->AddData("rgbDisplay", B_RGB_COLOR_TYPE,
        &fExpressionBGColor, sizeof(rgb_color));
                
        
// Parenthesis in simple assignment

lightness = (fExpressionBGColor.red
        + fExpressionBGColor.green + fExpressionBGColor.blue) / 3;


Regards,
Alex
                
        

Other related posts: