mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 14:48:32 -04:00
DBD-SQLite: removed all of the "croak"s to close #44871
This commit is contained in:
parent
b0009ebcc6
commit
c831b89e7e
1 changed files with 31 additions and 25 deletions
56
dbdimp.c
56
dbdimp.c
|
@ -1192,13 +1192,13 @@ sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr_
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sqlite_db_collation_dispatcher(void *func, int len1, const void *string1,
|
sqlite_db_collation_dispatcher(SV *func, int len1, const void *string1,
|
||||||
int len2, const void *string2)
|
int len2, const void *string2)
|
||||||
{
|
{
|
||||||
dTHX;
|
dTHX;
|
||||||
dSP;
|
dSP;
|
||||||
int cmp;
|
int cmp = 0;
|
||||||
int n_retval;
|
int n_retval, i;
|
||||||
|
|
||||||
ENTER;
|
ENTER;
|
||||||
SAVETMPS;
|
SAVETMPS;
|
||||||
|
@ -1206,12 +1206,14 @@ sqlite_db_collation_dispatcher(void *func, int len1, const void *string1,
|
||||||
XPUSHs( sv_2mortal ( newSVpvn( string1, len1) ) );
|
XPUSHs( sv_2mortal ( newSVpvn( string1, len1) ) );
|
||||||
XPUSHs( sv_2mortal ( newSVpvn( string2, len2) ) );
|
XPUSHs( sv_2mortal ( newSVpvn( string2, len2) ) );
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
n_retval = call_sv((void*)func, G_SCALAR);
|
n_retval = call_sv(func, G_SCALAR);
|
||||||
if (n_retval != 1) {
|
|
||||||
croak("collation function returned %d arguments", n_retval);
|
|
||||||
}
|
|
||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
cmp = POPi;
|
if (n_retval != 1) {
|
||||||
|
warn("collation function returned %d arguments", n_retval);
|
||||||
|
}
|
||||||
|
for(i = 0; i < n_retval; i++) {
|
||||||
|
cmp = POPi;
|
||||||
|
}
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
FREETMPS;
|
FREETMPS;
|
||||||
LEAVE;
|
LEAVE;
|
||||||
|
@ -1221,13 +1223,13 @@ sqlite_db_collation_dispatcher(void *func, int len1, const void *string1,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sqlite_db_collation_dispatcher_utf8(
|
sqlite_db_collation_dispatcher_utf8(
|
||||||
void *func, int len1, const void *string1,
|
SV *func, int len1, const void *string1,
|
||||||
int len2, const void *string2)
|
int len2, const void *string2)
|
||||||
{
|
{
|
||||||
dTHX;
|
dTHX;
|
||||||
dSP;
|
dSP;
|
||||||
int cmp;
|
int cmp = 0;
|
||||||
int n_retval;
|
int n_retval, i;
|
||||||
SV *sv1, *sv2;
|
SV *sv1, *sv2;
|
||||||
|
|
||||||
ENTER;
|
ENTER;
|
||||||
|
@ -1240,12 +1242,14 @@ sqlite_db_collation_dispatcher_utf8(
|
||||||
XPUSHs( sv_2mortal ( sv1 ) );
|
XPUSHs( sv_2mortal ( sv1 ) );
|
||||||
XPUSHs( sv_2mortal ( sv2 ) );
|
XPUSHs( sv_2mortal ( sv2 ) );
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
n_retval = call_sv((void*)func, G_SCALAR);
|
n_retval = call_sv(func, G_SCALAR);
|
||||||
if (n_retval != 1) {
|
|
||||||
croak("collation function returned %d arguments", n_retval);
|
|
||||||
}
|
|
||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
cmp = POPi;
|
if (n_retval != 1) {
|
||||||
|
warn("collation function returned %d arguments", n_retval);
|
||||||
|
}
|
||||||
|
for(i = 0; i < n_retval; i++) {
|
||||||
|
cmp = POPi;
|
||||||
|
}
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
FREETMPS;
|
FREETMPS;
|
||||||
LEAVE;
|
LEAVE;
|
||||||
|
@ -1295,22 +1299,24 @@ sqlite3_db_create_collation(pTHX_ SV *dbh, const char *name, SV *func )
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sqlite_db_progress_handler_dispatcher( void *handler )
|
sqlite_db_progress_handler_dispatcher( SV *handler )
|
||||||
{
|
{
|
||||||
dTHX;
|
dTHX;
|
||||||
dSP;
|
dSP;
|
||||||
int n_retval;
|
int n_retval, i;
|
||||||
int retval;
|
int retval = 0;
|
||||||
|
|
||||||
ENTER;
|
ENTER;
|
||||||
SAVETMPS;
|
SAVETMPS;
|
||||||
PUSHMARK(SP);
|
PUSHMARK(SP);
|
||||||
n_retval = call_sv( handler, G_SCALAR );
|
n_retval = call_sv( handler, G_SCALAR );
|
||||||
if ( n_retval != 1 ) {
|
|
||||||
croak( "progress_handler returned %d arguments", n_retval );
|
|
||||||
}
|
|
||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
retval = POPi;
|
if ( n_retval != 1 ) {
|
||||||
|
warn( "progress_handler returned %d arguments", n_retval );
|
||||||
|
}
|
||||||
|
for(i = 0; i < n_retval; i++) {
|
||||||
|
retval = POPi;
|
||||||
|
}
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
FREETMPS;
|
FREETMPS;
|
||||||
LEAVE;
|
LEAVE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue