You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/03/25 12:03:17 UTC
svn commit: r927344 - in /subversion/trunk/subversion/libsvn_wc: upgrade.c
wc_db.c
Author: julianfoad
Date: Thu Mar 25 11:03:16 2010
New Revision: 927344
URL: http://svn.apache.org/viewvc?rev=927344&view=rev
Log:
Fix more svn_sqlite__bindf parameter type mismatches and potential
mismatches, following r927211.
* subversion/libsvn_wc/upgrade.c
(migrate_locks): Pass the (magic) WC id to svn_sqlite__bindf as a 64-bit
value, as required by the latter.
* subversion/libsvn_wc/wc_db.c
(insert_base_node, svn_wc__db_op_set_last_mod_time): Pass integers to
svn_sqlite__bindf as 64-bit values, as required by the latter. (The
first one here is typedef'd to 'long int' which may not be the same on
all architectures. The second one here is typedef'd to the right type
in my version of APR but it's obscure to rely on that.)
Modified:
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=927344&r1=927343&r2=927344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Thu Mar 25 11:03:16 2010
@@ -851,7 +851,7 @@ migrate_locks(const char *wcroot_abspath
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_WC_LOCK));
/* ### These values are magic, and will need to be updated when we
### go to a centralized system. */
- SVN_ERR(svn_sqlite__bindf(stmt, "is", 1, ""));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", (apr_int64_t)1, ""));
SVN_ERR(svn_sqlite__step_done(stmt));
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=927344&r1=927343&r2=927344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Mar 25 11:03:16 2010
@@ -1404,7 +1404,7 @@ insert_base_node(void *baton, svn_sqlite
name,
scratch_pool),
pibb->local_relpath,
- pibb->revision));
+ (apr_int64_t)pibb->revision));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
}
}
@@ -3025,7 +3025,7 @@ svn_wc__db_op_set_last_mod_time(svn_wc__
STMT_UPDATE_BASE_LAST_MOD_TIME));
SVN_ERR(svn_sqlite__bindf(stmt, "isi",
pdh->wcroot->wc_id, local_relpath,
- last_mod_time));
+ (apr_int64_t)last_mod_time));
SVN_ERR(svn_sqlite__step_done(stmt));
flush_entries(pdh);
Re: svn commit: r927344 - in
/subversion/trunk/subversion/libsvn_wc: upgrade.c wc_db.c
Posted by Julian Foad <ju...@wandisco.com>.
Greg Stein wrote:
> On Thu, Mar 25, 2010 at 07:03, <ju...@apache.org> wrote:
> >...
> > * subversion/libsvn_wc/wc_db.c
> > (insert_base_node, svn_wc__db_op_set_last_mod_time): Pass integers to
> > svn_sqlite__bindf as 64-bit values, as required by the latter. (The
> > first one here is typedef'd to 'long int' which may not be the same on
> > all architectures. The second one here is typedef'd to the right type
> > in my version of APR but it's obscure to rely on that.)
>
> It is NOT obscure. An apr_time_t is *defined* as a 64-bit integer, as
> microseconds since epoch. The entire apr_time interface revolves
> around that specific definition. Thus, your cast because wholly
> redundant and (for me) causes the exact opposite problem. "What? I
> thought this was a time? What's the cast in there for? ... Oh. Damn
> useless cast."
>
> Please revert the time cast.
Can do, will do.
- Julian
Re: svn commit: r927344 - in /subversion/trunk/subversion/libsvn_wc:
upgrade.c wc_db.c
Posted by Greg Stein <gs...@gmail.com>.
On Thu, Mar 25, 2010 at 07:03, <ju...@apache.org> wrote:
>...
> * subversion/libsvn_wc/wc_db.c
> (insert_base_node, svn_wc__db_op_set_last_mod_time): Pass integers to
> svn_sqlite__bindf as 64-bit values, as required by the latter. (The
> first one here is typedef'd to 'long int' which may not be the same on
> all architectures. The second one here is typedef'd to the right type
> in my version of APR but it's obscure to rely on that.)
It is NOT obscure. An apr_time_t is *defined* as a 64-bit integer, as
microseconds since epoch. The entire apr_time interface revolves
around that specific definition. Thus, your cast because wholly
redundant and (for me) causes the exact opposite problem. "What? I
thought this was a time? What's the cast in there for? ... Oh. Damn
useless cast."
Please revert the time cast.
>...
Cheers,
-g