diff options
| author | Amitay Isaacs <amitay@ozlabs.org> | 2018-11-23 15:40:16 +1100 |
|---|---|---|
| committer | Alistair Popple <alistair@popple.id.au> | 2018-12-03 14:49:27 +1100 |
| commit | cc75aa0c64691c3322c8e9cda3a52767d759431d (patch) | |
| tree | d02932b1aedf43eff7ce48e214c50e4a8d02eceb | |
| parent | 870878496817f40f2c3695fb0bdb1515dfe0b7fd (diff) | |
| download | pdbg-cc75aa0c64691c3322c8e9cda3a52767d759431d.tar.gz pdbg-cc75aa0c64691c3322c8e9cda3a52767d759431d.zip | |
main: Drop unused iterators with callbacks
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
| -rw-r--r-- | src/main.c | 61 | ||||
| -rw-r--r-- | src/main.h | 8 |
2 files changed, 0 insertions, 69 deletions
@@ -532,67 +532,6 @@ bool target_selected(struct pdbg_target *target) return path_target_selected(target); } -/* Returns the sum of return codes. This can be used to count how many targets the callback was run on. */ -int for_each_child_target(char *class, struct pdbg_target *parent, - int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), - uint64_t *arg1, uint64_t *arg2) -{ - int rc = 0; - struct pdbg_target *target; - uint32_t index; - enum pdbg_target_status status; - - pdbg_for_each_target(class, parent, target) { - if (!target_selected(target)) - continue; - - index = pdbg_target_index(target); - assert(index != -1); - status = pdbg_target_status(target); - if (status != PDBG_TARGET_ENABLED) - continue; - - rc += cb(target, index, arg1, arg2); - } - - return rc; -} - -int for_each_target(char *class, int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), uint64_t *arg1, uint64_t *arg2) -{ - struct pdbg_target *target; - uint32_t index; - enum pdbg_target_status status; - int rc = 0; - - pdbg_for_each_class_target(class, target) { - if (!target_selected(target)) - continue; - - index = pdbg_target_index(target); - assert(index != -1); - status = pdbg_target_status(target); - if (status != PDBG_TARGET_ENABLED) - continue; - - rc += cb(target, index, arg1, arg2); - } - - return rc; -} - -void for_each_target_release(char *class) -{ - struct pdbg_target *target; - - pdbg_for_each_class_target(class, target) { - if (!target_selected(target)) - continue; - - pdbg_target_release(target); - } -} - static bool target_selection(void) { switch (backend) { @@ -30,11 +30,3 @@ static inline bool target_is_disabled(struct pdbg_target *target) void target_select(struct pdbg_target *target); void target_unselect(struct pdbg_target *target); bool target_selected(struct pdbg_target *target); - -/* Returns the sum of return codes. This can be used to count how many targets the callback was run on. */ -int for_each_child_target(char *class, struct pdbg_target *parent, - int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), - uint64_t *arg1, uint64_t *arg2); - -int for_each_target(char *class, int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), uint64_t *arg1, uint64_t *arg2); -void for_each_target_release(char *class); |

