Skip to content
Permalink
Browse files

fix warnings

  • Loading branch information
jef-n committed Dec 26, 2015
1 parent 573a4b7 commit 46f283b683d5830030118afdcbf3f7713684bc5c
@@ -3696,7 +3696,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
break;
}
@@ -3771,7 +3771,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id )
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
goto abort;
}
@@ -4031,7 +4031,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( QgsGeometryMap & geometry_map
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
goto abort;
}
@@ -306,8 +306,8 @@ int vtable_create_connect( sqlite3* sql, void* aux, int argc, const char* const*
Q_UNUSED( aux );
Q_UNUSED( is_created );

#define RETURN_CSTR_ERROR(err) if (out_err) {size_t s = strlen(err); *out_err=(char*)sqlite3_malloc(s+1); strncpy(*out_err, err, s);}
#define RETURN_CPPSTR_ERROR(err) if (out_err) {*out_err=(char*)sqlite3_malloc(err.size()+1); strncpy(*out_err, err.c_str(), err.size());}
#define RETURN_CSTR_ERROR(err) if (out_err) {size_t s = strlen(err); *out_err=(char*)sqlite3_malloc( (int) s+1); strncpy(*out_err, err, s);}
#define RETURN_CPPSTR_ERROR(err) if (out_err) {*out_err=(char*)sqlite3_malloc( (int) err.size()+1); strncpy(*out_err, err.c_str(), err.size());}

if ( argc < 4 )
{

0 comments on commit 46f283b

Please sign in to comment.
You can’t perform that action at this time.