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
a26d8621
Commit
a26d8621
authored
Jun 23, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add warnings to %read about 3-arge ops and non-zero-based ranges.
parent
d0d7763e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/base/wlc/wlcReadVer.c
+15
-5
No files found.
src/base/wlc/wlcReadVer.c
View file @
a26d8621
...
...
@@ -113,6 +113,14 @@ void Wlc_PrsStop( Wlc_Prs_t * p )
SeeAlso []
***********************************************************************/
int
Wlc_PrsFindLine
(
Wlc_Prs_t
*
p
,
char
*
pCur
)
{
int
Entry
,
iLine
=
0
;
Vec_IntForEachEntry
(
p
->
vLines
,
Entry
,
iLine
)
if
(
Entry
>
pCur
-
p
->
pBuffer
)
return
iLine
+
1
;
return
-
1
;
}
int
Wlc_PrsWriteErrorMessage
(
Wlc_Prs_t
*
p
,
char
*
pCur
,
const
char
*
format
,
...
)
{
char
*
pMessage
;
...
...
@@ -128,11 +136,8 @@ int Wlc_PrsWriteErrorMessage( Wlc_Prs_t * p, char * pCur, const char * format, .
sprintf
(
p
->
sError
,
"%s: %s
\n
"
,
p
->
pFileName
,
pMessage
);
else
// print the error message with the line number
{
int
Entry
,
iLine
=
0
;
Vec_IntForEachEntry
(
p
->
vLines
,
Entry
,
iLine
)
if
(
Entry
>
pCur
-
p
->
pBuffer
)
break
;
sprintf
(
p
->
sError
,
"%s (line %d): %s
\n
"
,
p
->
pFileName
,
iLine
+
1
,
pMessage
);
int
iLine
=
Wlc_PrsFindLine
(
p
,
pCur
);
sprintf
(
p
->
sError
,
"%s (line %d): %s
\n
"
,
p
->
pFileName
,
iLine
,
pMessage
);
}
ABC_FREE
(
pMessage
);
return
0
;
...
...
@@ -768,6 +773,9 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
else
return
Wlc_PrsWriteErrorMessage
(
p
,
pStr
,
"Unsupported operation (%c)."
,
pStr
[
0
]
);
if
(
!
(
pStr
=
Wlc_PrsReadName
(
p
,
pStr
+
1
,
vFanins
))
)
return
0
;
pStr
=
Wlc_PrsSkipSpaces
(
pStr
);
if
(
pStr
[
0
]
)
printf
(
"Warning: Trailing symbols
\"
%s
\"
in line %d.
\n
"
,
pStr
,
Wlc_PrsFindLine
(
p
,
pStr
)
);
}
}
// make sure there is nothing left there
...
...
@@ -798,6 +806,8 @@ int Wlc_PrsReadDeclaration( Wlc_Prs_t * p, char * pStart )
pStart
=
Wlc_PrsFindRange
(
pStart
,
&
End
,
&
Beg
);
if
(
pStart
==
NULL
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"Cannot read range."
);
if
(
Beg
!=
0
)
printf
(
"Warning: Non-zero-based range ([%d:%d]) in line %d.
\n
"
,
End
,
Beg
,
Wlc_PrsFindLine
(
p
,
pStart
)
);
while
(
1
)
{
char
*
pName
;
...
...
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