Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jul 3, 2013
1 parent 5032784 commit 29b1585
Show file tree
Hide file tree
Showing 20 changed files with 691 additions and 688 deletions.
6 changes: 2 additions & 4 deletions scripts/jlibtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2000,8 +2000,7 @@ static void link_fixup(command_t *cmd)

static void post_parse_fixup(command_t *cmd)
{
switch (cmd->mode)
{
switch (cmd->mode) {
case MODE_COMPILE:
#ifdef PIC_FLAG
if (cmd->options.pic_mode != PIC_AVOID) {
Expand Down Expand Up @@ -2051,8 +2050,7 @@ static int run_mode(command_t *cmd)
cctemp = (count_chars*)lt_malloc(sizeof(count_chars));
init_count_chars(cctemp);

switch (cmd->mode)
{
switch (cmd->mode) {
case MODE_COMPILE:
rv = run_command(cmd, cmd->arglist);
if (rv) goto finish;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/valuepair.c
Original file line number Diff line number Diff line change
Expand Up @@ -2096,8 +2096,7 @@ FR_TOKEN pairread(char const **ptr, VALUE_PAIR_RAW *raw)
p = *ptr;

next = gettoken(&p, buf, sizeof(buf));
switch (next)
{
switch (next) {
case T_EOL:
case T_HASH:
break;
Expand Down
3 changes: 1 addition & 2 deletions src/main/conffile.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,7 @@ static char const *cf_expand_variables(char const *cf, int *lineno,
return NULL;
}

switch (fr_str2int(conf_property_name, q, CONF_PROPERTY_INVALID))
{
switch (fr_str2int(conf_property_name, q, CONF_PROPERTY_INVALID)) {
case CONF_PROPERTY_NAME:
strcpy(p, mycs->name1);
break;
Expand Down
83 changes: 41 additions & 42 deletions src/main/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,52 +155,51 @@ value_pair_tmpl_t *radius_str2tmpl(TALLOC_CTX *ctx, char const *name, FR_TOKEN t
vpt = talloc_zero(ctx, value_pair_tmpl_t);
vpt->name = talloc_strdup(vpt, name);

switch (type)
{
case T_BARE_WORD:
if (!isdigit((int) *name)) {
request_refs_t ref;
pair_lists_t list;
const char *p = name;

ref = radius_request_name(&p, REQUEST_CURRENT);
list = radius_list_name(&p, PAIR_LIST_REQUEST);

if ((p != name) && !*p) {
vpt->type = VPT_TYPE_LIST;

} else {
const DICT_ATTR *da;
da = dict_attrbyname(p);
if (!da) {
vpt->type = VPT_TYPE_LITERAL;
break;
}
vpt->da = da;
vpt->type = VPT_TYPE_ATTR;
}
switch (type) {
case T_BARE_WORD:
if (!isdigit((int) *name)) {
request_refs_t ref;
pair_lists_t list;
const char *p = name;

vpt->request = ref;
vpt->list = list;
break;
ref = radius_request_name(&p, REQUEST_CURRENT);
list = radius_list_name(&p, PAIR_LIST_REQUEST);

if ((p != name) && !*p) {
vpt->type = VPT_TYPE_LIST;

} else {
const DICT_ATTR *da;
da = dict_attrbyname(p);
if (!da) {
vpt->type = VPT_TYPE_LITERAL;
break;
}
vpt->da = da;
vpt->type = VPT_TYPE_ATTR;
}
/* FALL-THROUGH */

case T_SINGLE_QUOTED_STRING:
vpt->type = VPT_TYPE_LITERAL;
break;
case T_DOUBLE_QUOTED_STRING:
vpt->type = VPT_TYPE_XLAT;
break;
case T_BACK_QUOTED_STRING:
vpt->type = VPT_TYPE_EXEC;
break;
case T_OP_REG_EQ: /* hack */
vpt->type = VPT_TYPE_REGEX;
vpt->request = ref;
vpt->list = list;
break;
default:
rad_assert(0);
return NULL;
}
/* FALL-THROUGH */

case T_SINGLE_QUOTED_STRING:
vpt->type = VPT_TYPE_LITERAL;
break;
case T_DOUBLE_QUOTED_STRING:
vpt->type = VPT_TYPE_XLAT;
break;
case T_BACK_QUOTED_STRING:
vpt->type = VPT_TYPE_EXEC;
break;
case T_OP_REG_EQ: /* hack */
vpt->type = VPT_TYPE_REGEX;
break;
default:
rad_assert(0);
return NULL;
}

return vpt;
Expand Down
3 changes: 1 addition & 2 deletions src/main/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,7 @@ STATE_MACHINE_DECL(request_finish)
PW_PROXY_STATE, 0, TAG_ANY);
if (vp) pairadd(&request->reply->vps, vp);

switch (request->reply->code)
{
switch (request->reply->code) {
case PW_AUTHENTICATION_ACK:
rad_postauth(request);
break;
Expand Down
3 changes: 1 addition & 2 deletions src/main/radsniff.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,7 @@ int main(int argc, char *argv[])
* Get options
*/
while ((opt = getopt(argc, argv, "c:d:Ff:hi:I:p:qr:s:Svw:xX")) != EOF) {
switch (opt)
{
switch (opt) {
case 'c':
limit = atoi(optarg);
if (limit <= 0) {
Expand Down
6 changes: 2 additions & 4 deletions src/main/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,7 @@ void tls_session_information(tls_session_t *tls_session)

str_write_p = tls_session->info.origin ? ">>>" : "<<<";

switch (tls_session->info.version)
{
switch (tls_session->info.version) {
case SSL2_VERSION:
str_version = "SSL 2.0";
break;
Expand Down Expand Up @@ -701,8 +700,7 @@ void tls_session_information(tls_session_t *tls_session)
str_details1 = "???";

if (tls_session->info.record_len > 0)
switch (tls_session->info.handshake_type)
{
switch (tls_session->info.handshake_type) {
case SSL3_MT_HELLO_REQUEST:
str_details1 = ", HelloRequest";
break;
Expand Down
3 changes: 1 addition & 2 deletions src/main/valuepair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,7 @@ VALUE_PAIR *radius_vpt_get_vp(REQUEST *request, value_pair_tmpl_t const *vpt)
return NULL;
}

switch (vpt->type)
{
switch (vpt->type) {
/*
* May not may not be found, but it *is* a known name.
*/
Expand Down
43 changes: 21 additions & 22 deletions src/main/xlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,28 @@ static ssize_t xlat_integer(UNUSED void *instance, REQUEST *request,
return 0;
}

switch (vp->da->type)
{
case PW_TYPE_OCTETS:
case PW_TYPE_STRING:
if (vp->length > 8) {
break;
}

memcpy(&integer, &(vp->vp_octets), vp->length);

return snprintf(out, outlen, "%" PRIu64, ntohll(integer));

case PW_TYPE_INTEGER64:
return snprintf(out, outlen, "%" PRIu64, vp->vp_integer64);

case PW_TYPE_IPADDR:
case PW_TYPE_INTEGER:
case PW_TYPE_SHORT:
case PW_TYPE_BYTE:
case PW_TYPE_DATE:
return snprintf(out, outlen, "%u", vp->vp_integer);
default:
switch (vp->da->type) {
case PW_TYPE_OCTETS:
case PW_TYPE_STRING:
if (vp->length > 8) {
break;
}

memcpy(&integer, &(vp->vp_octets), vp->length);

return snprintf(out, outlen, "%" PRIu64, ntohll(integer));

case PW_TYPE_INTEGER64:
return snprintf(out, outlen, "%" PRIu64, vp->vp_integer64);

case PW_TYPE_IPADDR:
case PW_TYPE_INTEGER:
case PW_TYPE_SHORT:
case PW_TYPE_BYTE:
case PW_TYPE_DATE:
return snprintf(out, outlen, "%u", vp->vp_integer);
default:
break;
}

REDEBUG("Type \"%s\" cannot be converted to integer",
Expand Down
6 changes: 2 additions & 4 deletions src/modules/rlm_cache/rlm_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
fr_int2str(vpt_types, map->dst->type, "¿unknown?"),
fr_int2str(vpt_types, map->src->type, "¿unknown?"));

switch (map->src->type)
{
switch (map->src->type) {
case VPT_TYPE_ATTR:
from = NULL;
da = map->src->da;
Expand Down Expand Up @@ -566,8 +565,7 @@ static int cache_verify(rlm_cache_t *inst, value_pair_map_t **head)
return -1;
}

switch (map->src->type)
{
switch (map->src->type) {
/*
* Only =, :=, += and -= operators are supported for
* cache entries.
Expand Down
3 changes: 1 addition & 2 deletions src/modules/rlm_eap/radeapclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@ static void unmap_eap_methods(RADIUS_PACKET *rep)
eap1->vp_integer = e->code;
pairadd(&(rep->vps), eap1);

switch(e->code)
{
switch(e->code) {
default:
case PW_EAP_SUCCESS:
case PW_EAP_FAILURE:
Expand Down
3 changes: 1 addition & 2 deletions src/modules/rlm_opendirectory/rlm_opendirectory.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ static rlm_rcode_t mod_authenticate(UNUSED void *instance, REQUEST *request)

odResult = od_check_passwd(request->username->vp_strvalue,
request->password->vp_strvalue);
switch(odResult)
{
switch(odResult) {
case eDSNoErr:
ret = RLM_MODULE_OK;
break;
Expand Down
Loading

0 comments on commit 29b1585

Please sign in to comment.