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

Re: svn commit: r15343 - in trunk/subversion: libsvn_subr

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2005-07-19 04:44:25 CEST

Hi,

In <42DB7E16.10700@xbc.nu>
  "Re: svn commit: r15343 - in trunk/subversion: libsvn_subr" on Mon, 18 Jul 2005 12:01:58 +0200,
  Branko ╚ibej <brane@xbc.nu> wrote:

> >@@ -87,10 +87,10 @@
> > apr_err = APR_INCOMPLETE;
> > if (apr_err)
> > {
> >- error = svn_error_create(apr_err, NULL,
> >- _("Can't convert module path "
> >- "to UTF-8 from UCS-2: '%s'"),
> >- ucs2_path);
> >+ err = svn_error_create(apr_err, NULL,
> >+ _("Can't convert module path "
> >+ "to UTF-8 from UCS-2: '%s'"),
> >+ ucs2_path);
> >
> >
> This should be svn_error_createf.
> Another thing: this file uses the space-before-paren-in-function-call
> style, which you don't follow consistently. Please fix this.

I see.
What about the new patch?

Thanks,

--
kou

Index: subversion/include/svn_nls.h
===================================================================
--- subversion/include/svn_nls.h (revision 15359)
+++ subversion/include/svn_nls.h (working copy)
@@ -29,24 +29,28 @@
 #endif /* __cplusplus */
 
 /** Set up the NLS environment.
- * Return the error @c APR_EINVAL or APR_INCOMPLETE if an
+ * Return the error @c APR_EINVAL or @c APR_INCOMPLETE if an
  * error occurs.
  *
  * @note This function is for bindings. You should usually
- * use @c svn_cmdline_init() instead of calling this
+ * use svn_cmdline_init() instead of calling this
  * function directly. This function should be called
  * after initializing APR.
+ *
+ * @since New in 1.3.
  */
 svn_error_t *svn_nls_environment_init (void);
 
 /** Set up the NLS which includes NLS environment set up.
- * Return the error @c APR_EINVAL or APR_INCOMPLETE if an
+ * Return the error @c APR_EINVAL or @c APR_INCOMPLETE if an
  * error occurs.
  *
  * @note This function is for bindings. You should usually
- * use @c svn_cmdline_init() instead of calling this
+ * use svn_cmdline_init() instead of calling this
  * function directly. This function should be called
  * after initializing APR.
+ *
+ * @since New in 1.3.
  */
 svn_error_t *svn_nls_init (void);
 
Index: subversion/libsvn_subr/cmdline.c
===================================================================
--- subversion/libsvn_subr/cmdline.c (revision 15359)
+++ subversion/libsvn_subr/cmdline.c (working copy)
@@ -156,13 +156,13 @@
   svn_utf_initialize (pool);
   
   {
- svn_error_t *error = svn_nls_init();
- if (error)
+ svn_error_t *err = svn_nls_init();
+ if (err)
       {
- if (error_stream)
- fprintf(error_stream, "%s", error->message);
+ if (error_stream && err->message)
+ fprintf (error_stream, "%s", err->message);
         
- svn_error_clear(error);
+ svn_error_clear (err);
         return EXIT_FAILURE;
       }
   }
Index: subversion/libsvn_subr/nls.c
===================================================================
--- subversion/libsvn_subr/nls.c (revision 15359)
+++ subversion/libsvn_subr/nls.c (working copy)
@@ -45,7 +45,7 @@
 svn_error_t *
 svn_nls_environment_init (void)
 {
- svn_error_t *error = SVN_NO_ERROR;
+ svn_error_t *err = SVN_NO_ERROR;
   
 #ifdef ENABLE_NLS
 #ifdef WIN32
@@ -60,7 +60,7 @@
     apr_pool_create (&pool, 0);
     /* get exe name - our locale info will be in '../share/locale' */
     inwords = GetModuleFileNameW (0, ucs2_path,
- sizeof (ucs2_path) / sizeof(ucs2_path[0]));
+ sizeof (ucs2_path) / sizeof (ucs2_path[0]));
     if (! inwords)
       {
         /* We must be on a Win9x machine, so attempt to get an ANSI path,
@@ -73,20 +73,20 @@
               MultiByteToWideChar (CP_ACP, 0, ansi_path, -1, ucs2_path,
                                    sizeof (ucs2_path) / sizeof (ucs2_path[0]));
             if (! inwords) {
- error =
- svn_error_createf(APR_EINVAL, NULL,
- _("Can't convert string to UCS-2: '%s'"),
- ansi_path);
+ err =
+ svn_error_createf (APR_EINVAL, NULL,
+ _("Can't convert string to UCS-2: '%s'"),
+ ansi_path);
             }
           }
         else
           {
- error = svn_error_create(APR_EINVAL, NULL,
- _("Can't get module file name"));
+ err = svn_error_create (APR_EINVAL, NULL,
+ _("Can't get module file name"));
           }
       }
 
- if (error == SVN_NO_ERROR)
+ if (err == SVN_NO_ERROR)
       {
         outbytes = outlength = 3 * (inwords + 1);
         utf8_path = apr_palloc (pool, outlength);
@@ -96,7 +96,7 @@
           apr_err = APR_INCOMPLETE;
         if (apr_err)
           {
- error = svn_error_create(apr_err, NULL,
+ err = svn_error_createf (apr_err, NULL,
                                      _("Can't convert module path "
                                        "to UTF-8 from UCS-2: '%s'"),
                                      ucs2_path);
@@ -116,22 +116,22 @@
     apr_pool_destroy (pool);
   }
 #else
- bindtextdomain(PACKAGE_NAME, SVN_LOCALE_DIR);
+ bindtextdomain (PACKAGE_NAME, SVN_LOCALE_DIR);
 #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
- bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
+ bind_textdomain_codeset (PACKAGE_NAME, "UTF-8");
 #endif
 #endif
 #endif
 
- return error;
+ return err;
 }
 
 svn_error_t *
 svn_nls_init (void)
 {
 #ifdef ENABLE_NLS
- SVN_ERR(svn_nls_environment_init());
- textdomain(PACKAGE_NAME);
+ SVN_ERR (svn_nls_environment_init ());
+ textdomain (PACKAGE_NAME);
 #endif
 
   return SVN_NO_ERROR;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 19 04:45:07 2005

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