From 45e462985db891248ffcb9db21e6b66733de0b84 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 9 Oct 2014 16:44:15 -0700 Subject: 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 --- wiretap/camins.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'wiretap/camins.c') diff --git a/wiretap/camins.c b/wiretap/camins.c index 82657f2e2b..660bcf4dc3 100644 --- a/wiretap/camins.c +++ b/wiretap/camins.c @@ -299,7 +299,7 @@ camins_seek_read(wtap *wth, gint64 seek_off, -int camins_open(wtap *wth, int *err, gchar **err_info _U_) +wtap_open_return_val camins_open(wtap *wth, int *err, gchar **err_info _U_) { guint8 found_start_blocks = 0; guint8 count = 0; @@ -311,7 +311,7 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) if (!wtap_read_bytes(wth->fh, block, sizeof(block), err, err_info)) { if (*err == WTAP_ERR_SHORT_READ) break; - return -1; + return WTAP_OPEN_ERROR; } if (block[0]==0x00 && block[1] == 0xE1) @@ -321,11 +321,11 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) } while (count<20); if (found_start_blocks < 2) - return 0; /* no CAM Inspector file */ + return WTAP_OPEN_NOT_MINE; /* no CAM Inspector file */ /* rewind the fh so we re-read from the beginning */ if (-1 == file_seek(wth->fh, 0, SEEK_SET, err)) - return -1; + return WTAP_OPEN_ERROR; wth->file_encap = WTAP_ENCAP_DVBCI; wth->snapshot_length = 0; @@ -338,7 +338,7 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_CAMINS; *err = 0; - return 1; + return WTAP_OPEN_MINE; } -- cgit v1.2.1