@@ -430,15 +430,16 @@ pushStop(TSQueryParserState state)
430
430
431
431
#define STACKDEPTH 32
432
432
433
- typedef struct OperatorElement {
434
- int8 op ;
435
- int16 distance ;
433
+ typedef struct OperatorElement
434
+ {
435
+ int8 op ;
436
+ int16 distance ;
436
437
} OperatorElement ;
437
438
438
439
static void
439
440
pushOpStack (OperatorElement * stack , int * lenstack , int8 op , int16 distance )
440
441
{
441
- if (* lenstack == STACKDEPTH ) /* internal error */
442
+ if (* lenstack == STACKDEPTH ) /* internal error */
442
443
elog (ERROR , "tsquery stack too small" );
443
444
444
445
stack [* lenstack ].op = op ;
@@ -449,20 +450,20 @@ pushOpStack(OperatorElement *stack, int *lenstack, int8 op, int16 distance)
449
450
450
451
static void
451
452
cleanOpStack (TSQueryParserState state ,
452
- OperatorElement * stack , int * lenstack , int8 op )
453
+ OperatorElement * stack , int * lenstack , int8 op )
453
454
{
454
- int opPriority = OP_PRIORITY (op );
455
+ int opPriority = OP_PRIORITY (op );
455
456
456
- while (* lenstack )
457
+ while (* lenstack )
457
458
{
458
459
/* NOT is right associative unlike to others */
459
460
if ((op != OP_NOT && opPriority > OP_PRIORITY (stack [* lenstack - 1 ].op )) ||
460
- (op == OP_NOT && opPriority >= OP_PRIORITY (stack [* lenstack - 1 ].op )))
461
+ (op == OP_NOT && opPriority >= OP_PRIORITY (stack [* lenstack - 1 ].op )))
461
462
break ;
462
463
463
464
(* lenstack )-- ;
464
465
pushOperator (state , stack [* lenstack ].op ,
465
- stack [* lenstack ].distance );
466
+ stack [* lenstack ].distance );
466
467
}
467
468
}
468
469
@@ -480,7 +481,7 @@ makepol(TSQueryParserState state,
480
481
ts_tokentype type ;
481
482
int lenval = 0 ;
482
483
char * strval = NULL ;
483
- OperatorElement opstack [STACKDEPTH ];
484
+ OperatorElement opstack [STACKDEPTH ];
484
485
int lenstack = 0 ;
485
486
int16 weight = 0 ;
486
487
bool prefix ;
@@ -503,7 +504,7 @@ makepol(TSQueryParserState state,
503
504
makepol (state , pushval , opaque );
504
505
break ;
505
506
case PT_CLOSE :
506
- cleanOpStack (state , opstack , & lenstack , OP_OR /* lowest */ );
507
+ cleanOpStack (state , opstack , & lenstack , OP_OR /* lowest */ );
507
508
return ;
508
509
case PT_ERR :
509
510
default :
@@ -514,7 +515,7 @@ makepol(TSQueryParserState state,
514
515
}
515
516
}
516
517
517
- cleanOpStack (state , opstack , & lenstack , OP_OR /* lowest */ );
518
+ cleanOpStack (state , opstack , & lenstack , OP_OR /* lowest */ );
518
519
}
519
520
520
521
static void
@@ -845,8 +846,8 @@ infix(INFIX *in, int parentPriority, bool rightPhraseOp)
845
846
846
847
in -> curpol ++ ;
847
848
if (priority < parentPriority ||
848
- /* phrase operator depends on order */
849
- (op == OP_PHRASE && rightPhraseOp ))
849
+ /* phrase operator depends on order */
850
+ (op == OP_PHRASE && rightPhraseOp ))
850
851
{
851
852
needParenthesis = true;
852
853
RESIZEBUF (in , 2 );
@@ -916,7 +917,7 @@ tsqueryout(PG_FUNCTION_ARGS)
916
917
nrm .cur = nrm .buf = (char * ) palloc (sizeof (char ) * nrm .buflen );
917
918
* (nrm .cur ) = '\0' ;
918
919
nrm .op = GETOPERAND (query );
919
- infix (& nrm , -1 /* lowest priority */ , false);
920
+ infix (& nrm , -1 /* lowest priority */ , false);
920
921
921
922
PG_FREE_IF_COPY (query , 0 );
922
923
PG_RETURN_CSTRING (nrm .buf );
0 commit comments