Skip to content

Commit

Permalink
Formatting details.
Browse files Browse the repository at this point in the history
  • Loading branch information
kr committed Nov 19, 2008
1 parent 78480f9 commit 8ddcce9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ has_reserved_job(conn c)
int
conn_set_evq(conn c, const int events, evh handler)
{
int r, margin = 0, should_timeout=0;
int r, margin = 0, should_timeout = 0;
struct timeval tv = {INT_MAX, 0};

event_set(&c->evq, c->fd, events, handler, c);
Expand Down
6 changes: 3 additions & 3 deletions job.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static unsigned long long int next_id = 1;

static int cur_prime = 0;

static job *all_jobs=NULL;
static job *all_jobs = NULL;
static size_t all_jobs_cap = 12289; /* == primes[0] */
static size_t all_jobs_used = 0;

Expand All @@ -45,7 +45,7 @@ _get_job_hash_index(unsigned long long int job_id)
static void
store_job(job j)
{
int index=0;
int index = 0;

index = _get_job_hash_index(j->id);

Expand Down Expand Up @@ -150,7 +150,7 @@ make_job_with_id(unsigned int pri, unsigned int delay, unsigned int ttr,
static void
job_hash_free(job j)
{
int index=_get_job_hash_index(j->id);
int index = _get_job_hash_index(j->id);
job jh = all_jobs ? all_jobs[index] : NULL;

if (jh) {
Expand Down
19 changes: 10 additions & 9 deletions prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ reserve_job(conn c, job j)
conn_insert(&running, c);
j->state = JOB_STATE_RESERVED;
job_insert(&c->reserved_jobs, j);
j->reserver=c;
j->reserver = c;
if (c->soonest_job && j->deadline < c->soonest_job->deadline) {
c->soonest_job = j;
c->soonest_job = j;
}
return reply_job(c, j, MSG_RESERVED);
}
Expand Down Expand Up @@ -453,7 +453,7 @@ bury_job(job j)
global_stat.buried_ct++;
j->tube->stat.buried_ct++;
j->state = JOB_STATE_BURIED;
j->reserver=NULL;
j->reserver = NULL;
j->bury_ct++;
binlog_write_job(j);
}
Expand Down Expand Up @@ -979,7 +979,7 @@ remove_this_reserved_job(conn c, job j)
if (j) {
global_stat.reserved_ct--;
j->tube->stat.reserved_ct--;
j->reserver=NULL;
j->reserver = NULL;
}
c->soonest_job = NULL;
if (!job_list_any_p(&c->reserved_jobs)) conn_remove(c);
Expand Down Expand Up @@ -1226,7 +1226,7 @@ dispatch_cmd(conn c)
case OP_TOUCH:
errno = 0;
id = strtoull(c->cmd + CMD_TOUCH_LEN, &end_buf, 10);
perror("strtoull");
perror("strtoull");
if (errno) return reply_msg(c, MSG_BAD_FORMAT);

op_ct[type]++;
Expand All @@ -1238,7 +1238,7 @@ dispatch_cmd(conn c)
} else {
return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD);
}
break;
break;
case OP_STATS:
/* don't allow trailing garbage */
if (c->cmd_len != CMD_STATS_LEN + 2) {
Expand Down Expand Up @@ -1389,7 +1389,7 @@ h_conn_timeout(conn c)
return reply_msg(remove_waiting_conn(c), MSG_DEADLINE_SOON);
} else if (conn_waiting(c) && c->pending_timeout >= 0) {
dprintf("conn_waiting(%p) = %d\n", c, conn_waiting(c));
c->pending_timeout=-1;
c->pending_timeout = -1;
return reply_msg(remove_waiting_conn(c), MSG_TIMED_OUT);
}
}
Expand Down Expand Up @@ -1630,7 +1630,7 @@ prot_replay_binlog()
binlog_jobs.prev = binlog_jobs.next = &binlog_jobs;
binlog_read(&binlog_jobs);

for(j = binlog_jobs.next ; j != &binlog_jobs ; j = nj) {
for (j = binlog_jobs.next ; j != &binlog_jobs ; j = nj) {
nj = j->next;
job_remove(j);
delay = 0;
Expand All @@ -1640,8 +1640,9 @@ prot_replay_binlog()
break;
case JOB_STATE_DELAYED:
if (start_time < j->deadline) delay = j->deadline - start_time;
/* fall through */
default:
enqueue_job(j,delay);
}
}
}
}

0 comments on commit 8ddcce9

Please sign in to comment.