Remove editor modelines and .editorconfig exceptions from root files

This commit is contained in:
David Perry 2022-02-20 19:39:37 +00:00 committed by A Wireshark GitLab Utility
parent 695ce22b0d
commit 70d432c357
19 changed files with 15965 additions and 16219 deletions

View File

@ -71,51 +71,3 @@ indent_size = 8
[*.{c,cpp,h}]
indent_style = space
indent_size = 4
[{capinfos,captype,mergecap,tfshark,tshark}.c]
indent_size = 2
[{dftest,randpkt,trigcap}.c]
indent_style = tab
indent_size = tab
[capture_stop_conditions.[ch]]
indent_size = 2
[cfile.[ch]]
indent_size = 2
[conditions.[ch]]
indent_size = 2
[file.[ch]]
indent_size = 2
[frame_tvbuff.[ch]]
indent_style = tab
indent_size = tab
[pcapio.[ch]]
indent_size = 8
[ringbuffer.[ch]]
indent_size = 2
[randpkt_core.[ch]]
indent_style = tab
indent_size = tab
[sharkd.c]
indent_size = 2
[sharkd_daemon.c]
indent_style = tab
indent_size = tab
[sharkd_session.c]
indent_style = tab
indent_size = tab
[version_info.[ch]]
indent_style = tab
indent_size = tab

View File

