Skip to content

Commit 400a52d

Browse files
authored
Minor cleanup of random suff (#6377)
1 parent 1cb2f7c commit 400a52d

7 files changed

Lines changed: 31 additions & 33 deletions

File tree

lib/clas.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ local fam, filter, cl;
116116
fi;
117117
filter:=filter and HasActingDomain and HasRepresentative and
118118
HasFunctionAction;
119-
fam!.defaultClassType:=NewType( FamilyObj( G ), filter );
119+
fam!.defaultClassType:=NewType( fam, filter );
120120
fi;
121121

122122
cl:=rec( start := [ g ] );
@@ -141,7 +141,7 @@ local fam, filter, cl;
141141
fi;
142142
filter:=filter and HasActingDomain and HasRepresentative and
143143
HasFunctionAction and HasStabilizerOfExternalSet;
144-
fam!.defaultClassCentType:=NewType( FamilyObj( G ), filter );
144+
fam!.defaultClassCentType:=NewType( fam, filter );
145145
fi;
146146

147147
cl:=rec( start := [ g ]);

lib/oprt.gi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,9 @@ end );
587587
##
588588
#M ActionHomomorphismConstructor( <xset>, <surj> )
589589
##
590-
InstallGlobalFunction( ActionHomomorphismConstructor, function(arg)
591-
local xset,surj,G, D, act, fam, filter, hom, i,blockacttest;
590+
InstallGlobalFunction( ActionHomomorphismConstructor, function(xset, surj, arg...)
591+
local G, D, act, fam, filter, hom, i,blockacttest;
592592

593-
xset:=arg[1];surj:=arg[2];
594593
G := ActingDomain( xset );
595594
D := HomeEnumerator( xset );
596595
act := FunctionAction( xset );
@@ -650,8 +649,8 @@ local xset,surj,G, D, act, fam, filter, hom, i,blockacttest;
650649
end;
651650

652651
hom := rec( );
653-
if Length(arg)>2 then
654-
filter:=arg[3];
652+
if Length(arg)>0 then
653+
filter:=arg[1];
655654
elif IsExternalSetByActorsRep( xset ) then
656655
filter := filter and IsActionHomomorphismByActors;
657656
elif IsMatrixGroup( G )

src/ariths.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#define RequireValue(funcname, val) \
2222
do { \
23-
if (!val) \
23+
if (!(val)) \
2424
ErrorMayQuit(funcname ": method should have returned a value", \
2525
0, 0); \
2626
} while (0)

src/code.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,14 +1755,14 @@ void CodeListExprEnd(
17551755
}
17561756

17571757
// allocate the list expression
1758-
if ( ! range && ! (top && tilde) ) {
1759-
list = NewExpr(cs, EXPR_LIST, INT_INTEXPR(pos) * sizeof(Expr));
1758+
if (range) {
1759+
list = NewExpr(cs, EXPR_RANGE, INT_INTEXPR(pos) * sizeof(Expr));
17601760
}
1761-
else if ( ! range && (top && tilde) ) {
1761+
else if (top && tilde) {
17621762
list = NewExpr(cs, EXPR_LIST_TILDE, INT_INTEXPR(pos) * sizeof(Expr));
17631763
}
1764-
else /* if ( range && ! (top && tilde) ) */ {
1765-
list = NewExpr(cs, EXPR_RANGE, INT_INTEXPR(pos) * sizeof(Expr));
1764+
else {
1765+
list = NewExpr(cs, EXPR_LIST, INT_INTEXPR(pos) * sizeof(Expr));
17661766
}
17671767

17681768
// enter the entries

src/dt.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#include "modules.h"
6262
#include "plist.h"
6363

64-
static void UnmarkTree(Obj z);
64+
static void UnmarkTree(Obj tree);
6565
static UInt Mark(Obj tree, Obj reftree, Int indexx);
6666
static Int AlmostEqual(Obj tree1, Int index1, Obj tree2, Int index2);
6767
static Int Equal(Obj tree1, Int index1, Obj tree2, Int index2);
@@ -726,16 +726,15 @@ static Int Leftof(Obj tree1, Int index1, Obj tree2, Int index2)
726726
*/
727727
static Int Leftof2(Obj tree1, Int index1, Obj tree2, Int index2)
728728
{
729-
if ( DT_GEN(tree2, index2) < DT_GEN(tree1, DT_RIGHT(tree1, index1) ) )
730-
return 0;
731-
else if (Equal(tree1, DT_RIGHT(tree1, index1), tree2, index2 ) )
732-
return 0;
733-
else if (DT_GEN(tree2, index2) == DT_GEN(tree1, DT_RIGHT(tree1, index1)) )
734-
return Leftof(tree1, DT_RIGHT(tree1, index1), tree2, index2 );
735-
else if (Equal(tree1, DT_LEFT(tree1, index1), tree2, index2) )
736-
return 0;
737-
else
738-
return Leftof(tree1, DT_LEFT(tree1, index1), tree2, index2);
729+
if (DT_GEN(tree2, index2) < DT_GEN(tree1, DT_RIGHT(tree1, index1)))
730+
return 0;
731+
if (Equal(tree1, DT_RIGHT(tree1, index1), tree2, index2))
732+
return 0;
733+
if (DT_GEN(tree2, index2) == DT_GEN(tree1, DT_RIGHT(tree1, index1)))
734+
return Leftof(tree1, DT_RIGHT(tree1, index1), tree2, index2);
735+
if (Equal(tree1, DT_LEFT(tree1, index1), tree2, index2))
736+
return 0;
737+
return Leftof(tree1, DT_LEFT(tree1, index1), tree2, index2);
739738
}
740739

741740

src/error.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ void ErrorBoundedInt(const char * funcname,
192192
int min,
193193
int max) NORETURN;
194194

195-
#define RequireBoundedIntEx(funcname, op, argname, min, max) \
196-
do { \
197-
if (!(IS_INTOBJ(op) && min <= INT_INTOBJ(op) && \
198-
INT_INTOBJ(op) <= max)) { \
199-
ErrorBoundedInt(funcname, op, argname, min, max); \
200-
} \
201-
} while (0)
195+
EXPORT_INLINE void RequireBoundedIntEx(
196+
const char * funcname, Obj op, const char * argname, int min, int max)
197+
{
198+
if (!(IS_INTOBJ(op) && min <= INT_INTOBJ(op) && INT_INTOBJ(op) <= max)) {
199+
ErrorBoundedInt(funcname, op, argname, min, max);
200+
}
201+
}
202202

203203
#define RequireBoundedInt(funcname, op, min, max) \
204204
RequireBoundedIntEx(funcname, op, NICE_ARGNAME(op), min, max)

src/stringobj.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ static BOOL IsSSortString(Obj list)
10621062
len = GET_LEN_STRING( list );
10631063
ptr = CONST_CHARS_STRING(list);
10641064
for ( i = 1; i < len; i++ ) {
1065-
if ( ! (ptr[i-1] < ptr[i]) )
1065+
if (ptr[i - 1] >= ptr[i])
10661066
break;
10671067
}
10681068

@@ -1468,7 +1468,7 @@ static Obj FuncPOSITION_SUBSTRING(Obj self, Obj string, Obj substr, Obj off)
14681468
for (i = ipos; i < max; i++) {
14691469
if (c == s[i]) {
14701470
for (j = 1; j < lenss; j++) {
1471-
if (! (s[i+j] == ss[j]))
1471+
if (s[i + j] != ss[j])
14721472
break;
14731473
}
14741474
if (j == lenss)

0 commit comments

Comments
 (0)