[vlc-devel] [PATCH] Prepared statements for SQL

Laurent Aimar fenrir at via.ecp.fr
Tue Nov 10 00:06:15 CET 2009


On Fri, Nov 06, 2009, Srikanth Raju wrote:
>    I did this. But it seems to make the include a lot heavier. Not too heavy
>    though.
 If it is a problem, they could be moved to the core (later is fine).

> +#include <assert.h>
 Sadly, it is a bad idea to include <assert.h> in a public header, and
so you should remove it.

> +typedef struct sql_stmt_sys_t sql_stmt_sys_t;

>      /** Rollback transaction */
>      int (*pf_rollback) ( sql_t* );
In the current commited file, it is void and not int. It prevents me to
apply the patch.

> +struct sql_stmt_t;

>  /*****************************************************************************
>   * SQL Function headers
> @@ -249,6 +305,267 @@ static inline int sql_RollbackTransaction( sql_t *p_sql )
Same here, void instead of it.

> +static inline int sql_GetColumnInteger( sql_t* p_sql, sql_stmt_t* p_stmt,
> +        int i_col, int* i_res )
> +{
> +    assert( i_res != NULL );
 You will need to removes the assert() 

 Otherwise, the patch is fine (I would have applied it, but because of
rollback() and assert(), I prefered not to modify your patch myself).



More information about the vlc-devel mailing list