@@ -1972,7 +1972,7 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
19721972
19731973 initStringInfo (& buf );
19741974
1975- appendStringInfo (& buf , "\ndigraph sourceNFA {\n" );
1975+ appendStringInfoString (& buf , "\ndigraph sourceNFA {\n" );
19761976
19771977 for (state = 0 ; state < nstates ; state ++ )
19781978 {
@@ -1982,8 +1982,8 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
19821982
19831983 appendStringInfo (& buf , "s%d" , state );
19841984 if (pg_reg_getfinalstate (regex ) == state )
1985- appendStringInfo (& buf , " [shape = doublecircle]" );
1986- appendStringInfo (& buf , ";\n" );
1985+ appendStringInfoString (& buf , " [shape = doublecircle]" );
1986+ appendStringInfoString (& buf , ";\n" );
19871987
19881988 arcsCount = pg_reg_getnumoutarcs (regex , state );
19891989 arcs = (regex_arc_t * ) palloc (sizeof (regex_arc_t ) * arcsCount );
@@ -1998,13 +1998,13 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
19981998 pfree (arcs );
19991999 }
20002000
2001- appendStringInfo (& buf , " node [shape = point ]; initial;\n" );
2001+ appendStringInfoString (& buf , " node [shape = point ]; initial;\n" );
20022002 appendStringInfo (& buf , " initial -> s%d;\n" ,
20032003 pg_reg_getinitialstate (regex ));
20042004
20052005 /* Print colors */
2006- appendStringInfo (& buf , " { rank = sink;\n" );
2007- appendStringInfo (& buf , " Colors [shape = none, margin=0, label=<\n" );
2006+ appendStringInfoString (& buf , " { rank = sink;\n" );
2007+ appendStringInfoString (& buf , " Colors [shape = none, margin=0, label=<\n" );
20082008
20092009 for (i = 0 ; i < ncolors ; i ++ )
20102010 {
@@ -2020,17 +2020,17 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
20202020
20212021 memcpy (s , color -> wordChars [j ].bytes , MAX_MULTIBYTE_CHAR_LEN );
20222022 s [MAX_MULTIBYTE_CHAR_LEN ] = '\0' ;
2023- appendStringInfo (& buf , "%s" , s );
2023+ appendStringInfoString (& buf , s );
20242024 }
20252025 }
20262026 else
2027- appendStringInfo (& buf , "not expandable" );
2028- appendStringInfo (& buf , "\n" );
2027+ appendStringInfoString (& buf , "not expandable" );
2028+ appendStringInfoChar (& buf , '\n' );
20292029 }
20302030
2031- appendStringInfo (& buf , " >];\n" );
2032- appendStringInfo (& buf , " }\n" );
2033- appendStringInfo (& buf , "}\n" );
2031+ appendStringInfoString (& buf , " >];\n" );
2032+ appendStringInfoString (& buf , " }\n" );
2033+ appendStringInfoString (& buf , "}\n" );
20342034
20352035 {
20362036 /* dot -Tpng -o /tmp/source.png < /tmp/source.dot */
@@ -2056,7 +2056,7 @@ printTrgmNFA(TrgmNFA *trgmNFA)
20562056
20572057 initStringInfo (& buf );
20582058
2059- appendStringInfo (& buf , "\ndigraph transformedNFA {\n" );
2059+ appendStringInfoString (& buf , "\ndigraph transformedNFA {\n" );
20602060
20612061 hash_seq_init (& scan_status , trgmNFA -> states );
20622062 while ((state = (TrgmState * ) hash_seq_search (& scan_status )) != NULL )
@@ -2065,11 +2065,11 @@ printTrgmNFA(TrgmNFA *trgmNFA)
20652065
20662066 appendStringInfo (& buf , "s%p" , (void * ) state );
20672067 if (state -> fin )
2068- appendStringInfo (& buf , " [shape = doublecircle]" );
2068+ appendStringInfoString (& buf , " [shape = doublecircle]" );
20692069 if (state -> init )
20702070 initstate = state ;
20712071 appendStringInfo (& buf , " [label = \"%d\"]" , state -> stateKey .nstate );
2072- appendStringInfo (& buf , ";\n" );
2072+ appendStringInfoString (& buf , ";\n" );
20732073
20742074 foreach (cell , state -> arcs )
20752075 {
@@ -2078,21 +2078,21 @@ printTrgmNFA(TrgmNFA *trgmNFA)
20782078 appendStringInfo (& buf , " s%p -> s%p [label = \"" ,
20792079 (void * ) state , (void * ) arc -> target );
20802080 printTrgmColor (& buf , arc -> ctrgm .colors [0 ]);
2081- appendStringInfo (& buf , " " );
2081+ appendStringInfoChar (& buf , ' ' );
20822082 printTrgmColor (& buf , arc -> ctrgm .colors [1 ]);
2083- appendStringInfo (& buf , " " );
2083+ appendStringInfoChar (& buf , ' ' );
20842084 printTrgmColor (& buf , arc -> ctrgm .colors [2 ]);
2085- appendStringInfo (& buf , "\"];\n" );
2085+ appendStringInfoString (& buf , "\"];\n" );
20862086 }
20872087 }
20882088
20892089 if (initstate )
20902090 {
2091- appendStringInfo (& buf , " node [shape = point ]; initial;\n" );
2091+ appendStringInfoString (& buf , " node [shape = point ]; initial;\n" );
20922092 appendStringInfo (& buf , " initial -> s%p;\n" , (void * ) initstate );
20932093 }
20942094
2095- appendStringInfo (& buf , "}\n" );
2095+ appendStringInfoString (& buf , "}\n" );
20962096
20972097 {
20982098 /* dot -Tpng -o /tmp/transformed.png < /tmp/transformed.dot */
@@ -2112,9 +2112,9 @@ static void
21122112printTrgmColor (StringInfo buf , TrgmColor co )
21132113{
21142114 if (co == COLOR_UNKNOWN )
2115- appendStringInfo (buf , "u" );
2115+ appendStringInfoChar (buf , 'u' );
21162116 else if (co == COLOR_BLANK )
2117- appendStringInfo (buf , "b" );
2117+ appendStringInfoChar (buf , 'b' );
21182118 else
21192119 appendStringInfo (buf , "%d" , (int ) co );
21202120}
@@ -2131,7 +2131,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
21312131
21322132 initStringInfo (& buf );
21332133
2134- appendStringInfo (& buf , "\ndigraph packedGraph {\n" );
2134+ appendStringInfoString (& buf , "\ndigraph packedGraph {\n" );
21352135
21362136 for (i = 0 ; i < packedGraph -> statesCount ; i ++ )
21372137 {
@@ -2140,7 +2140,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
21402140
21412141 appendStringInfo (& buf , " s%d" , i );
21422142 if (i == 1 )
2143- appendStringInfo (& buf , " [shape = doublecircle]" );
2143+ appendStringInfoString (& buf , " [shape = doublecircle]" );
21442144
21452145 appendStringInfo (& buf , " [label = <s%d>];\n" , i );
21462146
@@ -2153,12 +2153,12 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
21532153 }
21542154 }
21552155
2156- appendStringInfo (& buf , " node [shape = point ]; initial;\n" );
2156+ appendStringInfoString (& buf , " node [shape = point ]; initial;\n" );
21572157 appendStringInfo (& buf , " initial -> s%d;\n" , 0 );
21582158
21592159 /* Print trigrams */
2160- appendStringInfo (& buf , " { rank = sink;\n" );
2161- appendStringInfo (& buf , " Trigrams [shape = none, margin=0, label=<\n" );
2160+ appendStringInfoString (& buf , " { rank = sink;\n" );
2161+ appendStringInfoString (& buf , " Trigrams [shape = none, margin=0, label=<\n" );
21622162
21632163 p = GETARR (trigrams );
21642164 for (i = 0 ; i < packedGraph -> colorTrigramsCount ; i ++ )
@@ -2171,7 +2171,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
21712171 for (j = 0 ; j < count ; j ++ )
21722172 {
21732173 if (j > 0 )
2174- appendStringInfo (& buf , ", " );
2174+ appendStringInfoString (& buf , ", " );
21752175
21762176 /*
21772177 * XXX This representation is nice only for all-ASCII trigrams.
@@ -2181,9 +2181,9 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
21812181 }
21822182 }
21832183
2184- appendStringInfo (& buf , " >];\n" );
2185- appendStringInfo (& buf , " }\n" );
2186- appendStringInfo (& buf , "}\n" );
2184+ appendStringInfoString (& buf , " >];\n" );
2185+ appendStringInfoString (& buf , " }\n" );
2186+ appendStringInfoString (& buf , "}\n" );
21872187
21882188 {
21892189 /* dot -Tpng -o /tmp/packed.png < /tmp/packed.dot */
0 commit comments