this patch does not remove all warnings but at least some...
the rest would need a deeper understanding of the source.

-- 
Wolfgang
--- Makefile.am	2005-09-25 19:08:45.000000000 +0200
+++ /home/wr/knew/Makefile.am	2006-02-26 16:03:03.000000000 +0100
@@ -7,6 +7,9 @@
 # set the include path for X, qt and KDE
 INCLUDES         = $(all_includes)
 
+# remove this if you want assert() to generate code:
+#define NDEBUG
+
 # the library search path. 
 ksudoku_LDFLAGS = $(KDE_RPATH) $(all_libraries)
 
--- glwindow.cpp	2005-09-29 17:16:04.000000000 +0200
+++ /home/wr/knew/glwindow.cpp	2006-02-26 15:37:30.000000000 +0100
@@ -347,7 +347,7 @@
 }
 
 
-void glWindow::myDrawCube(int name, GLfloat x, GLfloat y, GLfloat z, int texturef)
+void glWindow::myDrawCube(int name, GLfloat x, GLfloat y, GLfloat z)
 {
 	glPushMatrix();
 	glLoadName(name+1);
@@ -452,7 +452,7 @@
 			{
 				glPushMatrix();
 				glTranslatef(-(dist*base-dist)/2,-(dist*base-dist)/2,-(dist*base-dist)/2);
-				myDrawCube(c++,(GLfloat) (dist*xx), (GLfloat)(dist* yy ), (GLfloat) (dist*zz), 0);
+				myDrawCube(c++,(GLfloat) (dist*xx), (GLfloat)(dist* yy ), (GLfloat) (dist*zz));
 				glPopMatrix();
 			}
    
--- ksudoku.cpp	2005-09-29 17:22:52.000000000 +0200
+++ /home/wr/knew/ksudoku.cpp	2006-02-26 16:00:12.000000000 +0100
@@ -182,7 +182,7 @@
 	}
 }
 
-ksudoku::ksudoku(bool dub2, bool load, KURL path)
+ksudoku::ksudoku(bool load, KURL path)
     : KMainWindow( 0, "ksudoku" ),
       m_view(new ksudokuView(this)),
       m_printer(0)
@@ -659,7 +659,7 @@
     // button is clicked
     // standard filedialog
     myURL = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Open Location"));
-	(new ksudoku(false, true, myURL))->show();		
+	(new ksudoku(true, myURL))->show();		
 	
 }
 
@@ -730,7 +730,7 @@
 
         // we let our view do the actual printing
         QPaintDeviceMetrics metrics(m_printer);
-        m_view->print(&p, metrics.height(), metrics.width());
+        m_view->print(&p);
         // and send the result to the printer
         p.end();
     }
--- ksudokuview.cpp	2006-02-26 15:04:25.000000000 +0100
+++ /home/wr/knew/ksudokuview.cpp	2006-02-26 15:49:24.000000000 +0100
@@ -19,8 +19,8 @@
 #include "knewdlg.h"
 
 ksudokuView::ksudokuView(QWidget *parent)
-    : QWidget(parent),
-      DCOPObject("ksudokuIface")
+    :  DCOPObject("ksudokuIface"),
+       QWidget(parent)
 {
 	isWaitingForNumber = -1;
 	puzzle = 0;
@@ -50,7 +50,7 @@
 
 	//printf("%d\n", mySolver->order);
 	
-	createbuttons(order);
+	createbuttons();
 
 	if(!dub)
 		genPuzzle(difficulty,s);///CREATE PUZZLE
@@ -65,7 +65,7 @@
 	if(completed_puzzle) delete completed_puzzle;
 }
 
-void ksudokuView::print(QPainter *p, int height, int width)
+void ksudokuView::print(QPainter *p)
 {
     // do the actual printing, here
 	QPaintDeviceMetrics     metrics (p->device());
@@ -197,7 +197,7 @@
 
 void ksudokuView::btn_leave(int x, int y){}
 	
-void ksudokuView::createbuttons(int ord)
+void ksudokuView::createbuttons()
 {	
 	puzzle->size = puzzle->order*puzzle->order;
 	if(btns)
--- main.cpp	2005-09-28 18:10:34.000000000 +0200
+++ /home/wr/knew/main.cpp	2006-02-26 15:59:17.000000000 +0100
@@ -68,7 +68,7 @@
             int i = 0;
             for (; i < args->count(); i++)
             {
-                ksudoku *widget = new ksudoku(0,1, args->url(i));
+                ksudoku *widget = new ksudoku(1, args->url(i));
                 widget->show();
             }
         }
--- qsudokubutton.cpp	2005-09-28 17:32:01.000000000 +0200
+++ /home/wr/knew/qsudokubutton.cpp	2006-02-26 15:52:32.000000000 +0100
@@ -164,10 +164,10 @@
 			ITERATE(i,3)
 				if(highlighted[i] != 0) 
 					ITERATE(j,3)
-						c[j] = c[j]*.475f + cc[i][j]*.475f;
+						c[j] = int(c[j]*.475f + cc[i][j]*.475f);
 			if(highlighted[0]+highlighted[1]+highlighted[2] == 3)
 				ITERATE(i,3)
-					c[i] = 0xdc*.205f+cc[0][i]*.205f+cc[1][i]*.205f+cc[2][i]*.205f;
+					c[i] = int(0xdc*.205f+cc[0][i]*.205f+cc[1][i]*.205f+cc[2][i]*.205f);
 		}
 		qpainter.fillRect(rect(), QBrush(QColor(c[0],c[1],c[2])));
 	}
