From 347753be1d6bb07249641c84c3c582113af81941 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 18 Nov 2010 16:06:27 +0100 Subject: Allow safe deletion during iteration of an ARefSet. + make AREFSET_FOREACH take the name of an existing type variable which avoids an annoying type-cast in each statement. Change-Id: Icf9d886601a9876fa29c15eb0e60a9bf6c8ec163 --- android/looper-generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'android/looper-generic.c') diff --git a/android/looper-generic.c b/android/looper-generic.c index 38d8ab5..b471c50 100644 --- a/android/looper-generic.c +++ b/android/looper-generic.c @@ -363,10 +363,10 @@ glooper_run(Looper* ll) } if (ret > 0) { unsigned ready; + GLoopIo* io; /* Add io waiters to the pending list */ - AREFSET_FOREACH(looper->ios, io_, { - GLoopIo* io = io_; + AREFSET_FOREACH(looper->ios, io, { if (io->wanted == 0) continue; @@ -419,8 +419,8 @@ glooper_run(Looper* ll) /* Now fire the pending ios */ { - AREFSET_FOREACH(looper->pendingIos,io_,{ - GLoopIo* io = io_; + GLoopIo* io; + AREFSET_FOREACH(looper->pendingIos,io,{ io->callback(io->opaque,io->fd,io->ready); }); arefSet_clear(looper->pendingIos); -- cgit v1.1