You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joe Orton <jo...@manyfish.co.uk> on 2001/02/21 00:45:22 UTC

Re: CVS update: subversion/subversion/libsvn_subr svn_error.c

This was the only problem with the build on Tru64. FYI, the error the
compiler was giving was: (ignore the warning in the middle, that's still
there)

/bin/sh ../../libtool --silent --mode=compile cc -DHAVE_CONFIG_H -I. -I. 
-I../.. -I../../subversion/include -I../../apr/include 
-I../../expat-lite    -pthread -g  -c svn_error.c
cc: Error: svn_error.c, line 68: The controlling expression "ap" has a 
struct type, which is not scalar. (notscalarctrl)
  if (ap)
------^
cc: Info: svn_error.c, line 72: In this statement, the return type for 
intrinsic "strlen" is being changed from "size_t" to "int". 
(intrinsicint)
      permanent_msg = apr_palloc (newpool, (strlen (message) + 1));
--------------------------------------------^
cc: Error: svn_error.c, line 262: In this statement, "0" is of type 
"long", and cannot be converted to "struct declared without a tag". 
(noconvert)
  return make_error_internal (apr_err, src_err, child, pool, message, 
NULL);
----------------------------------------------------------------------^


On Wed, Feb 21, 2001 at 12:40:45AM -0000, joe@tigris.org wrote:
>   User: joe     
>   Date: 01/02/20 16:40:45
> 
>   Modified:    subversion/libsvn_subr svn_error.c
>   Log:
>   Fix non-portable use of 'va_list' argument.
>   
>   * svn_error.c (make_error_internal): Don't set the 'message' field
>   of the error object here.  (svn_error_create, svn_error_createf): Set it
>   here instead.
>   
>   Revision  Changes    Path
>   1.53      +16 -16    subversion/subversion/libsvn_subr/svn_error.c
>   
>   Index: svn_error.c
>   ===================================================================
>   RCS file: /cvs/subversion/subversion/libsvn_subr/svn_error.c,v
>   retrieving revision 1.52
>   retrieving revision 1.53
>   diff -u -r1.52 -r1.53
>   --- svn_error.c	2001/02/21 00:21:00	1.52
>   +++ svn_error.c	2001/02/21 00:40:45	1.53
>   @@ -36,13 +36,10 @@
>    make_error_internal (apr_status_t apr_err,
>                         int src_err,
>                         svn_error_t *child,
>   -                     apr_pool_t *pool,
>   -                     const char *message,
>   -                     va_list ap)
>   +                     apr_pool_t *pool)
>    {
>      svn_error_t *new_error;
>      apr_pool_t *newpool;
>   -  char *permanent_msg;
>    
>      /* Make a new subpool of the active error pool, or else use child's pool. */
>      if (pool)
>   @@ -64,19 +61,9 @@
>      /* Create the new error structure */
>      new_error = (svn_error_t *) apr_pcalloc (newpool, sizeof (*new_error));
>    
>   -  /* Copy the message to permanent storage. */
>   -  if (ap)
>   -    permanent_msg = apr_pvsprintf (newpool, message, ap);
>   -  else
>   -    {
>   -      permanent_msg = apr_palloc (newpool, (strlen (message) + 1));
>   -      strcpy (permanent_msg, message);
>   -    }
>   -
>      /* Fill 'er up. */
>      new_error->apr_err = apr_err;
>      new_error->src_err = src_err;
>   -  new_error->message = permanent_msg;
>      new_error->child   = child;
>      new_error->pool    = newpool;  
>    
>   @@ -259,7 +246,17 @@
>                      apr_pool_t *pool,
>                      const char *message)
>    {
>   -  return make_error_internal (apr_err, src_err, child, pool, message, NULL);
>   +  svn_error_t *err;
>   +  char *permanent_msg;
>   +
>   +  err = make_error_internal (apr_err, src_err, child, pool);
>   +  
>   +  permanent_msg = apr_palloc (err->pool, (strlen (message) + 1));
>   +  strcpy (permanent_msg, message);
>   +
>   +  err->message = permanent_msg;
>   +
>   +  return err;
>    }
>    
>    
>   @@ -274,8 +271,11 @@
>      svn_error_t *err;
>    
>      va_list ap;
>   +
>   +  err = make_error_internal (apr_err, src_err, child, pool);
>   +
>      va_start (ap, fmt);
>   -  err = make_error_internal (apr_err, src_err, child, pool, fmt, ap);
>   +  err->message = apr_pvsprintf (err->pool, fmt, ap);
>      va_end (ap);
>    
>      return err;
>   
>   
>