From: martin-s Date: Tue, 25 Jan 2011 16:02:24 +0000 (+0000) Subject: Fix:Core:MSVC fixes X-Git-Tag: navit-0.5.0.5194svn~1168 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a72b940a6dd41c79d64e98a947cdaff95f7a84ae;p=profile%2Fivi%2Fnavit.git Fix:Core:MSVC fixes git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4027 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/map/shapefile/shpopen.c b/navit/navit/map/shapefile/shpopen.c index ba0ae84..a0bda0d 100644 --- a/navit/navit/map/shapefile/shpopen.c +++ b/navit/navit/map/shapefile/shpopen.c @@ -230,6 +230,7 @@ #include #include #include +#include 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/navit/osd/core/osd_core.c b/navit/navit/osd/core/osd_core.c index a31a85f..ff58568 100644 --- a/navit/navit/osd/core/osd_core.c +++ b/navit/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+routespeedspeed_exceed_limit_percent)/100.0*routespeedannounce_state==eNoWarn && this->announce_on) { diff --git a/navit/navit/support/ezxml/ezxml.c b/navit/navit/support/ezxml/ezxml.c index 14754f1..216afdd 100644 --- a/navit/navit/support/ezxml/ezxml.c +++ b/navit/navit/support/ezxml/ezxml.c @@ -27,9 +27,11 @@ #include #include #include -#ifndef _MSC_VER +#include +#include "config.h" +#ifdef HAVE_UNISTD_H #include -#endif /* _MSC_VER */ +#endif #include #ifndef EZXML_NOMMAP #include @@ -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);