mirror of git://git.sysmocom.de/ofono
Style: Fix a few more occurences of if/else
See Linux coding style document for details
This commit is contained in:
parent
7ffd9cb8e8
commit
955e6a61ee
|
@ -777,8 +777,9 @@ static gboolean cb_lock_property_lookup(const char *property, const char *value,
|
||||||
} else if (!strcmp(property, "Incoming")) {
|
} else if (!strcmp(property, "Incoming")) {
|
||||||
start = CB_INCOMING_START;
|
start = CB_INCOMING_START;
|
||||||
end = CB_INCOMING_END;
|
end = CB_INCOMING_END;
|
||||||
} else
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Gah, this is a special case. If we're setting a barring to
|
/* Gah, this is a special case. If we're setting a barring to
|
||||||
* disabled, then generate a disable all outgoing/incoming
|
* disabled, then generate a disable all outgoing/incoming
|
||||||
|
|
|
@ -590,8 +590,9 @@ static gboolean clip_colp_colr_ss(int type,
|
||||||
} else if (!strcmp(sc, "77")) {
|
} else if (!strcmp(sc, "77")) {
|
||||||
cs->ss_setting = CALL_SETTING_TYPE_COLR;
|
cs->ss_setting = CALL_SETTING_TYPE_COLR;
|
||||||
query_op = cs->driver->colr_query;
|
query_op = cs->driver->colr_query;
|
||||||
} else
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (type != SS_CONTROL_TYPE_QUERY || strlen(sia) || strlen(sib) ||
|
if (type != SS_CONTROL_TYPE_QUERY || strlen(sia) || strlen(sib) ||
|
||||||
strlen(sic) || strlen(dn)) {
|
strlen(sic) || strlen(dn)) {
|
||||||
|
|
|
@ -1200,8 +1200,9 @@ static DBusMessage *gprs_set_property(DBusConnection *conn,
|
||||||
}
|
}
|
||||||
|
|
||||||
gprs_netreg_update(gprs);
|
gprs_netreg_update(gprs);
|
||||||
} else
|
} else {
|
||||||
return __ofono_error_invalid_args(msg);
|
return __ofono_error_invalid_args(msg);
|
||||||
|
}
|
||||||
|
|
||||||
path = __ofono_atom_get_path(gprs->atom);
|
path = __ofono_atom_get_path(gprs->atom);
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
|
|
|
@ -187,8 +187,10 @@ int main(int argc, char **argv)
|
||||||
ofono_error("Unable to hop onto D-Bus: %s",
|
ofono_error("Unable to hop onto D-Bus: %s",
|
||||||
error.message);
|
error.message);
|
||||||
dbus_error_free(&error);
|
dbus_error_free(&error);
|
||||||
} else
|
} else {
|
||||||
ofono_error("Unable to hop onto D-Bus");
|
ofono_error("Unable to hop onto D-Bus");
|
||||||
|
}
|
||||||
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -451,8 +451,9 @@ static gboolean set_powered_timeout(gpointer user)
|
||||||
OFONO_MODEM_INTERFACE,
|
OFONO_MODEM_INTERFACE,
|
||||||
"Powered", DBUS_TYPE_BOOLEAN,
|
"Powered", DBUS_TYPE_BOOLEAN,
|
||||||
&powered);
|
&powered);
|
||||||
} else
|
} else {
|
||||||
modem->powered_pending = modem->powered;
|
modem->powered_pending = modem->powered;
|
||||||
|
}
|
||||||
|
|
||||||
if (modem->pending != NULL) {
|
if (modem->pending != NULL) {
|
||||||
DBusMessage *reply;
|
DBusMessage *reply;
|
||||||
|
|
|
@ -948,8 +948,9 @@ void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
|
||||||
* but don't emit signal */
|
* but don't emit signal */
|
||||||
if (netreg->current_operator == NULL)
|
if (netreg->current_operator == NULL)
|
||||||
return;
|
return;
|
||||||
} else
|
} else {
|
||||||
netreg->base_station = g_strdup(name);
|
netreg->base_station = g_strdup(name);
|
||||||
|
}
|
||||||
|
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
NETWORK_REGISTRATION_INTERFACE,
|
NETWORK_REGISTRATION_INTERFACE,
|
||||||
|
|
|
@ -375,8 +375,9 @@ static gboolean set_own_numbers(struct ofono_sim *sim,
|
||||||
sim_adn_build(efmsisdn, sim->efmsisdn_length,
|
sim_adn_build(efmsisdn, sim->efmsisdn_length,
|
||||||
number, NULL);
|
number, NULL);
|
||||||
new_numbers = new_numbers->next;
|
new_numbers = new_numbers->next;
|
||||||
} else
|
} else {
|
||||||
memset(efmsisdn, 0xff, sim->efmsisdn_length);
|
memset(efmsisdn, 0xff, sim->efmsisdn_length);
|
||||||
|
}
|
||||||
|
|
||||||
if (ofono_sim_write(req->sim, SIM_EFMSISDN_FILEID,
|
if (ofono_sim_write(req->sim, SIM_EFMSISDN_FILEID,
|
||||||
msisdn_set_cb, OFONO_SIM_FILE_STRUCTURE_FIXED,
|
msisdn_set_cb, OFONO_SIM_FILE_STRUCTURE_FIXED,
|
||||||
|
@ -1171,8 +1172,9 @@ skip_efpl:
|
||||||
sim->language_prefs = concat_lang_prefs(NULL, efpl);
|
sim->language_prefs = concat_lang_prefs(NULL, efpl);
|
||||||
else
|
else
|
||||||
sim->language_prefs = concat_lang_prefs(efli, efpl);
|
sim->language_prefs = concat_lang_prefs(efli, efpl);
|
||||||
} else
|
} else {
|
||||||
sim->language_prefs = concat_lang_prefs(efpl, efli);
|
sim->language_prefs = concat_lang_prefs(efpl, efli);
|
||||||
|
}
|
||||||
|
|
||||||
if (sim->efli) {
|
if (sim->efli) {
|
||||||
g_free(sim->efli);
|
g_free(sim->efli);
|
||||||
|
|
|
@ -1013,8 +1013,9 @@ void ofono_sms_register(struct ofono_sms *sms)
|
||||||
sms->assembly = sms_assembly_new(imsi);
|
sms->assembly = sms_assembly_new(imsi);
|
||||||
|
|
||||||
sms_load_settings(sms, imsi);
|
sms_load_settings(sms, imsi);
|
||||||
} else
|
} else {
|
||||||
sms->assembly = sms_assembly_new(NULL);
|
sms->assembly = sms_assembly_new(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
__ofono_atom_register(sms->atom, sms_unregister);
|
__ofono_atom_register(sms->atom, sms_unregister);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1003,8 +1003,9 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
|
||||||
if (out->status_report.pi & 0x02) {
|
if (out->status_report.pi & 0x02) {
|
||||||
if (!next_octet(pdu, len, &offset, &out->status_report.dcs))
|
if (!next_octet(pdu, len, &offset, &out->status_report.dcs))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else {
|
||||||
out->status_report.dcs = 0;
|
out->status_report.dcs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (out->status_report.pi & 0x04) {
|
if (out->status_report.pi & 0x04) {
|
||||||
int expected;
|
int expected;
|
||||||
|
@ -1125,8 +1126,9 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
|
||||||
|
|
||||||
if (!next_octet(pdu, len, &offset, &octet))
|
if (!next_octet(pdu, len, &offset, &octet))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else {
|
||||||
out->type = SMS_TYPE_DELIVER_REPORT_ACK;
|
out->type = SMS_TYPE_DELIVER_REPORT_ACK;
|
||||||
|
}
|
||||||
|
|
||||||
pi = octet & 0x07;
|
pi = octet & 0x07;
|
||||||
|
|
||||||
|
@ -1776,8 +1778,9 @@ const char *sms_address_to_string(const struct sms_address *addr)
|
||||||
addr->address[0] != '+') {
|
addr->address[0] != '+') {
|
||||||
buffer[0] = '+';
|
buffer[0] = '+';
|
||||||
strcpy(buffer + 1, addr->address);
|
strcpy(buffer + 1, addr->address);
|
||||||
} else
|
} else {
|
||||||
strcpy(buffer, addr->address);
|
strcpy(buffer, addr->address);
|
||||||
|
}
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
@ -3092,8 +3095,9 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
(unsigned char *)iso639_lang);
|
(unsigned char *)iso639_lang);
|
||||||
iso639_lang[2] = '\0';
|
iso639_lang[2] = '\0';
|
||||||
} else
|
} else {
|
||||||
iso639_2_from_language(lang, iso639_lang);
|
iso639_2_from_language(lang, iso639_lang);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = g_new(unsigned char, bufsize);
|
buf = g_new(unsigned char, bufsize);
|
||||||
|
|
|
@ -430,8 +430,9 @@ static void ussd_cancel_callback(const struct ofono_error *error, void *data)
|
||||||
ussd->state = USSD_STATE_IDLE;
|
ussd->state = USSD_STATE_IDLE;
|
||||||
|
|
||||||
reply = dbus_message_new_method_return(ussd->pending);
|
reply = dbus_message_new_method_return(ussd->pending);
|
||||||
} else
|
} else {
|
||||||
reply = __ofono_error_failed(ussd->pending);
|
reply = __ofono_error_failed(ussd->pending);
|
||||||
|
}
|
||||||
|
|
||||||
__ofono_dbus_pending_reply(&ussd->pending, reply);
|
__ofono_dbus_pending_reply(&ussd->pending, reply);
|
||||||
}
|
}
|
||||||
|
|
|
@ -933,8 +933,9 @@ unsigned char *unpack_7bit_own_buf(const unsigned char *in, long len,
|
||||||
out++;
|
out++;
|
||||||
bits = 7;
|
bits = 7;
|
||||||
rest = 0;
|
rest = 0;
|
||||||
} else
|
} else {
|
||||||
bits = bits - 1;
|
bits = bits - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* According to 23.038 6.1.2.3.1, last paragraph:
|
/* According to 23.038 6.1.2.3.1, last paragraph:
|
||||||
|
|
|
@ -829,8 +829,9 @@ static ofono_bool_t clir_string_to_clir(const char *clirstr,
|
||||||
} else if (!strcmp(clirstr, "enabled")) {
|
} else if (!strcmp(clirstr, "enabled")) {
|
||||||
*clir = OFONO_CLIR_OPTION_INVOCATION;
|
*clir = OFONO_CLIR_OPTION_INVOCATION;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ofono_call *synthesize_outgoing_call(struct ofono_voicecall *vc,
|
static struct ofono_call *synthesize_outgoing_call(struct ofono_voicecall *vc,
|
||||||
|
|
Loading…
Reference in New Issue