summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2013-07-01 15:41:05 +0000
committerBill Meier <wmeier@newsguy.com>2013-07-01 15:41:05 +0000
commit828d4e89f64e397b922ff74d70783554a29f7671 (patch)
tree3ba01f877931aa2cfa113d03e7b597c8ce7f038e /epan
parent7b5a0e4a153659551c4f57f225355c4e8504f9b5 (diff)
downloadwireshark-828d4e89f64e397b922ff74d70783554a29f7671.tar.gz
Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time the function is called). Reduces code memory usage and execution time. (See SVN #50271) svn path=/trunk/; revision=50300
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-cimd.c2
-rw-r--r--epan/dissectors/packet-enttec.c4
-rw-r--r--epan/strutil.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-cimd.c b/epan/dissectors/packet-cimd.c
index 49df5bb1dd..12ef57dfb2 100644
--- a/epan/dissectors/packet-cimd.c
+++ b/epan/dissectors/packet-cimd.c
@@ -381,7 +381,7 @@ static void dissect_cimd_ud(tvbuff_t *tvb, proto_tree *tree, gint pindex, gint s
gint g_offset, g_size;
gchar token[4];
gchar ch;
- const char* mapping[128] = {
+ static const char* mapping[128] = {
"_Oa" , "_L-", "" , "_Y-", "_e`", "_e'", "_u`", "_i`", "_o`", "_C,", /*10*/
"" , "_O/", "_o/" , "" , "_A*", "_a*", "_gd", "_--", "_gf", "_gg", "_gl", /*21*/
"_go" , "_gp", "_gi" , "_gs", "_gt", "_gx", "_XX", "_AE", "_ae", "_ss", "_E'", /*32*/
diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c
index 048b0e1195..83817caaa2 100644
--- a/epan/dissectors/packet-enttec.c
+++ b/epan/dissectors/packet-enttec.c
@@ -181,12 +181,12 @@ dissect_enttec_ack(tvbuff_t *tvb _U_, guint offset, proto_tree *tree _U_)
static gint
dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree)
{
- const char* chan_format[] = {
+ static const char* chan_format[] = {
"%2u ",
"%02x ",
"%3u "
};
- const char* string_format[] = {
+ static const char* string_format[] = {
"%03x: %s",
"%3u: %s"
};
diff --git a/epan/strutil.c b/epan/strutil.c
index d7ad038976..6c77002b5d 100644
--- a/epan/strutil.c
+++ b/epan/strutil.c
@@ -534,7 +534,7 @@ format_uri(const GByteArray *bytes, const gchar *reserved_chars)
static gchar *fmtbuf[3];
static guint fmtbuf_len[3];
static guint idx;
- const guchar *reserved_def = ":/?#[]@!$&'()*+,;= ";
+ static const guchar *reserved_def = ":/?#[]@!$&'()*+,;= ";
const guchar *reserved = reserved_def;
guint8 c;
guint column, i;