[haiku-commits] Re: haiku: hrev46817 - src/servers/app src/kits/interface headers/private/interface headers

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 05 Feb 2014 10:35:49 +0100

Hi,

On 05.02.2014 10:00, Axel Dörfler wrote:
@@ -1805,12 +1825,10 @@ BView::Origin() const
                fOwner->fLink->StartMessage(AS_VIEW_GET_ORIGIN);

                int32 code;
-             if (fOwner->fLink->FlushWithReply(code) == B_OK
-                     && code == B_OK) {
+             if (fOwner->fLink->FlushWithReply(code) == B_OK && code == B_OK)
                        fOwner->fLink->Read(&fState->origin);

-                     fState->valid_flags |= B_VIEW_ORIGIN_BIT;
-             }
+             fState->valid_flags |= B_VIEW_ORIGIN_BIT;

Are you sure you want to set the valid bit when the reply failed?

+BAffineTransform
+BView::Transform() const
+{
+     if (!fState->IsValid(B_VIEW_TRANSFORM_BIT) && fOwner != NULL) {
+             _CheckLockAndSwitchCurrent();
+
+             fOwner->fLink->StartMessage(AS_VIEW_GET_TRANSFORM);
+
+             int32 code;
+             if (fOwner->fLink->FlushWithReply(code) == B_OK && code == B_OK)
+                     fOwner->fLink->Read(&fState->transform);
+
+             fState->valid_flags |= B_VIEW_TRANSFORM_BIT;

Same again here.

I noticed that is was done inconsistently in the file. In some places, it is set only on success, in others not. The idea could be that when it failed, something is very wrong, and the system should probably not be stressed even more by repeatedly trying to get the value from the server. In any case, I started to make it consistent (change the bit only on success), then reverted and changed it in Origin(), the only place I noticed where it was done so. I can change it either way, but I didn't want to make too many unrelated changes in that commit. What do you think after I explained one possible rational?

Best regards,
-Stephan



Other related posts: