summaryrefslogtreecommitdiffstats
path: root/src/bool
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-10-03 21:49:18 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-10-03 21:49:18 -0700
commit56d3d7cd22f761004139a0512681eac57e638cfc (patch)
tree524b94bee7e1dfbdf14c8ff1dbba271a97abaf13 /src/bool
parent63c95405439b464f6d801e68c15f767bc6336637 (diff)
downloadabc-56d3d7cd22f761004139a0512681eac57e638cfc.tar.gz
abc-56d3d7cd22f761004139a0512681eac57e638cfc.tar.bz2
abc-56d3d7cd22f761004139a0512681eac57e638cfc.zip
C++ portability changes.
Diffstat (limited to 'src/bool')
-rw-r--r--src/bool/lucky/luckyInt.h28
-rw-r--r--src/bool/lucky/luckySwapIJ.c2
2 files changed, 17 insertions, 13 deletions
diff --git a/src/bool/lucky/luckyInt.h b/src/bool/lucky/luckyInt.h
index 4801b961..f236693c 100644
--- a/src/bool/lucky/luckyInt.h
+++ b/src/bool/lucky/luckyInt.h
@@ -24,13 +24,16 @@
#include <math.h>
#include <time.h>
-
// comment out this line to run Lucky Code outside of ABC
#define _RUNNING_ABC_
#ifdef _RUNNING_ABC_
+
#include "misc/util/abc_global.h"
+#include "lucky.h"
+
#else
+
#define ABC_NAMESPACE_HEADER_START
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_IMPL_START
@@ -42,6 +45,18 @@ typedef unsigned __int64 word;
#define inline __inline // compatible with MS VS 6.0
#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
// #define LUCKY_VERIFY
+
+typedef struct
+{
+ int varN;
+ int* swapArray;
+ int swapCtr;
+ int totalSwaps;
+ int* flipArray;
+ int flipCtr;
+ int totalFlips;
+}permInfo;
+
#endif
@@ -71,17 +86,6 @@ typedef struct
int positionToSwap2;
} swapInfo;
-typedef struct
-{
- int varN;
- int* swapArray;
- int swapCtr;
- int totalSwaps;
- int* flipArray;
- int flipCtr;
- int totalFlips;
-}permInfo;
-
static inline void TimePrint( char* Message )
{
diff --git a/src/bool/lucky/luckySwapIJ.c b/src/bool/lucky/luckySwapIJ.c
index 9901f9cb..d1170f45 100644
--- a/src/bool/lucky/luckySwapIJ.c
+++ b/src/bool/lucky/luckySwapIJ.c
@@ -76,7 +76,7 @@ void swap_ij_case3( word* f,int totalVars, int i, int j)
shift = (wwj - wwi)/2;
WORDS_IN_TT = Kit_TruthWordNum_64bit(totalVars);
SizeOfBlock = sizeof(word)*wwi/2;
- temp = malloc(SizeOfBlock);
+ temp = (word *)malloc(SizeOfBlock);
for(y=wwj/2; y<WORDS_IN_TT; y+=wwj)
for(x=y-shift; x<y; x+=wwi)
{