diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-25 16:02:24 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-25 16:02:24 +0000 |
commit | 6404e49601b38c042e44ba20abd8b3c338a67a19 (patch) | |
tree | 16aebae60516d6795832728f02f872ea9bebe8e3 /navit | |
parent | a63119e5897fef7d434615443fac698d36914adb (diff) | |
download | navit-6404e49601b38c042e44ba20abd8b3c338a67a19.tar.gz |
Fix:Core:MSVC fixes
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4027 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r-- | navit/map/shapefile/shpopen.c | 25 | ||||
-rw-r--r-- | navit/osd/core/osd_core.c | 6 | ||||
-rw-r--r-- | navit/support/ezxml/ezxml.c | 8 |
3 files changed, 21 insertions, 18 deletions
diff --git a/navit/map/shapefile/shpopen.c b/navit/map/shapefile/shpopen.c index ba0ae849a..a0bda0dbe 100644 --- a/navit/map/shapefile/shpopen.c +++ b/navit/map/shapefile/shpopen.c @@ -230,6 +230,7 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> +#include <glib.h> SHP_CVSID("$Id: shpopen.c,v 1.59 2008/03/14 05:25:31 fwarmerdam Exp $") @@ -1566,7 +1567,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if ( 8 + 4 > nEntitySize ) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", hEntity, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1591,7 +1592,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if ( 40 + 8 + 4 > nEntitySize ) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", hEntity, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1623,7 +1624,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if (nPoints < 0 || nParts < 0 || nPoints > 50 * 1000 * 1000 || nParts > 10 * 1000 * 1000) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d.", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d.", hEntity, nPoints, nParts); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1646,7 +1647,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) } if (nRequiredSize > nEntitySize) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d, nEntitySize=%d.", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d, nEntitySize=%d.", hEntity, nPoints, nParts, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1670,7 +1671,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) psShape->panPartStart == NULL || psShape->panPartType == NULL) { - snprintf(pszErrorMsg, 128, + g_snprintf(pszErrorMsg, 128, "Not enough memory to allocate requested memory (nPoints=%d, nParts=%d) for shape %d. " "Probably broken SHP file", hEntity, nPoints, nParts ); psSHP->sHooks.Error( pszErrorMsg ); @@ -1693,7 +1694,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if (psShape->panPartStart[i] < 0 || psShape->panPartStart[i] >= psShape->nVertices) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, nVertices = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, nVertices = %d", hEntity, i, psShape->panPartStart[i], psShape->nVertices); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1701,7 +1702,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) } if (i > 0 && psShape->panPartStart[i] <= psShape->panPartStart[i-1]) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, panPartStart[%d] = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, panPartStart[%d] = %d", hEntity, i, psShape->panPartStart[i], i - 1, psShape->panPartStart[i - 1]); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1803,7 +1804,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if ( 44 + 4 > nEntitySize ) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", hEntity, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1815,7 +1816,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if (nPoints < 0 || nPoints > 50 * 1000 * 1000) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d", hEntity, nPoints); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1829,7 +1830,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) } if (nRequiredSize > nEntitySize) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d, nEntitySize = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d, nEntitySize = %d", hEntity, nPoints, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); @@ -1847,7 +1848,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) psShape->padfZ == NULL || psShape->padfM == NULL) { - snprintf(pszErrorMsg, 128, + g_snprintf(pszErrorMsg, 128, "Not enough memory to allocate requested memory (nPoints=%d) for shape %d. " "Probably broken SHP file", hEntity, nPoints ); psSHP->sHooks.Error( pszErrorMsg ); @@ -1941,7 +1942,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity ) if (20 + 8 + (( psShape->nSHPType == SHPT_POINTZ ) ? 8 : 0)> nEntitySize) { - snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", + g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d", hEntity, nEntitySize); psSHP->sHooks.Error( pszErrorMsg ); SHPDestroyObject(psShape); diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index a31a85ff4..ff5856886 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -640,9 +640,9 @@ osd_stopwatch_draw(struct stopwatch *this, struct navit *nav, total_days = total_hours/24; if (total_days==0) { - snprintf(buffer,32,"%02d:%02d:%02d", (int)total_hours%24, (int)total_min%60, (int)total_sec%60); + g_snprintf(buffer,32,"%02d:%02d:%02d", (int)total_hours%24, (int)total_min%60, (int)total_sec%60); } else { - snprintf(buffer,32,"%02dd %02d:%02d:%02d", + g_snprintf(buffer,32,"%02dd %02d:%02d:%02d", (int)total_days, (int)total_hours%24, (int)total_min%60, (int)total_sec%60); } @@ -1605,7 +1605,7 @@ osd_speed_warner_draw(struct osd_speed_warner *this, struct navit *navit, struct tracking_get_attr(tracking, attr_position_speed, &speed_attr, NULL); tracking_speed = *speed_attr.u.numd; if( -1 != tracking_speed && -1 != routespeed ) { - snprintf(text,16,"%s%.0lf",osm_data ? "" : "~",routespeed); + g_snprintf(text,16,"%s%.0lf",osm_data ? "" : "~",routespeed); if( this->speed_exceed_limit_offset+routespeed<tracking_speed && (100.0+this->speed_exceed_limit_percent)/100.0*routespeed<tracking_speed ) { if(this->announce_state==eNoWarn && this->announce_on) { diff --git a/navit/support/ezxml/ezxml.c b/navit/support/ezxml/ezxml.c index 14754f153..216afdd95 100644 --- a/navit/support/ezxml/ezxml.c +++ b/navit/support/ezxml/ezxml.c @@ -27,9 +27,11 @@ #include <stdarg.h> #include <string.h> #include <ctype.h> -#ifndef _MSC_VER +#include <glib.h> +#include "config.h" +#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* _MSC_VER */ +#endif #include <sys/types.h> #ifndef EZXML_NOMMAP #include <sys/mman.h> @@ -142,7 +144,7 @@ ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...) char *t, fmt[EZXML_ERRL]; for (t = root->s; t < s; t++) if (*t == '\n') line++; - snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); + g_snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); va_start(ap, err); vsnprintf(root->err, EZXML_ERRL, fmt, ap); |