Ticket #36397: patch-process.c.diff
File patch-process.c.diff, 3.8 KB (added by stevecheckoway (Stephen Checkoway), 12 years ago) |
---|
-
process.c
old new 7 7 8 8 #include <stdio.h> 9 9 #include <math.h> 10 #include <string.h> 10 11 11 12 #include "jgraph.h" 12 13 … … 18 19 19 20 static double Pi; 20 21 21 process_title(g) 22 Graph g; 22 static void process_label_max_n_mins(Label, float, float); 23 static void process_label(Label, Graph, int); 24 25 static void process_title(Graph g) 23 26 { 24 27 25 28 float ytitleloc; … … Graph g; 43 46 process_label(g->title, g, 0); 44 47 } 45 48 46 process_legend(g) 47 Graph g; 49 static void process_legend(Graph g) 48 50 { 49 51 Legend l; 50 52 int anything; … … Graph g; 208 210 process_label_max_n_mins(l->l, width, height); 209 211 } 210 212 211 float find_reasonable_hash_interval(a) 212 Axis a; 213 static float find_reasonable_hash_interval(Axis a) 213 214 { 214 215 float s, d; 215 216 … … Axis a; 237 238 } 238 239 } 239 240 240 float find_reasonable_hash_start(a) 241 Axis a; 241 static float find_reasonable_hash_start(Axis a) 242 242 { 243 243 int i; 244 244 … … Axis a; 248 248 return ((float) i) * a->hash_interval; 249 249 } 250 250 251 int find_reasonable_precision(a) 252 Axis a; 251 static int find_reasonable_precision(Axis a) 253 252 { 254 253 int i, b, b2, done; 255 254 float x, x2, tolerance; … … Axis a; 292 291 return MAX(b, b2); 293 292 } 294 293 295 int find_reasonable_minor_hashes(a) 296 Axis a; 294 static int find_reasonable_minor_hashes(Axis a) 297 295 { 298 296 float d; 299 297 int i; … … Axis a; 315 313 } 316 314 } 317 315 318 process_axis1(a, g) 319 Axis a; 320 Graph g; 316 static void process_axis1(Axis a, Graph g) 321 317 { 322 318 float tmp; 323 319 int i; … … Graph g; 385 381 } 386 382 } 387 383 388 process_axis2(a, g) 389 Axis a; 390 Graph g; 384 static void process_axis2(Axis a, Graph g) 391 385 { 392 386 float t1, t2, t3, minor_hashes, hloc, tmp; 393 387 float ymin, ymax, xmin, xmax; … … Graph g; 575 569 process_label (a->label, g, 0); 576 570 } 577 571 578 process_label(l, g, adjust) 579 Label l; 580 Graph g; 581 int adjust; 572 void process_label(Label l, Graph g, int adjust) 582 573 { 583 574 float len, height; 584 575 int f, i; … … int adjust; 617 608 process_label_max_n_mins(l, len, height); 618 609 } 619 610 620 process_label_max_n_mins(l, len, height) 621 Label l; 622 float len; 623 float height; 611 void process_label_max_n_mins(Label l, float len, float height) 624 612 { 625 613 float xlen, ylen, xheight, yheight; 626 614 float x, y; … … float height; 666 654 667 655 } 668 656 669 process_strings(g) 670 Graph g; 657 static void process_strings(Graph g) 671 658 { 672 659 String s; 673 660 … … Graph g; 676 663 } 677 664 } 678 665 679 process_curve(c, g) 680 Curve c; 681 Graph g; 666 static void process_curve(Curve c, Graph g) 682 667 { 683 668 if (c->bezier && (c->npts < 4 || (c->npts % 3 != 1))) { 684 669 error_header(); … … Graph g; 704 689 if (c->pparg == FSIG) c->pparg = 0.0; 705 690 } 706 691 707 process_curves(g) 708 Graph g; 692 static void process_curves(Graph g) 709 693 { 710 694 Curve c; 711 695 for(c = first(g->curves); c != nil(g->curves); c = next(c)) { … … Graph g; 713 697 } 714 698 } 715 699 716 process_extrema(g) /* This finds all the minval/maxvals for bbox calc */ 717 Graph g; 700 static void process_label_extrema(Label l, Graph g) 701 { 702 if (l->label == CNULL) return; 703 g->yminval = MIN(g->yminval, l->ymin); 704 g->ymaxval = MAX(g->ymaxval, l->ymax); 705 g->xminval = MIN(g->xminval, l->xmin); 706 g->xmaxval = MAX(g->xmaxval, l->xmax); 707 } 708 709 static void process_extrema(Graph g) /* This finds all the minval/maxvals for bbox calc */ 718 710 { 719 711 Curve c; 720 712 String s; … … Graph g; 763 755 } 764 756 } 765 757 766 process_label_extrema(l, g) 767 Label l; 768 Graph g; 769 { 770 if (l->label == CNULL) return; 771 g->yminval = MIN(g->yminval, l->ymin); 772 g->ymaxval = MAX(g->ymaxval, l->ymax); 773 g->xminval = MIN(g->xminval, l->xmin); 774 g->xmaxval = MAX(g->xmaxval, l->xmax); 775 } 776 777 process_graph(g) 778 Graph g; 758 static void process_graph(Graph g) 779 759 { 780 760 g->x_translate = intop(g->x_translate); 781 761 g->y_translate = intop(g->y_translate); … … Graph g; 790 770 process_extrema(g); 791 771 } 792 772 793 process_graphs(gs) 794 Graphs gs; 773 void process_graphs(Graphs gs) 795 774 { 796 775 Graphs the_g; 797 776 Graph g;