From cf654b44e36ebc19b36e939e4b18a3554b2b9061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Tue, 8 Jan 2013 10:18:26 -0200 Subject: [PATCH] removed some gcc warnings --- openglcanvas.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/openglcanvas.cpp b/openglcanvas.cpp index 1a111f8..ced8346 100644 --- a/openglcanvas.cpp +++ b/openglcanvas.cpp @@ -136,7 +136,10 @@ void OpenGLCanvas::initializeGL(){ glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST); char *input_image=(char*)malloc(512*sizeof(char*)); - GET_WORKDIR(input_image,512); + if(!GET_WORKDIR(input_image,512)){ + fprintf(stderr,"too long pathname\n"); + exit(-1); + }; strcat(input_image,"/\0"); strcat(input_image,INPUT_IMAGE_FILE); #ifdef __APPLE__ @@ -497,13 +500,19 @@ void OpenGLCanvas::setShaders() { GLuint f = glCreateShader(GL_FRAGMENT_SHADER); char *vs_file=(char*)malloc(512*sizeof(char*)); - GET_WORKDIR(vs_file,512); + if(!GET_WORKDIR(vs_file,512)){ + fprintf(stderr,"too long pathname\n"); + exit(-1); + }; strcat(vs_file,"/\0"); strcat(vs_file,VERT_SHADER_FILE); fprintf(stderr,"vs_file=%s\n",vs_file); char *fs_file=(char*)malloc(512*sizeof(char*)); - GET_WORKDIR(fs_file,512); + if(!GET_WORKDIR(fs_file,512)){ + fprintf(stderr,"too long pathname\n"); + exit(-1); + }; strcat(fs_file,"/\0"); strcat(fs_file,FRAG_SHADER_FILE); fprintf(stderr,"fs_file=%s\n",fs_file); @@ -558,7 +567,7 @@ void OpenGLCanvas::paintGL(){ // defining transformation parameters (that will be passed to the vertex shader) float extent = calculate_extent(fov_rads); - float vis_mode; + float vis_mode=.0; if (visualization=="Perspective") vis_mode=1.0; else if (visualization=="3D Sphere") vis_mode=2.0; else if (visualization=="Equi-Rectangular") vis_mode=3.0; -- GitLab