Fossil SCM

More coding style fixes.

florian 2018-11-16 14:01 UTC comment-formatter-utf8
Commit 2dca9b82d943d36caa1cc95060dbf1f892bc01f8
1 file changed +4 -5
+4 -5
--- src/comformat.c
+++ src/comformat.c
@@ -232,11 +232,11 @@
232232
#endif
233233
if( indent>sizeof(zBuf)-6 ) /* Limit initial indent to fit output buffer. */
234234
indent = sizeof(zBuf)-6;
235235
comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index);
236236
if( indent>0 ){
237
- for ( i=0; i<indent; i++ ){
237
+ for( i=0; i<indent; i++ ){
238238
zBuf[iBuf++] = ' ';
239239
}
240240
}
241241
if( origIndent>sizeof(zBuf)-6 ) /* Limit line indent to fit output buffer. */
242242
origIndent = sizeof(zBuf)-6;
@@ -259,11 +259,11 @@
259259
const char *zCurrent = &zLine[index];
260260
if( comment_check_orig(zOrigText, zCurrent, &charCnt, &lineCnt) ){
261261
zBuf[iBuf++] = '\n';
262262
comment_calc_indent(zCurrent, origIndent, trimCrLf, trimSpace,
263263
&index);
264
- for ( i=0; i<origIndent; i++ ){
264
+ for( i=0; i<origIndent; i++ ){
265265
zBuf[iBuf++] = ' ';
266266
}
267267
maxChars = lineChars;
268268
}
269269
}
@@ -315,12 +315,11 @@
315315
(zLine[index]&0xc0)==0x80 ){ /* UTF-8 trail byte 10vvvvvv */
316316
cchUTF8++;
317317
zBuf[iBuf++] = zLine[index++];
318318
}
319319
maxChars--;
320
- }
321
- else {
320
+ }else{
322321
zBuf[iBuf++] = c;
323322
maxChars -= useChars;
324323
}
325324
if( maxChars<=0 ) break;
326325
if( c=='\n' ) break;
@@ -328,11 +327,11 @@
328327
if( charCnt>0 ){
329328
zBuf[iBuf++] = '\n';
330329
lineCnt++;
331330
}
332331
/* Flush the remaining output buffer. */
333
- if( iBuf>0 ) {
332
+ if( iBuf>0 ){
334333
zBuf[iBuf]=0;
335334
iBuf=0;
336335
fossil_print("%s", zBuf);
337336
}
338337
if( pLineCnt ){
339338
--- src/comformat.c
+++ src/comformat.c
@@ -232,11 +232,11 @@
232 #endif
233 if( indent>sizeof(zBuf)-6 ) /* Limit initial indent to fit output buffer. */
234 indent = sizeof(zBuf)-6;
235 comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index);
236 if( indent>0 ){
237 for ( i=0; i<indent; i++ ){
238 zBuf[iBuf++] = ' ';
239 }
240 }
241 if( origIndent>sizeof(zBuf)-6 ) /* Limit line indent to fit output buffer. */
242 origIndent = sizeof(zBuf)-6;
@@ -259,11 +259,11 @@
259 const char *zCurrent = &zLine[index];
260 if( comment_check_orig(zOrigText, zCurrent, &charCnt, &lineCnt) ){
261 zBuf[iBuf++] = '\n';
262 comment_calc_indent(zCurrent, origIndent, trimCrLf, trimSpace,
263 &index);
264 for ( i=0; i<origIndent; i++ ){
265 zBuf[iBuf++] = ' ';
266 }
267 maxChars = lineChars;
268 }
269 }
@@ -315,12 +315,11 @@
315 (zLine[index]&0xc0)==0x80 ){ /* UTF-8 trail byte 10vvvvvv */
316 cchUTF8++;
317 zBuf[iBuf++] = zLine[index++];
318 }
319 maxChars--;
320 }
321 else {
322 zBuf[iBuf++] = c;
323 maxChars -= useChars;
324 }
325 if( maxChars<=0 ) break;
326 if( c=='\n' ) break;
@@ -328,11 +327,11 @@
328 if( charCnt>0 ){
329 zBuf[iBuf++] = '\n';
330 lineCnt++;
331 }
332 /* Flush the remaining output buffer. */
333 if( iBuf>0 ) {
334 zBuf[iBuf]=0;
335 iBuf=0;
336 fossil_print("%s", zBuf);
337 }
338 if( pLineCnt ){
339
--- src/comformat.c
+++ src/comformat.c
@@ -232,11 +232,11 @@
232 #endif
233 if( indent>sizeof(zBuf)-6 ) /* Limit initial indent to fit output buffer. */
234 indent = sizeof(zBuf)-6;
235 comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index);
236 if( indent>0 ){
237 for( i=0; i<indent; i++ ){
238 zBuf[iBuf++] = ' ';
239 }
240 }
241 if( origIndent>sizeof(zBuf)-6 ) /* Limit line indent to fit output buffer. */
242 origIndent = sizeof(zBuf)-6;
@@ -259,11 +259,11 @@
259 const char *zCurrent = &zLine[index];
260 if( comment_check_orig(zOrigText, zCurrent, &charCnt, &lineCnt) ){
261 zBuf[iBuf++] = '\n';
262 comment_calc_indent(zCurrent, origIndent, trimCrLf, trimSpace,
263 &index);
264 for( i=0; i<origIndent; i++ ){
265 zBuf[iBuf++] = ' ';
266 }
267 maxChars = lineChars;
268 }
269 }
@@ -315,12 +315,11 @@
315 (zLine[index]&0xc0)==0x80 ){ /* UTF-8 trail byte 10vvvvvv */
316 cchUTF8++;
317 zBuf[iBuf++] = zLine[index++];
318 }
319 maxChars--;
320 }else{
 
321 zBuf[iBuf++] = c;
322 maxChars -= useChars;
323 }
324 if( maxChars<=0 ) break;
325 if( c=='\n' ) break;
@@ -328,11 +327,11 @@
327 if( charCnt>0 ){
328 zBuf[iBuf++] = '\n';
329 lineCnt++;
330 }
331 /* Flush the remaining output buffer. */
332 if( iBuf>0 ){
333 zBuf[iBuf]=0;
334 iBuf=0;
335 fossil_print("%s", zBuf);
336 }
337 if( pLineCnt ){
338

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button