Use std::swap instead of inline swap

This commit is contained in:
Kp 2014-08-20 01:50:40 +00:00
parent c102a507df
commit 388405d04a
2 changed files with 3 additions and 8 deletions

View file

@ -132,7 +132,7 @@ void clip_line(g3s_point **p0,g3s_point **p1,ubyte codes_or)
if (codes_or & plane_flag) {
if ((*p0)->p3_codes & plane_flag)
{g3s_point *t=*p0; *p0=*p1; *p1=t;} //swap!
std::swap(*p0, *p1);
old_p1 = *p1;
@ -197,7 +197,6 @@ static int clip_plane(int plane_flag,g3s_point **src,g3s_point **dest,int *nv,g3
g3s_point **clip_polygon(g3s_point **src,g3s_point **dest,int *nv,g3s_codes *cc)
{
int plane_flag;
g3s_point **t;
for (plane_flag=1;plane_flag<16;plane_flag<<=1)
@ -208,8 +207,7 @@ g3s_point **clip_polygon(g3s_point **src,g3s_point **dest,int *nv,g3s_codes *cc)
if (cc->uand) //clipped away
return dest;
t = src; src = dest; dest = t;
std::swap(src, dest);
}
return src; //we swapped after we copied

View file

@ -1059,7 +1059,6 @@ void draw_all_edges(automap *am)
// Sort the bright ones using a shell sort
{
int t;
int i, j, incr, v1, v2;
incr = nbright / 2;
@ -1073,9 +1072,7 @@ void draw_all_edges(automap *am)
if (Segment_points[v1].p3_z < Segment_points[v2].p3_z) {
// If not in correct order, them swap 'em
t=am->drawingListBright[j+incr];
am->drawingListBright[j+incr]=am->drawingListBright[j];
am->drawingListBright[j]=t;
std::swap(am->drawingListBright[j+incr], am->drawingListBright[j]);
j -= incr;
}
else