Remove pointless IntSwap function from utils.h

Originally committed to SVN as r4560.
This commit is contained in:
Thomas Goyne 2010-06-22 00:03:03 +00:00
parent e5eb91a269
commit fe9aa56d10
2 changed files with 8 additions and 36 deletions

View file

@ -37,9 +37,6 @@
#pragma once
///////////
// Headers
#ifndef AGI_PRE
#include <stdint.h>
@ -50,13 +47,9 @@
#include <wx/menuitem.h>
#endif
/// DOCME
typedef std::vector<std::pair<int,int> > IntPairVector;
///////////////////////
// Function prototypes
#ifndef __LINUX__
int64_t abs64(int64_t input);
#endif
@ -76,24 +69,15 @@ int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end
wxIcon BitmapToIcon(wxBitmap bmp);
void RestartAegisub();
//////////
// Macros
#ifndef MIN
/// DOCME
#define MIN(a,b) ((a)<(b))?(a):(b)
#endif
#ifndef MAX
/// DOCME
#define MAX(a,b) ((a)>(b))?(a):(b)
#endif
#ifndef MID
/// DOCME
#define MID(a,b,c) MAX((a),MIN((b),(c)))
#endif
@ -110,20 +94,6 @@ void RestartAegisub();
#endif
#endif
/// @brief Inlines
/// @param a
/// @param b
///
static inline void IntSwap(int &a,int &b) {
int c = a;
a = b;
b = c;
}
/// @brief Code taken from http://bob.allegronetwork.com/prog/tricks.html#clamp Clamp integer to range
/// @param x
/// @param min
@ -138,5 +108,3 @@ static FORCEINLINE int ClampSignedInteger32(int x,int min,int max) {
x += max;
return x;
}

View file

@ -35,6 +35,10 @@
#include "config.h"
#ifndef AGI_PRE
#include <utility>
#endif
#include "ass_dialogue.h"
#include "ass_file.h"
#include "subs_edit_box.h"
@ -112,8 +116,8 @@ void VisualToolClip::UpdateHold() {
curY2 = video.y;
// Make sure 1 is smaller than 2
if (curX1 > curX2) IntSwap(curX1,curX2);
if (curY1 > curY2) IntSwap(curY1,curY2);
if (curX1 > curX2) std::swap(curX1,curX2);
if (curY1 > curY2) std::swap(curY1,curY2);
// Limit to video area
curX1 = MID(0,curX1,video.w);
@ -202,8 +206,8 @@ void VisualToolClip::UpdateDrag(ClipCorner* feature) {
curY2 = features[3].y;
// Make sure p1 < p2
if (curX1 > curX2) IntSwap(curX1,curX2);
if (curY1 > curY2) IntSwap(curY1,curY2);
if (curX1 > curX2) std::swap(curX1,curX2);
if (curY1 > curY2) std::swap(curY1,curY2);
}
/// @brief Done dragging