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

jpd at videolan.org jpd at videolan.org
Tue Nov 3 20:18:49 CET 2009


On Tue, Nov 03, 2009 at 08:02:39PM +0100, Laurent Aimar wrote:
> On Tue, Oct 27, 2009, Srikanth Raju wrote:
> >      > +#define VLC_SQL_ROW 1
> >      > +#define VLC_SQL_DONE 2
> >      ?What are they used for? A doxy comment would be usefull.
> >    They're used as return values for sql_Run(). Documented.

Only two values? Wouldn't it make more sense to make it a bool then?


>  The problem with sql_type_e is that the size of the storage of an
> enum is compiler dependant and so the ABI would easily be broken. Now,
> I don't feel strongly about it, anyone cares to comment ?

I'll take an unsigned or unsigned short to taste, thanks.


> > +    /** Create a statement object */
> > +    sql_stmt_t* (*pf_prepare) ( sql_t* p_sql, const char* psz_fmt,
> > +                                int i_length );
>  Please, change the psz_ prefix into p_ to avoid confusion as it is not always
> a 0 terminated string.

That, and another unsigned for the length please. size_t in this case.
If the parameter cannot be meaningfully negative it shouldn't be signed.





More information about the vlc-devel mailing list