Skip to content

Commit c8ade3d

Browse files
committed
Fix warnings in MacOS X
1 parent 55ca0d1 commit c8ade3d

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

analyzer/bufpool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ suscan_buffer_alloc(unsigned int length)
7878
if (header == NULL) {
7979
SU_TRYCATCH(
8080
header = malloc(
81-
sizeof(struct suscan_buffer_header) + sizeof(SUCOMPLEX) << i),
81+
sizeof(struct suscan_buffer_header) + (sizeof(SUCOMPLEX) << i)),
8282
return NULL);
8383
}
8484

analyzer/inspector/impl/audio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ suscan_audio_inspector_commit_config(void *private)
261261
SUSCAN_AUDIO_INSPECTOR_BRICKWALL_LEN,
262262
SU_ABS2NORM_FREQ(fs, insp->req_params.audio.cutoff));
263263
break;
264+
265+
default:
266+
break;
264267
}
265268

266269
if (!filt_initialized) {
@@ -340,6 +343,9 @@ suscan_audio_inspector_feed(
340343
lo = su_ncqo_read(&self->lo);
341344
output = det_x * SU_C_CONJ(lo);
342345
break;
346+
347+
default:
348+
break;
343349
}
344350

345351
output *= self->cur_params.audio.volume;

analyzer/source.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,10 +1734,10 @@ suscan_source_set_sample_rate_near(suscan_source_t *source)
17341734
} else {
17351735
rates = source->config->device->samp_rate_list;
17361736
for (i = 0; i < source->config->device->samp_rate_count; ++i)
1737-
if (SU_ABS(rates[i] - source->config->samp_rate) < dist) {
1738-
dist = SU_ABS(rates[i] - source->config->samp_rate);
1739-
closest_rate = rates[i];
1740-
}
1737+
if (SU_ABS(SU_ASFLOAT(rates[i] - source->config->samp_rate)) < dist) {
1738+
dist = SU_ABS(SU_ASFLOAT(rates[i] - source->config->samp_rate));
1739+
closest_rate = rates[i];
1740+
}
17411741
}
17421742

17431743
if (SoapySDRDevice_setSampleRate(

util/deserialize.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,21 @@ suscan_object_populate_from_xmlNode(suscan_object_t *object, xmlNode *node)
5252

5353
for (this = node->children; this != NULL; this = this->next) {
5454
if (this->type == XML_ELEMENT_NODE) {
55-
if ((type = suscan_object_xmltag_to_type(this->name)) == -1) {
55+
if ((type = suscan_object_xmltag_to_type((const char *) this->name)) == -1) {
5656
SU_ERROR("Unrecognized tag name `%s'\n", this->name);
5757
goto fail;
5858
}
5959

6060
/* Create object */
6161
SU_TRYCATCH(new = suscan_object_new(type), goto fail);
6262

63-
if ((attrib = xmlGetProp(this, "name")) != NULL) {
63+
if ((attrib = (char *) xmlGetProp(this, (const xmlChar *) "name")) != NULL) {
6464
SU_TRYCATCH(suscan_object_set_name(new, attrib), goto fail);
6565
xmlFree(attrib);
6666
attrib = NULL;
6767
}
6868

69-
if ((attrib = xmlGetProp(this, "class")) != NULL) {
69+
if ((attrib = (char *) xmlGetProp(this, (const xmlChar *) "class")) != NULL) {
7070
SU_TRYCATCH(suscan_object_set_class(new, attrib), goto fail);
7171
xmlFree(attrib);
7272
attrib = NULL;
@@ -87,8 +87,8 @@ suscan_object_populate_from_xmlNode(suscan_object_t *object, xmlNode *node)
8787
/* Populate new object */
8888
if (type == SUSCAN_OBJECT_TYPE_FIELD) {
8989
/* Try to find value from member and contents */
90-
if ((attrib = xmlGetProp(this, "value")) == NULL)
91-
attrib = xmlNodeGetContent(this);
90+
if ((attrib = (char *) xmlGetProp(this, (const xmlChar *) "value")) == NULL)
91+
attrib = (char *) xmlNodeGetContent(this);
9292

9393
if (attrib != NULL) {
9494
SU_TRYCATCH(suscan_object_set_value(new, attrib), goto fail);
@@ -140,7 +140,7 @@ suscan_object_from_xml(const char *url, const void *data, size_t size)
140140
goto done;
141141
}
142142

143-
if (strcmp(root->name, "serialization") != 0) {
143+
if (strcmp((const char *) root->name, "serialization") != 0) {
144144
SU_ERROR("Unexpected root tag `%s' in `%s'\n", root->name, url);
145145
goto done;
146146
}

0 commit comments

Comments
 (0)