ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/glaresrc.c
(Generate patch)

Comparing ray/src/util/glaresrc.c (file contents):
Revision 2.6 by greg, Mon May 29 16:47:54 2006 UTC vs.
Revision 2.7 by greg, Tue Nov 29 20:45:21 2022 UTC

# Line 17 | Line 17 | struct source  *donelist = NULL;       /* finished sources */
17   void    pict_stats(void);
18  
19   static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
20 static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
20   static void addindirect(int     h, int  v, double       br);
21   static void addsrcspan(struct srcspan   *nss);
22   static void mergesource(struct source   *sp, struct source      *ap);
23   static void close_sources(int   v);
24   static void close_allsrcs(void);
25 < static struct srcspan * splitspan(register struct srcspan       *sso, double    h, double       v, double       m);
25 > static struct srcspan * splitspan(struct srcspan        *sso, double    h, double       v, double       m);
26   static struct source * splitsource(struct source        *so);
27 < static void donesource(register struct source   *sp);
28 < static struct source * findbuddy(register struct source *s, register struct source      *l);
29 < static void absorb(register struct source       *s);
27 > static void donesource(struct source    *sp);
28 > static struct source * findbuddy(struct source  *s, struct source       *l);
29 > static void absorb(struct source        *s);
30   static void freespans(struct source     *sp);
31  
32  
# Line 39 | Line 38 | newspan(               /* allocate a new source span */
38          float   *sb
39   )
40   {
41 <        register struct srcspan *ss;
42 <        register int    i;
41 >        struct srcspan  *ss;
42 >        int     i;
43  
44          ss = (struct srcspan *)malloc(sizeof(struct srcspan));
45          if (ss == NULL)
# Line 55 | Line 54 | newspan(               /* allocate a new source span */
54   }
55  
56  
57 < extern void
57 > void
58   analyze(void)                   /* analyze our scene */
59   {
60          int     h, v;
# Line 112 | Line 111 | addindirect(           /* add brightness to indirect illuminanc
111   {
112          double  tanb, d;
113          int     hl;
114 <        register int    i;
114 >        int     i;
115  
116          hl = hlim(v);
117          if (h <= -hl) {                 /* left region */
# Line 154 | Line 153 | addindirect(           /* add brightness to indirect illuminanc
153   }
154  
155  
156 < extern void
156 > void
157   comp_thresh(void)                       /* compute glare threshold */
158   {
159          int     h, v;
# Line 200 | Line 199 | addsrcspan(                    /* add new source span to our list */
199   )
200   {
201          struct source   *last, *cs, *this;
202 <        register struct srcspan *ss;
202 >        struct srcspan  *ss;
203  
204          cs = NULL;
205          for (this = curlist; this != NULL; this = this->next) {
# Line 241 | Line 240 | mergesource(           /* merge source ap into source sp */
240   )
241   {
242          struct srcspan  head;
243 <        register struct srcspan *alp, *prev, *tp;
243 >        struct srcspan  *alp, *prev, *tp;
244  
245          head.next = sp->first;
246          prev = &head;
# Line 277 | Line 276 | close_sources(         /* close sources above v */
276   )
277   {
278          struct source   head;
279 <        register struct source  *last, *this;
279 >        struct source   *last, *this;
280  
281          head.next = curlist;
282          last = &head;
# Line 295 | Line 294 | close_sources(         /* close sources above v */
294   static void
295   close_allsrcs(void)                     /* done with everything */
296   {
297 <        register struct source  *this, *next;
297 >        struct source   *this, *next;
298  
299          this = curlist;
300          while (this != NULL) {
# Line 309 | Line 308 | close_allsrcs(void)                    /* done with everything */
308  
309   static struct srcspan *
310   splitspan(              /* divide source span at point */
311 <        register struct srcspan *sso,
311 >        struct srcspan  *sso,
312          double  h,
313          double  v,
314          double  m
315   )
316   {
317 <        register struct srcspan *ssn;
317 >        struct srcspan  *ssn;
318          double  d;
319          int     hs;
320  
# Line 345 | Line 344 | splitsource(                   /* divide source in two if it's big and
344   {
345          LRSUM   lr;
346          LRLIN   fit;
347 <        register struct srcspan *ss, *ssn;
347 >        struct srcspan  *ss, *ssn;
348          struct srcspan  *ssl, *ssnl, head;
349          int     h;
350          double  mh, mv;
# Line 393 | Line 392 | splitsource(                   /* divide source in two if it's big and
392  
393   static void
394   donesource(                     /* finished with this source */
395 <        register struct source  *sp
395 >        struct source   *sp
396   )
397   {
398          struct source   *newsrc;
399 <        register struct srcspan *ss;
399 >        struct srcspan  *ss;
400          int     h, n;
401          double  hsum, vsum, d;
402  
# Line 436 | Line 435 | donesource(                    /* finished with this source */
435  
436   static struct source *
437   findbuddy(                      /* find close enough source to s in l*/
438 <        register struct source  *s,
439 <        register struct source  *l
438 >        struct source   *s,
439 >        struct source   *l
440   )
441   {
442          struct source   *bestbuddy = NULL;
# Line 455 | Line 454 | findbuddy(                     /* find close enough source to s in l*/
454   }
455  
456  
457 < extern void
457 > void
458   absorb_specks(void)                     /* eliminate too-small sources */
459   {
460          struct source   head, *buddy;
461 <        register struct source  *last, *this;
461 >        struct source   *last, *this;
462  
463          if (verbose)
464                  fprintf(stderr, "%s: absorbing small sources...\n", progname);
# Line 482 | Line 481 | absorb_specks(void)                    /* eliminate too-small sources *
481  
482   static void
483   absorb(                 /* absorb a source into indirect */
484 <        register struct source  *s
484 >        struct source   *s
485   )
486   {
487          FVECT   dir;
488          double  d;
489 <        register int    i;
489 >        int     i;
490  
491          for (i = 0; i < nglardirs; i++) {
492                  spinvector(dir, ourview.vdir, ourview.vup, indirect[i].theta);
# Line 507 | Line 506 | freespans(                     /* free spans associated with source */
506          struct source   *sp
507   )
508   {
509 <        register struct srcspan *ss;
509 >        struct srcspan  *ss;
510  
511          while ((ss = sp->first) != NULL) {
512                  sp->first = ss->next;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines