Browse Source

struct member devdep, use void* instead of char*

pre-master-46
rlar 16 years ago
parent
commit
d6353fb9ee
  1. 18
      ChangeLog
  2. 8
      src/frontend/hpgl.c
  3. 8
      src/frontend/plotting/plot5.c
  4. 2
      src/frontend/plotting/x11.c
  5. 8
      src/frontend/postsc.c
  6. 2
      src/frontend/wdisp/windisp.c
  7. 2
      src/frontend/wdisp/winprint.c
  8. 2
      src/include/graph.h
  9. 2
      src/tclspice.c

18
ChangeLog

@ -1,3 +1,21 @@
2010-10-24 Robert Larice
* src/frontend/hpgl.c ,
* src/frontend/plotting/plot5.c ,
* src/frontend/plotting/x11.c ,
* src/frontend/postsc.c ,
* src/frontend/wdisp/windisp.c ,
* src/frontend/wdisp/winprint.c ,
* src/include/graph.h ,
* src/tclspice.c :
struct member devdep, use void* instead of char*
2010-10-24 Robert Larice
* src/frontend/help/readhelp.c ,
* src/ngmultidec.c ,
* src/tclspice.c :
tmalloc usage, drop explicit (unsigned) cast
later to be reinstated in a tmalloc wrapper macro
2010-10-24 Robert Larice 2010-10-24 Robert Larice
* src/frontend/com_display.c , * src/frontend/com_display.c ,
* src/frontend/device.c , * src/frontend/device.c ,

8
src/frontend/hpgl.c

@ -118,9 +118,9 @@ GRAPH *graph)
hcopygraphid = graph->graphid; hcopygraphid = graph->graphid;
if (!(plotfile = fopen(graph->devdep, "w"))) {
perror(graph->devdep);
graph->devdep = (char *) NULL;
if (!(plotfile = fopen((char*) graph->devdep, "w"))) {
perror((char*) graph->devdep);
graph->devdep = NULL;
return(1); return(1);
} }
@ -154,7 +154,7 @@ GRAPH *graph)
if (!screenflag) if (!screenflag)
#endif #endif
graph->devdep = (char*) tmalloc(sizeof(GLdevdep));
graph->devdep = (GLdevdep*) tmalloc(sizeof(GLdevdep));
DEVDEP(graph).lastlinestyle = -1; DEVDEP(graph).lastlinestyle = -1;
DEVDEP(graph).lastx = -1; DEVDEP(graph).lastx = -1;
DEVDEP(graph).lasty = -1; DEVDEP(graph).lasty = -1;

8
src/frontend/plotting/plot5.c

@ -40,9 +40,9 @@ int
Plt5_NewViewport(GRAPH *graph) Plt5_NewViewport(GRAPH *graph)
{ {
if (!(plotfile = fopen(graph->devdep, "w"))) {
graph->devdep = (char *) NULL;
perror(graph->devdep);
if (!(plotfile = fopen((char*) graph->devdep, "w"))) {
graph->devdep = NULL;
perror((char*) graph->devdep);
return(1); return(1);
} }
@ -77,7 +77,7 @@ Plt5_NewViewport(GRAPH *graph)
} }
/* set to NULL so graphdb doesn't incorrectly de-allocate it */ /* set to NULL so graphdb doesn't incorrectly de-allocate it */
graph->devdep = (char *) NULL;
graph->devdep = NULL;
return(0); return(0);

2
src/frontend/plotting/x11.c

@ -366,7 +366,7 @@ X11_NewViewport(GRAPH *graph)
}; };
int trys; int trys;
graph->devdep = (char*) tmalloc(sizeof(X11devdep));
graph->devdep = (X11devdep*) tmalloc(sizeof(X11devdep));
/* set up new shell */ /* set up new shell */
DEVDEP(graph).shell = XtCreateApplicationShell("shell", DEVDEP(graph).shell = XtCreateApplicationShell("shell",

8
src/frontend/postsc.c

@ -168,9 +168,9 @@ PS_NewViewport(GRAPH *graph)
int x1,x2,y1,y2; int x1,x2,y1,y2;
hcopygraphid = graph->graphid; hcopygraphid = graph->graphid;
/* devdep initially contains name of output file */ /* devdep initially contains name of output file */
if (!(plotfile = fopen(graph->devdep, "w"))) {
perror(graph->devdep);
graph->devdep = (char *) NULL;
if (!(plotfile = fopen((char*)graph->devdep, "w"))) {
perror((char*)graph->devdep);
graph->devdep = NULL;
return(1); return(1);
} }
@ -218,7 +218,7 @@ PS_NewViewport(GRAPH *graph)
fprintf(plotfile, "/%s findfont %d scalefont setfont\n\n", fprintf(plotfile, "/%s findfont %d scalefont setfont\n\n",
psfont, (int) (fontsize * scale)); psfont, (int) (fontsize * scale));
graph->devdep = (char*) tmalloc(sizeof(PSdevdep));
graph->devdep = (PSdevdep*) tmalloc(sizeof(PSdevdep));
DEVDEP(graph).lastlinestyle = -1; DEVDEP(graph).lastlinestyle = -1;
DEVDEP(graph).lastcolor = -1; DEVDEP(graph).lastcolor = -1;
DEVDEP(graph).lastx = -1; DEVDEP(graph).lastx = -1;

2
src/frontend/wdisp/windisp.c

@ -587,7 +587,7 @@ int WIN_NewViewport( GRAPH * graph)
/* allocate device dependency info */ /* allocate device dependency info */
wd = calloc(1, sizeof(tWindowData)); wd = calloc(1, sizeof(tWindowData));
if (!wd) return 1; if (!wd) return 1;
graph->devdep = (char *)wd;
graph->devdep = wd;
/* Create the window */ /* Create the window */
i = GetSystemMetrics( SM_CYSCREEN) / 3; i = GetSystemMetrics( SM_CYSCREEN) / 3;

2
src/frontend/wdisp/winprint.c

@ -242,7 +242,7 @@ int WPRINT_NewViewport( GRAPH * graph)
/* Device dep. Info allocieren */ /* Device dep. Info allocieren */
pd = calloc(1, sizeof(tPrintData)); pd = calloc(1, sizeof(tPrintData));
if (!pd) return 1; if (!pd) return 1;
graph->devdep = (char *)pd;
graph->devdep = pd;
/* Setze den Color-Index */ /* Setze den Color-Index */
pd->ColorIndex = 0; pd->ColorIndex = 0;

2
src/include/graph.h

@ -126,7 +126,7 @@ struct graph {
/* Space here is allocated by NewViewport /* Space here is allocated by NewViewport
and de-allocated by DestroyGraph. and de-allocated by DestroyGraph.
*/ */
char *devdep;
void *devdep;
}; };

2
src/tclspice.c

@ -1343,7 +1343,7 @@ int sp_Tk_Init(void) {
int sp_Tk_NewViewport(GRAPH *graph) { int sp_Tk_NewViewport(GRAPH *graph) {
const char *result; const char *result;
int width, height, fontwidth, fontheight; int width, height, fontwidth, fontheight;
graph->devdep = (char *) NULL;
graph->devdep = NULL;
if(Tcl_GlobalEval(spice_interp,"spice_gr_NewViewport") != TCL_OK) { if(Tcl_GlobalEval(spice_interp,"spice_gr_NewViewport") != TCL_OK) {
Tcl_ResetResult(spice_interp); Tcl_ResetResult(spice_interp);

Loading…
Cancel
Save