Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
62a4072c
Commit
62a4072c
authored
Jan 05, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor bugs
parent
938cb884
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
dsnlexer.cpp
common/dsnlexer.cpp
+2
-2
richio.cpp
common/richio.cpp
+6
-2
eeschema_config.cpp
eeschema/eeschema_config.cpp
+1
-2
sch_lib_table.cpp
new/sch_lib_table.cpp
+12
-3
No files found.
common/dsnlexer.cpp
View file @
62a4072c
...
...
@@ -346,6 +346,8 @@ int DSNLEXER::NextTok() throw( IO_ERROR )
if
(
cur
>=
limit
)
{
L_read
:
cur
=
start
;
// blank lines are returned as "\n" and will have a len of 1.
// EOF will have a len of 0 and so is detectable.
int
len
=
readLine
();
...
...
@@ -355,8 +357,6 @@ L_read:
goto
exit
;
}
cur
=
start
;
// skip leading whitespace
while
(
cur
<
limit
&&
isSpace
(
*
cur
)
)
++
cur
;
...
...
common/richio.cpp
View file @
62a4072c
...
...
@@ -122,7 +122,10 @@ unsigned FILE_LINE_READER::ReadLine() throw( IO_ERROR )
expandCapacity
(
capacity
*
2
);
}
if
(
length
)
/* if( length ) RHH: this may now refer to a non-existent line but
* that leads to better error reporting on unexpected end of file.
*/
++
lineNum
;
return
length
;
...
...
@@ -173,10 +176,11 @@ unsigned STRING_LINE_READER::ReadLine() throw( IO_ERROR )
memcpy
(
line
,
&
lines
[
ndx
],
length
);
++
lineNum
;
ndx
+=
length
;
}
++
lineNum
;
// this gets incremented even if no bytes were read
line
[
length
]
=
0
;
return
length
;
...
...
eeschema/eeschema_config.cpp
View file @
62a4072c
...
...
@@ -634,14 +634,13 @@ void SCH_EDIT_FRAME::LoadSettings()
{
m_TemplateFieldNames
.
Parse
(
&
lexer
);
}
catch
(
IO_ERROR
e
)
catch
(
IO_ERROR
&
e
)
{
// @todo show error msg
D
(
printf
(
"templatefieldnames parsing error: '%s'
\n
"
,
CONV_TO_UTF8
(
e
.
errorText
)
);
)
}
}
}
...
...
new/sch_lib_table.cpp
View file @
62a4072c
...
...
@@ -57,10 +57,13 @@ void LIB_TABLE::Parse( SCH_LIB_TABLE_LEXER* in ) throw( IO_ERROR )
ELT_T
tok
;
while
(
(
tok
=
in
->
NextTok
()
)
!=
T_RIGHT
&&
tok
!=
T_EOF
)
while
(
(
tok
=
in
->
NextTok
()
)
!=
T_RIGHT
)
{
// (lib (logical "LOGICAL")(type "TYPE")(full_uri "FULL_URI")(options "OPTIONS"))
if
(
tok
==
T_EOF
)
in
->
Expecting
(
T_RIGHT
);
if
(
tok
!=
T_LEFT
)
in
->
Expecting
(
T_LEFT
);
...
...
@@ -353,6 +356,7 @@ void LIB_TABLE::Test()
" (lib (logical www) (type http) (full_uri http://kicad.org/libs) (options
\"
\"
))
\n
"
" (lib (logical meparts) (type dir) (full_uri /tmp/eeschema-lib) (options useVersioning))
\n
"
" (lib (logical old-project) (type schematic)(full_uri /tmp/old-schematic.sch) (options
\"
\"
))
\n
"
")
\n
"
,
wxT
(
"inline text"
)
// source
...
...
@@ -416,8 +420,13 @@ int main( int argc, char** argv )
catch
(
PARSE_ERROR
&
ioe
)
// most derived class first
{
printf
(
"%s
\n
"
,
(
const
char
*
)
ioe
.
errorText
.
ToUTF8
()
);
printf
(
"%s"
,
ioe
.
inputLine
.
c_str
()
);
// rare not to have \n at end
printf
(
"%*s^
\n
"
,
ioe
.
byteIndex
-
1
,
" "
);
printf
(
"%s%s"
,
ioe
.
inputLine
.
c_str
(),
ioe
.
inputLine
.
empty
()
||
*
ioe
.
inputLine
.
rbegin
()
!=
'\n'
?
"
\n
"
:
""
);
// rare not to have \n at end
printf
(
"%*s^
\n
"
,
ioe
.
byteIndex
>=
1
?
ioe
.
byteIndex
-
1
:
0
,
""
);
}
catch
(
IO_ERROR
&
ioe
)
{
...
...
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