Remove usage of some deprecated C++ features

Change-Id: I8faff44ca5fbce9b56ce135ebd070be6bd4c1c78
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6799
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
PulkoMandy 2023-08-07 20:58:25 +02:00 committed by Adrien Destugues
parent cc6365c7aa
commit 9c8f4ac5d6
4 changed files with 18 additions and 6 deletions

View File

@ -103,6 +103,14 @@ PCL6Driver::NextBand(BBitmap* bitmap, BPoint* offset)
{
DBGMSG(("> nextBand\n"));
#if __GNUC__ <= 2
typedef auto_ptr<Rasterizer> RasterizerPointer;
typedef auto_ptr<DeltaRowCompressor> DeltaRowCompressorPointer;
#else
typedef shared_ptr<Rasterizer> RasterizerPointer;
typedef shared_ptr<DeltaRowCompressor> DeltaRowCompressorPointer;
#endif
try {
int y = (int)offset->y;
@ -118,7 +126,7 @@ PCL6Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} else
rasterizer = new MonochromeRasterizer(fHalftone);
auto_ptr<Rasterizer> _rasterizer(rasterizer);
RasterizerPointer _rasterizer(rasterizer);
bool valid = rasterizer->SetBitmap((int)offset->x, (int)offset->y,
bitmap, GetPageHeight());
@ -135,7 +143,7 @@ PCL6Driver::NextBand(BBitmap* bitmap, BPoint* offset)
return false;
}
}
auto_ptr<DeltaRowCompressor>_deltaRowCompressor(deltaRowCompressor);
DeltaRowCompressorPointer _deltaRowCompressor(deltaRowCompressor);
int deltaRowSize = 0;
// remember position

View File

@ -84,7 +84,7 @@ private:
int virtual Compare(const void *key, const void* item) = 0;
};
struct comparator : public binary_function<const void*, const void*, bool>
struct comparator
{
comparator(AbstractPointerListHelper* helper) : helper(helper) {}

View File

@ -269,7 +269,12 @@ FavoritesMenu::AddNextItem()
// don't add folders that are already in the GoTo section
if (find_if(fUniqueRefCheck.begin(), fUniqueRefCheck.end(),
bind2nd(std::equal_to<entry_ref>(), ref))
#if __GNUC__ <= 2
bind2nd(std::equal_to<entry_ref>(), ref)
#else
[ref](entry_ref compared) { return ref == compared; }
#endif
)
!= fUniqueRefCheck.end()) {
continue;
}

View File

@ -9548,8 +9548,7 @@ PoseCompareAddWidgetBinder(const BPose* p1, const BPose* p2,
}
struct PoseComparator : public std::binary_function<const BPose*,
const BPose*, bool>
struct PoseComparator
{
PoseComparator(BPoseView* poseView): fPoseView(poseView) { }