aboutsummaryrefslogtreecommitdiffstats
path: root/epan/disabled_protos.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-03-18 13:13:44 -0700
committerAnders Broman <a.broman58@gmail.com>2016-06-13 16:18:25 +0000
commite2e84563eeb1e7b9add817d2b0c39656fab297d5 (patch)
tree083a272cec243de00c603c63a395c0e3e91c04d6 /epan/disabled_protos.c
parent92ef3d0b55a37f042e1ce7e208e7f39cb49b9bce (diff)
Use getc_unlocked in a few places.
Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This reduces startup time by about 100ms here. Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af Reviewed-on: https://code.wireshark.org/review/14518 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/disabled_protos.c')
-rw-r--r--epan/disabled_protos.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c
index 9398f41599..c0492602a9 100644
--- a/epan/disabled_protos.c
+++ b/epan/disabled_protos.c
@@ -214,7 +214,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff,
a protocol to be disabled. */
/* Skip over leading white space, if any. */
- while ((c = getc(ff)) != EOF && g_ascii_isspace(c)) {
+ while ((c = ws_getc_unlocked(ff)) != EOF && g_ascii_isspace(c)) {
if (c == '\n') {
/* Blank line. */
continue;
@@ -232,7 +232,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff,
/* Get the name of the protocol. */
prot_name_index = 0;
for (;;) {
- c = getc(ff);
+ c = ws_getc_unlocked(ff);
if (c == EOF)
break; /* End of file, or I/O error */
if (g_ascii_isspace(c))
@@ -251,7 +251,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff,
if (g_ascii_isspace(c) && c != '\n') {
/* Skip over trailing white space. */
- while ((c = getc(ff)) != EOF && c != '\n' && g_ascii_isspace(c))
+ while ((c = ws_getc_unlocked(ff)) != EOF && c != '\n' && g_ascii_isspace(c))
;
if (c != EOF && c != '\n' && c != '#') {
/* Non-white-space after the protocol name; warn about it,
@@ -262,7 +262,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff,
}
if (c != EOF && c != '\n') {
/* Skip to end of line. */
- while ((c = getc(ff)) != EOF && c != '\n')
+ while ((c = ws_getc_unlocked(ff)) != EOF && c != '\n')
;
}
@@ -529,7 +529,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
a protocol to be disabled. */
/* Skip over leading white space, if any. */
- while ((c = getc(ff)) != EOF && g_ascii_isspace(c)) {
+ while ((c = ws_getc_unlocked(ff)) != EOF && g_ascii_isspace(c)) {
if (c == '\n') {
/* Blank line. */
continue;
@@ -549,7 +549,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
enabled = FALSE;
parse_enabled = FALSE;
for (;;) {
- c = getc(ff);
+ c = ws_getc_unlocked(ff);
if (c == EOF)
break; /* End of file, or I/O error */
if (g_ascii_isspace(c))
@@ -576,7 +576,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
if (g_ascii_isspace(c) && c != '\n') {
/* Skip over trailing white space. */
- while ((c = getc(ff)) != EOF && c != '\n' && g_ascii_isspace(c))
+ while ((c = ws_getc_unlocked(ff)) != EOF && c != '\n' && g_ascii_isspace(c))
;
if (c != EOF && c != '\n' && c != '#') {
/* Non-white-space after the protocol name; warn about it,
@@ -587,7 +587,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
}
if (c != EOF && c != '\n') {
/* Skip to end of line. */
- while ((c = getc(ff)) != EOF && c != '\n')
+ while ((c = ws_getc_unlocked(ff)) != EOF && c != '\n')
;
}