From: Don Armstrong Date: Fri, 28 Mar 2014 20:59:53 +0000 (-0700) Subject: redfine swap to use typeof instead X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d6e40359c3e9ec0dce7d46a9462ff76fb122b4bd;p=genome.git redfine swap to use typeof instead --- diff --git a/genome.cpp b/genome.cpp index 9924018..f50dd92 100644 --- a/genome.cpp +++ b/genome.cpp @@ -77,7 +77,7 @@ static int BUFFER=1500; static int INCREMENT=1000; #define BLOCKSIZE 128 -#define SWAP(tmp,a,b) tmp=a; a=b; b=tmp; +#define SWAP(x,y) do {typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0) static vector< vector< vector > > chromosome; static int * fragmentLength; @@ -174,18 +174,15 @@ void FreeIntPtrMatrix(int *** & matrix, int rows){ void NewGeneration(){ - int *** ptrmatrix, * vector; - bool * boolvector; - // for(int i=0;i