Repository navigation
radiance: drop - #451240
radiance: drop#451240
Conversation
0f7a330 to
d397fb4
Compare
|
|
I'm not really in a place where I can verify that this package works as expected since I've switched jobs and have no use for it anymore :/ |
d397fb4 to
ac8aafe
Compare
|
Now that i rebased it, it shows new gcc 15 related issues ... 😅 |
diff --git a/src/common/lamps.c b/src/common/lamps.c
index 24b8119..0c751ce 100644
--- a/src/common/lamps.c
+++ b/src/common/lamps.c
@@ -13,8 +13,6 @@ static const char RCSid[] = "$Id: lamps.c,v 2.11 2025/06/07 05:12:49 greg Exp $"
#include "paths.h"
#include "color.h"
-extern char *eindex(), *expsave();
-
typedef struct lamp {
char *pattern; /* search pattern */
float *color; /* pointer to lamp value */
diff --git a/src/common/loadvars.c b/src/common/loadvars.c
index 8d77c9c..7ff03dc 100644
--- a/src/common/loadvars.c
+++ b/src/common/loadvars.c
@@ -15,9 +15,6 @@ static const char RCSid[] = "$Id: loadvars.c,v 2.24 2025/06/07 05:09:45 greg Exp
#define NOCHAR 127 /* constant for character to delete */
-extern char *fgetline();
-
-
void
loadvars( /* load variables into vv from file */
const char *rfname
diff --git a/src/common/mgf_parser.c b/src/common/mgf_parser.c
index 5a87b25..814d497 100644
--- a/src/common/mgf_parser.c
+++ b/src/common/mgf_parser.c
@@ -23,11 +23,11 @@ char mg_ename[MG_NENTITIES][MG_MAXELEN] = MG_NAMELIST;
/* Handler routines for each entity */
-int (*mg_ehand[MG_NENTITIES])();
+int (*mg_ehand[MG_NENTITIES])(int, char **);
/* Handler routine for unknown entities */
-int (*mg_uhand)() = mg_defuhand;
+int (*mg_uhand)(int argc, char **argv) = mg_defuhand;
unsigned mg_nunknown; /* count of unknown entities */
diff --git a/src/common/object.h b/src/common/object.h
index 1d187d5..2ff7508 100644
--- a/src/common/object.h
+++ b/src/common/object.h
@@ -10,6 +10,11 @@
extern "C" {
#endif
+#include <stdio.h>
+
+#include "tiff.h"
+#include "mat4.h"
+
#ifndef OCTREE
#define OCTREE int
#endif
diff --git a/src/common/otypes.h b/src/common/otypes.h
index 0f306fc..d8d2eec 100644
--- a/src/common/otypes.h
+++ b/src/common/otypes.h
@@ -8,21 +8,16 @@
extern "C" {
#endif
+#include "object.h"
+#include "../rt/ray.h"
+
typedef struct {
char funame[12]; /* function name */
int flags; /* type flags */
-#ifdef FUN_ARGLIST
- int (*funp)(FUN_ARGLIST); /* pointer to function */
-#else
- int (*funp)(); /* pointer to function */
-#endif
+ int (*funp)(OBJECT *, RAY *); /* pointer to function */
} FUN;
-#ifdef FUN_ARGLIST
-extern int o_default(FUN_ARGLIST);
-#else
-extern int o_default(); /* XXX conflict with radogl.h */
-#endif
+extern int o_default(OBJREC *, RAY *); /* XXX conflict with radogl.h */
/* object types in decreasing frequency */
#define OBJ_FACE 0 /* polygon */
diff --git a/src/common/radogl.h b/src/common/radogl.h
index c902759..5ac43c6 100644
--- a/src/common/radogl.h
+++ b/src/common/radogl.h
@@ -74,7 +74,6 @@ extern int loadoct(char *fname);
/* defined in rglmat.c */
extern void rgl_matclear(void);
extern MATREC *getmatp(char *nam);
-extern int o_default(OBJREC *o);
extern int o_unsupported(OBJREC *o);
extern MATREC *newmaterial(char *nam);
extern void freemtl(void *p);
diff --git a/src/common/rglfile.c b/src/common/rglfile.c
index bab4a57..142ef0f 100644
--- a/src/common/rglfile.c
+++ b/src/common/rglfile.c
@@ -151,7 +151,6 @@ void
rgl_load(inpspec) /* convert scene description into OGL calls */
char *inpspec;
{
- char *fgetline();
FILE *infp;
char buf[1024];
register int c;
@@ -223,7 +222,7 @@ FILE *fp;
fgetword(sbuf2, MAXSTR, fp);
if (ob.os == NULL)
ob.os = (char *)getmatp(sbuf2);
- o_default(&ob); /* fake reference */
+ o_default(&ob, NULL); /* fake reference */
return;
}
if ((rval = readfargs(&ob.oargs, fp)) == 0) {
@@ -234,7 +233,7 @@ FILE *fp;
error(SYSTEM, errmsg);
}
/* execute */
- (*ofun[ob.otype].funp)(&ob);
+ (*ofun[ob.otype].funp)(&ob, NULL);
/* free arguments */
freefargs(&ob.oargs);
}
diff --git a/src/common/rglinst.c b/src/common/rglinst.c
index b2827de..45e55d0 100644
--- a/src/common/rglinst.c
+++ b/src/common/rglinst.c
@@ -254,8 +254,6 @@ static char *
ogetstr(s) /* get null-terminated string */
char *s;
{
- extern char *getstr();
-
if (getstr(s, infp) == NULL)
octerror(USER, "truncated octree");
return(s);
@@ -266,7 +264,6 @@ static long
ogetint(siz) /* get a siz-byte integer */
int siz;
{
- extern long getint();
register long r;
r = getint(siz, infp);
@@ -279,7 +276,6 @@ int siz;
static double
ogetflt() /* get a floating point number */
{
- extern double getflt();
double r;
r = getflt(infp);
@@ -372,7 +368,7 @@ loadobj() /* get next object */
} else
ob.oargs.farg = NULL;
/* process object */
- (*ofun[ob.otype].funp)(&ob);
+ (*ofun[ob.otype].funp)(&ob, NULL);
/* record material if modifier */
if (ismodifier(ob.otype)) {
if ((lep = lu_find(&imtab, (char *)(size_t)nobjects)) == NULL)
diff --git a/src/common/rglmat.c b/src/common/rglmat.c
index 1ce60bf..ab58f1a 100644
--- a/src/common/rglmat.c
+++ b/src/common/rglmat.c
@@ -41,7 +41,8 @@ getmatp( /* find material record for modifier name */
int
o_default( /* default object is non-material modifier */
- register OBJREC *o
+ register OBJREC *o,
+ RAY *_ray
)
{
register LUENT *lup;
diff --git a/src/cv/arch2rad.c b/src/cv/arch2rad.c
index 17a6584..a133d6a 100644
--- a/src/cv/arch2rad.c
+++ b/src/cv/arch2rad.c
@@ -584,6 +584,7 @@ matchrule( /* see if block matches this rule */
return((1<<NFACES)-1); /* matched all faces */
}
+char *blkname(BLOCK *bp);
void
putfaces( /* put out faces */
@@ -593,7 +594,7 @@ putfaces( /* put out faces */
FILE *fp
)
{
- char *blkname(), *bn;
+ char *bn;
if (!strcmp(m, VOIDID))
return;
diff --git a/src/cv/lampcolor.c b/src/cv/lampcolor.c
index 858dca4..b9fe7f4 100644
--- a/src/cv/lampcolor.c
+++ b/src/cv/lampcolor.c
@@ -35,7 +35,7 @@ double lumens; /* total lamp lumens */
struct {
char *name;
char value[64];
- int (*check)();
+ int (*check)(char *);
char *help;
} param[NPARAMS] = {
{ "lamp type", "WHITE", typecheck,
diff --git a/src/cv/rad2mgf.c b/src/cv/rad2mgf.c
index f5ac48e..e043a2a 100644
--- a/src/cv/rad2mgf.c
+++ b/src/cv/rad2mgf.c
@@ -380,7 +380,7 @@ clrverts(void) /* clear vertex table */
void
add2dispatch( /* add function to dispatch table */
char *name,
- int (*func)()
+ int (*func)(char *, char *, char *, FUNARGS *)
)
{
LUENT *lp;
diff --git a/src/cv/tmesh2rad.c b/src/cv/tmesh2rad.c
index b3c7fd6..c65220f 100644
--- a/src/cv/tmesh2rad.c
+++ b/src/cv/tmesh2rad.c
@@ -59,7 +59,7 @@ int nverts = 0; /* number of vertices in our list */
#define CHUNKSIZ 128 /* vertex allocation chunk size */
-extern VERTEX *vnew(); /* allocate a vertex (never freed) */
+extern VERTEX *vnew(int id, double x, double y, double z); /* allocate a vertex (never freed) */
char *defmat = VOIDID; /* default (starting) material name */
char *defpat = ""; /* default (starting) picture name */
@@ -318,7 +318,6 @@ syntax( /* report syntax error and exit */
char *er
)
{
- extern long ftell();
long cpos;
int c;
int lineno;
diff --git a/src/gen/genbranch.c b/src/gen/genbranch.c
index 5bb3b7c..4746bc1 100644
--- a/src/gen/genbranch.c
+++ b/src/gen/genbranch.c
@@ -61,7 +61,6 @@ double beg[3], end[3];
double rad;
int lvl;
{
- double sqrt();
double newbeg[3], newend[3];
double t;
int i, j;
diff --git a/src/gen/genmarble.c b/src/gen/genmarble.c
index 924e43a..c124e5f 100644
--- a/src/gen/genmarble.c
+++ b/src/gen/genmarble.c
@@ -19,8 +19,30 @@ static const char RCSid[] = "$Id: genmarble.c,v 2.7 2003/11/16 10:29:38 schorsch
typedef double FVECT[3];
-static double bubble(); /* pretty cute, huh? */
-static void sphere_cart();
+static void
+sphere_cart(FVECT v, double ro, double theta, double phi) /* spherical to cartesian coord. conversion */
+{
+ double d;
+
+ d = sin(phi);
+ v[0] = ro*d*cos(theta);
+ v[1] = ro*d*sin(theta);
+ v[2] = ro*cos(phi);
+}
+
+static double
+bubble(FVECT v, FVECT cent, double rad, double bubrad) /* compute location of random bubble */
+{
+ double r, ro, theta, phi;
+
+ r = frandom()*bubrad;
+ ro = sqrt(frandom())*(rad-r);
+ theta = frandom()*(2.0*PI);
+ phi = frandom()*PI;
+ sphere_cart(v, ro, theta, phi);
+ v[0] += cent[0]; v[1] += cent[1]; v[2] += cent[2];
+ return(r);
+}
int
main(argc, argv)
@@ -66,34 +88,3 @@ char **argv;
return(0);
}
-
-
-static double
-bubble(v, cent, rad, bubrad) /* compute location of random bubble */
-FVECT v, cent;
-double rad, bubrad;
-{
- double r, ro, theta, phi;
-
- r = frandom()*bubrad;
- ro = sqrt(frandom())*(rad-r);
- theta = frandom()*(2.0*PI);
- phi = frandom()*PI;
- sphere_cart(v, ro, theta, phi);
- v[0] += cent[0]; v[1] += cent[1]; v[2] += cent[2];
- return(r);
-}
-
-
-static void
-sphere_cart(v, ro, theta, phi) /* spherical to cartesian coord. conversion */
-FVECT v;
-double ro, theta, phi;
-{
- double d;
-
- d = sin(phi);
- v[0] = ro*d*cos(theta);
- v[1] = ro*d*sin(theta);
- v[2] = ro*cos(phi);
-}
diff --git a/src/gen/xform.c b/src/gen/xform.c
index f122025..1f91a70 100644
--- a/src/gen/xform.c
+++ b/src/gen/xform.c
@@ -445,7 +445,8 @@ xfobject( /* transform an object */
}
putchar('\n');
/* transform arguments */
- if ((*ofun[fn].funp)(fin) < 0) {
+
+ if ((*(int(**)(FILE *))(ofun[fn].funp))(fin) < 0) {
fprintf(stderr, "%s: (%s): bad %s \"%s\"\n",
progname, fname, ofun[fn].funame, nam);
exit(1);
diff --git a/src/meta/plotin.c b/src/meta/plotin.c
index 39abafd..ff62638 100644
--- a/src/meta/plotin.c
+++ b/src/meta/plotin.c
@@ -261,7 +261,6 @@ arc(
)
{
double pc;
- double sqrt();
int flg,m,xc,yc,xs,ys,qs,qf;
float dx,dy,r;
char use;
diff --git a/src/meta/syscalls.c b/src/meta/syscalls.c
index 799c190..ef1c5dd 100644
--- a/src/meta/syscalls.c
+++ b/src/meta/syscalls.c
@@ -17,7 +17,6 @@ const char *mode
)
{
FILE *fp;
- FILE *fopen();
if ((fp = fopen(fname, mode)) == NULL) {
sprintf(errmsg, "cannot open file \"%s\", mode \"%s\"", fname, mode);
@@ -36,7 +35,6 @@ const char *mode
)
{
char *mdir, stemp[MAXFNAME];
- char *getenv();
if ((mdir = getenv("MDIR")) == NULL)
mdir = MDIR;
diff --git a/src/px/pflip.c b/src/px/pflip.c
index 0e45223..ec83eeb 100644
--- a/src/px/pflip.c
+++ b/src/px/pflip.c
@@ -124,7 +124,6 @@ memerr(void)
static void
scanfile(void) /* scan to the end of file */
{
- extern long ftell();
COLR *scanin;
int y;
diff --git a/src/px/protate.c b/src/px/protate.c
index 9920776..e1c564e 100644
--- a/src/px/protate.c
+++ b/src/px/protate.c
@@ -149,7 +149,7 @@ rotatecw( /* rotate picture clockwise */
{
register COLR *inln;
register int xoff, inx, iny;
- long start, ftell();
+ long start;
if ((inln = (COLR *)malloc(xres*sizeof(COLR))) == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
@@ -187,7 +187,7 @@ rotateccw( /* rotate picture counter-clockwise */
{
register COLR *inln;
register int xoff, inx, iny;
- long start, ftell();
+ long start;
if ((inln = (COLR *)malloc(xres*sizeof(COLR))) == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
diff --git a/src/rt/mkpmap.c b/src/rt/mkpmap.c
index c4d6d1c..d6ee95d 100644
--- a/src/rt/mkpmap.c
+++ b/src/rt/mkpmap.c
@@ -77,7 +77,7 @@ int ambvwt = 0, ambssamp = 0, ambres = 32, ambounce = 0,
ambdiv = 128, vspretest = 512, maxdepth = 6, contrib = 0;
unsigned long samplendx = 0;
char *ambfile = NULL, *RCCONTEXT = NULL;
-void (*trace)() = NULL, (*addobjnotify [])() = {ambnotify, NULL};
+void (*trace)(RAY *) = NULL, (*addobjnotify [])() = {ambnotify, NULL};
void printdefaults()
diff --git a/src/rt/raycalls.c b/src/rt/raycalls.c
index 6e91e2b..b439688 100644
--- a/src/rt/raycalls.c
+++ b/src/rt/raycalls.c
@@ -112,9 +112,9 @@ int dimlist[MAXDIM]; /* sampling dimensions */
int ndims = 0; /* number of sampling dimensions */
unsigned long samplendx = 0; /* index for this sample */
-void (*trace)() = NULL; /* trace call */
+void (*trace)(RAY *) = NULL; /* trace call */
-void (*addobjnotify[8])() = {ambnotify, NULL};
+void (*addobjnotify[8])(OBJECT) = {ambnotify, NULL};
int castonly = 0; /* only doing ray-casting? */
diff --git a/src/rt/rcontrib.c b/src/rt/rcontrib.c
index 8fba76c..6f31375 100644
--- a/src/rt/rcontrib.c
+++ b/src/rt/rcontrib.c
@@ -19,7 +19,7 @@ int dimlist[MAXDIM]; /* sampling dimensions */
int ndims = 0; /* number of sampling dimensions */
unsigned long samplendx = 0; /* index for this sample */
-void (*trace)() = NULL; /* trace call (NULL before rcinit) */
+void (*trace)(RAY *) = NULL; /* trace call (NULL before rcinit) */
int do_irrad = 0; /* compute irradiance? */
diff --git a/src/rt/rpict.c b/src/rt/rpict.c
index 5ddf3da..3fe52db 100644
--- a/src/rt/rpict.c
+++ b/src/rt/rpict.c
@@ -69,7 +69,7 @@ double mblur = 0.; /* motion blur parameter */
double dblur = 0.; /* depth-of-field blur parameter */
-void (*trace)() = NULL; /* trace call */
+void (*trace)(RAY *) = NULL; /* trace call */
int do_irrad = 0; /* compute irradiance? */
diff --git a/src/rt/source.h b/src/rt/source.h
index 2137816..de25a01 100644
--- a/src/rt/source.h
+++ b/src/rt/source.h
@@ -9,6 +9,9 @@
#include <string.h>
+#include "ray.h"
+#include "../common/mat4.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -118,15 +121,15 @@ typedef struct {
*/
typedef struct {
- int (*vproj)(); /* project virtual sources */
+ int (*vproj)(MAT4 proj, OBJREC *o, SRCREC *source, int i); /* project virtual sources */
int nproj; /* number of possible projections */
} VSMATERIAL; /* virtual source material functions */
typedef struct {
- void (*setsrc)(); /* set light source for object */
- void (*partit)(); /* partition light source object */
- double (*getpleq)(); /* plane equation for surface */
- double (*getdisk)(); /* maximum disk for surface */
+ void (*setsrc)(SRCINDEX *si, RAY *r); /* set light source for object */
+ void (*partit)(SRCINDEX *si, RAY *r); /* partition light source object */
+ double (*getpleq)(SRCINDEX *si, RAY *r); /* plane equation for surface */
+ double (*getdisk)(SRCINDEX *si, RAY *r); /* maximum disk for surface */
} SOBJECT; /* source object functions */
typedef union {
... giving up on patching radiance |
ac8aafe to
159922d
Compare
159922d to
3e98724
Compare
gepbird
left a comment
There was a problem hiding this comment.
I agree with dropping this, there was no specific issue of radiance being broken so probably no one used it.
3e98724 to
409ca1f
Compare
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.