summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-25 15:55:50 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-25 15:55:50 +0000
commit219c447ed4399fcb21a50e8eb91155b85bdbfdd9 (patch)
tree54c68438757bfe59db9d98d5718b36cc18b17571
parente2d54712e663dba3ebf046601c96bf1dc843d737 (diff)
downloadnavit-svn-219c447ed4399fcb21a50e8eb91155b85bdbfdd9.tar.gz
Fix:Core:MSVC fixes
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4026 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/coord.c18
-rw-r--r--navit/support/glib/gprintfint.h4
-rw-r--r--navit/support/win32/serial_io.c3
3 files changed, 15 insertions, 10 deletions
diff --git a/navit/coord.c b/navit/coord.c
index 8ee98d3e..e77bd5ec 100644
--- a/navit/coord.c
+++ b/navit/coord.c
@@ -351,27 +351,27 @@ void coord_format(float lat,float lng, enum coord_format fmt, char * buffer, int
case DEGREES_DECIMAL:
if (lat<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%02.6f°%c",lat,lat_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%02.6f°%c",lat,lat_c);
if ((lat<360)&&(lng<360))
- size_used+=snprintf(buffer+size_used,size-size_used," ");
+ size_used+=g_snprintf(buffer+size_used,size-size_used," ");
if (lng<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%03.7f°%c",lng,lng_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%03.7f°%c",lng,lng_c);
break;
case DEGREES_MINUTES:
if (lat<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%02.0f°%07.4f' %c",floor(lat_deg),lat_min,lat_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%02.0f°%07.4f' %c",floor(lat_deg),lat_min,lat_c);
if ((lat<360)&&(lng<360))
- size_used+=snprintf(buffer+size_used,size-size_used," ");
+ size_used+=g_snprintf(buffer+size_used,size-size_used," ");
if (lng<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%03.0f°%07.4f' %c",floor(lng_deg),lng_min,lng_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%03.0f°%07.4f' %c",floor(lng_deg),lng_min,lng_c);
break;
case DEGREES_MINUTES_SECONDS:
if (lat<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%02.0f°%02.0f'%05.2f\" %c",floor(lat_deg),floor(lat_min),lat_sec,lat_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%02.0f°%02.0f'%05.2f\" %c",floor(lat_deg),floor(lat_min),lat_sec,lat_c);
if ((lat<360)&&(lng<360))
- size_used+=snprintf(buffer+size_used,size-size_used," ");
+ size_used+=g_snprintf(buffer+size_used,size-size_used," ");
if (lng<360)
- size_used+=snprintf(buffer+size_used,size-size_used,"%03.0f°%02.0f'%05.2f\" %c",floor(lng_deg),floor(lng_min),lng_sec,lng_c);
+ size_used+=g_snprintf(buffer+size_used,size-size_used,"%03.0f°%02.0f'%05.2f\" %c",floor(lng_deg),floor(lng_min),lng_sec,lng_c);
break;
diff --git a/navit/support/glib/gprintfint.h b/navit/support/glib/gprintfint.h
index eac281ee..88eb2221 100644
--- a/navit/support/glib/gprintfint.h
+++ b/navit/support/glib/gprintfint.h
@@ -35,7 +35,11 @@
#define _g_printf printf
#define _g_fprintf fprintf
#define _g_sprintf sprintf
+#ifdef _MSC_VER
+#define _g_snprintf _snprintf
+#else
#define _g_snprintf snprintf
+#endif
#define _g_vprintf vprintf
#define _g_vfprintf vfprintf
diff --git a/navit/support/win32/serial_io.c b/navit/support/win32/serial_io.c
index a1cc77fe..33ca5fe6 100644
--- a/navit/support/win32/serial_io.c
+++ b/navit/support/win32/serial_io.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <windows.h>
+#include <glib.h>
#include "serial_io.h"
#include "debug.h"
@@ -24,7 +25,7 @@ int serial_io_init( const char* port, const char* strsettings )
COMMTIMEOUTS sCT;
char strport[16];
- snprintf( strport, sizeof( strport ), "\\\\.\\%s", port );
+ g_snprintf( strport, sizeof( strport ), "\\\\.\\%s", port );
hCom = CreateFile(
strport,