summaryrefslogtreecommitdiff
path: root/src/or/scheduler.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2017-07-31 19:30:30 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-03 08:56:35 -0400
commit5ee6ca8da22ad8da94c829e6c02c05920742c364 (patch)
tree4e69b0cc5f825f316aa05b290d2340c94e46c3ea /src/or/scheduler.c
parent02fcb29d11abe9556ab4d118f2f89e557d1751dd (diff)
downloadtor-5ee6ca8da22ad8da94c829e6c02c05920742c364.tar.gz
tor-5ee6ca8da22ad8da94c829e6c02c05920742c364.zip
Switch to offsetof()
Diffstat (limited to 'src/or/scheduler.c')
-rw-r--r--src/or/scheduler.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index fac545fba7..0d31c7d58c 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -282,7 +282,7 @@ scheduler_channel_doesnt_want_writes,(channel_t *chan))
*/
smartlist_pqueue_remove(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
chan->scheduler_state = SCHED_CHAN_WAITING_TO_WRITE;
log_debug(LD_SCHED,
@@ -324,7 +324,7 @@ scheduler_channel_has_waiting_cells,(channel_t *chan))
chan->scheduler_state = SCHED_CHAN_PENDING;
smartlist_pqueue_add(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
log_debug(LD_SCHED,
"Channel " U64_FORMAT " at %p went from waiting_for_cells "
@@ -400,7 +400,7 @@ scheduler_release_channel,(channel_t *chan))
if (chan->scheduler_state == SCHED_CHAN_PENDING) {
smartlist_pqueue_remove(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
}
@@ -430,7 +430,7 @@ scheduler_run, (void))
/* Pop off a channel */
chan = smartlist_pqueue_pop(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx));
+ offsetof(channel_t, sched_heap_idx));
tor_assert(chan);
/* Figure out how many cells we can write */
@@ -531,7 +531,7 @@ scheduler_run, (void))
readd_chan->scheduler_state = SCHED_CHAN_PENDING;
smartlist_pqueue_add(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
readd_chan);
} SMARTLIST_FOREACH_END(readd_chan);
smartlist_free(to_readd);
@@ -581,7 +581,7 @@ scheduler_channel_wants_writes(channel_t *chan)
*/
smartlist_pqueue_add(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
chan->scheduler_state = SCHED_CHAN_PENDING;
log_debug(LD_SCHED,
@@ -624,11 +624,11 @@ scheduler_touch_channel(channel_t *chan)
/* Remove and re-add it */
smartlist_pqueue_remove(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
smartlist_pqueue_add(channels_pending,
scheduler_compare_channels,
- STRUCT_OFFSET(channel_t, sched_heap_idx),
+ offsetof(channel_t, sched_heap_idx),
chan);
}
/* else no-op, since it isn't in the queue */