Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
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
doxverilog
Commits
de9e2e0b
Commit
de9e2e0b
authored
Jan 14, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #92 from groleo/sqlite3-fixes
sqlite3: clear bindings on errors and more care with return
parents
09a5fc19
1a708967
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
sqlite3gen.cpp
src/sqlite3gen.cpp
+18
-12
No files found.
src/sqlite3gen.cpp
View file @
de9e2e0b
...
...
@@ -708,14 +708,15 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if
(
id_bfile
==
-
1
)
{
sqlite3_clear_bindings
(
i_s_memberdef
);
return
;
}
else
{
bindIntParameter
(
i_s_memberdef
,
":id_ibfile"
,
id_bfile
);
bindIntParameter
(
i_s_memberdef
,
":bline"
,
md
->
getStartBodyLine
());
bindIntParameter
(
i_s_memberdef
,
":id_ibfile"
,
id_bfile
);
bindIntParameter
(
i_s_memberdef
,
":bline"
,
md
->
getStartBodyLine
());
// XXX implement getStartBodyColumn
bindIntParameter
(
i_s_memberdef
,
":bcolumn"
,
1
);
// XXX implement getStartBodyColumn
bindIntParameter
(
i_s_memberdef
,
":bcolumn"
,
1
);
}
}
}
}
...
...
@@ -724,7 +725,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
{
sqlite3_clear_bindings
(
i_s_memberdef
);
}
/*int id_src =*/
sqlite3_last_insert_rowid
(
db
);
sqlite3_last_insert_rowid
(
db
);
// + source references
// The cross-references in initializers only work when both the src and dst
...
...
@@ -825,8 +826,9 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindIntParameter
(
i_s_compounddef
,
":line"
,
cd
->
getDefLine
());
bindIntParameter
(
i_s_compounddef
,
":column"
,
cd
->
getDefColumn
());
if
(
-
1
==
step
(
db
,
i_s_compounddef
))
return
;
if
(
-
1
==
step
(
db
,
i_s_compounddef
))
{
sqlite3_clear_bindings
(
i_s_compounddef
);
}
// + list of direct super classes
if
(
cd
->
baseClasses
())
...
...
@@ -848,8 +850,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter
(
i_s_basecompoundref
,
":base"
,
bcd
->
classDef
->
displayName
());
}
bindTextParameter
(
i_s_basecompoundref
,
":derived"
,
cd
->
displayName
());
if
(
-
1
==
step
(
db
,
i_s_basecompoundref
))
if
(
-
1
==
step
(
db
,
i_s_basecompoundref
))
{
sqlite3_clear_bindings
(
i_s_basecompoundref
);
continue
;
}
}
}
...
...
@@ -865,8 +869,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter
(
i_s_derivedcompoundref
,
":refid"
,
bcd
->
classDef
->
getOutputFileBase
());
bindIntParameter
(
i_s_derivedcompoundref
,
":prot"
,
bcd
->
prot
);
bindIntParameter
(
i_s_derivedcompoundref
,
":virt"
,
bcd
->
virt
);
if
(
-
1
==
step
(
db
,
i_s_derivedcompoundref
))
if
(
-
1
==
step
(
db
,
i_s_derivedcompoundref
))
{
sqlite3_reset
(
i_s_derivedcompoundref
);
continue
;
}
}
}
...
...
@@ -888,7 +894,7 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindIntParameter
(
i_s_includes
,
":id_src"
,
id_file
);
bindTextParameter
(
i_s_includes
,
":dst"
,
nm
);
if
(
-
1
==
step
(
db
,
i_s_includes
))
return
;
sqlite3_clear_bindings
(
i_s_basecompoundref
)
;
}
}
}
...
...
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