@ -38,7 +38,6 @@
* (Previously a success status was always
* returned if the -C option was not used).
*
*/
@ -575,7 +574,8 @@ relative_time_string(nstime_t *timer, int tsprecision, capture_info *cf_info, gb
return time_string_buf;
}
static void print_value(const gchar *text_p1, gint width, const gchar *text_p2, double value) {
static void print_value(const gchar *text_p1, gint width, const gchar *text_p2, double value)
{
if (value > 0.0)
printf("%s%.*f%s\n", text_p1, width, value, text_p2);
else
@ -1154,7 +1154,8 @@ count_decryption_secret(guint32 secrets_type _U_, const void *secrets _U_, guint
}
static void
hash_to_str(const unsigned char *hash, size_t length, char *str) {
hash_to_str(const unsigned char *hash, size_t length, char *str)
{
int i;
for (i = 0; i < (int) length; i++) {
@ -1873,16 +1874,3 @@ exit:
free_progdirs();
return overall_error_status;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -200,16 +200,3 @@ main(int argc, char *argv[])
free_progdirs();
return overall_error_status;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

13
cfile.c
View File

@ -23,16 +23,3 @@ cap_file_init(capture_file *cf)
/* Initialize the capture file struct */
memset(cf, 0, sizeof(capture_file));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

13
cfile.h
View File

@ -140,16 +140,3 @@ void cap_file_provider_set_modified_block(struct packet_provider_data *prov, fra
#endif /* __cplusplus */
#endif /* cfile.h */
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -174,16 +174,3 @@ dftest_cmdarg_err_cont(const char *fmt, va_list ap)
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

49
file.c
View File

@ -168,7 +168,6 @@ cf_callback_invoke(int event, gpointer data)
}
}
void
cf_callback_add(cf_callback_t func, gpointer user_data)
{
@ -225,7 +224,8 @@ cf_get_computed_elapsed(capture_file *cf)
return cf->computed_elapsed;
}
static void compute_elapsed(capture_file *cf, gint64 start_time)
static void
compute_elapsed(capture_file *cf, gint64 start_time)
{
gint64 delta_time = g_get_monotonic_time() - start_time;
@ -911,7 +911,8 @@ cf_continue_tail(capture_file *cf, volatile int to_read, wtap_rec *rec,
}
void
cf_fake_continue_tail(capture_file *cf) {
cf_fake_continue_tail(capture_file *cf)
{
cf->state = FILE_READ_DONE;
}
@ -1106,7 +1107,9 @@ cf_get_basename(capture_file *cf)
return displayname;
}
void cf_set_tempfile_source(capture_file *cf, gchar *source) {
void
cf_set_tempfile_source(capture_file *cf, gchar *source)
{
if (cf->source) {
g_free(cf->source);
}
@ -1118,7 +1121,9 @@ void cf_set_tempfile_source(capture_file *cf, gchar *source) {
}
}
const gchar *cf_get_tempfile_source(capture_file *cf) {
const gchar *
cf_get_tempfile_source(capture_file *cf)
{
if (!cf->source) {
return "";
}
@ -1140,37 +1145,43 @@ cf_is_tempfile(capture_file *cf)
return cf->is_tempfile;
}
void cf_set_tempfile(capture_file *cf, gboolean is_tempfile)
void
cf_set_tempfile(capture_file *cf, gboolean is_tempfile)
{
cf->is_tempfile = is_tempfile;
}
/* XXX - use a macro instead? */
void cf_set_drops_known(capture_file *cf, gboolean drops_known)
void
cf_set_drops_known(capture_file *cf, gboolean drops_known)
{
cf->drops_known = drops_known;
}
/* XXX - use a macro instead? */
void cf_set_drops(capture_file *cf, guint32 drops)
void
cf_set_drops(capture_file *cf, guint32 drops)
{
cf->drops = drops;
}
/* XXX - use a macro instead? */
gboolean cf_get_drops_known(capture_file *cf)
gboolean
cf_get_drops_known(capture_file *cf)
{
return cf->drops_known;
}
/* XXX - use a macro instead? */
guint32 cf_get_drops(capture_file *cf)
guint32
cf_get_drops(capture_file *cf)
{
return cf->drops;
}
void cf_set_rfcode(capture_file *cf, dfilter_t *rfcode)
void
cf_set_rfcode(capture_file *cf, dfilter_t *rfcode)
{
cf->rfcode = rfcode;
}
@ -5221,7 +5232,8 @@ cf_rename_failure_alert_box(const char *filename, int err)
/* Reload the current capture file. */
cf_status_t
cf_reload(capture_file *cf) {
cf_reload(capture_file *cf)
{
gchar *filename;
gboolean is_tempfile;
cf_status_t cf_status = CF_OK;
@ -5275,16 +5287,3 @@ cf_reload(capture_file *cf) {
g_free(filename);
return cf_status;
}
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

13
file.h
View File

@ -735,16 +735,3 @@ gboolean cf_add_ip_name_from_string(capture_file *cf, const char *addr, const ch
#endif /* __cplusplus */
#endif /* file.h */
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/

View File

@ -329,16 +329,3 @@ file_tvbuff_new_buffer(const struct packet_provider_data *prov,
{
return frame_tvbuff_new(prov, fd, ws_buffer_start_ptr(buf));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -37,16 +37,3 @@ extern tvbuff_t *file_tvbuff_new_buffer(const struct packet_provider_data *prov,
#endif /* __cplusplus */
#endif /* __FRAME_TVBUFF_H__ */
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -424,16 +424,3 @@ clean_exit:
free_progdirs();
return (status == MERGE_OK) ? 0 : 2;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -259,16 +259,3 @@ clean_exit:
wtap_cleanup();
return ret;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -91,7 +91,8 @@ static ringbuf_data rb_data;
/*
* delete pending uncompressed pcap files.
*/
static void CleanupOldCap(gchar* name)
static void
CleanupOldCap(gchar* name)
{
ws_statb64 statb;
size_t i;
@ -128,7 +129,8 @@ static void CleanupOldCap(gchar* name)
/*
* compress capture file
*/
static int ringbuf_exec_compress(gchar* name)
static int
ringbuf_exec_compress(gchar* name)
{
guint8 *buffer = NULL;
gchar* outgz = NULL;
@ -186,7 +188,8 @@ static int ringbuf_exec_compress(gchar* name)
/*
* thread to compress capture file
*/
static void* exec_compress_thread(void* arg)
static void*
exec_compress_thread(void* arg)
{
ringbuf_exec_compress((gchar*)arg);
return NULL;
@ -195,7 +198,8 @@ static void* exec_compress_thread(void* arg)
/*
* start a thread to compress capture file
*/
static int ringbuf_start_compress_file(rb_file* rfile)
static int
ringbuf_start_compress_file(rb_file* rfile)
{
gchar* name = g_strdup(rfile->name);
g_thread_new("exec_compress", &exec_compress_thread, name);
@ -206,7 +210,8 @@ static int ringbuf_start_compress_file(rb_file* rfile)
/*
* create the next filename and open a new binary file with that name
*/
static int ringbuf_open_file(rb_file *rfile, int *err)
static int
ringbuf_open_file(rb_file *rfile, int *err)
{
char filenum[5+1];
char timestr[14+1];
@ -385,12 +390,14 @@ ringbuf_set_print_name(gchar *name, int *err)
* Whether the ringbuf filenames are ready.
* (Whether ringbuf_init is called and ringbuf_free is not called.)
*/
gboolean ringbuf_is_initialized(void)
gboolean
ringbuf_is_initialized(void)
{
return rb_data.files != NULL;
}
const gchar *ringbuf_current_filename(void)
const gchar *
ringbuf_current_filename(void)
{
return rb_data.files[rb_data.curr_file_num % rb_data.num_files].name;
}
@ -589,16 +596,3 @@ ringbuf_error_cleanup(void)
}
#endif /* HAVE_LIBPCAP */
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -37,16 +37,3 @@ void ringbuf_error_cleanup(void);
gboolean ringbuf_set_print_name(gchar *name, int *err);
#endif /* ringbuffer.h */
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -77,7 +77,8 @@ static void sharkd_cmdarg_err(const char *msg_format, va_list ap);
static void sharkd_cmdarg_err_cont(const char *msg_format, va_list ap);
static void
print_current_user(void) {
print_current_user(void)
{
gchar *cur_user, *cur_group;
if (started_with_special_privs()) {
@ -758,16 +759,3 @@ sharkd_set_modified_block(frame_data *fd, wtap_block_t new_block)
cap_file_provider_set_modified_block(&cfile.provider, fd, new_block);
return 0;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -464,16 +464,3 @@ sharkd_loop(int argc _U_, char* argv[])
}
return 0;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -298,20 +298,20 @@ is_param_match(const char *param_in, const char *valid_param)
}
/*
* json_prep does four things:
*
* 1. check the syntax of the root and parameter members
* 2. tokenize the names and values by zero terminating them
* 3. unescape the names and values
* 4. extracts and saves the rpcid
* - we have to do it here as it's needed for the error messages
*
* The objective is to minimise the validation work in the functions
* that process each called method.
*
* This gets a little messy as the JSON parser creates a flat list
* of all members rather than create a tree.
*/
* json_prep does four things:
*
* 1. check the syntax of the root and parameter members
* 2. tokenize the names and values by zero terminating them
* 3. unescape the names and values
* 4. extracts and saves the rpcid
* - we have to do it here as it's needed for the error messages
*
* The objective is to minimise the validation work in the functions
* that process each called method.
*
* This gets a little messy as the JSON parser creates a flat list
* of all members rather than create a tree.
*/
static gboolean
json_prep(char* buf, const jsmntok_t* tokens, int count)
{
@ -5086,16 +5086,3 @@ sharkd_session_main(int mode_setting)
return 0;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -246,7 +246,8 @@ glossary_option_help(void)
}
static void
print_current_user(void) {
print_current_user(void)
{
gchar *cur_user, *cur_group;
if (started_with_special_privs()) {
@ -295,7 +296,7 @@ main(int argc, char *argv[])
e_prefs *prefs_p;
gchar *output_only = NULL;
/*
/*
* The leading + ensures that getopt_long() does not permute the argv[]
* entries.
*
@ -583,29 +584,30 @@ main(int argc, char *argv[])
goto clean_exit;
break;
case 'l': /* "Line-buffer" standard output */
/* The ANSI C standard does not appear to *require* that a line-buffered
stream be flushed to the host environment whenever a newline is
written, it just says that, on such a stream, characters "are
intended to be transmitted to or from the host environment as a
block when a new-line character is encountered".
/* The ANSI C standard does not appear to *require* that a
line-buffered stream be flushed to the host environment
whenever a newline is written, it just says that, on such a
stream, characters "are intended to be transmitted to or
from the host environment as a block when a new-line
character is encountered".
The Visual C++ 6.0 C implementation doesn't do what is intended;
even if you set a stream to be line-buffered, it still doesn't
flush the buffer at the end of every line.
The Visual C++ 6.0 C implementation doesn't do what is
intended; even if you set a stream to be line-buffered, it
still doesn't flush the buffer at the end of every line.
The whole reason for the "-l" flag in either tcpdump or TShark
is to allow the output of a live capture to be piped to a program
or script and to have that script see the information for the
packet as soon as it's printed, rather than having to wait until
a standard I/O buffer fills up.
The whole reason for the "-l" flag in either tcpdump or
TShark is to allow the output of a live capture to be piped
to a program or script and to have that script see the
information for the packet as soon as it's printed, rather
than having to wait until a standard I/O buffer fills up.
So, if the "-l" flag is specified, we flush the standard output
at the end of a packet. This will do the right thing if we're
printing packet summary lines, and, as we print the entire protocol
tree for a single packet without waiting for anything to happen,
it should be as good as line-buffered mode if we're printing
protocol trees - arguably even better, as it may do fewer
writes. */
So, if the "-l" flag is specified, we flush the standard
output at the end of a packet. This will do the right thing
if we're printing packet summary lines, and, as we print the
entire protocol tree for a single packet without waiting for
anything to happen, it should be as good as line-buffered
mode if we're printing protocol trees - arguably even
better, as it may do fewer writes. */
line_buffered = TRUE;
break;
case 'o': /* Override preference from command line */
@ -2050,13 +2052,13 @@ show_print_file_io_error(int err)
case ENOSPC:
cmdarg_err("Not all the packets could be printed because there is "
"no space left on the file system.");
"no space left on the file system.");
break;
#ifdef EDQUOT
case EDQUOT:
cmdarg_err("Not all the packets could be printed because you are "
"too close to, or over your disk quota.");
"too close to, or over your disk quota.");
break;
#endif
@ -2211,16 +2213,3 @@ tfshark_cmdarg_err_cont(const char *msg_format, va_list ap)
vfprintf(stderr, msg_format, ap);
fprintf(stderr, "\n");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -260,7 +260,8 @@ static void tshark_cmdarg_err_cont(const char *msg_format, va_list ap);
static GHashTable *output_only_tables = NULL;
static void
list_capture_types(void) {
list_capture_types(void)
{
GArray *writable_type_subtypes;
fprintf(stderr, "tshark: The available capture file types for the \"-F\" flag are:\n");
@ -294,7 +295,8 @@ string_elem_print(gpointer data)
}
static void
list_read_capture_types(void) {
list_read_capture_types(void)
{
guint i;
size_t num_file_types;
struct string_elem *captypes;
@ -319,7 +321,8 @@ list_read_capture_types(void) {
}
static void
list_export_pdu_taps(void) {
list_export_pdu_taps(void)
{
fprintf(stderr, "tshark: The available export tap names for the \"-U tap_name\" option are:\n");
for (GSList *export_pdu_tap_name_list = get_export_pdu_tap_list();
export_pdu_tap_name_list != NULL;
@ -565,7 +568,8 @@ hexdump_option_help(FILE *output)
}
static void
print_current_user(void) {
print_current_user(void)
{
gchar *cur_user, *cur_group;
if (started_with_special_privs()) {
@ -745,7 +749,7 @@ main(int argc, char *argv[])
{"elastic-mapping-filter", ws_required_argument, NULL, LONGOPT_ELASTIC_MAPPING_FILTER},
{"capture-comment", ws_required_argument, NULL, LONGOPT_CAPTURE_COMMENT},
{"hexdump", ws_required_argument, NULL, LONGOPT_HEXDUMP},
{0, 0, 0, 0 }
{0, 0, 0, 0}
};
gboolean arg_error = FALSE;
gboolean has_extcap_options = FALSE;
@ -781,7 +785,7 @@ main(int argc, char *argv[])
exp_pdu_t exp_pdu_tap_data;
const gchar* elastic_mapping_filter = NULL;
/*
/*
* The leading + ensures that getopt_long() does not permute the argv[]
* entries.
*
@ -4553,13 +4557,13 @@ show_print_file_io_error(void)
case ENOSPC:
cmdarg_err("Not all the packets could be printed because there is "
"no space left on the file system.");
"no space left on the file system.");
break;
#ifdef EDQUOT
case EDQUOT:
cmdarg_err("Not all the packets could be printed because you are "
"too close to, or over your disk quota.");
"too close to, or over your disk quota.");
break;
#endif
@ -4641,7 +4645,8 @@ tshark_cmdarg_err_cont(const char *msg_format, va_list ap)
fprintf(stderr, "\n");
}
static void reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree, gboolean visual)
static void
reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree, gboolean visual)
{
if (!epan_auto_reset || (cf->count < epan_auto_reset_count))
return;
@ -4655,16 +4660,3 @@ static void reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree,
epan_dissect_init(edt, cf->epan, tree, visual);
cf->count = 0;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/