[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r35379 - in trunk/subversion: include/private libsvn_fs_fs libsvn_subr

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Wed, 21 Jan 2009 14:37:41 -0600

Greg Stein wrote:
> On Wed, Jan 21, 2009 at 19:52, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>> ...
>> +++ trunk/subversion/libsvn_subr/sqlite.c Wed Jan 21 10:52:27 2009 (r35379)
>> @@ -50,6 +50,10 @@ sqlite_tracer(void *data, const char *sq
>> struct svn_sqlite__db_t
>> {
>> sqlite3 *db3;
>> + const char **statement_strings;
>
> You changed this decl in a later revision to:
>
> const char * const *statement_strings;
>
> but the argument uses [] ... maybe do the same here?

I tried, but the compiler wasn't too happy. We need to assign this variable,
and I don't think that an array name can be used as an lvalue.

>> ...
>> svn_error_t *
>> +svn_sqlite__get_statement(svn_sqlite__stmt_t **stmt, svn_sqlite__db_t *db,
>> + int stmt_idx)
>> +{
>> + if (db->prepared_stmts[stmt_idx] == NULL)
>> + SVN_ERR(svn_sqlite__prepare(&db->prepared_stmts[stmt_idx], db,
>> + db->statement_strings[stmt_idx], db->pool));
>
> Before the if, maybe add:
>
> SVN_ERR_ASSERT(stmt_idx < db->nbr_statements);

Ah, good idea. r35382.

-Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041968
Received on 2009-01-21 21:38:10 CET

This is an archived mail posted to the Subversion Dev mailing list.