diff options
author | Patrick Höhn <hoehnp@users.noreply.github.com> | 2018-01-14 22:07:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-14 22:07:49 +0100 |
commit | 86a08e793eded11b0535a7a25dd389768a71d21f (patch) | |
tree | 3350553a097e1a393933f613b92038cc9edb98c9 | |
parent | dd0f195da55c8011e4308cbe86fe24ea97412f71 (diff) | |
parent | da36bf6e1cbacb9b4af035143c175e173ede41b0 (diff) | |
download | navit-86a08e793eded11b0535a7a25dd389768a71d21f.tar.gz |
Merge pull request #393 from hoehnp/fix_compiler_warning
fix:build:fixed compiler warning in graphics module
-rw-r--r-- | navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c | 9 | ||||
-rw-r--r-- | navit/graphics/opengl/graphics_opengl.c | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c index 387003c40..dbb18310a 100644 --- a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c +++ b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c @@ -49,6 +49,7 @@ #include "plugin.h" #include "navit/font/freetype/font_freetype.h" #include "navit.h" +#include <errno.h> #ifndef GDK_Book #define GDK_Book XF86XK_Book @@ -428,6 +429,7 @@ draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point * cairo_paint(gr->cairo); } +#ifdef HAVE_IMLIB2 static unsigned char* create_buffer_with_stride_if_required(unsigned char *input_buffer, int w, int h, size_t bytes_per_pixel, size_t output_stride) { @@ -448,7 +450,6 @@ create_buffer_with_stride_if_required(unsigned char *input_buffer, int w, int h, return out_buf; } -#ifdef HAVE_IMLIB2 static void draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, struct graphics_image_priv *img) { @@ -1037,7 +1038,11 @@ get_data(struct graphics_priv *this, char const *type) #if !defined(_WIN32) && !defined(__CEGCC__) f=popen("pidof /usr/bin/ipaq-sleep","r"); if (f) { - fscanf(f,"%d",&this->pid); + int fscanf_result; + fscanf_result = fscanf(f,"%d",&this->pid); + if ((fscanf_result == EOF) || (fscanf_result == 0)){ + dbg(lvl_warning, "Failed to open iPaq sleep file. Error-Code: %d\n" , errno); + } dbg(lvl_debug,"ipaq_sleep pid=%d\n", this->pid); pclose(f); } diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c index 98230f0dc..a0c2be2fe 100644 --- a/navit/graphics/opengl/graphics_opengl.c +++ b/navit/graphics/opengl/graphics_opengl.c @@ -50,7 +50,7 @@ #define PIXEL_FORMAT GL_BGRA #endif -#if HAVE_FREEIMAGE +#ifdef HAVE_FREEIMAGE #include <FreeImage.h> #endif @@ -371,7 +371,7 @@ static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation) { -#if HAVE_FREEIMAGE +#ifdef HAVE_FREEIMAGE FIBITMAP *image; RGBQUAD aPixel; unsigned char *data; @@ -527,7 +527,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, return gi; } #else - dbg(lvl_error,"FreeImage not available - cannot load any images.\n", path); + dbg(lvl_error,"FreeImage not available - cannot load any images.\n"); return NULL; #endif } |