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

problems compiling using Solaris 8 c compiler

From: Max Okumoto <okumoto_at_ucsd.edu>
Date: 2001-11-28 22:19:12 CET

Hi I am compiling using the Solaris 8 c compiler, and have found
some problems. The compiler does not like non constants in struct
initializers. In the process of porting the code I found a bug in
subversion/libsvn_ra_dav/commit.c, where two params where swaped.

                                Max Okumoto

Index: ./subversion/libsvn_ra_dav/commit.c
===================================================================
--- ./subversion/libsvn_ra_dav/.svn/text-base/commit.c.svn-base Wed Nov 28 11:01:13 2001
+++ ./subversion/libsvn_ra_dav/commit.c Wed Nov 28 11:58:35 2001
@@ -256,8 +256,14 @@
   svn_stringbuf_t * activity_url;
   apr_uuid_t uuid;
   char uuid_buf[APR_UUID_FORMATTED_LENGTH + 1];
- svn_stringbuf_t uuid_str = { uuid_buf, sizeof(uuid_buf), 0, NULL };
+ svn_stringbuf_t uuid_str;
   int code;
+
+ /* Note: it looks like len and blocksize are swaped */
+ uuid_str.data = uuid_buf;
+ uuid_str.len = 0;
+ uuid_str.blocksize = sizeof(uuid_buf);
+ uuid_str.pool = NULL;
 
   /* get the URL where we'll create activities */
   SVN_ERR( get_activity_url(cc, &activity_url) );
Index: ./subversion/libsvn_ra_dav/fetch.c
===================================================================
--- ./subversion/libsvn_ra_dav/.svn/text-base/fetch.c.svn-base Wed Nov 28 11:01:16 2001
+++ ./subversion/libsvn_ra_dav/fetch.c Wed Nov 28 11:59:22 2001
@@ -332,7 +332,11 @@
   file_read_ctx_t *frc = userdata;
   svn_txdelta_window_t window = { 0 };
   svn_txdelta_op_t op;
- svn_stringbuf_t data = { (char *)buf, len, len, frc->pool };
+ svn_stringbuf_t data;
+ data.data = (char *)buf;
+ data.len = len;
+ data.blocksize = len;
+ data.pool = frc->pool;;
 
   if (frc->err)
     {
@@ -379,8 +383,12 @@
   svn_error_t *err;
   svn_error_t *err2;
   int rv;
- svn_string_t my_url = { url, strlen(url) };
- svn_stringbuf_t *url_str = svn_path_uri_encode (&my_url, pool);
+ svn_string_t my_url;
+ svn_stringbuf_t *url_str;
+
+ my_url.data = url;
+ my_url.len = strlen(url);
+ url_str = svn_path_uri_encode (&my_url, pool);
 
   err = (*editor->apply_textdelta)(file_baton,
                                    &frc.handler,
Index: ./subversion/libsvn_client/add.c
===================================================================
--- ./subversion/libsvn_client/.svn/text-base/add.c.svn-base Wed Nov 28 04:41:40 2001
+++ ./subversion/libsvn_client/add.c Wed Nov 28 05:43:07 2001
@@ -141,8 +141,11 @@
                   svn_stringbuf_t *log_msg,
                   apr_pool_t *pool)
 {
- svn_string_t path_str = { path->data, path->len };
+ svn_string_t path_str;
   apr_status_t apr_err;
+
+ path_str.data = path->data;
+ path_str.len = path->len;
 
   /* If this is a URL, we want to drive a commit editor to create this
      directory. */
Index: ./subversion/libsvn_client/commit.c
===================================================================
--- ./subversion/libsvn_client/.svn/text-base/commit.c.svn-base Sun Nov 25 02:25:06 2001
+++ ./subversion/libsvn_client/commit.c Wed Nov 28 11:10:57 2001
@@ -416,9 +416,13 @@
   svn_ra_plugin_t *ra_lib;
   svn_ra_callbacks_t *ra_callbacks;
   svn_boolean_t is_import;
- struct svn_wc_close_commit_baton ccb = {base_dir, pool};
- apr_hash_t *committed_targets = apr_hash_make (pool);
-
+ struct svn_wc_close_commit_baton ccb;
+ apr_hash_t *committed_targets;
+
+ ccb.prefix_path = base_dir;
+ ccb.pool = pool;
+ committed_targets = apr_hash_make (pool);
+
   if (url)
     is_import = TRUE;
   else
Index: ./subversion/clients/cmdline/propget-cmd.c
===================================================================
--- ./subversion/clients/cmdline/.svn/text-base/propget-cmd.c.svn-base Sat Nov 24 02:39:12 2001
+++ ./subversion/clients/cmdline/propget-cmd.c Wed Nov 28 11:11:52 2001
@@ -69,9 +69,11 @@
       svn_stringbuf_t *target = ((svn_stringbuf_t **) (targets->elts))[i];
       /* ### Main code should propably be changed to make arguments
          svn_string_t's instead of svn_stringbuf_t's */
- svn_string_t pname = { propname->data, propname->len };
+ svn_string_t pname;
       apr_hash_t *props;
       apr_hash_index_t *hi;
+ pname.data = propname->data;
+ pname.len = propname->len;
 
       SVN_ERR (svn_client_propget (&props, propname, target,
                                    opt_state->recursive, pool));
Index: ./subversion/libsvn_ra_dav/props.c
===================================================================
--- ./subversion/libsvn_ra_dav/.svn/text-base/props.c.svn-base Tue Nov 27 18:19:47 2001
+++ ./subversion/libsvn_ra_dav/props.c Wed Nov 28 11:12:34 2001
@@ -136,8 +136,12 @@
   char *url_path;
   svn_ra_dav_resource_t *r = apr_pcalloc(pc->pool, sizeof(*r));
   apr_size_t len;
- svn_string_t my_url = { url, strlen(url) };
- svn_stringbuf_t *url_str = svn_path_uri_decode(&my_url, pc->pool);
+ svn_string_t my_url;
+ svn_stringbuf_t *url_str;
+
+ my_url.data = url;
+ my_url.len = strlen(url);
+ url_str = svn_path_uri_decode(&my_url, pc->pool);
 
   r->pool = pc->pool;
 
@@ -305,9 +309,13 @@
   ne_xml_parser *hip;
   int rv;
   prop_ctx_t pc = { 0 };
- svn_string_t my_url = { url, strlen(url) };
- svn_stringbuf_t *url_str = svn_path_uri_encode(&my_url, pool);
+ svn_string_t my_url;
+ svn_stringbuf_t *url_str;
   ne_request *req;
+
+ my_url.data = url;
+ my_url.len = strlen(url);
+ url_str = svn_path_uri_encode(&my_url, pool);
 
   pc.pool = pool;
   pc.props = apr_hash_make(pc.pool);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:49 2006

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