From d7e6519a081d2beddaba53df9025904e5f1f8f90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Jacob?= Date: Thu, 19 Oct 2006 08:16:36 +0000 Subject: [PATCH] Fix 2 warnings svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.h; revision=597023 --- kalzium/kalziumglwidget.cpp | 20 +++++++++++--------- kalzium/kalziumglwidget.h | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/kalzium/kalziumglwidget.cpp b/kalzium/kalziumglwidget.cpp index a99538e..3345d27 100644 --- a/kalzium/kalziumglwidget.cpp +++ b/kalzium/kalziumglwidget.cpp @@ -124,7 +124,7 @@ void KalziumGLWidget::renderScene( GLenum renderMode, const QPoint *mousePosition, GLsizei selectionBufferSize, GLuint *selectionBuffer, - GLint *numberOfHits ) + GLuint *numberOfHits ) { // if renderMode is not GL_RENDER, check that it is GL_SELECT and that // the required arguments have been passed @@ -591,8 +591,14 @@ void KalziumGLWidget::computeClickedAtom( if( ! m_molecule ) return; const GLsizei selectionBufferSize = 1024; - GLuint selectionBuffer[selectionBufferSize]; - GLint numberOfHits; + + GLuint i, names, + minZ = 0xffffffff, + *ptrNames = 0, + numberOfNames = 0, + numberOfHits, + selectionBuffer[selectionBufferSize], + *ptr = selectionBuffer; renderScene( GL_SELECT, &mousePosition, @@ -600,11 +606,7 @@ void KalziumGLWidget::computeClickedAtom( selectionBuffer, &numberOfHits ); - unsigned int i, j; - GLuint names, *ptr = selectionBuffer, - minZ = 0xffffffff, - *ptrNames, - numberOfNames = 0; + for( i = 0; i < numberOfHits; i++ ) { names = *ptr; @@ -618,7 +620,7 @@ void KalziumGLWidget::computeClickedAtom( ptr += names+2; } - for( j = 0, ptr = ptrNames; j < numberOfNames; j++, ptr++ ) + for( i = 0, ptr = ptrNames; i < numberOfNames; i++, ptr++ ) if( *ptr ) { m_clickedAtom = m_molecule->GetAtom( *ptr ); diff --git a/kalzium/kalziumglwidget.h b/kalzium/kalziumglwidget.h index ae1a8c4..cc19aee 100644 --- a/kalzium/kalziumglwidget.h +++ b/kalzium/kalziumglwidget.h @@ -227,7 +227,7 @@ class KalziumGLWidget : public QGLWidget const QPoint * mousePosition = 0, GLsizei selectionBufferSize = 0, GLuint * selectionBuffer = 0, - GLint * numberOfHits = 0 ); + GLuint * numberOfHits = 0 ); /** * recomputes the geometry of the geometric objects ( sphere, -- 2.47.3