Skip to content

Commit 2366f9c

Browse files
authored
Merge pull request #221 from freeswitch/macos
Fix MacOS build
2 parents a3b8303 + 63cf61c commit 2366f9c

File tree

9 files changed

+14
-23
lines changed

9 files changed

+14
-23
lines changed

libsofia-sip-ua/msg/msg_parser_util.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ issize_t msg_params_join(su_home_t *home,
14621462
unsigned prune,
14631463
int dup)
14641464
{
1465-
size_t n, m, n_before, n_after, pruned, total = 0;
1465+
size_t n, m, n_before, n_after, pruned;
14661466
msg_param_t *d = *dst;
14671467

14681468
if (prune > 3)
@@ -1483,8 +1483,6 @@ issize_t msg_params_join(su_home_t *home,
14831483
if (prune > 1)
14841484
continue;
14851485
}
1486-
if (dup)
1487-
total += strlen(src[m]) + 1;
14881486
}
14891487

14901488
n_after = MSG_PARAMS_NUM(n + m - pruned + 1);

libsofia-sip-ua/nta/nta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ int agent_init_via(nta_agent_t *self, tport_t *primaries, int use_maddr)
24722472

24732473
/* Set via field magic for the tports */
24742474
for (tp = primaries; tp; tp = tport_next(tp)) {
2475-
assert(via->v_common && via->v_common->h_data == tp);
2475+
assert(via && via->v_common[0].h_data == tp);
24762476
v = tport_magic(tp);
24772477
tport_set_magic(tp, new_via);
24782478
msg_header_free(self->sa_home, (void *)v);

libsofia-sip-ua/nua/nua.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ nua_handle_t *nua_handle_by_call_id(nua_t *nua, const char *call_id)
10981098
/** Get leg from dialog. */
10991099
const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh)
11001100
{
1101-
if (nh && nh->nh_ds)
1101+
if (nh)
11021102
return nh->nh_ds->ds_leg;
11031103
else
11041104
return NULL;
@@ -1107,7 +1107,7 @@ const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh)
11071107
/** Get su_home_t from nua handle. */
11081108
su_home_t *nua_handle_get_home(nua_handle_t *nh)
11091109
{
1110-
if (nh && nh->nh_home)
1110+
if (nh)
11111111
return nh->nh_home;
11121112
else
11131113
return NULL;
@@ -1116,7 +1116,7 @@ su_home_t *nua_handle_get_home(nua_handle_t *nh)
11161116
/** Get su_home_t from nua. */
11171117
su_home_t *nua_get_home(nua_t *nua)
11181118
{
1119-
if (nua && nua->nua_home)
1119+
if (nua)
11201120
return nua->nua_home;
11211121
else
11221122
return NULL;
@@ -1147,7 +1147,7 @@ unsigned nua_handle_is_destroyed(nua_handle_t *nh)
11471147

11481148
void nua_handle_dialog_usage_set_refresh_range(nua_handle_t *nh,
11491149
unsigned min, unsigned max) {
1150-
if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
1150+
if (nh && nh->nh_ds->ds_usage) {
11511151
nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, min, max);
11521152
}
11531153
}

libsofia-sip-ua/sip/sip_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ msg_mclass_t const *sip_default_mclass(void)
7373
}
7474

7575
/** Restore default SIP parser to non-extended */
76-
void sip_default_mclass_restore() {
76+
void sip_default_mclass_restore(void) {
7777
_default = sip_mclass;
7878
}
7979

libsofia-sip-ua/sip/sofia-sip/sip_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ SOFIAPUBFUN void sip_cloned_parser_destroy(void);
6767
SOFIAPUBFUN void sip_destroy_mclass(msg_mclass_t *mclass);
6868

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

7272
SOFIAPUBFUN int sip_update_default_mclass(msg_mclass_t const *mclass);
7373
SOFIAPUBFUN msg_mclass_t *sip_extend_mclass(msg_mclass_t *input);

libsofia-sip-ua/sresolv/sres.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,6 @@ static
22812281
int sres_parse_config(sres_config_t *c, FILE *f)
22822282
{
22832283
su_home_t *home = c->c_home;
2284-
int line;
22852284
char const *localdomain;
22862285
char *search = NULL, *domain = NULL;
22872286
char buf[1025];
@@ -2297,7 +2296,7 @@ int sres_parse_config(sres_config_t *c, FILE *f)
22972296
c->c_port = _sres_default_port;
22982297

22992298
if (f != NULL) {
2300-
for (line = 1; fgets(buf, sizeof(buf), f); line++) {
2299+
while (fgets(buf, sizeof(buf), f)) {
23012300
size_t len;
23022301
char *value, *b;
23032302

libsofia-sip-ua/stun/stun_dns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void priv_sres_cb(stun_dns_lookup_t *self,
9292

9393
for (i = 0; answer && answer[i] != NULL; i++) {
9494
sres_srv_record_t *rr = (sres_srv_record_t *) answer[i]->sr_srv;
95-
if (rr && rr->srv_record && rr->srv_record->r_type == sres_type_srv) {
95+
if (rr && rr->srv_record->r_type == sres_type_srv) {
9696
const char *tcp_name = STUN_SRV_SERVICE_TCP;
9797
const char *udp_name = STUN_SRV_SERVICE_UDP;
9898
if ((self->stun_state & stun_dns_tls) == 0 &&

libsofia-sip-ua/su/sofia-sip/htable.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int prefix##_resize(su_home_t *home, \
135135
size_t old_size; \
136136
size_t i, j, i0; \
137137
unsigned again = 0; \
138-
size_t used = 0, collisions = 0; \
138+
size_t used = 0; \
139139
\
140140
if (new_size == 0) \
141141
new_size = 2 * pr->pr##_size + 1; \
@@ -160,8 +160,7 @@ int prefix##_resize(su_home_t *home, \
160160
\
161161
i0 = hfun(old_hash[j]) % new_size; \
162162
\
163-
for (i = i0; new_hash[i]; i = (i + 1) % new_size, assert(i != i0)) \
164-
collisions++; \
163+
for (i = i0; new_hash[i]; i = (i + 1) % new_size, assert(i != i0)); \
165164
\
166165
new_hash[i] = old_hash[j], old_hash[j] = NULL; \
167166
used++; \

utils/sip-dig.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@
8282
* <dt>-6</dt>
8383
* <dd>Query IP6 addresses (AAAA records).
8484
* </dd>
85-
* <dt>-v</dt>
86-
* <dd>Be verbatim.
87-
* </dd>
8885
* <dt></dt>
8986
* <dd>
9087
* </dd>
@@ -204,7 +201,7 @@ void usage(int exitcode)
204201
int main(int argc, char *argv[])
205202
{
206203
int exitcode = 0;
207-
int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
204+
int o_sctp = 1, o_tls_sctp = 1;
208205
int family = 0, multiple = 0;
209206
/*
210207
char const *dnsserver = NULL;
@@ -222,9 +219,7 @@ int main(int argc, char *argv[])
222219
return -1;
223220

224221
while (argv[1] && argv[1][0] == '-') {
225-
if (strcmp(argv[1], "-v") == 0)
226-
o_verbatim++;
227-
else if (strcmp(argv[1], "-6") == 0)
222+
if (strcmp(argv[1], "-6") == 0)
228223
dig->ip6 = ++family;
229224
else if (strcmp(argv[1], "-4") == 0)
230225
dig->ip4 = ++family;

0 commit comments

Comments
 (0)