Opened 2 years ago

Closed 2 years ago

#13607 closed bug (invalid)

View.h: use of long instead of off_t

Reported by: korli Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

diff --git a/headers/os/interface/View.h b/headers/os/interface/View.h
index ddec3df..602d29c 100644
--- a/headers/os/interface/View.h
+++ b/headers/os/interface/View.h
@@ -514,7 +514,7 @@ public:
                        void                            DelayedInvalidate(bigtime_t delay,
                                                                        BRect invalRect);
 
-                       void                            SetDiskMode(char* filename, long offset);
+                       void                            SetDiskMode(char* filename, off_t offset);
 
                        void                            BeginPicture(BPicture* a_picture);
                        void                            AppendToPicture(BPicture* a_picture);
@@ -523,13 +523,13 @@ public:
                        void                            DrawPicture(const BPicture* a_picture);
                        void                            DrawPicture(const BPicture* a_picture,
                                                                        BPoint where);
-                       void                            DrawPicture(const char* filename, long offset,
+                       void                            DrawPicture(const char* filename, off_t offset,
                                                                        BPoint where);
                        void                            DrawPictureAsync(const BPicture* a_picture);
                        void                            DrawPictureAsync(const BPicture* a_picture,
                                                                        BPoint where);
                        void                            DrawPictureAsync(const char* filename,
-                                                                       long offset, BPoint where);
+                                                                       off_t offset, BPoint where);
 
                        void                            BeginLayer(uint8 opacity);
                        void                            EndLayer();

diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp
index 8f164a6..b1567bf 100644
--- a/src/kits/interface/View.cpp
+++ b/src/kits/interface/View.cpp
@@ -4098,7 +4098,7 @@ BView::EndLineArray()
 
 
 void
-BView::SetDiskMode(char* filename, long offset)
+BView::SetDiskMode(char* filename, off_t offset)
 {
        // TODO: implement
        // One BeBook version has this to say about SetDiskMode():
@@ -4280,7 +4280,7 @@ BView::DrawPicture(const BPicture* picture, BPoint where)
 
 
 void
-BView::DrawPicture(const char* filename, long offset, BPoint where)
+BView::DrawPicture(const char* filename, off_t offset, BPoint where)
 {
        if (!filename)
                return;
@@ -4317,7 +4317,7 @@ BView::DrawPictureAsync(const BPicture* picture, BPoint where)
 
 
 void
-BView::DrawPictureAsync(const char* filename, long offset, BPoint where)
+BView::DrawPictureAsync(const char* filename, off_t offset, BPoint where)
 {
        if (!filename)
                return;


In BeOS R4 SetDiskMode is documented as using off_t: http://download.unirc.eu/BeOS/Docs/BeBook/The%20Interface%20Kit/View.html#SetDiskMode()

In BeOS R5 DrawPicture* are documented as using off_t: https://www.haiku-os.org/legacy-docs/bebook/BView.html

Change History (4)

comment:1 Changed 2 years ago by korli

Resolution: fixed
Status: newclosed

Applied in hrev51296.

comment:2 Changed 2 years ago by axeld

This change is incorrect; the BeOS headers were using "long", so it looks the documentation was wrong here. As is, this breaks binary compatibility.

comment:3 Changed 2 years ago by korli

Resolution: fixed
Status: closedreopened

Thanks for checking, reverted in hrev51305.

comment:4 Changed 2 years ago by korli

Resolution: invalid
Status: reopenedclosed
Note: See TracTickets for help on using tickets.