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

[PATCH] svn_ra_svn_handle_commands should take a pointer-to-const for its command list

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-02-03 02:10:40 CET

Would you agree with the following? No big deal ... just seems better.

svn_ra_svn_handle_commands should be able to accept a constant list of
commands, and so should take a pointer-to-const for its command list.

Index: subversion/include/svn_ra_svn.h
===================================================================
--- subversion/include/svn_ra_svn.h (revision 4704)
+++ subversion/include/svn_ra_svn.h (working copy)
@@ -223,7 +223,7 @@
   */
  svn_error_t *svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn,
                                          apr_pool_t *pool,
- svn_ra_svn_cmd_entry_t *commands,
+ const svn_ra_svn_cmd_entry_t
*commands,
                                          void *baton,
                                          svn_boolean_t
pass_through_errors);

Index: subversion/libsvn_ra_svn/marshal.c
===================================================================
--- subversion/libsvn_ra_svn/marshal.c (revision 4704)
+++ subversion/libsvn_ra_svn/marshal.c (working copy)
@@ -627,7 +627,7 @@

  svn_error_t *svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn,
                                          apr_pool_t *pool,
- svn_ra_svn_cmd_entry_t *commands,
+ const svn_ra_svn_cmd_entry_t
*commands,
                                          void *baton,
                                          svn_boolean_t pass_through_errors)
  {

This would allow the command lists in subversion/svnserve/serve.c and
subversion/libsvn_ra/editor.c to be constant. Also, the command lists
in serve.c should, I think, be "static". There are no declarations or
references to them outside that file.

Index: subversion/libsvn_ra_svn/editor.c
===================================================================
--- subversion/libsvn_ra_svn/editor.c (revision 4704)
+++ subversion/libsvn_ra_svn/editor.c (working copy)
@@ -659,7 +659,7 @@
    return svn_ra_svn_write_cmd_response(conn, pool, "");
  }

-static svn_ra_svn_cmd_entry_t ra_svn_edit_commands[] = {
+static const svn_ra_svn_cmd_entry_t ra_svn_edit_commands[] = {
    { "target-rev", ra_svn_handle_target_rev },
    { "open-root", ra_svn_handle_open_root },
    { "delete-entry", ra_svn_handle_delete_entry },
Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 4704)
+++ subversion/svnserve/serve.c (working copy)
@@ -144,7 +144,7 @@
    return SVN_NO_ERROR;
  }

-svn_ra_svn_cmd_entry_t report_commands[] = {
+static const svn_ra_svn_cmd_entry_t report_commands[] = {
    { "set-path", set_path },
    { "delete-path", delete_path },
    { "link-path", link_path },
@@ -820,7 +820,7 @@
    return SVN_NO_ERROR;
  }

-svn_ra_svn_cmd_entry_t main_commands[] = {
+static const svn_ra_svn_cmd_entry_t main_commands[] = {
    { "get-latest-rev", get_latest_rev },
    { "get-dated-rev", get_dated_rev },
    { "change-rev-prop", change_rev_prop },

Revision 4704 passes "make check" with these patches applied.

- Julian

Index: subversion/include/svn_ra_svn.h
===================================================================
--- subversion/include/svn_ra_svn.h (revision 4704)
+++ subversion/include/svn_ra_svn.h (working copy)
@@ -223,7 +223,7 @@
  */
 svn_error_t *svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn,
                                         apr_pool_t *pool,
- svn_ra_svn_cmd_entry_t *commands,
+ const svn_ra_svn_cmd_entry_t *commands,
                                         void *baton,
                                         svn_boolean_t pass_through_errors);

Index: subversion/libsvn_ra_svn/marshal.c
===================================================================
--- subversion/libsvn_ra_svn/marshal.c (revision 4704)
+++ subversion/libsvn_ra_svn/marshal.c (working copy)
@@ -627,7 +627,7 @@
 
 svn_error_t *svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn,
                                         apr_pool_t *pool,
- svn_ra_svn_cmd_entry_t *commands,
+ const svn_ra_svn_cmd_entry_t *commands,
                                         void *baton,
                                         svn_boolean_t pass_through_errors)
 {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 3 02:08:12 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.