@@ -295,21 +295,15 @@ static char *
295
295
build_linkage_postscript_string (const Linkage linkage ,
296
296
bool display_walls , ps_ctxt_t * pctx )
297
297
{
298
- int link , i ,j ;
299
- int d ;
300
298
bool print_word_0 = true, print_word_N = true;
301
299
int N_links = linkage -> num_links ;
302
300
Link * ppla = linkage -> link_array ;
303
- dyn_str * string ;
304
- int N_words_to_print ;
305
-
306
- string = dyn_str_new ();
307
301
308
302
/* Do we want to print the left and right walls? */
309
303
if (!display_walls )
310
304
{
311
305
int N_wall_connectors = 0 ;
312
- for (j = 0 ; j < N_links ; j ++ )
306
+ for (int j = 0 ; j < N_links ; j ++ )
313
307
{
314
308
if (0 == ppla [j ].lw )
315
309
{
@@ -326,7 +320,7 @@ build_linkage_postscript_string(const Linkage linkage,
326
320
}
327
321
328
322
N_wall_connectors = 0 ;
329
- for (j = 0 ; j < N_links ; j ++ )
323
+ for (int j = 0 ; j < N_links ; j ++ )
330
324
{
331
325
if (ppla [j ].rw == linkage -> num_words - 1 )
332
326
{
@@ -342,38 +336,38 @@ build_linkage_postscript_string(const Linkage linkage,
342
336
}
343
337
}
344
338
345
- if (print_word_0 ) d = 0 ; else d = 1 ;
346
-
347
- i = 0 ;
348
- N_words_to_print = linkage -> num_words ;
339
+ int N_words_to_print = linkage -> num_words ;
349
340
if (!print_word_N ) N_words_to_print -- ;
350
341
342
+ /* The postscriipt string */
343
+ dyn_str * string = dyn_str_new ();
351
344
dyn_strcat (string , "[" );
352
- for (j = d ; j < N_words_to_print ; j ++ ) {
353
- if ((i %10 == 0 ) && (i > 0 )) dyn_strcat (string , "\n" );
354
- i ++ ;
345
+
346
+ int doff = print_word_0 ? 0 : 1 ;
347
+ for (int j = doff ; j < N_words_to_print ; j ++ )
348
+ {
349
+ if ((j %10 == 0 ) && (j > doff )) dyn_strcat (string , "\n" );
355
350
append_string (string , "(%s)" , linkage -> word [j ]);
356
351
}
357
352
dyn_strcat (string ,"]" );
358
353
dyn_strcat (string ,"\n" );
359
354
360
355
dyn_strcat (string ,"[" );
361
- j = 0 ;
362
- for (link = 0 ; link < N_links ; link ++ ) {
356
+ int k = 0 ;
357
+ for (int link = 0 ; link < N_links ; link ++ ) {
363
358
if (!print_word_0 && (ppla [link ].lw == 0 )) continue ;
364
359
if (!print_word_N && (ppla [link ].rw == linkage -> num_words - 1 )) continue ;
365
- assert (ppla [link ].lw != SIZE_MAX , "Missing word in link" );
366
- if ((j %7 == 0 ) && (j > 0 )) dyn_strcat (string ,"\n" );
367
- j ++ ;
360
+ if ((k %7 == 0 ) && (k > 0 )) dyn_strcat (string ,"\n" );
361
+ k ++ ;
368
362
append_string (string ,"[%d %d %d" ,
369
- ppla [link ].lw - d , ppla [link ].rw - d ,
363
+ ppla [link ].lw - doff , ppla [link ].rw - doff ,
370
364
pctx -> link_heights [link ]);
371
365
append_string (string ," (%s)]" , ppla [link ].link_name );
372
366
}
373
367
dyn_strcat (string ,"]" );
374
368
dyn_strcat (string ,"\n" );
375
369
dyn_strcat (string ,"[" );
376
- for (j = 0 ; j < pctx -> N_rows ; j ++ )
370
+ for (int j = 0 ; j < pctx -> N_rows ; j ++ )
377
371
{
378
372
if (j > 0 ) append_string (string , " %d" , pctx -> row_starts [j ]);
379
373
else append_string (string ,"%d" , pctx -> row_starts [j ]);
@@ -434,8 +428,6 @@ static void sort_link_lengths(Link *ppla, link_by_length *ll,
434
428
for (unsigned int j = 0 ; j < N_links ; j ++ )
435
429
{
436
430
Link * lnk = & ppla [j ];
437
-
438
- assert (lnk -> lw != SIZE_MAX , "Missing word in link" );
439
431
assert (lnk -> link_name != NULL , "Missing link name" );
440
432
441
433
lla [j ] = & ll_tmp [j ];
0 commit comments