Fix:Core:Fix some warnings
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 23 Apr 2012 18:45:28 +0000 (18:45 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 23 Apr 2012 18:45:28 +0000 (18:45 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5035 ffa7fe5e-494d-0410-b361-a75ebd5db220

13 files changed:
navit/navit/file.c
navit/navit/graphics/null/graphics_null.c
navit/navit/graphics/win32/graphics_win32.c
navit/navit/graphics/win32/xpm2bmp.c
navit/navit/map/filter/filter.c
navit/navit/maptool/google/protobuf-c/protobuf-c.c
navit/navit/maptool/zip.c
navit/navit/navigation.c
navit/navit/support/espeak/tr_languages.c
navit/navit/support/glib/gutils.c
navit/navit/support/libc/locale.h
navit/navit/support/wordexp/wordexp.c
navit/navit/util.c

index ce9dcab..87a2adf 100644 (file)
@@ -333,7 +333,7 @@ file_mmap(struct file *file)
        int mmap_size=file->size;
 #endif
 #ifdef HAVE_API_WIN32_BASE
-       file->begin = (char*)mmap_readonly_win32( file->name, &file->map_handle, &file->map_file );
+       file->begin = (unsigned char*)mmap_readonly_win32( file->name, &file->map_handle, &file->map_file );
 #else
        file->begin=mmap(NULL, mmap_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, file->fd, 0);
        dbg_assert(file->begin != NULL);
index 1c3bbbd..bfa45da 100644 (file)
@@ -38,7 +38,6 @@
 
 static struct callback_list* callbacks;
 
-static int dummy;
 static struct graphics_priv {
        int dummy;
 } graphics_priv;
index 20f7e42..46bc711 100644 (file)
@@ -957,8 +957,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
 
 }
 
-
-static void * get_data(struct graphics_priv *this_, char *type)
+static void * get_data(struct graphics_priv *this_, const char *type)
 {
     if ( strcmp( "wnd_parent_handle_ptr", type ) == 0 )
     {
@@ -1515,7 +1514,6 @@ static struct graphics_priv *
     return this_;
 }
 
-
 static void set_alphablend(struct graphics_priv* gra_priv)
 {
 #if HAVE_API_WIN32_CE
index f208f7e..455d699 100644 (file)
@@ -495,7 +495,7 @@ static int CreateBitmapFromXpm( const char* filename, PXPM2BMP pXpm2bmp )
     unsigned char i, row;
        char line[ 1024   ];
        int nbytes ;
-       int padding, rowsize;
+       int padding, rowsize = 0;
        FILE* file_xpm = fopen( filename, "r" );
 
        int phase = 0;
index edc6a84..abad31a 100644 (file)
@@ -383,7 +383,7 @@ static struct map_methods map_methods_filter = {
 
 
 static struct map_priv *
-map_filter_new(struct map_methods *meth, struct attr **attrs)
+map_filter_new(struct map_methods *meth, struct attr **attrs, struct callback_list *cbl)
 {
        struct map_priv *m=NULL;
        struct attr **parent_attrs,type,*subtype=attr_search(attrs, NULL, attr_subtype),*filter=attr_search(attrs, NULL, attr_filter);
index efa5fd3..885edec 100644 (file)
@@ -1966,10 +1966,12 @@ parse_packed_repeated_member (ScannedMember *scanned_member,
   *p_n += count;
   return TRUE;
 
+#if IS_LITTLE_ENDIAN
 no_unpacking_needed:
   memcpy (array, at, count * siz);
   *p_n += count;
   return TRUE;
+#endif
 }
 
 static protobuf_c_boolean
index 578f356..349bc02 100644 (file)
@@ -150,7 +150,7 @@ write_zipmember(struct zip_info *zip_info, char *name, int filelen, char *data,
        unsigned char salt[8], key[34], verify[2], mac[10];
 #endif
        char filename[filelen+1];
-       int error,crc=0,len,comp_size=data_size;
+       int crc=0,len,comp_size=data_size;
        uLongf destlen=data_size+data_size/500+12;
        char *compbuffer;
 
@@ -175,7 +175,7 @@ write_zipmember(struct zip_info *zip_info, char *name, int filelen, char *data,
        lfh.zipmthd=zip_info->compression_level ? 8:0;
 #ifdef HAVE_ZLIB
        if (zip_info->compression_level) {
-               error=compress2_int((Byte *)compbuffer, &destlen, (Bytef *)data, data_size, zip_info->compression_level);
+               int error=compress2_int((Byte *)compbuffer, &destlen, (Bytef *)data, data_size, zip_info->compression_level);
                if (error == Z_OK) {
                        if (destlen < data_size) {
                                data=compbuffer;
index 1ce73ea..cb04af6 100644 (file)
@@ -1680,7 +1680,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
                if (!connect) {
                        ret=g_strdup_printf(_("You have reached your destination %s"), d);
                } else {
-                       ret=g_strdup_printf(_("then you have reached your destination."));
+                       ret=g_strdup(_("then you have reached your destination."));
                }
        }
        g_free(d);
index 2416755..83d1c80 100644 (file)
@@ -493,7 +493,7 @@ Translator *SelectTranslator(const char *name)
                        tr->langopts.stress_flags = 0x0024;  // don't use secondary stress
                        tr->langopts.param[LOPT_IT_LENGTHEN] = 1;    // remove lengthen indicator from unstressed syllables
 
-                       tr->langopts.numbers = 0x1509 + 0x8000 + NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL;
+                       tr->langopts.numbers = 0x1509 + 0x8000 + (NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL);
                        SetLetterVowel(tr,'y');
                }
                break;
index 2871e38..6d3fda4 100644 (file)
@@ -1899,9 +1899,8 @@ static gchar *g_prgname = NULL;
 gchar*
 g_get_prgname (void)
 {
-  gchar* retval;
+  gchar* retval =NULL;
 
-return 0;
 //  G_LOCK (g_prgname);
 //#ifdef G_OS_WIN32
 //  if (g_prgname == NULL)
@@ -1929,7 +1928,7 @@ return 0;
 //  retval = g_prgname;
 //  G_UNLOCK (g_prgname);
 //
-//  return retval;
+  return retval;
 }
 
 /**
index 51d62f3..320c3ac 100644 (file)
@@ -1,8 +1,15 @@
 #ifndef _LOCALE_H
 #define _LOCALE_H       1
+
+#ifndef SUBLANG_BENGALI_BANGLADESH
 #define SUBLANG_BENGALI_BANGLADESH 0x02
+#endif
+#ifndef SUBLANG_PUNJABI_PAKISTAN
 #define SUBLANG_PUNJABI_PAKISTAN 0x02
+#endif
+#ifndef SUBLANG_ROMANIAN_MOLDOVA
 #define SUBLANG_ROMANIAN_MOLDOVA 0x02
+#endif
 struct lconv {
        char *decimal_point;
 };
index d2ed3ff..6b080d1 100644 (file)
@@ -12,6 +12,7 @@
 #endif /* _MSC_VER */
 #include "wordexp.h"
 #include "glob.h"
+#include <glib.h>
 
 
 static int
index 6046747..2574c6e 100644 (file)
@@ -518,7 +518,6 @@ spawn_process(char **argv)
 #ifdef HAVE_API_WIN32_BASE
        {
                char *cmdline;
-               LPCWSTR cmd,args;
                DWORD dwRet;
 
                // For [desktop] Windows it's adviceable not to use
@@ -530,6 +529,7 @@ spawn_process(char **argv)
                // no WinCE program has support for quoted strings in arguments.
                // So...
 #ifdef HAVE_API_WIN32_CE
+               LPWSTR cmd,args;
                cmdline=g_strjoinv(" ",argv+1);
                args=newSysString(cmdline);
                cmd = newSysString(argv[0]);
@@ -537,6 +537,7 @@ spawn_process(char **argv)
                dbg(0, "CreateProcess(%s,%s), PID=%i\n",argv[0],cmdline,r->pr.dwProcessId);
                g_free(cmd);
 #else
+               TCHAR* args;
                STARTUPINFO startupInfo;
                memset(&startupInfo, 0, sizeof(startupInfo));
                startupInfo.cb = sizeof(startupInfo);