Skip to content

Commit

Permalink
fix hd-rum so clang-tidy won't complain
Browse files Browse the repository at this point in the history
  • Loading branch information
xrucka authored and mpiatka committed May 30, 2024
1 parent 7e7d253 commit 3dc789c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions hd-rum-multi/hd-rum.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ static pthread_cond_t qfull_cond = PTHREAD_COND_INITIALIZER;
struct replica *replicas;
int count;

void qinit(int qsize)
static void qinit(int qsize)
{
int i;

printf("initializing packet queue for %d items\n", qsize);

queue = (struct item *) calloc(qsize, sizeof(struct item));
Expand All @@ -55,15 +53,15 @@ void qinit(int qsize)
exit(2);
}

for (i = 0; i < qsize; i++)
for (int i = 0; i < qsize; i++)
queue[i].next = queue + i + 1;
queue[qsize - 1].next = queue;

qhead = qtail = queue;
}


int buffer_size(int sock, int optname, int size)
static int buffer_size(int sock, int optname, int size)
{
socklen_t len = sizeof(int);

Expand All @@ -80,7 +78,7 @@ int buffer_size(int sock, int optname, int size)
}


int output_socket(unsigned short port, const char *host, int bufsize)
static int output_socket(unsigned short port, const char *host, int bufsize)
{
int s;
struct addrinfo hints;
Expand Down Expand Up @@ -128,13 +126,13 @@ int output_socket(unsigned short port, const char *host, int bufsize)
}


void *writer(void *arg)
static void *writer(void *arg)
{
int i;
(void)arg;

while (1) {
while (qhead != qtail) {
for (i = 0; i < count; i++)
for (int i = 0; i < count; i++)
write(replicas[i].sock, qhead->buf, qhead->size);

qhead = qhead->next;
Expand Down

0 comments on commit 3dc789c

Please sign in to comment.