Commit 7052d3f9 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Fixed indentation of bool operators.

(commit_aux_item_list_internal): Removed a redundant "continue".
parent ed53d878
/*
* $Id: aux-items.c,v 1.53 2003/08/16 12:00:28 ceder Exp $
* $Id: aux-items.c,v 1.54 2003/08/16 13:00:37 ceder Exp $
* Copyright (C) 1994-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -900,10 +900,12 @@ prepare_aux_item(Aux_item *item,
/* AUX_ADJUST_FLAG(deleted); */
item->flags.deleted = 0;
if (def->inherit_limit != 0 &&
(item->inherit_limit > def->inherit_limit ||
item->inherit_limit == 0))
if (def->inherit_limit != 0
&& (item->inherit_limit > def->inherit_limit
|| item->inherit_limit == 0))
{
item->inherit_limit = def->inherit_limit;
}
item->creator = creator;
item->sent_at = current_time.tv_sec;
......@@ -1083,16 +1085,15 @@ aux_item_add_perm(const Aux_item *item,
if (can_add_when)
{
if (!((creating && (can_add_when & AUX_ITEM_ADD_ON_CREATE)) ||
(!creating && (can_add_when & AUX_ITEM_ADD_ON_MODIFY))))
if (!((creating && (can_add_when & AUX_ITEM_ADD_ON_CREATE))
|| (!creating && (can_add_when & AUX_ITEM_ADD_ON_MODIFY))))
{
kom_errno = KOM_AUX_PERM;
return FALSE;
}
}
if (def->system_only &&
owner_check)
if (def->system_only && owner_check)
{
kom_errno = KOM_AUX_PERM;
return FALSE;
......@@ -1103,11 +1104,11 @@ aux_item_add_perm(const Aux_item *item,
item_creator is supervisor of object_creator. The intention is
to check if item_creator is supervisor of conference X, where
X's supervisor is object_creator. */
if (def->author_only &&
owner_check &&
object_creator != item_creator &&
!is_strictly_supervisor(object_creator, item_creator, NULL) &&
!(item_creator == ACTPERS && ENA(wheel, 8))) /* NOT OK! */
if (def->author_only
&& owner_check
&& object_creator != item_creator
&& !is_strictly_supervisor(object_creator, item_creator, NULL)
&& !(item_creator == ACTPERS && ENA(wheel, 8))) /* NOT OK! */
{
kom_errno = KOM_AUX_PERM;
return FALSE;
......@@ -1118,10 +1119,10 @@ aux_item_add_perm(const Aux_item *item,
item_creator is supervisor of object_creator. The intention is
to check if item_creator is supervisor of conference X, where
X's supervisor is object_creator. */
if (def->supervisor_only &&
owner_check &&
!is_strictly_supervisor(object_creator, item_creator, NULL) &&
!(item_creator == ACTPERS && ENA(wheel,8))) /* NOT OK! */
if (def->supervisor_only
&& owner_check
&& !is_strictly_supervisor(object_creator, item_creator, NULL)
&& !(item_creator == ACTPERS && ENA(wheel,8))) /* NOT OK! */
{
kom_errno = KOM_AUX_PERM;
return FALSE;
......@@ -1181,10 +1182,12 @@ aux_item_check_unique(const Aux_item *item,
{
unsigned long i;
if (add_to_list == NULL ||
item == NULL ||
start_looking_at >= add_to_list->length)
if (add_to_list == NULL
|| item == NULL
|| start_looking_at >= add_to_list->length)
{
return TRUE;
}
if (def != NULL)
def = find_aux_item_definition(item);
......@@ -1241,22 +1244,21 @@ aux_inherit_items(Aux_item_list *target,
for (i = 0; i < parent->length; i++)
{
if (parent->items[i].flags.inherit &&
!parent->items[i].flags.deleted &&
parent->items[i].inherit_limit != 1)
if (parent->items[i].flags.inherit
&& !parent->items[i].flags.deleted
&& parent->items[i].inherit_limit != 1)
{
def = find_aux_item_definition(&parent->items[i]);
if (def == NULL ||
!aux_item_add_perm(&parent->items[i],
def,
parent->items[i].creator,
target_creator,
TRUE,
target,
0,
creating,
object_type
))
if (def == NULL
|| !aux_item_add_perm(&parent->items[i],
def,
parent->items[i].creator,
target_creator,
TRUE,
target,
0,
creating,
object_type))
continue;
copy_aux_item(&item, &parent->items[i]);
......@@ -1304,19 +1306,23 @@ filter_aux_item_list(const Aux_item_list *original,
for (from = 0; from < original->length; from++)
{
orig_aux = &original->items[from];
if ( orig_aux->flags.secret &&
!is_supervisor(orig_aux->creator,
viewer_conn->pers_no, viewer_conn->person) &&
!ENA_C(viewer_conn, admin, 4))
if (orig_aux->flags.secret
&& !is_supervisor(orig_aux->creator,
viewer_conn->pers_no, viewer_conn->person)
&& !ENA_C(viewer_conn, admin, 4))
{
continue;
}
result->items[to] = *orig_aux;
if (orig_aux->flags.hide_creator &&
!is_supervisor(orig_aux->creator,
viewer_conn->pers_no, viewer_conn->person) &&
!ENA_C(viewer_conn, admin, 4))
if (orig_aux->flags.hide_creator
&& !is_supervisor(orig_aux->creator,
viewer_conn->pers_no, viewer_conn->person)
&& !ENA_C(viewer_conn, admin, 4))
{
result->items[to].creator = 0;
}
result->length += 1;
to += 1;
......@@ -1384,9 +1390,10 @@ check_delete_aux_item_list(const Number_list *items_to_delete,
}
else if (item->creator != ACTPERS)
{
if (!ENA(wheel, 8) &&
!is_supervisor(item->creator, ACTPERS, NULL) &&
(!def->owner_delete || !is_supervisor(owner, ACTPERS, NULL)))
if (!ENA(wheel, 8)
&& !is_supervisor(item->creator, ACTPERS, NULL)
&& (!def->owner_delete
|| !is_supervisor(owner, ACTPERS, NULL)))
{
kom_errno = KOM_AUX_PERM;
err_stat = i;
......@@ -1628,15 +1635,14 @@ commit_aux_item_list_internal(Aux_item_list *list_to_commit, Bool shallow)
linked item is marked as deleted */
linked_item = find_linked_aux_item(&list_to_commit->items[i]);
if (linked_item &&
linked_item->flags.deleted &&
!shallow)
if (linked_item
&& linked_item->flags.deleted
&& !shallow)
{
aux_item_list = find_linked_aux_item_list(&list_to_commit->items[i]);
commit_aux_item_list_internal(aux_item_list, TRUE);
mark_linked_object_as_changed(&list_to_commit->items[i]);
}
continue;
}
else if (target != i)
{
......@@ -1759,9 +1765,9 @@ text_stat_check_add_aux_item_list(Text_stat *text_s,
text_s?&text_s->aux_item_list:NULL,
0,
creating,
TEXT_OBJECT_TYPE) ||
!aux_item_check_unique(item, def, list, i + 1) ||
!def->texts)
TEXT_OBJECT_TYPE)
|| !aux_item_check_unique(item, def, list, i + 1)
|| !def->texts)
{
kom_errno = kom_errno?kom_errno:KOM_AUX_PERM;
err_stat = i;
......@@ -1825,10 +1831,10 @@ conf_stat_check_add_aux_item_list(Conference *conf,
&conf->aux_item_list,
0,
creating,
CONF_OBJECT_TYPE) ||
!aux_item_check_unique(item, def, list, i + 1) ||
(!conf->type.letter_box && !def->confs) ||
(conf->type.letter_box && !def->letterboxes))
CONF_OBJECT_TYPE)
|| !aux_item_check_unique(item, def, list, i + 1)
|| (!conf->type.letter_box && !def->confs)
|| (conf->type.letter_box && !def->letterboxes))
{
kom_errno = kom_errno?kom_errno:KOM_AUX_PERM;
err_stat = i;
......@@ -1888,9 +1894,9 @@ Success system_check_add_aux_item_list(Info *info,
&info->aux_item_list, /* add_to_list */
0, /* start_looking_at */
FALSE, /* creating */
INFO_OBJECT_TYPE) ||
!aux_item_check_unique(item, def, list, i + 1) ||
!def->system)
INFO_OBJECT_TYPE)
|| !aux_item_check_unique(item, def, list, i + 1)
|| !def->system)
{
kom_errno = kom_errno?kom_errno:KOM_AUX_PERM;
err_stat = i;
......@@ -1982,9 +1988,14 @@ aux_item_trigger_mirror_faq(Aux_item_trigger_data *data)
String str;
if ((data->object_type != CONF_OBJECT_TYPE &&
data->object_type != INFO_OBJECT_TYPE) || data->object == NULL)
if (data->object == NULL)
return;
if (data->object_type != CONF_OBJECT_TYPE
&& data->object_type != INFO_OBJECT_TYPE)
{
return;
}
/* Get the object number of where we want to put the new item */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment