You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mark Grosberg <my...@gladesoft.com> on 2004/11/16 22:32:28 UTC

[PATCH] Constify some tables in utf_validate.c

Hello all,

Here is a patch to constify a few tables that are read-only.

- Mark G.

------------------------------------------------------------------------

   * utf_validate.c
     (octet_category, machine): Made tables constant.


Index: subversion/libsvn_subr/utf_validate.c
===================================================================
--- subversion/libsvn_subr/utf_validate.c	(revision 11927)
+++ subversion/libsvn_subr/utf_validate.c	(working copy)
@@ -54,7 +54,7 @@
  #include "utf_impl.h"

  /* Lookup table to categorise each octet in the string. */
-static char octet_category[256] = {
+static const char octet_category[256] = {
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, /* 0x00-0x7f */
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
@@ -98,7 +98,7 @@
     harder to understand?  */

  /* Machine transition table */
-static char machine [9][14] = {
+static const char machine [9][14] = {
    /* FSM_START */
    {FSM_START,         /* 0x00-0x7f */
     FSM_ERROR,         /* 0x80-0x8f */

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Constify some tables in utf_validate.c

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Tue, 16 Nov 2004, Mark Grosberg wrote:

>
> Here is a patch to constify a few tables that are read-only.
>
Thank you. For some reason, there was whitespace mismatch between the file
in the repository and your patch, so I hand-applied it instead. Committed
in r11956. I fixed the log message to look like what we usually write. You
can check it out if you want to.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org