[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-20 07:16:43 CEST

Hi,

In <20050719.215156.12661349.kou@cozmixng.org>
  "Re: svn commit: r15343 - in trunk/subversion: libsvn_subr" on Tue, 19 Jul 2005 21:51:56 +0900 (JST),
  Kouhei Sutou <kou@cozmixng.org> wrote:

> > >- if (error == SVN_NO_ERROR)
> > >+ if (err == SVN_NO_ERROR)
> > >
> > >
> > SVN_NO_ERROR is NULL by definition. we usually test this as "if (!err)"
>
> Could you fix this problem and commit the patch if you
> approve the patch?

I re-made a patch. What about the new patch?

[[[
Fix documentation and coding style.

* subversion/include/svn_nls.h:
  - Add '@since New in 1.3.'
  - Fix markups.

* subversion/libsvn_subr/cmdline.c(svn_cmdline_init),
  subversion/libsvn_subr/nls.c(svn_nls_environment_init):
  - Use err instead of error as svn_error_t * variable name.
  - Fix coding style.

* subversion/libsvn_subr/nls.c(svn_nls_init): Fix coding style.
]]]

Thanks,

--
kou

Index: subversion/include/svn_nls.h
===================================================================
--- subversion/include/svn_nls.h (revision 15372)
+++ 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 15372)
+++ 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 15372)
+++ 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)
       {
         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 Wed Jul 20 23:06:36 2005

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.