chiark / gitweb /
Compiles with libc6.
authorian <ian>
Mon, 21 Sep 1998 19:58:45 +0000 (19:58 +0000)
committerian <ian>
Mon, 21 Sep 1998 19:58:45 +0000 (19:58 +0000)
.cvsignore [new file with mode: 0644]
Makefile
dualx11.cc
graphics.cc
library.cc
main.cc
moebius.cc
parameter.cc

diff --git a/.cvsignore b/.cvsignore
new file mode 100644 (file)
index 0000000..cba7efc
--- /dev/null
@@ -0,0 +1 @@
+a.out
index 80111df5db09261104a43fd9076cd027afabb251..c82512a5d0d286d8e349e99f64b88b3a171d4d52 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-C++FLAGS= -Wall -O2
-CPPFLAGS= -I/usr/include
+CPPFLAGS= -I/usr/include -Wall -O2 -Wmissing-prototypes -Wstrict-prototypes $(WERROR)
+WERROR=-Werror
 LDFLAGS= 
 LIBS= 
 
index 4bfc39cba3edb3b7c39012a7eafd0bc9d6a6d670..dbd3e4b84a8d5a849dac18a65a40c06c38dcbdf6 100644 (file)
@@ -29,6 +29,7 @@ DualX11Output::DualX11Output() {
                               0,0, 500,500, 0,0, pixelbase);
 
   XGCValues gcvalues;
+  int i;
   for (i=0; i<2; i++) {
     gcvalues.plane_mask= planemasks[i];
     // First, the fabric
index 5fdfb25d6ba434675d85dd0222736a8093d0344f..ae1659e97b69b4cae05e1043d5ff0198345bac3c 100644 (file)
@@ -23,7 +23,8 @@ static int checkneededline(Onscreen a, Onscreen b) {
 void Cell::display(Output& o) {
   int nn[4];
   int totalnn= 0;
-  for (int i=0; i<4; i++) {
+  int i;
+  for (i=0; i<4; i++) {
     nn[i]= checkneededline(p[i],p[(i+1)&3]);
     totalnn+= nn[i];
   }
@@ -55,7 +56,8 @@ SortedCellList::Fragment* SortedCellList::insertfragment(int at) {
 
 void SortedCellList::insert(Cell *it) {
   double index= it->index();
-  for (int fragment= used-1;
+  int fragment;
+  for (fragment= used-1;
        fragment >= 0 && index < fragments[fragment]->entries[0].index;
        fragment--);
   if (fragment < 0) {
@@ -65,7 +67,8 @@ void SortedCellList::insert(Cell *it) {
     nf->entries[0].cell= it;
     return;
   }
-  for (int entry= 0;
+  int entry;
+  for (entry= 0;
        entry < fragments[fragment]->used &&
        index > fragments[fragment]->entries[entry].index;
        entry++);
index 60f8446a97175b05975c08dfd5628f77635aec79..d15c454ca6103601f73a6e096e917dfbdc2acbf7 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "library.hh"
 #include "transforms.hh"
diff --git a/main.cc b/main.cc
index 700719426255463c5ad67ebfada24e17ca8fec03..bbe9621e138e0e50ceb24606010b3663c515a0b5 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -21,8 +21,8 @@
 Parameter<int> tn("tn", "Number of sections around `strip'", 30, 1, 1, 500);
 Parameter<int> un("un", "Number of sections across `strip'", 15, 1, 1, 500);
 Parameter<double> theta("theta", "Angle of model rotation",
-                        /*-PI/2.*/0, PI/8., -PI*2., PI*2.);
-Parameter<double> eta("eta", "Angle of model elevation", 0., PI/8., -PI*2., PI*2.);
+                        /*-PI/2.*/0, M_PI/8., -M_PI*2., M_PI*2.);
+Parameter<double> eta("eta", "Angle of model elevation", 0., M_PI/8., -M_PI*2., M_PI*2.);
 Parameter<double> planedistance("plane", "Distance from projection plane to origin", 
                                 4., .25, 0., 100.);
 Parameter<double> eyedistance("eye", "Distance from projection eye to origin", 
index d68f4aff8174426088f4f7c9972a60268ac4fecf..148ce0c3da9c34772abc28d1a1a59f0d685438dd 100644 (file)
@@ -9,7 +9,7 @@
 #include "moebius.hh"
 
 Point MoebiusStrip::edgepoint(double t) {
-  double theta= (t-0.5)*4.0*PI;
+  double theta= (t-0.5)*4.0*M_PI;
   double r= 1.0 - halfgap*(1.0 - sin(theta/2.0));
   return Point(r*sin(theta),
                -r*cos(theta),
@@ -47,7 +47,7 @@ void Bezier::debug() {
 // The second end is oriented towards [0,-1,0]
 
 Point MoebiusEnfoldment::edgepoint(double t) {
-  double theta= t*2.0*PI;
+  double theta= t*2.0*M_PI;
   return Point(sin(theta),cos(theta),0);
 }
 
@@ -58,13 +58,13 @@ Point MoebiusEnfoldment::middlepoint(double t, double u) {
     double sizehere= sqrt(1-t*t);
     return Point((u*2.0-1.0) * sizehere,
                  t,
-                 sizehere * thickness * sin(u*2.0*PI));
+                 sizehere * thickness * sin(u*2.0*M_PI));
   } else {
     t /= bottomportion;
-    double theta= (.5-u)*2*PI;
-    Bezier bx(sin(theta*.5), -theta/PI, 0, 0);
+    double theta= (.5-u)*2*M_PI;
+    Bezier bx(sin(theta*.5), -theta/M_PI, 0, 0);
     double ypushiness= (1-cos(theta))*2.5+1;
-//        double fudge= (PI*sin(theta*.5)*cos(theta*.5))*(.5-u)*(.5-u)*4;
+//        double fudge= (M_PI*sin(theta*.5)*cos(theta*.5))*(.5-u)*(.5-u)*4;
     double fudge= (.5-u)*(.5-u)*4*cos(theta*.5);
     Bezier by(-cos(theta*.5), 0,
               cos(theta)*ypushiness + fudge*ypushiness,
index 0eb6df6c355fc9c068095ca3e9f2e012366f1c30..89566fde067a1ee49dd3a7fa51fd0c0e3884c770 100644 (file)
@@ -11,7 +11,8 @@ AnyParameter::AnyParameter(const char *n, const char *d) {
 }
 
 AnyParameter* AnyParameter::find(const char *n) {
-  for (AnyParameter* search= first;
+  AnyParameter* search;
+  for (search= first;
        search && strcmp(search->name,n);
        search= search->next);
   return search;