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  
    77
    88#include <stdio.h>
    99#include <math.h>
     10#include <string.h>
    1011
    1112#include "jgraph.h"
    1213
     
    1819
    1920static double Pi;
    2021
    21 process_title(g)
    22 Graph g;
     22static void process_label_max_n_mins(Label, float, float);
     23static void process_label(Label, Graph, int);
     24
     25static void process_title(Graph g)
    2326{
    2427
    2528  float ytitleloc;
    Graph g; 
    4346  process_label(g->title, g, 0);
    4447}
    4548
    46 process_legend(g)
    47 Graph g;
     49static void process_legend(Graph g)
    4850{
    4951  Legend l;
    5052  int anything;
    Graph g; 
    208210  process_label_max_n_mins(l->l, width, height);
    209211}
    210212
    211 float find_reasonable_hash_interval(a)
    212 Axis a;
     213static float find_reasonable_hash_interval(Axis a)
    213214{
    214215  float s, d;
    215216
    Axis a; 
    237238  }
    238239}
    239240
    240 float find_reasonable_hash_start(a)
    241 Axis a;
     241static float find_reasonable_hash_start(Axis a)
    242242{
    243243  int i;
    244244 
    Axis a; 
    248248  return ((float) i) * a->hash_interval;
    249249}
    250250
    251 int find_reasonable_precision(a)
    252 Axis a;
     251static int find_reasonable_precision(Axis a)
    253252{
    254253  int i, b, b2, done;
    255254  float x, x2, tolerance;
    Axis a; 
    292291  return MAX(b, b2);
    293292}
    294293
    295 int find_reasonable_minor_hashes(a)
    296 Axis a;
     294static int find_reasonable_minor_hashes(Axis a)
    297295{
    298296  float d; 
    299297  int i;
    Axis a; 
    315313  }
    316314}
    317315
    318 process_axis1(a, g)
    319 Axis a;
    320 Graph g;
     316static void process_axis1(Axis a, Graph g)
    321317{
    322318  float tmp;
    323319  int i;
    Graph g; 
    385381  }
    386382}
    387383
    388 process_axis2(a, g)
    389 Axis a;
    390 Graph g;
     384static void process_axis2(Axis a, Graph g)
    391385{
    392386  float t1, t2, t3, minor_hashes, hloc, tmp;
    393387  float ymin, ymax, xmin, xmax;
    Graph g; 
    575569  process_label (a->label, g, 0);
    576570}
    577571
    578 process_label(l, g, adjust)
    579 Label l;
    580 Graph g;
    581 int adjust;
     572void process_label(Label l, Graph g, int adjust)
    582573{
    583574  float len, height;
    584575  int f, i;
    int adjust; 
    617608  process_label_max_n_mins(l, len, height);
    618609}
    619610   
    620 process_label_max_n_mins(l, len, height)
    621 Label l;
    622 float len;
    623 float height;
     611void process_label_max_n_mins(Label l, float len, float height)
    624612{
    625613  float xlen, ylen, xheight, yheight;
    626614  float x, y;
    float height; 
    666654
    667655}
    668656
    669 process_strings(g)
    670 Graph g;
     657static void process_strings(Graph g)
    671658{
    672659  String s;
    673660
    Graph g; 
    676663  }
    677664}
    678665
    679 process_curve(c, g)
    680 Curve c;
    681 Graph g;
     666static void process_curve(Curve c, Graph g)
    682667{
    683668  if (c->bezier && (c->npts < 4 || (c->npts % 3 != 1))) {
    684669    error_header();
    Graph g; 
    704689  if (c->pparg == FSIG) c->pparg = 0.0;
    705690}
    706691
    707 process_curves(g)
    708 Graph g;
     692static void process_curves(Graph g)
    709693{
    710694  Curve c;
    711695  for(c = first(g->curves); c != nil(g->curves); c = next(c)) {
    Graph g; 
    713697  }
    714698}
    715699 
    716 process_extrema(g)  /* This finds all the minval/maxvals for bbox calc */
    717 Graph g;
     700static 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
     709static void process_extrema(Graph g)  /* This finds all the minval/maxvals for bbox calc */
    718710{
    719711  Curve c;
    720712  String s;
    Graph g; 
    763755  }
    764756}
    765757
    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;
     758static void process_graph(Graph g)
    779759{
    780760  g->x_translate = intop(g->x_translate);
    781761  g->y_translate = intop(g->y_translate);
    Graph g; 
    790770  process_extrema(g);
    791771}
    792772
    793 process_graphs(gs)
    794 Graphs gs;
     773void process_graphs(Graphs gs)
    795774{
    796775  Graphs the_g;
    797776  Graph g;