Permalink
Browse files

STARTREK: Replace min & max with MIN & MAX

  • Loading branch information...
Drenn1 authored and sev- committed Jul 28, 2018
1 parent be4174d commit 982502650f8b6378f30dfbd324cd7881f6e30ab0
Showing with 5 additions and 15 deletions.
  1. +4 −4 engines/startrek/common.cpp
  2. +0 −10 engines/startrek/common.h
  3. +1 −1 engines/startrek/textbox.cpp
@@ -27,10 +27,10 @@
namespace StarTrek {

Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) {
uint16 l = min(r1.left, r2.left);
uint16 t = min(r1.top, r2.top);
uint16 r = max(r1.right, r2.right);
uint16 b = max(r1.bottom, r2.bottom);
uint16 l = MIN(r1.left, r2.left);
uint16 t = MIN(r1.top, r2.top);
uint16 r = MAX(r1.right, r2.right);
uint16 b = MAX(r1.bottom, r2.bottom);

return Common::Rect(l, t, r, b);
}
@@ -32,16 +32,6 @@ class Serializer;

namespace StarTrek {

template<class T>
T min(T a, T b) {
return a < b ? a : b;
}

template<class T>
T max(T a, T b) {
return a > b ? a : b;
}

Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
void serializeRect(Common::Rect rect, Common::Serializer &ser);

@@ -142,7 +142,7 @@ String StarTrekEngine::centerTextboxHeader(String headerText) {
text[TEXT_CHARS_PER_LINE] = '\0';

int strlen = headerText.size();
strlen = min(strlen, TEXT_CHARS_PER_LINE);
strlen = MIN(strlen, TEXT_CHARS_PER_LINE);

memcpy(text + (TEXT_CHARS_PER_LINE - strlen) / 2, headerText.c_str(), strlen);

0 comments on commit 9825026

Please sign in to comment.