Skip to content

Commit

Permalink
Merge pull request #221 from freeswitch/macos
Browse files Browse the repository at this point in the history
Fix MacOS build
  • Loading branch information
andywolk committed Jun 18, 2023
2 parents a3b8303 + 63cf61c commit 2366f9c
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 23 deletions.
4 changes: 1 addition & 3 deletions libsofia-sip-ua/msg/msg_parser_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ issize_t msg_params_join(su_home_t *home,
unsigned prune,
int dup)
{
size_t n, m, n_before, n_after, pruned, total = 0;
size_t n, m, n_before, n_after, pruned;
msg_param_t *d = *dst;

if (prune > 3)
Expand All @@ -1483,8 +1483,6 @@ issize_t msg_params_join(su_home_t *home,
if (prune > 1)
continue;
}
if (dup)
total += strlen(src[m]) + 1;
}

n_after = MSG_PARAMS_NUM(n + m - pruned + 1);
Expand Down
2 changes: 1 addition & 1 deletion libsofia-sip-ua/nta/nta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ int agent_init_via(nta_agent_t *self, tport_t *primaries, int use_maddr)

/* Set via field magic for the tports */
for (tp = primaries; tp; tp = tport_next(tp)) {
assert(via->v_common && via->v_common->h_data == tp);
assert(via && via->v_common[0].h_data == tp);
v = tport_magic(tp);
tport_set_magic(tp, new_via);
msg_header_free(self->sa_home, (void *)v);
Expand Down
8 changes: 4 additions & 4 deletions libsofia-sip-ua/nua/nua.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ nua_handle_t *nua_handle_by_call_id(nua_t *nua, const char *call_id)
/** Get leg from dialog. */
const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh)
{
if (nh && nh->nh_ds)
if (nh)
return nh->nh_ds->ds_leg;
else
return NULL;
Expand All @@ -1107,7 +1107,7 @@ const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh)
/** Get su_home_t from nua handle. */
su_home_t *nua_handle_get_home(nua_handle_t *nh)
{
if (nh && nh->nh_home)
if (nh)
return nh->nh_home;
else
return NULL;
Expand All @@ -1116,7 +1116,7 @@ su_home_t *nua_handle_get_home(nua_handle_t *nh)
/** Get su_home_t from nua. */
su_home_t *nua_get_home(nua_t *nua)
{
if (nua && nua->nua_home)
if (nua)
return nua->nua_home;
else
return NULL;
Expand Down Expand Up @@ -1147,7 +1147,7 @@ unsigned nua_handle_is_destroyed(nua_handle_t *nh)

void nua_handle_dialog_usage_set_refresh_range(nua_handle_t *nh,
unsigned min, unsigned max) {
if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
if (nh && nh->nh_ds->ds_usage) {
nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, min, max);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libsofia-sip-ua/sip/sip_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ msg_mclass_t const *sip_default_mclass(void)
}

/** Restore default SIP parser to non-extended */
void sip_default_mclass_restore() {
void sip_default_mclass_restore(void) {
_default = sip_mclass;
}

Expand Down
2 changes: 1 addition & 1 deletion libsofia-sip-ua/sip/sofia-sip/sip_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SOFIAPUBFUN void sip_cloned_parser_destroy(void);
SOFIAPUBFUN void sip_destroy_mclass(msg_mclass_t *mclass);

/** Restore default SIP parser to non-extended */
SOFIAPUBFUN void sip_default_mclass_restore();
SOFIAPUBFUN void sip_default_mclass_restore(void);

SOFIAPUBFUN int sip_update_default_mclass(msg_mclass_t const *mclass);
SOFIAPUBFUN msg_mclass_t *sip_extend_mclass(msg_mclass_t *input);
Expand Down
3 changes: 1 addition & 2 deletions libsofia-sip-ua/sresolv/sres.c
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,6 @@ static
int sres_parse_config(sres_config_t *c, FILE *f)
{
su_home_t *home = c->c_home;
int line;
char const *localdomain;
char *search = NULL, *domain = NULL;
char buf[1025];
Expand All @@ -2297,7 +2296,7 @@ int sres_parse_config(sres_config_t *c, FILE *f)
c->c_port = _sres_default_port;

if (f != NULL) {
for (line = 1; fgets(buf, sizeof(buf), f); line++) {
while (fgets(buf, sizeof(buf), f)) {
size_t len;
char *value, *b;

Expand Down
2 changes: 1 addition & 1 deletion libsofia-sip-ua/stun/stun_dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void priv_sres_cb(stun_dns_lookup_t *self,

for (i = 0; answer && answer[i] != NULL; i++) {
sres_srv_record_t *rr = (sres_srv_record_t *) answer[i]->sr_srv;
if (rr && rr->srv_record && rr->srv_record->r_type == sres_type_srv) {
if (rr && rr->srv_record->r_type == sres_type_srv) {
const char *tcp_name = STUN_SRV_SERVICE_TCP;
const char *udp_name = STUN_SRV_SERVICE_UDP;
if ((self->stun_state & stun_dns_tls) == 0 &&
Expand Down
5 changes: 2 additions & 3 deletions libsofia-sip-ua/su/sofia-sip/htable.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int prefix##_resize(su_home_t *home, \
size_t old_size; \
size_t i, j, i0; \
unsigned again = 0; \
size_t used = 0, collisions = 0; \
size_t used = 0; \
\
if (new_size == 0) \
new_size = 2 * pr->pr##_size + 1; \
Expand All @@ -160,8 +160,7 @@ int prefix##_resize(su_home_t *home, \
\
i0 = hfun(old_hash[j]) % new_size; \
\
for (i = i0; new_hash[i]; i = (i + 1) % new_size, assert(i != i0)) \
collisions++; \
for (i = i0; new_hash[i]; i = (i + 1) % new_size, assert(i != i0)); \
\
new_hash[i] = old_hash[j], old_hash[j] = NULL; \
used++; \
Expand Down
9 changes: 2 additions & 7 deletions utils/sip-dig.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@
* <dt>-6</dt>
* <dd>Query IP6 addresses (AAAA records).
* </dd>
* <dt>-v</dt>
* <dd>Be verbatim.
* </dd>
* <dt></dt>
* <dd>
* </dd>
Expand Down Expand Up @@ -204,7 +201,7 @@ void usage(int exitcode)
int main(int argc, char *argv[])
{
int exitcode = 0;
int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
int o_sctp = 1, o_tls_sctp = 1;
int family = 0, multiple = 0;
/*
char const *dnsserver = NULL;
Expand All @@ -222,9 +219,7 @@ int main(int argc, char *argv[])
return -1;

while (argv[1] && argv[1][0] == '-') {
if (strcmp(argv[1], "-v") == 0)
o_verbatim++;
else if (strcmp(argv[1], "-6") == 0)
if (strcmp(argv[1], "-6") == 0)
dig->ip6 = ++family;
else if (strcmp(argv[1], "-4") == 0)
dig->ip4 = ++family;
Expand Down

0 comments on commit 2366f9c

Please sign in to comment.