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

Re: [patch] c99-isms

From: Matthew Woehlke <mw_triad_at_users.sourceforge.net>
Date: Thu, 26 Mar 2009 14:29:41 -0500

C. Michael Pilato wrote:
> Matthew Woehlke wrote:
>> Oops! Actually... I'm not sure how that compiled (given that the
>> problems I'm having are from non-c99 compilers!) :-). You're right of
>> course, the assignments should be moved below. Can you do that bit of
>> cut-and-paste, or do you want a fresh patch?
>
> If you give me a fresh patch, you'll be demonstrating a measurable amount of
> respect for my time. If you give me a fresh patch that applies cleanly
> against the trunk (as we request all patches to, and as your last one did
> not), you might even get to be my Favorite Person of the Day. :-)

Well, there is an added whitespace in util.c where I made the change
causing a conflict; it probably won't backport cleanly either :-).
Anyway, updated patch (against trunk r36796) attached.

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
"We're all mad here. I'm mad. You're mad... You must be, or you wouldn't 
have come here." -- The Cheshire Cat (from Lewis Carroll's Alice in 
Wonderland)
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1434221

Index: subversion/libsvn_subr/cache-memcache.c
===================================================================
--- subversion/libsvn_subr/cache-memcache.c (revision 36796)
+++ subversion/libsvn_subr/cache-memcache.c (working copy)
@@ -243,7 +243,8 @@
 
   wrapper->vtable = &memcache_vtable;
   wrapper->cache_internal = cache;
- wrapper->error_handler = wrapper->error_baton = NULL;
+ wrapper->error_handler = 0;
+ wrapper->error_baton = 0;
 
   *cache_p = wrapper;
   return SVN_NO_ERROR;
Index: subversion/libsvn_subr/dirent_uri.c
===================================================================
--- subversion/libsvn_subr/dirent_uri.c (revision 36796)
+++ subversion/libsvn_subr/dirent_uri.c (working copy)
@@ -45,7 +45,7 @@
 /* Path type definition. Used only by internal functions. */
 typedef enum {
   type_uri,
- type_dirent,
+ type_dirent
 } path_type_t;
 
 
Index: subversion/tests/libsvn_subr/opt-test.c
===================================================================
--- subversion/tests/libsvn_subr/opt-test.c (revision 36796)
+++ subversion/tests/libsvn_subr/opt-test.c (working copy)
@@ -132,7 +132,10 @@
       apr_array_header_t *targets;
       apr_getopt_t *os;
       const int argc = 2;
- const char *argv[] = { "opt-test", input, NULL };
+ const char *argv[3];
+ argv[0] = "opt-test";
+ argv[1] = input;
+ argv[2] = NULL;
       apr_status_t apr_err;
       svn_error_t *err;
 
Index: subversion/tests/libsvn_client/client-test.c
===================================================================
--- subversion/tests/libsvn_client/client-test.c (revision 36796)
+++ subversion/tests/libsvn_client/client-test.c (working copy)
@@ -146,10 +146,14 @@
       apr_array_header_t *targets;
       apr_getopt_t *os;
       const int argc = 2;
- const char *argv[] = { "opt-test", input, NULL };
+ const char *argv[3];
       apr_status_t apr_err;
       svn_error_t *err;
 
+ argv[0] = "opt-test";
+ argv[1] = input;
+ argv[2] = NULL;
+
       apr_err = apr_getopt_init(&os, iterpool, argc, argv);
       if (apr_err)
         return svn_error_wrap_apr(apr_err,
Index: subversion/svn/util.c
===================================================================
--- subversion/svn/util.c (revision 36796)
+++ subversion/svn/util.c (working copy)
@@ -240,14 +240,22 @@
            "configuration option were not set.\n"));
 
   {
- const char *arguments[] = { merge_tool, base_path, their_path,
- my_path, merged_path, wc_path, NULL};
+ const char *arguments[7];
     char *cwd;
     int exitcode;
 
     apr_status_t status = apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, pool);
     if (status != 0)
       return svn_error_wrap_apr(status, NULL);
+
+ arguments[0] = merge_tool;
+ arguments[1] = base_path;
+ arguments[2] = their_path;
+ arguments[3] = my_path;
+ arguments[4] = merged_path;
+ arguments[5] = wc_path;
+ arguments[6] = NULL;
+
     SVN_ERR(svn_io_run_cmd(svn_path_internal_style(cwd, pool), merge_tool,
                            arguments, &exitcode, NULL, TRUE, NULL, NULL, NULL,
                            pool));
