Skip to content

Commit

Permalink
siprepo: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 6b63f48 commit 2c17fbc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
13 changes: 7 additions & 6 deletions src/modules/siprepo/siprepo_data.h
Expand Up @@ -29,7 +29,8 @@

#define SIPREPO_RMODE_RM 1

typedef struct siprepo_msg {
typedef struct siprepo_msg
{
unsigned int hid;
int mtype;
str msgid;
Expand All @@ -49,18 +50,18 @@ typedef struct siprepo_msg {
struct siprepo_msg *prev;
} siprepo_msg_t;

typedef struct siprepo_slot {
typedef struct siprepo_slot
{
siprepo_msg_t *plist;
gen_lock_t lock;
} siprepo_slot_t;

int siprepo_table_init(void);
int siprepo_msg_set(sip_msg_t *msg, str *msgid, int rmode);
int siprepo_msg_rm(str *callid, str *msgid);
int siprepo_msg_pull(str *callid, str *msgid, str *rname,
int rmode);
int siprepo_msg_async_pull(str *callid, str *msgid, str *gname,
str *rname, int rmode);
int siprepo_msg_pull(str *callid, str *msgid, str *rname, int rmode);
int siprepo_msg_async_pull(
str *callid, str *msgid, str *gname, str *rname, int rmode);
int siprepo_msg_check(sip_msg_t *msg);
void siprepo_msg_timer(unsigned int ticks, int worker, void *param);

Expand Down
35 changes: 18 additions & 17 deletions src/modules/siprepo/siprepo_mod.c
Expand Up @@ -49,8 +49,8 @@ static int child_init(int);
static void mod_destroy(void);

static int w_sr_msg_push(sip_msg_t *msg, char *pmsgid, char *prmode);
static int w_sr_msg_pull(sip_msg_t *msg, char *pcallid, char *pmsgid, char *prname,
char *prmode);
static int w_sr_msg_pull(sip_msg_t *msg, char *pcallid, char *pmsgid,
char *prname, char *prmode);
static int w_sr_msg_async_pull(sip_msg_t *msg, char *pcallid, char *pmsgid,
char *pgname, char *prname, char *prmode);
static int w_sr_msg_rm(sip_msg_t *msg, char *pcallid, char *pmsgid);
Expand Down Expand Up @@ -108,7 +108,7 @@ struct module_exports exports = {
*/
static int mod_init(void)
{
if(siprepo_table_init()<0) {
if(siprepo_table_init() < 0) {
LM_ERR("failed to initialize hash table\n");
return -1;
}
Expand All @@ -124,14 +124,15 @@ static int child_init(int rank)
int i;
char si_desc[MAX_PT_DESC];

if(rank!=PROC_MAIN) {
if(rank != PROC_MAIN) {
return 0;
}
for(i=0; i<_siprepo_timer_procs; i++) {
for(i = 0; i < _siprepo_timer_procs; i++) {
snprintf(si_desc, MAX_PT_DESC, "SIPREPO child=%d", i);
if(fork_basic_timer_w(PROC_TIMER, si_desc, 1 /*socks flag*/,
siprepo_timer_exec, i, NULL, _siprepo_timer_interval
/*sec*/)<0) {
siprepo_timer_exec, i, NULL, _siprepo_timer_interval
/*sec*/)
< 0) {
LM_ERR("failed to start timer routine as process\n");
return -1; /* error */
}
Expand All @@ -155,7 +156,7 @@ static int ki_sr_msg_push(sip_msg_t *msg, str *msgid, int rmode)

ret = siprepo_msg_set(msg, msgid, rmode);

if(ret<0) {
if(ret < 0) {
return ret;
}
return 1;
Expand Down Expand Up @@ -184,14 +185,14 @@ static int w_sr_msg_push(sip_msg_t *msg, char *pmsgid, char *prmode)
/**
*
*/
static int ki_sr_msg_pull(sip_msg_t *msg, str *callid, str *msgid, str *rname,
int rmode)
static int ki_sr_msg_pull(
sip_msg_t *msg, str *callid, str *msgid, str *rname, int rmode)
{
int ret;

ret = siprepo_msg_pull(callid, msgid, rname, rmode);

if(ret<0) {
if(ret < 0) {
return ret;
}
return 1;
Expand All @@ -200,8 +201,8 @@ static int ki_sr_msg_pull(sip_msg_t *msg, str *callid, str *msgid, str *rname,
/**
*
*/
static int w_sr_msg_pull(sip_msg_t *msg, char *pcallid, char *pmsgid, char *prname,
char *prmode)
static int w_sr_msg_pull(
sip_msg_t *msg, char *pcallid, char *pmsgid, char *prname, char *prmode)
{
str callid = STR_NULL;
str msgid = STR_NULL;
Expand Down Expand Up @@ -238,7 +239,7 @@ static int ki_sr_msg_async_pull(sip_msg_t *msg, str *callid, str *msgid,

ret = siprepo_msg_async_pull(callid, msgid, gname, rname, rmode);

if(ret<0) {
if(ret < 0) {
return ret;
}
return 1;
Expand Down Expand Up @@ -290,7 +291,7 @@ static int ki_sr_msg_rm(sip_msg_t *msg, str *callid, str *msgid)

ret = siprepo_msg_rm(callid, msgid);

if(ret<0) {
if(ret < 0) {
return ret;
}
return 1;
Expand Down Expand Up @@ -325,8 +326,8 @@ static int ki_sr_msg_check(sip_msg_t *msg)

ret = siprepo_msg_check(msg);

if(ret<=0) {
return (ret-1);
if(ret <= 0) {
return (ret - 1);
}
return ret;
}
Expand Down

0 comments on commit 2c17fbc

Please sign in to comment.