commit 97376d740e7dffca1e825789f8a88afdf3db7a0d Author: Egeyar Bagcioglu Date: Sun Jan 12 02:01:56 2020 +0100 Remove ios_get and replace bogus ios_get calls with ios_search_by_id. diff --git a/ChangeLog b/ChangeLog index 4488737c..2b4fc162 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2020-01-12 Egeyar Bagcioglu + + * src/ios.c (ios_get): Remove. + * src/ios.h (ios_get): Likewise. + * src/pk-file.c (pk_cmd_file): Replace the bogus call to ios_get + with ios_search_by_id. + (pk_cmd_close): Replace the bogus call to ios_get with + ios_search_by_id. + 2020-01-12 Egeyar Bagcioglu * src/ios.c (ios_open): Add argument set_cur to control making diff --git a/src/ios.c b/src/ios.c index d9f13fc6..587cf853 100644 --- a/src/ios.c +++ b/src/ios.c @@ -289,20 +289,6 @@ ios_search_by_id (int id) return io; } -ios -ios_get (int n) -{ - ios io; - - if (n < 0) - return NULL; - - for (io = io_list; io && n > 0; n--, io = io->next) - ; - - return io; -} - int ios_get_id (ios io) { diff --git a/src/ios.h b/src/ios.h index e09c8800..6121a9af 100644 --- a/src/ios.h +++ b/src/ios.h @@ -160,11 +160,6 @@ ios ios_search (const char *handler); ios ios_search_by_id (int id); -/* Return the Nth IO space. If N is negative or bigger than the - number of IO spaces which are currently opened, return NULL. */ - -ios ios_get (int n); - /* Return the ID of the given IO space. */ int ios_get_id (ios io); diff --git a/src/pk-file.c b/src/pk-file.c index 52f00f77..5ff46e58 100644 --- a/src/pk-file.c +++ b/src/pk-file.c @@ -91,7 +91,7 @@ pk_cmd_file (int argc, struct pk_cmd_arg argv[], uint64_t uflags) ios io; io_id = PK_CMD_ARG_TAG (argv[0]); - io = ios_get (io_id); + io = ios_search_by_id (io_id); if (io == NULL) { pk_printf (_("No such file #%d\n"), io_id); @@ -159,7 +159,7 @@ pk_cmd_close (int argc, struct pk_cmd_arg argv[], uint64_t uflags) { int io_id = PK_CMD_ARG_TAG (argv[0]); - io = ios_get (io_id); + io = ios_search_by_id (io_id); if (io == NULL) { pk_printf (_("No such file #%d\n"), io_id);