Index: subversion/libsvn_wc/deprecated.c
===================================================================
--- subversion/libsvn_wc/deprecated.c (revision 36796)
+++ subversion/libsvn_wc/deprecated.c (working copy)
@@ -1155,8 +1155,9 @@
                      void *cancel_baton,
                      apr_pool_t *pool)
 {
- svn_wc_entry_callbacks2_t walk_cb2 = { walk_callbacks->found_entry,
- svn_wc__walker_default_error_handler };
+ svn_wc_entry_callbacks2_t walk_cb2;
+ walk_cb2.found_entry = walk_callbacks->found_entry;
+ walk_cb2.handle_error = svn_wc__walker_default_error_handler;
   return svn_wc_walk_entries3(path, adm_access,
                               &walk_cb2, walk_baton, svn_depth_infinity,
                               show_hidden, cancel_func, cancel_baton, pool);
Index: subversion/libsvn_client/deprecated.c
===================================================================
--- subversion/libsvn_client/deprecated.c (revision 36796)
+++ subversion/libsvn_client/deprecated.c (working copy)
@@ -1462,7 +1462,9 @@
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool)
 {
- struct status3_wrapper_baton swb = { status_func, status_baton };
+ struct status3_wrapper_baton swb;
+ swb.old_func = status_func;
+ swb.old_baton = status_baton;
 
   return svn_client_status4(result_rev, path, revision, status3_wrapper_func,
                             &swb, depth, get_all, update, no_ignore,
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c (revision 36796)
+++ subversion/libsvn_client/merge.c (working copy)
@@ -1294,9 +1294,11 @@
           const char *right_label = apr_psprintf(subpool,
                                                  _(".merge-right.r%ld"),
                                                  yours_rev);
- conflict_resolver_baton_t conflict_baton =
- { merge_b->ctx->conflict_func, merge_b->ctx->conflict_baton,
- &merge_b->conflicted_paths, merge_b->pool };
+ conflict_resolver_baton_t conflict_baton;
+ conflict_baton.wrapped_func = merge_b->ctx->conflict_func;
+ conflict_baton.wrapped_baton = merge_b->ctx->conflict_baton;
+ conflict_baton.conflicted_paths = &merge_b->conflicted_paths;
+ conflict_baton.pool = merge_b->pool;
           SVN_ERR(svn_wc_merge3(&merge_outcome,
                                 older, yours, mine, adm_access,
                                 left_label, right_label, target_label,
@@ -4831,11 +4833,19 @@
   apr_pool_t *iterpool;
   static const svn_wc_entry_callbacks2_t walk_callbacks =
     { get_mergeinfo_walk_cb, get_mergeinfo_error_handler };
- struct get_mergeinfo_walk_baton wb =
- { adm_access, children_with_mergeinfo,
- merge_src_canon_path, merge_cmd_baton->target, source_root_url,
- url1, url2, revision1, revision2,
- depth, ra_session, merge_cmd_baton->ctx };
+ struct get_mergeinfo_walk_baton wb;
+ wb.base_access = adm_access;
+ wb.children_with_mergeinfo = children_with_mergeinfo;
+ wb.merge_src_canon_path = merge_src_canon_path;
+ wb.merge_target_path = merge_cmd_baton->target;
+ wb.source_root_url = source_root_url;
+ wb.url1 = url1;
+ wb.url2 = url2;
+ wb.revision1 = revision1;
+ wb.revision2 = revision2;
+ wb.depth = depth;
+ wb.ra_session = ra_session;
+ wb.ctx = merge_cmd_baton->ctx;
 
   /* Cover cases 1), 2), 6), and 7) by walking the WC to get all paths which
      have mergeinfo and/or are switched or are absent from disk or is the
Index: subversion/libsvn_client/mergeinfo.c
===================================================================
--- subversion/libsvn_client/mergeinfo.c (revision 36796)
+++ subversion/libsvn_client/mergeinfo.c (working copy)
@@ -1008,11 +1008,12 @@
   apr_array_header_t *elidable_paths = apr_array_make(pool, 1,
                                                       sizeof(const char *));
   svn_delta_editor_t *editor = svn_delta_default_editor(pool);
- struct elide_mergeinfo_catalog_cb_baton cb = {elidable_paths,
- mergeinfo_catalog,
- pool};
+ struct elide_mergeinfo_catalog_cb_baton cb;
   int i;
 
+ cb.elidable_paths = elidable_paths;
+ cb.mergeinfo_catalog = mergeinfo_catalog;
+ cb.result_pool = pool;
   editor->open_root = elide_mergeinfo_catalog_open_root;
   editor->open_directory = elide_mergeinfo_catalog_open_directory;
 
Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c (revision 36796)
+++ subversion/libsvn_client/log.c (working copy)
@@ -124,11 +124,12 @@
                             apr_pool_t *pool)
 {
   svn_error_t *err;
- copyfrom_info_t copyfrom_info = { TRUE, NULL, SVN_INVALID_REVNUM, pool };
+ copyfrom_info_t copyfrom_info = { TRUE, NULL, SVN_INVALID_REVNUM, NULL };
   apr_pool_t *sesspool = svn_pool_create(pool);
   svn_ra_session_t *ra_session;
   svn_revnum_t at_rev;
   const char *at_url;
+ copyfrom_info.pool = pool;
 
   SVN_ERR(svn_client__ra_session_from_path(&ra_session, &at_rev, &at_url,
                                            path_or_url, NULL,
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 36796)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -7041,7 +7041,11 @@
                 void *cancel_baton,
                 apr_pool_t *pool)
 {
- struct pack_baton pb = { fs, notify_func, notify_baton,
- cancel_func, cancel_baton };
+ struct pack_baton pb;
+ pb.fs = fs;
+ pb.notify_func = notify_func;
+ pb.notify_baton = notify_baton;
+ pb.cancel_func = cancel_func;
+ pb.cancel_baton = cancel_baton;
   return svn_fs_fs__with_write_lock(fs, pack_body, &pb, pool);
 }
Received on 2009-03-26 20:40:25 CET

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