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
b7afd347
Commit
b7afd347
authored
Jun 20, 2013
by
Adrian Negreanu
Committed by
Adrian Negreanu
Aug 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sqlite3: cleanup prepareStatements
parent
cf0f9ca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
60 deletions
+21
-60
sqlite3gen.cpp
src/sqlite3gen.cpp
+21
-60
No files found.
src/sqlite3gen.cpp
View file @
b7afd347
...
@@ -401,73 +401,34 @@ static void generateSqlite3Section(sqlite3*db,
...
@@ -401,73 +401,34 @@ static void generateSqlite3Section(sqlite3*db,
}
}
}
}
static
int
prepareStatement
s
(
sqlite3
*
db
)
static
int
prepareStatement
(
sqlite3
*
db
,
const
char
*
query
,
sqlite3_stmt
**
statement
)
{
{
int
rc
;
int
rc
;
rc
=
sqlite3_prepare_v2
(
db
,
id_q_memberdef
,
-
1
,
&
id_s_memberdef
,
0
);
rc
=
sqlite3_prepare_v2
(
db
,
query
,
-
1
,
statement
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
id_q_memberdef
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
id_q_files
,
-
1
,
&
id_s_files
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
id_q_files
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_files
,
-
1
,
&
i_s_files
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_files
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_xrefs
,
-
1
,
&
i_s_xrefs
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_xrefs
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_innerclass
,
-
1
,
&
i_s_innerclass
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_innerclass
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_memberdef
,
-
1
,
&
i_s_memberdef
,
0
);
if
(
rc
!=
SQLITE_OK
)
if
(
rc
!=
SQLITE_OK
)
{
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_memberdef
,
sqlite3_errmsg
(
db
));
msg
(
"prepare failed for %s
\n
%s
\n
"
,
query
,
sqlite3_errmsg
(
db
));
return
-
1
;
return
-
1
;
}
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_compounddef
,
-
1
,
&
i_s_compounddef
,
0
);
return
rc
;
if
(
rc
!=
SQLITE_OK
)
}
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_compounddef
,
sqlite3_errmsg
(
db
));
static
int
prepareStatements
(
sqlite3
*
db
)
return
-
1
;
{
}
if
(
rc
=
sqlite3_prepare_v2
(
db
,
i_q_basecompoundref
,
-
1
,
&
i_s_basecompoundref
,
0
);
-
1
==
prepareStatement
(
db
,
id_q_memberdef
,
&
id_s_memberdef
)
||
if
(
rc
!=
SQLITE_OK
)
-
1
==
prepareStatement
(
db
,
id_q_files
,
&
id_s_files
)
||
{
-
1
==
prepareStatement
(
db
,
i_q_files
,
&
i_s_files
)
||
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_basecompoundref
,
sqlite3_errmsg
(
db
));
-
1
==
prepareStatement
(
db
,
i_q_xrefs
,
&
i_s_xrefs
)
||
return
-
1
;
-
1
==
prepareStatement
(
db
,
i_q_innerclass
,
&
i_s_innerclass
)
||
}
-
1
==
prepareStatement
(
db
,
i_q_memberdef
,
&
i_s_memberdef
)
||
rc
=
sqlite3_prepare_v2
(
db
,
i_q_derivedcompoundref
,
-
1
,
&
i_s_derivedcompoundref
,
0
);
-
1
==
prepareStatement
(
db
,
i_q_compounddef
,
&
i_s_compounddef
)
||
if
(
rc
!=
SQLITE_OK
)
-
1
==
prepareStatement
(
db
,
i_q_basecompoundref
,
&
i_s_basecompoundref
)
||
{
-
1
==
prepareStatement
(
db
,
i_q_derivedcompoundref
,
&
i_s_derivedcompoundref
)
||
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_derivedcompoundref
,
sqlite3_errmsg
(
db
));
-
1
==
prepareStatement
(
db
,
i_q_includes
,
&
i_s_includes
)
||
return
-
1
;
-
1
==
prepareStatement
(
db
,
c_q_includes
,
&
c_s_includes
)
}
)
rc
=
sqlite3_prepare_v2
(
db
,
i_q_includes
,
-
1
,
&
i_s_includes
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_includes
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
c_q_includes
,
-
1
,
&
c_s_includes
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
c_q_includes
,
sqlite3_errmsg
(
db
));
return
-
1
;
return
-
1
;
}
}
return
0
;
return
0
;
...
...
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