Ticket #36397: patch-draw.c.diff

File patch-draw.c.diff, 3.4 KB (added by stevecheckoway (Stephen Checkoway), 12 years ago)
  • draw.c

    old new  
    88#include "jgraph.h"
    99#include <stdio.h>
    1010#include <math.h>
     11#include <string.h>
    1112
    1213static char real_eof = EOF;
    1314
    14 float ctop(val, axis)
    15 float val;
    16 Axis axis;
     15static void draw_footer(Graphs, int);
     16static void draw_header(Graphs, int, int);
     17static void draw_arrow(float, float, float, float, Curve);
     18static void draw_mark(float, float, Curve, Graph);
     19static void draw_curve(Curve, Graph);
     20static void draw_label(Label);
     21
     22float ctop(float val, Axis axis)
    1723{
    1824  if (axis->is_lg) {
    1925    if (val <= 0.0) {
    Axis axis; 
    2935  }
    3036}
    3137
    32 float disttop(val, axis)
    33 float val;
    34 Axis axis;
     38float disttop(float val, Axis axis)
    3539{
    3640  if (axis->is_lg) {
    3741    return FCPI * val;
    Axis axis; 
    4044  }
    4145}
    4246
    43 float intop(val)
    44 float val;
     47float intop(float val)
    4548{
    4649  return FCPI * val;
    4750}
    4851
    4952#define MAXIMUM(a,b) ((a > b) ? a : b)
    5053
    51 draw_axis(a, other)
    52 Axis a, other;
     54void draw_axis(Axis a, Axis other)
    5355{
    5456  char orientation;
    5557  Hash h;
    Axis a, other; 
    114116}
    115117
    116118
    117 draw_label(l)
    118 Label l;
     119void draw_label(Label l)
    119120{
    120121  if (l->label == CNULL) return;
    121122  comment(l->label);
    122123  print_label(l);
    123124}
    124125
    125 set_clip(g)
    126 Graph g;
     126static void set_clip(Graph g)
    127127{
    128128  comment("Setting Clip");
    129129  printf("newpath\n");
    Graph g; 
    133133  printf("  closepath clip newpath\n");
    134134}
    135135
    136 draw_curves(g)
    137 Graph g;
     136static void draw_curves(Graph g)
    138137{
    139138  Curve c;
    140139
    Graph g; 
    148147  printf("\n");
    149148}
    150149
    151 draw_curve(c, g)
    152 Curve c;
    153 Graph g;
     150void draw_curve(Curve c, Graph g)
    154151{
    155152  Point p, px, py;
    156153  int i, j;
    Graph g; 
    267264  printf("\n");
    268265}
    269266
    270 draw_mark(x, y, c, g)
    271 float x, y;
    272 Curve c;
    273 Graph g;
     267void draw_mark(float x, float y, Curve c, Graph g)
    274268{
    275269  Point p;
    276270  float ms0, ms1, scx, scy, trx, try;
    Graph g; 
    499493  grestore();
    500494}
    501495
    502 draw_arrow(x1, y1, x2, y2, c)
    503 float x1, y1, x2, y2;
    504 Curve c;
     496void draw_arrow(float x1, float y1, float x2, float y2, Curve c)
    505497{
    506498  float dx, dy;
    507499  float ms0;
    Curve c; 
    539531  printf("\n");
    540532}
    541533
    542 draw_legend(g)
    543 Graph g;
     534static void draw_legend(Graph g)
    544535{
    545536  Curve c;
    546537  Legend l;
    Graph g; 
    603594  printf("\n");
    604595}
    605596
    606 draw_strings(g)
    607 Graph g;
     597static void draw_strings(Graph g)
    608598{
    609599  String s;
    610600
    Graph g; 
    613603    draw_label(s->s);
    614604}
    615605
    616 draw_graph(g)
    617 Graph g;
     606static void draw_graph(Graph g)
    618607{
    619608  comment("Drawing New Graph");
    620609  printf("%f %f translate\n", g->x_translate, g->y_translate);
    Graph g; 
    634623
    635624}
    636625
    637 draw_graphs(gs, pp, landscape)
    638 Graphs gs;
    639 int pp;
    640 int landscape;
     626void draw_graphs(Graphs gs, int pp, int landscape)
    641627{
    642628  Graphs gs_p;
    643629  Graph g;
    int landscape; 
    651637  }
    652638}
    653639
    654 draw_header(gs, pp, landscape)
    655 Graphs gs;
    656 int pp;
    657 int landscape;
     640void draw_header(Graphs gs, int pp, int landscape)
    658641{
    659642  FILE *f;
    660643  char c;
    int landscape; 
    685668        (((11.0 * FCPI) - (gs->bb[3] - gs->bb[1])) / 2.0) - gs->bb[1]);     
    686669    }
    687670  } else if (landscape) {
    688     printf("%f 0 translate\n", -gs->bb[2] - gs->bb[0]);
     671    printf("%f 0 translate\n", (double)(-gs->bb[2] - gs->bb[0]));
    689672  }
    690673  printf("1 setlinecap 1 setlinejoin\n");
    691674  printf("0.700 setlinewidth\n");
    int landscape; 
    746729  }
    747730}
    748731
    749 draw_footer(gs, pp)
    750 Graphs gs;
    751 int pp;
     732void draw_footer(Graphs gs, int pp)
    752733{
    753734  FILE *f;
    754735  char c;