--- sudoku_solver.cpp	2005-09-29 18:08:11.000000000 +0200
+++ /home/wr/knew/sudoku_solver.cpp	2006-02-26 15:54:55.000000000 +0100
@@ -13,7 +13,7 @@
 
 skSolver::skSolver(int n, bool threedimensionalf)
 {
-	base = sqrt(n);
+	base = int(sqrt(n));
 	order=n;
 	threedimensional = threedimensionalf ;
 
@@ -78,7 +78,6 @@
 int skSolver::remove_numbers(skPuzzle* p, int level, int simmetry, int type)
 {
 	std::srand(time(0));
-	int  b;
 	int cnt=p->size;
 	int to=p->size*(4+4*(level==-1));
 	int solutions_d=0;
@@ -313,7 +312,7 @@
 }
 
 
-int skSolver:: init()
+void skSolver:: init()
 {
 	g = new skGraph(order, threedimensional);
 	
@@ -381,7 +380,9 @@
 	ITERATE(i,size)
 	{
 		ITERATE(j,size) visited[j]=0;
+#if 0
 		fscc(visited, done, g->graph[i], i);
+#endif
 		done[i]=1;
 	}
 	printf("%d\n",g->sc_count);
@@ -411,10 +412,15 @@
 		
 }
 
+#if 0
 	//findStronglyConnectedComponents
 int skSolver::fscc(bool* visited, bool* done, bool mask[625], int node)
 {
-	/*if(done[node]==1) return 0;
+	return 0;
+//this code block was commented out entirely anyway. I also
+//changed some comment beginners/enders because gcc complained about
+//nested comments.
+	if(done[node]==1) return 0;
 	int cc=0;
 	ITERATE(i, size) if(mask[i] == 1) cc++;
 	if(cc == 0) return  0;	
@@ -445,12 +451,13 @@
 					g->sc_count++;
 					visited[node] = 0;
 					return 1;
-				//}
+				}*/
 		return 1;
 	}
 	//visited[node] = 0;
-	return 0;*/
+	return 0;
 }
+#endif
 
 void skSolver::copy(skPuzzle* dest, skPuzzle* src)
 {
--- ArcBall.h	2004-01-26 02:43:14.000000000 +0100
+++ /home/wr/knew/ArcBall.h	2006-02-26 15:13:28.000000000 +0100
@@ -22,12 +22,7 @@
 
 // 8<--Snip here if you have your own math types/funcs-->8 
 
-//Only support assertions in debug builds
-#ifdef _DEBUG
-# include "assert.h"
-#else
-# define assert(x) { }
-#endif
+#include "assert.h"
 
 //Math types derived from the KempoApi tMath library
     typedef union Tuple2f_t
--- glwindow.h	2005-09-29 16:40:32.000000000 +0200
+++ /home/wr/knew/glwindow.h	2006-02-26 15:37:37.000000000 +0100
@@ -79,7 +79,7 @@
 		if(e->button() == Qt::LeftButton) isClicked = true;
 	}	
 protected:
-	void myDrawCube(int n, GLfloat x, GLfloat y, GLfloat z, int texture);
+	void myDrawCube(int n, GLfloat x, GLfloat y, GLfloat z);
 	void mouseMoveEvent ( QMouseEvent * e ) ;
 	void keyReleaseEvent ( QKeyEvent * e );
 
--- ksudoku.h	2005-09-29 18:30:35.000000000 +0200
+++ /home/wr/knew/ksudoku.h	2006-02-26 15:58:14.000000000 +0100
@@ -40,7 +40,7 @@
     /**
      * Default Constructor
      */
-    ksudoku(bool dub = false, bool load = false, KURL path = "");
+    ksudoku(bool load = false, KURL path = "");
 
     /**
      * Default Destructor
--- ksudokuview.h	2005-09-29 18:30:32.000000000 +0200
+++ /home/wr/knew/ksudokuview.h	2006-02-26 15:34:20.000000000 +0100
@@ -66,7 +66,7 @@
     /**
      * Print this view to any medium -- paper or not
      */
-    void print(QPainter *, int height, int width);
+    void print(QPainter *);
 
 signals:
     /**
@@ -106,7 +106,7 @@
 	void finishHighlight();
 public:
 
-	void createbuttons(int ord = 9);
+	void createbuttons();
 	int genPuzzle(int difficulty, int s, bool dub=false);
 protected:
 	void resizeEvent(QResizeEvent *);
--- sudoku_solver.h	2005-09-28 20:41:23.000000000 +0200
+++ /home/wr/knew/sudoku_solver.h	2006-02-26 15:47:29.000000000 +0100
@@ -115,8 +115,10 @@
 	int remove_numbers(skPuzzle* p, int difficulty, int simmetry, int type);
 	int solve(skPuzzle* puzzle,  int max_solutions = 1, skPuzzle* out_solutions = 0, int* forks=0);
 	int solve_engine(skPuzzle *s,  int& solutions, skPuzzle* out_solutions = 0, int maxsolutions = 1, int last_add=-1, int dynindex=-1, int dynvalue=0, int* forks=0);
-	int init();
+	void init();
+#if 0
 	int fscc(bool* visited, bool* done, bool* mask, int node);
+#endif
 	void copy(skPuzzle* dest, skPuzzle* src);
 };
 

Reply via email to