[haiku-commits] Re: haiku: hrev45618 - in src: apps/diskprobe apps/mail apps/codycam kits/mail servers/bluetooth

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 04 May 2013 18:02:42 +0200

On 05/04/2013 03:31 PM, korli@xxxxxxxxxxxxxxxx wrote:
diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.cpp 
b/src/apps/mediaplayer/playlist/PlaylistListView.cpp
index df2e048..7c80341 100644
--- a/src/apps/mediaplayer/playlist/PlaylistListView.cpp
+++ b/src/apps/mediaplayer/playlist/PlaylistListView.cpp
@@ -425,7 +425,7 @@ PlaylistListView::Randomize()
                int32 index = CurrentSelection(count);
                if (index < 0)
                        break;
-               if (!indices.AddItem((void*)index))
+               if (!indices.AddItem((void*)(long)index))

As Ingo corrected me, it should actually be addr_t to make sure it's the same size as void*.

diff --git a/src/apps/diskprobe/DataEditor.cpp 
b/src/apps/diskprobe/DataEditor.cpp
index 2fd85a2..72701cf 100644
--- a/src/apps/diskprobe/DataEditor.cpp
+++ b/src/apps/diskprobe/DataEditor.cpp
@@ -236,8 +236,10 @@ void
[...]
@@ -263,8 +265,10 @@ void
[...]
@@ -307,8 +311,8 @@ ReplaceChange::Merge(DataChange *_change)
[...]
@@ -560,7 +564,7 @@ DataEditor::Replace(off_t offset, const uint8 *data, size_t 
length)

        if (offset >= fSize)
                return B_BAD_VALUE;
-       if (offset + length > fSize)
+       if ((offset + (off_t)length) > fSize)
                length = fSize - offset;

        if (fNeedsUpdate) {
@@ -705,7 +709,7 @@ DataEditor::Save()

                // don't try to change the file size
                size_t size = fRealViewSize;
-               if (fRealViewOffset + fRealViewSize > fSize)
+               if ((fRealViewOffset + (off_t)fRealViewSize) > (off_t)fSize)

You have introduced those extra parentheses at quite a few places - they should be completely superfluous, though.

Bye,
   Axel


Other related posts: