Skip to content

Commit 25d29bb

Browse files
Use braces with control statements in #ifdef'ed out code
1 parent e766015 commit 25d29bb

30 files changed

+262
-10
lines changed

libtrn/art.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ do_article_result do_article()
186186
ART_LINE linenum = 1;
187187
#if 0 /* This causes a bug (headers displayed twice sometimes when you press v then ^R) */
188188
if (!g_do_hiding)
189+
{
189190
g_is_mime = false;
191+
}
190192
#endif
191193
if (s_firstpage) {
192194
if (g_firstline) {
@@ -501,7 +503,7 @@ do_article_result do_article()
501503
#ifdef DEBUG
502504
if (debug & DEB_INNERSRCH && outpos < g_tc_COLS - 6) {
503505
standout();
504-
printf("%4d",g_artline);
506+
printf("%4d",g_artline);
505507
un_standout();
506508
}
507509
#endif
@@ -1253,7 +1255,9 @@ bool innermore()
12531255
if (g_artpos < g_innersearch) { /* not even on page yet? */
12541256
#ifdef DEBUG
12551257
if (debug & DEB_INNERSRCH)
1258+
{
12561259
printf("Not on page %ld < %ld\n",(long)g_artpos,(long)g_innersearch);
1260+
}
12571261
#endif
12581262
return true;
12591263
}

libtrn/artsrch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ static bool wanted(COMPEX *compex, ART_NUM artnum, art_scope scope)
447447
strncpy(g_buf+9,fetchsubj(artnum,false),256);
448448
#ifdef DEBUG
449449
if (debug & DEB_SEARCH_AHEAD)
450+
{
450451
printf("%s\n",g_buf);
452+
}
451453
#endif
452454
break;
453455
case ARTSCOPE_FROM:

libtrn/backpage.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,18 @@ void vwtary(ART_LINE indx, ART_POS newvalue)
7171

7272
#ifdef DEBUG
7373
if (indx < 0)
74+
{
7475
printf("vwtary(%ld)\n",(long)indx);
76+
}
7577
if (!indx)
78+
{
7679
maxindx = 0;
80+
}
7781
if (indx > maxindx) {
7882
if (indx != maxindx + 1)
83+
{
7984
printf("indx skipped %d-%d\n",maxindx+1,indx-1);
85+
}
8086
maxindx = indx;
8187
}
8288
#endif

libtrn/bits.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ void rc_to_bits()
9090
termdown(2);
9191
for (i = article_first(g_absfirst); i < g_firstart; i = article_next(i)) {
9292
if (article_unread(i))
93+
{
9394
printf("%ld ",(long)i);
95+
}
9496
}
9597
}
9698
#endif
@@ -637,7 +639,9 @@ static bool check_chase(char *ptr, int until_key)
637639
chase_xref(article_num(ap),true);
638640
ap->flags &= ~AF_MCHASE;
639641
if (!--s_chase_count)
642+
{
640643
return 1;
644+
}
641645
}
642646
#endif
643647
if (until_key && input_pending())
@@ -785,16 +789,22 @@ static bool valid_xref_site(ART_NUM artnum, char *site)
785789
{
786790
char* t = strchr(s+7, '.');
787791
if (t)
792+
{
788793
*t = '\0';
794+
}
789795
inews_site = savestr(s+7);
790796
}
791797
#endif /* ANCIENT_NEWS */
792798
else
799+
{
793800
inews_site = savestr("");
801+
}
794802
free(sitebuf);
795803

796804
if (!strcmp(site,inews_site))
805+
{
797806
return true;
807+
}
798808

799809
#ifdef DEBUG
800810
if (debug) {

libtrn/cache.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,14 @@ void cache_article(ARTICLE *ap)
205205
if (ap->subj->flags & SF_WASSELECTED) {
206206
#if 0
207207
if (g_selected_only)
208+
{
208209
ap->flags |= g_sel_mask;
210+
}
209211
else
210212
#endif
213+
{
211214
select_article(ap, AUTO_KILL_NONE);
215+
}
212216
}
213217
ap->subj->flags |= SF_VISIT;
214218
}
@@ -321,7 +325,9 @@ void check_poster(ARTICLE *ap)
321325
#ifdef REPLYTO_POSTER_CHECKING
322326
char* reply_buf = fetchlines(article_num(ap),REPLY_LINE);
323327
if (in_string(reply_buf, g_login_name.c_str(), true))
328+
{
324329
select_subthread(ap,AUTO_SEL_FOL);
330+
}
325331
free(reply_buf);
326332
#endif
327333
}

libtrn/edit_dist.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,15 @@ int edit_distn(const char *from, int from_len, const char *to, int to_len)
173173
#ifdef DEBUG_EDITDIST
174174
printf(" ");
175175
for (col = 0; col < from_len; col++)
176+
{
176177
printf(" %c ", from[col]);
178+
}
177179
printf("\n ");
178180

179181
for (col = 0; col <= from_len; col++)
182+
{
180183
printf("%2d ", col * del);
184+
}
181185
#endif
182186

183187
/* Row 0 is handled implicitly; its value at a given column is col*del.
@@ -245,9 +249,13 @@ int edit_distn(const char *from, int from_len, const char *to, int to_len)
245249
} /* for col = 1 */
246250
#ifdef DEBUG_EDITDIST
247251
if (row < to_len - 1)
252+
{
248253
printf("\n %c %2d ", to[row+1], (row + 2) * ins);
254+
}
249255
else
256+
{
250257
printf("\n");
258+
}
251259
#endif
252260
#ifdef TRN_SPEEDUP
253261
if (low > MIN_DIST)

libtrn/final.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ Signal_t int_catcher(int dummy)
139139
sigset(SIGINT,int_catcher);
140140
#ifdef DEBUG
141141
if (debug)
142+
{
142143
write(2,"int_catcher\n",12);
144+
}
143145
#endif
144146
if (!g_waiting) {
145147
if (g_int_count++) { /* was there already an interrupt? */
@@ -264,19 +266,21 @@ Signal_t stop_catcher(int signo)
264266
resetty(); /* this is the point of all this */
265267
#ifdef DEBUG
266268
if (debug)
269+
{
267270
write(2,"stop_catcher\n",13);
271+
}
268272
#endif
269273
fflush(stdout);
270274
sigset(signo,SIG_DFL); /* enable stop */
271275
#ifdef HAS_SIGBLOCK
272276
sigsetmask(sigblock(0) & ~(1 << (signo-1)));
273277
#endif
274278
kill(0,signo); /* and do the stop */
275-
savetty();
279+
savetty();
276280
#ifdef MAILCALL
277-
g_mailcount = 0; /* force recheck */
281+
g_mailcount = 0; /* force recheck */
278282
#endif
279-
if (!g_panic) {
283+
if (!g_panic) {
280284
if (!g_waiting) {
281285
termlib_init();
282286
noecho(); /* set no echo */
@@ -285,7 +289,7 @@ Signal_t stop_catcher(int signo)
285289
/* (defined only if TIOCSTI defined) */
286290
errno = 0; /* needed for getcmd */
287291
}
288-
}
292+
}
289293
xmouse_check();
290294
}
291295
sigset(signo,stop_catcher); /* unenable the stop */

libtrn/hash.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ static void hefree(HASHENT *hp)
275275
{
276276
#ifdef HASH_FREE_ENTRIES
277277
if (s_reusables >= RETAIN) /* compost heap is full? */
278+
{
278279
free((char*)hp); /* yup, just pitch this one */
280+
}
279281
else { /* no, just stash for reuse */
280282
++s_reusables;
281283
hp->he_next = s_hereuse;

libtrn/head.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ void start_header(ART_NUM artnum)
230230
{
231231
#ifdef DEBUG
232232
if (debug & DEB_HEADER)
233+
{
233234
dumpheader("start_header\n");
235+
}
234236
#endif
235237
for (HEADTYPE &i : g_htype)
236238
{
@@ -303,7 +305,9 @@ bool parseline(char *art_buf, int newhide, int oldhide)
303305
}
304306
#ifdef DEBUG
305307
if (debug & DEB_HEADER)
308+
{
306309
dumpheader(art_buf);
310+
}
307311
#endif
308312
if (g_htype[g_in_header].flags & HT_HIDE)
309313
{

libtrn/intrp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ void intrp_init(char *tcbuf, int tcbuf_len)
7171
struct passwd* pwd = getpwnam(NEWS_ADMIN);
7272

7373
if (pwd != nullptr)
74+
{
7475
g_newsuid = pwd->pw_uid;
76+
}
7577
#else
7678
#ifdef TILDENAME
7779
char tildenews[2+sizeof NEWS_ADMIN];
@@ -135,7 +137,9 @@ static char *skipinterp(char *pattern, const char *stoppers)
135137
{
136138
#ifdef DEBUG
137139
if (debug & DEB_INTRP)
140+
{
138141
printf("skipinterp %s (till %s)\n",pattern,stoppers?stoppers:"");
142+
}
139143
#endif
140144

141145
while (*pattern && (!stoppers || !strchr(stoppers,*pattern))) {

0 commit comments

Comments
 (0)