diff options
author | Bruce Momjian | 2005-11-22 18:17:34 +0000 |
---|---|---|
committer | Bruce Momjian | 2005-11-22 18:17:34 +0000 |
commit | 436a2956d80db29ac1dff640b631620d856b4f70 (patch) | |
tree | db2252048385dd23a7d7a196e8685cb0a5816f7a /contrib/tsearch2/query.c | |
parent | e196eedd8a95380fb392c00b9e7ea88a0e46053e (diff) |
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory. Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).
Backpatch to 8.1.X.
Diffstat (limited to 'contrib/tsearch2/query.c')
-rw-r--r-- | contrib/tsearch2/query.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c index e312cf6af7..de6d96ed52 100644 --- a/contrib/tsearch2/query.c +++ b/contrib/tsearch2/query.c @@ -178,7 +178,7 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2 state->state = WAITOPERATOR; return VAL; } - else if ( state->state == WAITFIRSTOPERAND ) + else if (state->state == WAITFIRSTOPERAND) return END; else ereport(ERROR, @@ -206,13 +206,13 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2 return ERR; break; case WAITSINGLEOPERAND: - if ( *(state->buf) == '\0' ) + if (*(state->buf) == '\0') return END; *strval = state->buf; - *lenval = strlen( state->buf ); - state->buf += strlen( state->buf ); + *lenval = strlen(state->buf); + state->buf += strlen(state->buf); state->count++; - return VAL; + return VAL; default: return ERR; break; @@ -600,7 +600,7 @@ findoprnd(ITEM * ptr, int4 *pos) * input */ static QUERYTYPE * -queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int cfg_id, bool isplain) + queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int cfg_id, bool isplain) { QPRS_STATE state; int4 i; @@ -637,12 +637,13 @@ queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int c /* parse query & make polish notation (postfix, but in reverse order) */ makepol(&state, pushval); pfree(state.valstate.word); - if (!state.num) { + if (!state.num) + { elog(NOTICE, "Query doesn't contain lexem(s)"); - query = (QUERYTYPE*)palloc( HDRSIZEQT ); + query = (QUERYTYPE *) palloc(HDRSIZEQT); query->len = HDRSIZEQT; query->size = 0; - return query; + return query; } /* make finish struct */ @@ -928,9 +929,9 @@ to_tsquery(PG_FUNCTION_ARGS) str = text2char(in); PG_FREE_IF_COPY(in, 1); - query = queryin(str, pushval_morph, PG_GETARG_INT32(0),false); - - if ( query->size == 0 ) + query = queryin(str, pushval_morph, PG_GETARG_INT32(0), false); + + if (query->size == 0) PG_RETURN_POINTER(query); res = clean_fakeval_v2(GETQUERY(query), &len); @@ -984,8 +985,8 @@ plainto_tsquery(PG_FUNCTION_ARGS) PG_FREE_IF_COPY(in, 1); query = queryin(str, pushval_morph, PG_GETARG_INT32(0), true); - - if ( query->size == 0 ) + + if (query->size == 0) PG_RETURN_POINTER(query); res = clean_fakeval_v2(GETQUERY(query), &len); @@ -1023,4 +1024,3 @@ plainto_tsquery_current(PG_FUNCTION_ARGS) Int32GetDatum(get_currcfg()), PG_GETARG_DATUM(0))); } - |