[Scummvm-git-logs] scummvm master -> c4942be17feb5195a2993770eeb030604e5c8b85
bluegr
noreply at scummvm.org
Fri Sep 20 16:05:33 UTC 2024
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a689ba0d95 COMMON: Replace NDEBUG define checks with RELEASE_BUILD
e6cc9416a3 DEVTOOLS: Replace NDEBUG define checks with RELEASE_BUILD
c4942be17f SCI: Replace NDEBUG define checks with RELEASE_BUILD
Commit: a689ba0d952a4ae1e43fd70ccfdfbe0c8941e1b7
https://github.com/scummvm/scummvm/commit/a689ba0d952a4ae1e43fd70ccfdfbe0c8941e1b7
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-09-20T19:05:29+03:00
Commit Message:
COMMON: Replace NDEBUG define checks with RELEASE_BUILD
Changed paths:
common/hashmap.h
diff --git a/common/hashmap.h b/common/hashmap.h
index 70e7550b8ee..70f00d9930f 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -451,7 +451,7 @@ template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
assert(newCapacity > _mask + 1);
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
const size_type old_size = _size;
#endif
const size_type old_mask = _mask;
@@ -484,9 +484,11 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity
_size++;
}
+#ifndef RELEASE_BUILD
// Perform a sanity check: Old number of elements should match the new one!
// This check will fail if some previous operation corrupted this hashmap.
assert(_size == old_size);
+#endif
delete[] old_storage;
Commit: e6cc9416a329ca426048aaeea54431daf3529b37
https://github.com/scummvm/scummvm/commit/e6cc9416a329ca426048aaeea54431daf3529b37
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-09-20T19:05:29+03:00
Commit Message:
DEVTOOLS: Replace NDEBUG define checks with RELEASE_BUILD
Changed paths:
devtools/create_mm/create_xeen/hashmap.h
devtools/create_titanic/hashmap.h
diff --git a/devtools/create_mm/create_xeen/hashmap.h b/devtools/create_mm/create_xeen/hashmap.h
index 944e0555bf0..2e0d6631be7 100644
--- a/devtools/create_mm/create_xeen/hashmap.h
+++ b/devtools/create_mm/create_xeen/hashmap.h
@@ -407,7 +407,7 @@ template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
assert(newCapacity > _mask+1);
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
const size_type old_size = _size;
#endif
const size_type old_mask = _mask;
@@ -440,9 +440,11 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity
_size++;
}
+#ifndef RELEASE_BUILD
// Perform a sanity check: Old number of elements should match the new one!
// This check will fail if some previous operation corrupted this hashmap.
assert(_size == old_size);
+#endif
delete[] old_storage;
diff --git a/devtools/create_titanic/hashmap.h b/devtools/create_titanic/hashmap.h
index caacbc3693b..8f39eb447fb 100644
--- a/devtools/create_titanic/hashmap.h
+++ b/devtools/create_titanic/hashmap.h
@@ -407,7 +407,7 @@ template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
assert(newCapacity > _mask+1);
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
const size_type old_size = _size;
#endif
const size_type old_mask = _mask;
@@ -440,9 +440,11 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity
_size++;
}
+#ifndef RELEASE_BUILD
// Perform a sanity check: Old number of elements should match the new one!
// This check will fail if some previous operation corrupted this hashmap.
assert(_size == old_size);
+#endif
delete[] old_storage;
Commit: c4942be17feb5195a2993770eeb030604e5c8b85
https://github.com/scummvm/scummvm/commit/c4942be17feb5195a2993770eeb030604e5c8b85
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-09-20T19:05:29+03:00
Commit Message:
SCI: Replace NDEBUG define checks with RELEASE_BUILD
Changed paths:
engines/sci/graphics/celobj32.cpp
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index 1c1d28d1451..85d71853f2e 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -105,7 +105,7 @@ void CelObj::deinit() {
template<bool FLIP, typename READER>
struct SCALER_NoScale {
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
const byte *_rowEdge;
#endif
const byte *_row;
@@ -125,13 +125,13 @@ struct SCALER_NoScale {
_row = _reader.getRow(y - _sourceY);
if (FLIP) {
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
_rowEdge = _row - 1;
#endif
_row += _lastIndex - (x - _sourceX);
assert(_row > _rowEdge);
} else {
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
_rowEdge = _row + _lastIndex + 1;
#endif
_row += x - _sourceX;
@@ -152,7 +152,7 @@ struct SCALER_NoScale {
template<bool FLIP, typename READER>
struct SCALER_Scale {
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
int16 _minX;
int16 _maxX;
#endif
@@ -167,7 +167,7 @@ struct SCALER_Scale {
SCALER_Scale(const CelObj &celObj, const Common::Rect &targetRect, const Common::Point &scaledPosition, const Ratio scaleX, const Ratio scaleY) :
_row(nullptr),
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
_minX(targetRect.left),
_maxX(targetRect.right - 1),
#endif
@@ -176,7 +176,7 @@ struct SCALER_Scale {
// decompress an entire line of source data when scaling
_reader(celObj, celObj._width),
_sourceBuffer() {
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
assert(_minX <= _maxX);
#endif
@@ -316,7 +316,7 @@ int16 SCALER_Scale<FLIP, READER>::_valuesY[kCelScalerTableSize];
struct READER_Uncompressed {
private:
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
int16 _sourceHeight;
#endif
const byte *_pixels;
@@ -324,7 +324,7 @@ private:
public:
READER_Uncompressed(const CelObj &celObj, const int16) :
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
_sourceHeight(celObj._height),
#endif
_sourceWidth(celObj._width) {
@@ -334,7 +334,7 @@ public:
if (numPixels < celObj._width * celObj._height) {
warning("%s is truncated", celObj._info.toString().c_str());
-#ifndef NDEBUG
+#ifndef RELEASE_BUILD
_sourceHeight = numPixels / celObj._width;
#endif
}
More information about the Scummvm-git-logs
mailing list