Commit f2945e12 by Alan Mishchenko

Upgrading epd and mtr packages to be compatible with the latest release of CUDD 2.4.2

parent e3f2dde1
......@@ -57,9 +57,9 @@ ABC_NAMESPACE_HEADER_START
/* Constant declarations */
/*---------------------------------------------------------------------------*/
#define EPD_MAX_BIN 1023
#define EPD_MAX_DEC 308
#define EPD_EXP_INF 0x7ff
#define EPD_MAX_BIN 1023
#define EPD_MAX_DEC 308
#define EPD_EXP_INF 0x7ff
/*---------------------------------------------------------------------------*/
/* Structure declarations */
......@@ -74,15 +74,15 @@ ABC_NAMESPACE_HEADER_START
SeeAlso []
******************************************************************************/
#ifdef EPD_BIG_ENDIAN
struct IeeeDoubleStruct { /* BIG_ENDIAN */
#ifdef EPD_BIG_ENDIAN
struct IeeeDoubleStruct { /* BIG_ENDIAN */
unsigned int sign: 1;
unsigned int exponent: 11;
unsigned int mantissa0: 20;
unsigned int mantissa1: 32;
};
#else
struct IeeeDoubleStruct { /* LITTLE_ENDIAN */
struct IeeeDoubleStruct { /* LITTLE_ENDIAN */
unsigned int mantissa1: 32;
unsigned int mantissa0: 20;
unsigned int exponent: 11;
......@@ -99,8 +99,8 @@ struct IeeeDoubleStruct { /* LITTLE_ENDIAN */
SeeAlso []
******************************************************************************/
#ifdef EPD_BIG_ENDIAN
struct IeeeNanStruct { /* BIG_ENDIAN */
#ifdef EPD_BIG_ENDIAN
struct IeeeNanStruct { /* BIG_ENDIAN */
unsigned int sign: 1;
unsigned int exponent: 11;
unsigned int quiet_bit: 1;
......@@ -108,7 +108,7 @@ struct IeeeNanStruct { /* BIG_ENDIAN */
unsigned int mantissa1: 32;
};
#else
struct IeeeNanStruct { /* LITTLE_ENDIAN */
struct IeeeNanStruct { /* LITTLE_ENDIAN */
unsigned int mantissa1: 32;
unsigned int mantissa0: 19;
unsigned int quiet_bit: 1;
......@@ -127,14 +127,14 @@ struct IeeeNanStruct { /* LITTLE_ENDIAN */
******************************************************************************/
union EpTypeUnion {
double value;
struct IeeeDoubleStruct bits;
struct IeeeNanStruct nan;
double value;
struct IeeeDoubleStruct bits;
struct IeeeNanStruct nan;
};
struct EpDoubleStruct {
union EpTypeUnion type;
int exponent;
union EpTypeUnion type;
int exponent;
};
/*---------------------------------------------------------------------------*/
......
......@@ -96,20 +96,20 @@ ABC_NAMESPACE_HEADER_START
#endif
/* Flag definitions */
#define MTR_DEFAULT 0x00000000
#define MTR_DEFAULT 0x00000000
#define MTR_TERMINAL 0x00000001
#define MTR_SOFT 0x00000002
#define MTR_FIXED 0x00000004
#define MTR_NEWNODE 0x00000008
#define MTR_SOFT 0x00000002
#define MTR_FIXED 0x00000004
#define MTR_NEWNODE 0x00000008
/* MTR_MAXHIGH is defined in such a way that on 32-bit and 64-bit
** machines one can cast a value to (int) without generating a negative
** number.
*/
#if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
#define MTR_MAXHIGH (((MtrHalfWord) ~0) >> 1)
#define MTR_MAXHIGH (((MtrHalfWord) ~0) >> 1)
#else
#define MTR_MAXHIGH ((MtrHalfWord) ~0)
#define MTR_MAXHIGH ((MtrHalfWord) ~0)
#endif
......@@ -150,8 +150,8 @@ typedef struct MtrNode {
/*---------------------------------------------------------------------------*/
/* Flag manipulation macros */
#define MTR_SET(node, flag) (node->flags |= (flag))
#define MTR_RESET(node, flag) (node->flags &= ~ (flag))
#define MTR_SET(node, flag) (node->flags |= (flag))
#define MTR_RESET(node, flag) (node->flags &= ~ (flag))
#define MTR_TEST(node, flag) (node->flags & (flag))
......
......@@ -7,20 +7,20 @@
Synopsis [Basic manipulation of multiway branching trees.]
Description [External procedures included in this module:
<ul>
<li> Mtr_AllocNode()
<li> Mtr_DeallocNode()
<li> Mtr_InitTree()
<li> Mtr_FreeTree()
<li> Mtr_CopyTree()
<li> Mtr_MakeFirstChild()
<li> Mtr_MakeLastChild()
<li> Mtr_CreateFirstChild()
<li> Mtr_CreateLastChild()
<li> Mtr_MakeNextSibling()
<li> Mtr_PrintTree()
</ul>
]
<ul>
<li> Mtr_AllocNode()
<li> Mtr_DeallocNode()
<li> Mtr_InitTree()
<li> Mtr_FreeTree()
<li> Mtr_CopyTree()
<li> Mtr_MakeFirstChild()
<li> Mtr_MakeLastChild()
<li> Mtr_CreateFirstChild()
<li> Mtr_CreateLastChild()
<li> Mtr_MakeNextSibling()
<li> Mtr_PrintTree()
</ul>
]
SeeAlso [cudd package]
......@@ -60,7 +60,7 @@
******************************************************************************/
#include "util.h"
#include "util_hack.h"
#include "mtrInt.h"
ABC_NAMESPACE_IMPL_START
......@@ -119,7 +119,7 @@ Mtr_AllocNode(void)
{
MtrNode *node;
node = ALLOC(MtrNode,1);
node = ABC_ALLOC(MtrNode,1);
return node;
} /* Mtr_AllocNode */
......@@ -140,7 +140,7 @@ void
Mtr_DeallocNode(
MtrNode * node /* node to be deallocated */)
{
FREE(node);
ABC_FREE(node);
return;
} /* end of Mtr_DeallocNode */
......@@ -224,18 +224,18 @@ Mtr_CopyTree(
if (copy == NULL) return(NULL);
copy->parent = copy->elder = copy->child = copy->younger = NULL;
if (node->child != NULL) {
copy->child = Mtr_CopyTree(node->child, expansion);
if (copy->child == NULL) {
Mtr_DeallocNode(copy);
return(NULL);
}
copy->child = Mtr_CopyTree(node->child, expansion);
if (copy->child == NULL) {
Mtr_DeallocNode(copy);
return(NULL);
}
}
if (node->younger != NULL) {
copy->younger = Mtr_CopyTree(node->younger, expansion);
if (copy->younger == NULL) {
Mtr_FreeTree(copy);
return(NULL);
}
copy->younger = Mtr_CopyTree(node->younger, expansion);
if (copy->younger == NULL) {
Mtr_FreeTree(copy);
return(NULL);
}
}
copy->flags = node->flags;
copy->low = node->low * expansion;
......@@ -243,11 +243,11 @@ Mtr_CopyTree(
copy->index = node->index * expansion;
if (copy->younger) copy->younger->elder = copy;
if (copy->child) {
MtrNode *auxnode = copy->child;
while (auxnode != NULL) {
auxnode->parent = copy;
auxnode = auxnode->younger;
}
MtrNode *auxnode = copy->child;
while (auxnode != NULL) {
auxnode->parent = copy;
auxnode = auxnode->younger;
}
}
return(copy);
......@@ -275,9 +275,9 @@ Mtr_MakeFirstChild(
child->elder = NULL;
if (parent->child != NULL) {
#ifdef MTR_DEBUG
assert(parent->child->elder == NULL);
assert(parent->child->elder == NULL);
#endif
parent->child->elder = child;
parent->child->elder = child;
}
parent->child = child;
return;
......@@ -306,14 +306,14 @@ Mtr_MakeLastChild(
child->younger = NULL;
if (parent->child == NULL) {
parent->child = child;
child->elder = NULL;
parent->child = child;
child->elder = NULL;
} else {
for (node = parent->child;
node->younger != NULL;
node = node->younger);
node->younger = child;
child->elder = node;
for (node = parent->child;
node->younger != NULL;
node = node->younger);
node->younger = child;
child->elder = node;
}
child->parent = parent;
return;
......@@ -398,7 +398,7 @@ Mtr_MakeNextSibling(
{
second->younger = first->younger;
if (first->younger != NULL) {
first->younger->elder = second;
first->younger->elder = second;
}
second->parent = first->parent;
first->younger = second;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment