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

[PATCH] Constify some tables in utf_validate.c

From: Mark Grosberg <myg_at_gladesoft.com>
Date: 2004-11-16 23:32:28 CET

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
Received on Wed Nov 17 01:34:39 2004

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.