Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
cb439f2e
Commit
cb439f2e
authored
Aug 26, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix in Vec_IntInsert() and a couple of new APIs.
parent
41d18ca0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletions
+34
-1
src/base/cba/cbaPrs.h
+18
-0
src/misc/vec/vecInt.h
+1
-1
src/misc/vec/vecPtr.h
+15
-0
No files found.
src/base/cba/cbaPrs.h
View file @
cb439f2e
...
...
@@ -217,6 +217,24 @@ static inline void Prs_ManFinalizeNtk( Prs_Man_t * p )
p
->
pNtk
=
NULL
;
}
static
inline
int
Prs_NtkNewStrId
(
Prs_Ntk_t
*
pNtk
,
const
char
*
format
,
...
)
{
Abc_Nam_t
*
p
=
pNtk
->
pStrs
;
Vec_Str_t
*
vBuf
=
Abc_NamBuffer
(
p
);
int
nAdded
,
nSize
=
1000
;
va_list
args
;
va_start
(
args
,
format
);
Vec_StrGrow
(
vBuf
,
Vec_StrSize
(
vBuf
)
+
nSize
);
nAdded
=
vsnprintf
(
Vec_StrLimit
(
vBuf
),
nSize
,
format
,
args
);
if
(
nAdded
>
nSize
)
{
Vec_StrGrow
(
vBuf
,
Vec_StrSize
(
vBuf
)
+
nAdded
+
nSize
);
nSize
=
vsnprintf
(
Vec_StrLimit
(
vBuf
),
nAdded
,
format
,
args
);
assert
(
nSize
==
nAdded
);
}
va_end
(
args
);
return
Abc_NamStrFindOrAddLim
(
p
,
Vec_StrLimit
(
vBuf
),
Vec_StrLimit
(
vBuf
)
+
nAdded
,
NULL
);
}
// parsing slice/concatentation/box
static
inline
int
Prs_NtkAddSlice
(
Prs_Ntk_t
*
p
,
int
Name
,
int
Range
)
{
...
...
src/misc/vec/vecInt.h
View file @
cb439f2e
...
...
@@ -1013,7 +1013,7 @@ static inline void Vec_IntDrop( Vec_Int_t * p, int i )
static
inline
void
Vec_IntInsert
(
Vec_Int_t
*
p
,
int
iHere
,
int
Entry
)
{
int
i
;
assert
(
iHere
>=
0
&&
iHere
<
p
->
nSize
);
assert
(
iHere
>=
0
&&
iHere
<
=
p
->
nSize
);
Vec_IntPush
(
p
,
0
);
for
(
i
=
p
->
nSize
-
1
;
i
>
iHere
;
i
--
)
p
->
pArray
[
i
]
=
p
->
pArray
[
i
-
1
];
...
...
src/misc/vec/vecPtr.h
View file @
cb439f2e
...
...
@@ -64,6 +64,8 @@ struct Vec_Ptr_t_
for ( i = Vec_PtrSize(vVec) - 1; (i >= 0) && (((pEntry) = (Type)Vec_PtrEntry(vVec, i)), 1); i-- )
#define Vec_PtrForEachEntryTwo( Type1, vVec1, Type2, vVec2, pEntry1, pEntry2, i ) \
for ( i = 0; (i < Vec_PtrSize(vVec1)) && (((pEntry1) = (Type1)Vec_PtrEntry(vVec1, i)), 1) && (((pEntry2) = (Type2)Vec_PtrEntry(vVec2, i)), 1); i++ )
#define Vec_PtrForEachEntryDouble( Type1, Type2, vVec, Entry1, Entry2, i ) \
for ( i = 0; (i+1 < Vec_IntSize(vVec)) && (((Entry1) = (Type1)Vec_PtrEntry(vVec, i)), 1) && (((Entry2) = (Type2)Vec_PtrEntry(vVec, i+1)), 1); i += 2 )
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
...
...
@@ -464,6 +466,14 @@ static inline void Vec_PtrFill( Vec_Ptr_t * p, int nSize, void * Entry )
p
->
pArray
[
i
]
=
Entry
;
p
->
nSize
=
nSize
;
}
static
inline
void
Vec_PtrFillTwo
(
Vec_Ptr_t
*
p
,
int
nSize
,
void
*
EntryEven
,
void
*
EntryOdd
)
{
int
i
;
Vec_PtrGrow
(
p
,
nSize
);
for
(
i
=
0
;
i
<
nSize
;
i
++
)
p
->
pArray
[
i
]
=
(
i
&
1
)
?
EntryOdd
:
EntryEven
;
p
->
nSize
=
nSize
;
}
/**Function*************************************************************
...
...
@@ -624,6 +634,11 @@ static inline void Vec_PtrPush( Vec_Ptr_t * p, void * Entry )
}
p
->
pArray
[
p
->
nSize
++
]
=
Entry
;
}
static
inline
void
Vec_PtrPushTwo
(
Vec_Ptr_t
*
p
,
void
*
Entry1
,
void
*
Entry2
)
{
Vec_PtrPush
(
p
,
Entry1
);
Vec_PtrPush
(
p
,
Entry2
);
}
/**Function*************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment