diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-09 16:44:15 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-09 23:45:30 +0000 |
commit | 45e462985db891248ffcb9db21e6b66733de0b84 (patch) | |
tree | 90d031f9769c07abaea83330a58dd9d3933eb7b1 /wiretap/stanag4607.c | |
parent | 112c90a04b778958985b02b9663743cea1039f47 (diff) | |
download | wireshark-45e462985db891248ffcb9db21e6b66733de0b84.tar.gz |
Use an enum for the open-routine return value, as per Evan Huus's suggestion.
Clean up some things we ran across while making those changes.
Change-Id: Ic0d8943d36e6e120d7af0a6148fad98015d1e83e
Reviewed-on: https://code.wireshark.org/review/4581
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/stanag4607.c')
-rw-r--r-- | wiretap/stanag4607.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/stanag4607.c b/wiretap/stanag4607.c index 24b29d7518..a3c0a207aa 100644 --- a/wiretap/stanag4607.c +++ b/wiretap/stanag4607.c @@ -158,21 +158,21 @@ static gboolean stanag4607_seek_read(wtap *wth, gint64 seek_off, return stanag4607_read_file(wth, wth->random_fh, phdr, buf, err, err_info); } -int stanag4607_open(wtap *wth, int *err, gchar **err_info) +wtap_open_return_val stanag4607_open(wtap *wth, int *err, gchar **err_info) { guint16 version_id; stanag4607_t *stanag4607; if (!wtap_read_bytes(wth->fh, &version_id, sizeof version_id, err, err_info)) - return (*err != WTAP_ERR_SHORT_READ) ? -1 : 0; + return (*err != WTAP_ERR_SHORT_READ) ? WTAP_OPEN_ERROR : WTAP_OPEN_NOT_MINE; if (!is_valid_id(GUINT16_TO_BE(version_id))) /* Not a stanag4607 file */ - return 0; + return WTAP_OPEN_NOT_MINE; /* seek back to the start of the file */ if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) - return -1; + return WTAP_OPEN_ERROR; wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_STANAG_4607; wth->file_encap = WTAP_ENCAP_STANAG_4607; @@ -186,5 +186,5 @@ int stanag4607_open(wtap *wth, int *err, gchar **err_info) wth->subtype_seek_read = stanag4607_seek_read; wth->file_tsprec = WTAP_TSPREC_MSEC; - return 1; + return WTAP_OPEN_MINE; } |