Style: Fix a few more occurences of if/else

See Linux coding style document for details
This commit is contained in:
Denis Kenzior 2009-12-17 21:31:35 -06:00
parent 7ffd9cb8e8
commit 955e6a61ee
12 changed files with 33 additions and 16 deletions

View File

@ -777,8 +777,9 @@ static gboolean cb_lock_property_lookup(const char *property, const char *value,
} else if (!strcmp(property, "Incoming")) {
start = CB_INCOMING_START;
end = CB_INCOMING_END;
} else
} else {
return FALSE;
}
/* Gah, this is a special case. If we're setting a barring to
* disabled, then generate a disable all outgoing/incoming

View File

@ -590,8 +590,9 @@ static gboolean clip_colp_colr_ss(int type,
} else if (!strcmp(sc, "77")) {
cs->ss_setting = CALL_SETTING_TYPE_COLR;
query_op = cs->driver->colr_query;
} else
} else {
return FALSE;
}
if (type != SS_CONTROL_TYPE_QUERY || strlen(sia) || strlen(sib) ||
strlen(sic) || strlen(dn)) {

View File

@ -1200,8 +1200,9 @@ static DBusMessage *gprs_set_property(DBusConnection *conn,
}
gprs_netreg_update(gprs);
} else
} else {
return __ofono_error_invalid_args(msg);
}
path = __ofono_atom_get_path(gprs->atom);
ofono_dbus_signal_property_changed(conn, path,

View File

@ -187,8 +187,10 @@ int main(int argc, char **argv)
ofono_error("Unable to hop onto D-Bus: %s",
error.message);
dbus_error_free(&error);
} else
} else {
ofono_error("Unable to hop onto D-Bus");
}
goto cleanup;
}

View File

@ -451,8 +451,9 @@ static gboolean set_powered_timeout(gpointer user)
OFONO_MODEM_INTERFACE,
"Powered", DBUS_TYPE_BOOLEAN,
&powered);
} else
} else {
modem->powered_pending = modem->powered;
}
if (modem->pending != NULL) {
DBusMessage *reply;

View File

@ -948,8 +948,9 @@ void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
* but don't emit signal */
if (netreg->current_operator == NULL)
return;
} else
} else {
netreg->base_station = g_strdup(name);
}
ofono_dbus_signal_property_changed(conn, path,
NETWORK_REGISTRATION_INTERFACE,

View File

@ -375,8 +375,9 @@ static gboolean set_own_numbers(struct ofono_sim *sim,
sim_adn_build(efmsisdn, sim->efmsisdn_length,
number, NULL);
new_numbers = new_numbers->next;
} else
} else {
memset(efmsisdn, 0xff, sim->efmsisdn_length);
}
if (ofono_sim_write(req->sim, SIM_EFMSISDN_FILEID,
msisdn_set_cb, OFONO_SIM_FILE_STRUCTURE_FIXED,
@ -1171,8 +1172,9 @@ skip_efpl:
sim->language_prefs = concat_lang_prefs(NULL, efpl);
else
sim->language_prefs = concat_lang_prefs(efli, efpl);
} else
} else {
sim->language_prefs = concat_lang_prefs(efpl, efli);
}
if (sim->efli) {
g_free(sim->efli);

View File

@ -1013,8 +1013,9 @@ void ofono_sms_register(struct ofono_sms *sms)
sms->assembly = sms_assembly_new(imsi);
sms_load_settings(sms, imsi);
} else
} else {
sms->assembly = sms_assembly_new(NULL);
}
__ofono_atom_register(sms->atom, sms_unregister);
}

View File

@ -1003,8 +1003,9 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
if (out->status_report.pi & 0x02) {
if (!next_octet(pdu, len, &offset, &out->status_report.dcs))
return FALSE;
} else
} else {
out->status_report.dcs = 0;
}
if (out->status_report.pi & 0x04) {
int expected;
@ -1125,8 +1126,9 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
if (!next_octet(pdu, len, &offset, &octet))
return FALSE;
} else
} else {
out->type = SMS_TYPE_DELIVER_REPORT_ACK;
}
pi = octet & 0x07;
@ -1776,8 +1778,9 @@ const char *sms_address_to_string(const struct sms_address *addr)
addr->address[0] != '+') {
buffer[0] = '+';
strcpy(buffer + 1, addr->address);
} else
} else {
strcpy(buffer, addr->address);
}
return buffer;
}
@ -3092,8 +3095,9 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
NULL, 0,
(unsigned char *)iso639_lang);
iso639_lang[2] = '\0';
} else
} else {
iso639_2_from_language(lang, iso639_lang);
}
}
buf = g_new(unsigned char, bufsize);

View File

@ -430,8 +430,9 @@ static void ussd_cancel_callback(const struct ofono_error *error, void *data)
ussd->state = USSD_STATE_IDLE;
reply = dbus_message_new_method_return(ussd->pending);
} else
} else {
reply = __ofono_error_failed(ussd->pending);
}
__ofono_dbus_pending_reply(&ussd->pending, reply);
}

View File

@ -933,8 +933,9 @@ unsigned char *unpack_7bit_own_buf(const unsigned char *in, long len,
out++;
bits = 7;
rest = 0;
} else
} else {
bits = bits - 1;
}
}
/* According to 23.038 6.1.2.3.1, last paragraph:

View File

@ -829,8 +829,9 @@ static ofono_bool_t clir_string_to_clir(const char *clirstr,
} else if (!strcmp(clirstr, "enabled")) {
*clir = OFONO_CLIR_OPTION_INVOCATION;
return TRUE;
} else
} else {
return FALSE;
}
}
static struct ofono_call *synthesize_outgoing_call(struct ofono_voicecall *vc,