You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
| 2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
| 2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
| 2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
| 2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
| 2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
| 2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
| 2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2013-08-03 11:33:13
|
Revision: 5555
http://sourceforge.net/p/navit/code/5555
Author: mdankov
Date: 2013-08-03 11:33:10 +0000 (Sat, 03 Aug 2013)
Log Message:
-----------
Fix:core:Define explicit CMake dependency of support/glib header files on libintl.h built by intl_cmake.
Modified Paths:
--------------
trunk/navit/navit/CMakeLists.txt
Modified: trunk/navit/navit/CMakeLists.txt
===================================================================
--- trunk/navit/navit/CMakeLists.txt 2013-08-02 19:48:58 UTC (rev 5554)
+++ trunk/navit/navit/CMakeLists.txt 2013-08-03 11:33:10 UTC (rev 5555)
@@ -156,6 +156,7 @@
ADD_DEPENDENCIES(${NAVIT_LIBNAME} version)
if (USE_LIBGNUINTL AND NOT HAVE_GLIB)
ADD_DEPENDENCIES(support_glib intl_cmake)
+ set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/support/glib/glibconfig.h APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/intl_cmake/libintl.h")
endif()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-08-02 19:49:02
|
Revision: 5554
http://sourceforge.net/p/navit/code/5554
Author: mdankov
Date: 2013-08-02 19:48:58 +0000 (Fri, 02 Aug 2013)
Log Message:
-----------
Fix:core:Remove duplicate code imported with r5539. Refix the win* "Dollar S" announcement bug with already imported libintl implementations of the proper printf.
Revision Links:
--------------
http://sourceforge.net/p/navit/code/5539
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
trunk/navit/config.h.cmake
trunk/navit/configure.in
trunk/navit/navit/support/glib/CMakeLists.txt
trunk/navit/navit/support/glib/Makefile.am
trunk/navit/navit/support/glib/glibconfig.h
Removed Paths:
-------------
trunk/navit/navit/support/glib/gnulib/
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/CMakeLists.txt 2013-08-02 19:48:58 UTC (rev 5554)
@@ -175,6 +175,7 @@
if (NOT HAVE_LIBINTL)
add_plugin(intl_cmake "native libintl missing" TRUE)
set(USE_LIBGNUINTL TRUE)
+ include_directories("${CMAKE_BINARY_DIR}/navit/intl_cmake")
else()
CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL)
if (NEEDS_LIBINTL)
@@ -492,7 +493,6 @@
enable_language(RC)
set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
- set(GLIB_USE_OWN_PRINTF 1)
endif()
if (WIN32 AND NOT WINCE)
set(HAVE_PRAGMA_PACK 1)
Modified: trunk/navit/config.h.cmake
===================================================================
--- trunk/navit/config.h.cmake 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/config.h.cmake 2013-08-02 19:48:58 UTC (rev 5554)
@@ -7,7 +7,6 @@
#cmakedefine HAVE_API_WIN32 1
#cmakedefine HAVE_API_WIN32_CE 1
#cmakedefine HAVE_GLIB 1
-#cmakedefine GLIB_USE_OWN_PRINTF 1
#cmakedefine HAVE_GMODULE 1
#cmakedefine HAVE_GETCWD 1
#define CACHE_SIZE ${CACHE_SIZE}
Modified: trunk/navit/configure.in
===================================================================
--- trunk/navit/configure.in 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/configure.in 2013-08-02 19:48:58 UTC (rev 5554)
@@ -295,10 +295,6 @@
if test "x${win32}" != "xyes" -a "x${android}" != "xyes"; then
GLIB_LIBS="$GLIB_LIBS -lpthread"
fi
- if test "x${win32}" == "xyes"; then
- glib_use_own_printf=yes; glib_use_own_printf_reason="Win32/WinCE detected"
- AC_DEFINE(GLIB_USE_OWN_PRINTF, 1, [Undef to make internal glib use system printf implementation.])
- fi
fi
# gmodule
@@ -351,7 +347,6 @@
AM_CONDITIONAL(EVENT_GLIB, [test "x$glib" = "xyes"])
AM_CONDITIONAL(SUPPORT_GLIB, [test "x$glib" = "xno"])
-AM_CONDITIONAL(GLIB_USE_OWN_PRINTF, [test "x$glib_use_own_printf" = "xyes"])
AM_CONDITIONAL(SUPPORT_EZXML, [test "x$glib" = "xno"])
AC_CHECK_HEADER([sys/time.h],
Modified: trunk/navit/navit/support/glib/CMakeLists.txt
===================================================================
--- trunk/navit/navit/support/glib/CMakeLists.txt 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/navit/support/glib/CMakeLists.txt 2013-08-02 19:48:58 UTC (rev 5554)
@@ -1,13 +1,3 @@
-set(SUPPORT_GLIB_SRC fake.c galiasdef.c gatomic.c gerror.c ghash.c
+supportlib_add_library(support_glib fake.c galiasdef.c gatomic.c gerror.c ghash.c
glib_init.c glist.c gmem.c gmessages.c gprimes.c gprintf.c gslice.c gslist.c
- gstrfuncs.c gstring.c gutf8.c gutils.c)
-if(WIN32 OR WINCE)
- list(APPEND SUPPORT_GLIB_SRC gnulib/asnprintf.c gnulib/printf.c gnulib/printf-args.c gnulib/printf-parse.c gnulib/vasnprintf.c)
- set(GLIB_NEED_PRINTF 1)
-endif()
-supportlib_add_library(support_glib ${SUPPORT_GLIB_SRC})
-if(GLIB_USE_OWN_PRINTF)
-else(GLIB_USE_OWN_PRINTF)
- GET_TARGET_PROPERTY(GLIB_DEFS support_glib COMPILE_DEFINITIONS)
- SET_TARGET_PROPERTIES(support_glib PROPERTIES COMPILE_DEFINITIONS "HAVE_GOOD_PRINTF;${GLIB_DEFS}")
-endif(GLIB_USE_OWN_PRINTF)
+ gstrfuncs.c gstring.c gutf8.c gutils.c)
Modified: trunk/navit/navit/support/glib/Makefile.am
===================================================================
--- trunk/navit/navit/support/glib/Makefile.am 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/navit/support/glib/Makefile.am 2013-08-02 19:48:58 UTC (rev 5554)
@@ -7,8 +7,3 @@
fake.h galias.h gerror.h ghash.h glib.h glibconfig.h glibintl.h glist.h \
gmacros.h gmem.h gmessages.h gprintf.h gprintfint.h gquark.h gslice.h \
gslist.h gstrfuncs.h gthreadprivate.h gtypes.h
-if GLIB_USE_OWN_PRINTF
- libsupport_glib_la_SOURCES += gnulib/asnprintf.c gnulib/printf-args.c gnulib/printf-args.h \
- gnulib/printf-parse.c gnulib/printf-parse.h gnulib/vasnprintf.c gnulib/vasnprintf.h gnulib/printf.c \
- gnulib/printf.h gnulib/g-gnulib.h
-endif
Modified: trunk/navit/navit/support/glib/glibconfig.h
===================================================================
--- trunk/navit/navit/support/glib/glibconfig.h 2013-07-31 14:33:37 UTC (rev 5553)
+++ trunk/navit/navit/support/glib/glibconfig.h 2013-08-02 19:48:58 UTC (rev 5554)
@@ -13,6 +13,10 @@
#include <float.h>
#include "config.h"
+#ifdef HAVE_API_WIN32_BASE
+#include <libintl.h>
+#endif
+
G_BEGIN_DECLS
#define G_MINFLOAT FLT_MIN
@@ -244,10 +248,7 @@
#define G_MODULE_SUFFIX "dll"
-#ifndef GLIB_USE_OWN_PRINTF
-# define HAVE_GOOD_PRINTF
-#endif
-#define HAVE_ALLOCA
+#define HAVE_GOOD_PRINTF
#define NO_SYS_SIGLIST_DECL
#define GLIB_STATIC_COMPILATION
#define G_DISABLE_CHECKS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xen...@us...> - 2013-07-31 14:33:39
|
Revision: 5553
http://sourceforge.net/p/navit/code/5553
Author: xenos1984
Date: 2013-07-31 14:33:37 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
Fix:Core:Updated Polish translations sent by user robwoj44
Modified Paths:
--------------
trunk/navit/po/pl.po.in
Modified: trunk/navit/po/pl.po.in
===================================================================
--- trunk/navit/po/pl.po.in 2013-07-30 06:58:52 UTC (rev 5552)
+++ trunk/navit/po/pl.po.in 2013-07-31 14:33:37 UTC (rev 5553)
@@ -1,22 +1,21 @@
# Polish translations for navit.
# Copyright (C) 2007, 2008 The Navit Team
# This file is distributed under the same license as the Navit package.
-# Michael "Mineque" Madej <mi...@qu...>, 2007.
+# Michael "Mineque" Madej <mi...@qu...>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: navit 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-04-30 19:57+0200\n"
-"PO-Revision-Date: 2010-06-09 18:10+0000\n"
-"Last-Translator: Lukasz Semler <luk...@o2...>\n"
+"PO-Revision-Date: 2013-07-31 14:19+0100\n"
+"Last-Translator: Robert Wojewódzki <rob...@po...>\n"
"Language-Team: Translators\n"
-"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
-"|| n%100>=20) ? 1 : 2;\n"
+"Language: \n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: POLAND\n"
"X-Poedit-Language: Polish\n"
@@ -84,11 +83,11 @@
#, c-format
msgid "%d feet"
-msgstr ""
+msgstr "%d stopa"
#, c-format
msgid "in %d feet"
-msgstr ""
+msgstr "za %d stóp"
#, c-format
msgid "%d meters"
@@ -96,15 +95,15 @@
#, c-format
msgid "in %d meters"
-msgstr "za %d m"
+msgstr "za %d metrów"
#, c-format
msgid "%d.%d miles"
-msgstr ""
+msgstr "%d.%d mil"
#, c-format
msgid "in %d.%d miles"
-msgstr ""
+msgstr "za %d.%d mil"
#, c-format
msgid "%d.%d kilometers"
@@ -117,30 +116,30 @@
#, c-format
msgid "one mile"
msgid_plural "%d miles"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "jedna mila"
+msgstr[1] "%d mile"
+msgstr[2] "%d mil"
#, c-format
msgid "in one mile"
msgid_plural "in %d miles"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "za jedną milę"
+msgstr[1] "za %d mile"
+msgstr[2] "za %d mil"
#, c-format
msgid "one kilometer"
msgid_plural "%d kilometers"
msgstr[0] "jeden kilometr"
-msgstr[1] "%d kilometr"
-msgstr[2] "%d kilometr"
+msgstr[1] "%d kilometry"
+msgstr[2] "%d kilometrów"
#, c-format
msgid "in one kilometer"
msgid_plural "in %d kilometers"
-msgstr[0] "za kilometr"
-msgstr[1] "%d kilometr"
-msgstr[2] "%d kilometr"
+msgstr[0] "za jeden kilometr"
+msgstr[1] "za %d kilometry"
+msgstr[2] "za %d kilometrów"
msgid "exit"
msgstr "zjazd"
@@ -156,22 +155,22 @@
#. TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Male form. The stuff after | doesn't have to be included
#, c-format
msgid "%sinto the %s%s%s|male form"
-msgstr "%sw %s%s%s|male form"
+msgstr "%sw %s%s%s|męski rodzaj"
#. TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Female form. The stuff after | doesn't have to be included
#, c-format
msgid "%sinto the %s%s%s|female form"
-msgstr "%sw %s%s%s|female form"
+msgstr "%sw %s%s%s|żeński rodzaj"
#. TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Neutral form. The stuff after | doesn't have to be included
#, c-format
msgid "%sinto the %s%s%s|neutral form"
-msgstr "%sw %s%s%s|neutral form"
+msgstr "%sw %s%s%s|neutralny rodzaj"
#. TRANSLATORS: gives the name of the next road to turn into (into the E17)
#, c-format
msgid "%sinto the %s"
-msgstr "%s na / w %s"
+msgstr "%s do %s"
#. TRANSLATORS: right, as in 'Turn right'
msgid "right"
@@ -206,7 +205,7 @@
#. TRANSLATORS: %s is the distance to the roundabout
#, c-format
msgid "Enter the roundabout %s"
-msgstr ""
+msgstr "Wjazd na rondo %s"
#, c-format
msgid "then leave the roundabout at the %s"
@@ -218,7 +217,7 @@
#, c-format
msgid "Follow the road for the next %s"
-msgstr "Jedź tą drogą %s"
+msgstr "Jedź tą drogą do następnego %s"
msgid "soon"
msgstr "wkrótce"
@@ -226,18 +225,18 @@
#. TRANSLATORS: First argument is the how manieth street to take, second the direction
#, c-format
msgid "Take the %1$s road to the %2$s"
-msgstr "Jedź %1$s drogą w %2$s"
+msgstr "Jedź drogą %1$s do %2$s"
#, c-format
msgid "after %i roads"
-msgstr "%i skrzyżowanie"
+msgstr "po drodze %i"
msgid "now"
msgstr "teraz"
#, c-format
msgid "then take the %1$s road to the %2$s"
-msgstr "następnie jedź %1$s drogą w %2$s"
+msgstr "następnie jedź %1$s drogą do %2$s"
msgid "error"
msgstr "błąd"
@@ -245,7 +244,7 @@
#. TRANSLATORS: The first argument is strength, the second direction, the third distance and the fourth destination Example: 'Turn 'slightly' 'left' in '100 m' 'onto baker street'
#, c-format
msgid "Turn %1$s%2$s %3$s%4$s"
-msgstr "Skręć %1$s%2$s %4$s %3$s"
+msgstr "Skręć %1$s%2$s %3$s%4$s"
#. TRANSLATORS: First argument is strength, second direction, third how many roads to skip, fourth destination
#, c-format
@@ -288,10 +287,10 @@
#, c-format
msgid "Waypoint %d"
-msgstr ""
+msgstr "Punkt trasy %d"
msgid "Visit before..."
-msgstr ""
+msgstr "Odwiedź najpierw..."
msgid "Set as position"
msgstr "Ustaw jako pozycję"
@@ -432,7 +431,7 @@
#. 535
msgid "Bonaire, Sint Eustatius and Saba"
-msgstr ""
+msgstr "Bonaire, Sint Eustatius i Saba"
#. 076
msgid "Brazil"
@@ -524,7 +523,7 @@
#. 531
msgid "Curacao"
-msgstr ""
+msgstr "Curacao"
#. 162
msgid "Christmas Island"
@@ -1144,7 +1143,7 @@
#. 728
msgid "South Sudan"
-msgstr ""
+msgstr "Sudan Południowy"
#. 678
msgid "Sao Tome and Principe"
@@ -1156,7 +1155,7 @@
#. 534
msgid "Sint Maarten (Dutch part)"
-msgstr ""
+msgstr "Sint Maarten (część holenderska)"
#. 760
msgid "Syrian Arab Republic"
@@ -1311,43 +1310,47 @@
msgstr "Zimbabwe"
msgid "* Unknown, add is_in tags to those cities"
-msgstr "* Nieznane, dodaj tag \"is_in\" dla tych miast"
+msgstr "* Nieznane, dodaj is w tagach dla tych miast"
#, c-format
msgid ""
"navit usage:\n"
"navit [options] [configfile]\n"
"\t-c <file>: use <file> as config file\n"
-"\t-d <n>: set the global debug output level to <n> (0-3). Overrides setting "
-"from config file.\n"
+"\t-d <n>: set the global debug output level to <n> (0-3). Overrides setting from config file.\n"
"\t-h: print this usage info and exit.\n"
"\t-v: Print the version and exit.\n"
msgstr ""
+"navit użycie:\n"
+"navit [opcje] [plik config]\n"
+"\t-c <plik>: użyje <plik> jako plik config\n"
+"\t-d <n>: ustawi wyjściowy poziom globalnego debugowania na <n> (0-3). Nadpisze ustawienia z pliku config.\n"
+"\t-h: wydrukuje to info użycia i wyjdzie.\n"
+"\t-v: Wydrukuje wersję i wyjdzie.\n"
#. We have not found an existing config file from all possibilities
msgid "No config file navit.xml, navit.xml.local found\n"
-msgstr ""
+msgstr "Brak pliku konfiguracji navit.xml, znaleziony navit.xml.local\n"
#, c-format
msgid "Error parsing config file '%s': %s\n"
-msgstr ""
+msgstr "Błąd przetworzenia pliku config '%s': %s\n"
#, c-format
msgid "Using config file '%s'\n"
-msgstr ""
+msgstr "Użycie pliku konfiguracji '%s'\n"
-msgid ""
-"Internal initialization failed, exiting. Check previous error messages.\n"
-msgstr ""
+msgid "Internal initialization failed, exiting. Check previous error messages.\n"
+msgstr "Nieudana wewnętrzna inicjalizacja, wychodzenie. Sprawdź poprzednie komunikaty błędu.\n"
msgid "unknown street"
-msgstr ""
+msgstr "nieznana ulica"
msgid "Unnamed vehicle"
-msgstr ""
+msgstr "Nienazwany pojazd"
msgid "Failed to write bookmarks file"
-msgstr ""
+msgstr "Nieudany zapis pliku zakładek"
#. Strings from navit_shipped.xml
msgid "Map Point"
@@ -1372,7 +1375,7 @@
msgstr "Miasto"
msgid "District"
-msgstr "Dzielnica/Okręg miejski"
+msgstr "Dzielnica"
msgid "Street"
msgstr "Ulica"
@@ -1403,94 +1406,94 @@
#. TRANSLATORS: These texts are for menu items in GTK GUI. The _ indicates the mnemonic key (=underlined character) for this menu item. Please place the _ before a suitable character in the translation (or omit it if no mnemonic key is desired).
msgid "_Display"
-msgstr "Pokaż"
+msgstr "_Wyświetl"
msgid "_Route"
-msgstr "Trasa"
+msgstr "_Trasa"
msgid "_Former Destinations"
-msgstr "Poprzednie cele"
+msgstr "_Poprzednie cele"
msgid "_Bookmarks"
-msgstr "Zakładki"
+msgstr "_Zakładki"
msgid "_Map"
-msgstr "Mapa"
+msgstr "_Mapa"
msgid "_Layout"
-msgstr "Układ kolorów"
+msgstr "_Układ kolorów"
msgid "_Projection"
-msgstr "Odwzorowanie"
+msgstr "_Odwzorowanie"
msgid "_Vehicle"
-msgstr "Pojazd"
+msgstr "_Pojazd"
msgid "Zoom_Out"
msgstr "Oddal"
msgid "Decrease zoom level"
-msgstr ""
+msgstr "Zmniejsz poziom powiększenia"
msgid "Zoom_In"
msgstr "Zbliż"
msgid "Increase zoom level"
-msgstr ""
+msgstr "Zwiększ poziom powiększenia"
msgid "_Recalculate"
-msgstr "Oblicz ponownie"
+msgstr "_Oblicz ponownie"
msgid "Redraw map"
-msgstr ""
+msgstr "Przerysuj mapę"
msgid "_Info"
-msgstr "Info"
+msgstr "_Info"
msgid "Set _destination"
-msgstr ""
+msgstr "Ustaw _cel"
msgid "Opens address search dialog"
-msgstr ""
+msgstr "Otwórz okno dialogowe wyszukiwania adresu"
msgid "_Stop Navigation"
-msgstr "Zatrzymaj nawigację"
+msgstr "_Zatrzymaj nawigację"
msgid "Test"
msgstr "Test"
msgid "_Quit"
-msgstr "Zakończ"
+msgstr "_Zakończ"
msgid "Quit the application"
-msgstr ""
+msgstr "Wyjście z aplikacji"
msgid "Show position _cursor"
-msgstr ""
+msgstr "Pokaż pozycję _kursora"
msgid "_Lock on Road"
-msgstr "Trzymaj się drogi"
+msgstr "_Trzymaj się drogi"
msgid "_Keep orientation to the North"
-msgstr ""
+msgstr "_Zachowaj orientację na Północ"
msgid "Switches map orientation to the north or the vehicle"
-msgstr ""
+msgstr "Przełącz orientację mapy na północ lub pojazd"
msgid "_Roadbook"
-msgstr "Szczegóły trasy"
+msgstr "_Szczegóły trasy"
msgid "Show/hide route description"
-msgstr ""
+msgstr "Pokaż/ukryj opis drogi"
msgid "_Autozoom"
-msgstr "Automatyczne przybliżenie"
+msgstr "_Automatyczne przybliżenie"
msgid "Enable/disable automatic zoom level changing"
-msgstr ""
+msgstr "Włącz/wyłącz automatyczną zmianę poziomu powiększenia"
msgid "_Fullscreen"
-msgstr "Pełny ekran"
+msgstr "_Pełny ekran"
msgid "Data"
msgstr "Dane"
@@ -1523,36 +1526,36 @@
msgstr "Nie"
msgid "2D"
-msgstr "2W"
+msgstr "2D"
msgid "3D"
-msgstr "3W"
+msgstr "3D"
msgid "OT"
msgstr "OT"
#, c-format
msgid "Route %4.0fkm %02d:%02d ETA"
-msgstr "Trasa %4.0fkm %02d:%02d ETA"
+msgstr "Trasa %4.0fkm %02d:%02d ETA"
msgid "Route 0000km 0+00:00 ETA"
-msgstr "Trasa 0000km 0+00:00 ETA"
+msgstr "Trasa 0000km 0+00:00 ETA"
msgid "Help"
msgstr "Pomoc"
#, c-format
msgid "Waypoint %s"
-msgstr ""
+msgstr "Punkt trasy %s"
msgid "Select waypoint to insert the new one before"
-msgstr ""
+msgstr "Wybierz punkt trasy aby wstawić przed nowy"
msgid "View in Browser"
msgstr "Zobacz w przeglądarce"
msgid "Item type"
-msgstr ""
+msgstr "Typ pozycji"
msgid "Streets"
msgstr "Ulice"
@@ -1564,7 +1567,7 @@
msgstr "Zobacz właściwości"
msgid "Set as position (and deactivate vehicle)"
-msgstr ""
+msgstr "Ustaw jako pozycję (i deaktywuj pojazd)"
msgid "POIs"
msgstr "Użyteczne miejsca"
@@ -1573,10 +1576,10 @@
msgstr "Zobacz na mapie"
msgid "Remove search results from the map"
-msgstr ""
+msgstr "Usuń wyniki wyszukiwania z mapy"
msgid "Show results on the map"
-msgstr ""
+msgstr "Pokaż wyniki na mapie"
msgid "Cut Bookmark"
msgstr "Wytnij zakładkę"
@@ -1594,22 +1597,22 @@
msgstr "Usuń zakładkę"
msgid "Delete waypoint"
-msgstr ""
+msgstr "Usuń punkt trasy"
msgid "Bookmarks"
msgstr "Zakładki"
msgid "Bookmarks as waypoints"
-msgstr ""
+msgstr "Zakładki jako punkty trasy"
msgid "Save waypoints"
-msgstr ""
+msgstr "Zapisz punkty trasy"
msgid "Replace with waypoints"
-msgstr ""
+msgstr "Zamień punktami trasy"
msgid "Delete Folder"
-msgstr ""
+msgstr "Usuń Katalog"
#. Adds the Bookmark folders
msgid "Add Bookmark folder"
@@ -1625,19 +1628,19 @@
#, c-format
msgid "Download %s"
-msgstr ""
+msgstr "Pobieranie %s"
msgid "Map Download"
-msgstr ""
+msgstr "Pobieranie Mapy"
msgid "Active"
-msgstr ""
+msgstr "Aktywny"
msgid "Download Enabled"
-msgstr ""
+msgstr "Włączone pobieranie"
msgid "Download completely"
-msgstr ""
+msgstr "Pobieranie kompletne"
msgid "Show Satellite Status"
msgstr "Pokaż status satelitów"
@@ -1698,10 +1701,10 @@
msgstr "członkowie oraz współtwórcy."
msgid "Waypoints"
-msgstr ""
+msgstr "Punkty trasy"
msgid "Enter Coordinates"
-msgstr ""
+msgstr "Wprowadź współrzędne"
#.
#. w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill)
@@ -1710,10 +1713,10 @@
#. we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill)
#. gui_internal_widget_append(w, we)
msgid "Longitude Latitude"
-msgstr ""
+msgstr "Długość i szerokość geograficzna"
msgid "Enter coordinates, for example:"
-msgstr ""
+msgstr "Wprowadź współrzędne, na przykład:"
msgid "Vehicle"
msgstr "Pojazd"
@@ -1731,7 +1734,7 @@
msgstr "Wyśrodkuj mapę"
msgid "Plan with Waypoints"
-msgstr ""
+msgstr "Plan z punktami trasy"
msgid "Maps"
msgstr "Mapy"
@@ -1746,13 +1749,13 @@
msgstr "Opis trasy"
msgid "Show Locale"
-msgstr ""
+msgstr "Pokaż ustawienia regionalne"
msgid "Former Destinations"
msgstr "Poprzednie cele"
msgid "- No former destinations available -"
-msgstr ""
+msgstr "- Brak dostępnych poprzednich celów -"
msgid "Message"
msgstr "Wiadomość"
@@ -1770,21 +1773,21 @@
msgstr "Numer domu"
msgid "Next"
-msgstr ""
+msgstr "Następny"
msgid "Prev"
-msgstr ""
+msgstr "Poprzedni"
msgid "Return to route!"
-msgstr ""
+msgstr "Powróć do drogi!"
#. warning told
msgid "Look out! Camera!"
-msgstr ""
+msgstr "Uważaj! Radar!"
#. warning told
msgid "Please decrease your speed"
-msgstr ""
+msgstr "Proszę zmniejszyć szybkość"
msgid "Vehicle Position"
msgstr "Pozycja pojazdu"
@@ -1818,6 +1821,8 @@
"Former\n"
"Destinations"
msgstr ""
+"Poprzednie\n"
+"Cele"
msgid "Quit"
msgstr "Zakończ"
@@ -1845,26 +1850,30 @@
"Drop last \n"
"Waypoint"
msgstr ""
+"Opuść ostatni \n"
+"Punkt trasy"
msgid ""
"Drop next \n"
"Waypoint"
msgstr ""
+"Opuść następny \n"
+"Punkt trasy"
msgid "Satellite Status"
-msgstr ""
+msgstr "Status satelity"
msgid "NMEA Data"
-msgstr ""
+msgstr "Dane NMEA"
msgid "car_shortest"
-msgstr ""
+msgstr "samochód_najkrótsza"
msgid "car_avoid_tolls"
-msgstr ""
+msgstr "samochód_unikanie_opłat"
msgid "car_pedantic"
-msgstr ""
+msgstr "samochód _pedantyczny"
msgid "horse"
msgstr "koń"
@@ -1892,13 +1901,12 @@
#. vehicle_axle_weight= 34000 lbs, 15422 kg
#.
msgid "Truck"
-msgstr ""
+msgstr "Ciężarówka"
#~ msgid "In %s, enter the roundabout"
#~ msgstr "Wjedź na rondo za %s"
-
#~ msgid "Cursor"
#~ msgstr "Kursor"
-
#~ msgid "%d.%d kilometer"
#~ msgstr "%d.%d kilometra"
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-07-30 06:58:54
|
Revision: 5552
http://sourceforge.net/p/navit/code/5552
Author: martin-s
Date: 2013-07-30 06:58:52 +0000 (Tue, 30 Jul 2013)
Log Message:
-----------
Fix:maptool:Fix some memory leaks regarding boundary processing
Modified Paths:
--------------
trunk/navit/navit/maptool/boundaries.c
trunk/navit/navit/maptool/itembin.c
trunk/navit/navit/maptool/maptool.c
trunk/navit/navit/maptool/maptool.h
trunk/navit/navit/maptool/osm.c
trunk/navit/navit/maptool/osm_relations.c
Modified: trunk/navit/navit/maptool/boundaries.c
===================================================================
--- trunk/navit/navit/maptool/boundaries.c 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/boundaries.c 2013-07-30 06:58:52 UTC (rev 5552)
@@ -322,5 +322,34 @@
boundaries_list=process_boundaries_setup(boundaries, relations);
relations_process(relations, NULL, ways, NULL);
+ relations_destroy(relations);
return process_boundaries_finish(boundaries_list);
}
+
+void
+free_boundaries(GList *l)
+{
+ while (l) {
+ struct boundary *boundary=l->data;
+ GList *s=boundary->segments;
+ while (s) {
+ struct geom_poly_segment *seg=s->data;
+ g_free(seg->first);
+ g_free(seg);
+ s=g_list_next(s);
+ };
+ s=boundary->sorted_segments;
+ while (s) {
+ struct geom_poly_segment *seg=s->data;
+ g_free(seg->first);
+ g_free(seg);
+ s=g_list_next(s);
+ };
+ g_list_free(boundary->segments);
+ g_list_free(boundary->sorted_segments);
+ g_free(boundary->ib);
+ free_boundaries(boundary->children);
+ g_free(boundary);
+ l=g_list_next(l);
+ }
+}
Modified: trunk/navit/navit/maptool/itembin.c
===================================================================
--- trunk/navit/navit/maptool/itembin.c 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/itembin.c 2013-07-30 06:58:52 UTC (rev 5552)
@@ -588,8 +588,7 @@
count++;
p+=(*((int *)p)+1)*4;
}
- idx=malloc(count*sizeof(void *));
- dbg_assert(idx != NULL);
+ idx=g_malloc(count*sizeof(void *));
p=buffer;
for (j = 0 ; j < count ; j++) {
idx[j]=p;
@@ -614,6 +613,8 @@
}
}
fclose(f);
+ g_free(idx);
+ g_free(buffer);
return 1;
}
return 0;
Modified: trunk/navit/navit/maptool/maptool.c
===================================================================
--- trunk/navit/navit/maptool/maptool.c 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/maptool.c 2013-07-30 06:58:52 UTC (rev 5552)
@@ -91,6 +91,9 @@
long mem=(long)sbrk(0)-start_brk;
fprintf(stderr," %ld MB",mem/1024/1024);
#endif
+#if 0
+ system("grep -i VmRSS /proc/$PPID/status");
+#endif
}
void
Modified: trunk/navit/navit/maptool/maptool.h
===================================================================
--- trunk/navit/navit/maptool/maptool.h 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/maptool.h 2013-07-30 06:58:52 UTC (rev 5552)
@@ -133,6 +133,8 @@
GList *boundary_find_matches(GList *bl, struct coord *c);
+void free_boundaries(GList *l);
+
/* buffer.c */
struct buffer {
int malloced_step;
@@ -293,6 +295,7 @@
struct relations_func *relations_func_new(void (*func)(void *func_priv, void *relation_priv, struct item_bin *member, void *member_priv), void *func_priv);
void relations_add_func(struct relations *rel, struct relations_func *func, void *relation_priv, void *member_priv, int type, osmid id);
void relations_process(struct relations *rel, FILE *nodes, FILE *ways, FILE *relations);
+void relations_destroy(struct relations *rel);
/* osm_xml.c */
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/osm.c 2013-07-30 06:58:52 UTC (rev 5552)
@@ -1939,11 +1939,12 @@
for(a=end-1;a>max_adm_level && a>2;a--)
attrs[a-2].type=type_none;
}
-
-
+ g_list_free(matches);
return match->country;
- } else
+ } else {
+ g_list_free(matches);
return NULL;
+ }
}
static void
@@ -2066,6 +2067,8 @@
fclose(towns_poly);
g_hash_table_destroy(town_hash);
+ free_boundaries(bl);
+
profile(0, "Finished processing towns\n");
}
Modified: trunk/navit/navit/maptool/osm_relations.c
===================================================================
--- trunk/navit/navit/maptool/osm_relations.c 2013-07-27 20:13:18 UTC (rev 5551)
+++ trunk/navit/navit/maptool/osm_relations.c 2013-07-30 06:58:52 UTC (rev 5552)
@@ -151,3 +151,23 @@
}
}
}
+
+void
+relations_destroy_func(void *key, GList *l, void *data)
+{
+ while (l) {
+ g_free(l->data);
+ l=g_list_next(l);
+ }
+}
+
+void
+relations_destroy(struct relations *relations)
+{
+ int i;
+
+ for (i = 0 ; i < 3 ; i++) {
+ g_hash_table_foreach(relations->member_hash[i], (GHFunc)relations_destroy_func, NULL);
+ g_hash_table_destroy(relations->member_hash[i]);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-07-27 20:13:20
|
Revision: 5551
http://sourceforge.net/p/navit/code/5551
Author: martin-s
Date: 2013-07-27 20:13:18 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
Fix:Core:Enable routing for a few special pedestrian road types
Modified Paths:
--------------
trunk/navit/navit/item.c
Modified: trunk/navit/navit/item.c
===================================================================
--- trunk/navit/navit/item.c 2013-07-27 20:07:09 UTC (rev 5550)
+++ trunk/navit/navit/item.c 2013-07-27 20:13:18 UTC (rev 5551)
@@ -72,7 +72,11 @@
{type_steps, AF_PBH},
{type_street_pedestrian, AF_PBH},
{type_hiking_mountain, AF_PEDESTRIAN},
+ {type_hiking_mountain_demanding, AF_PEDESTRIAN},
{type_hiking, AF_PEDESTRIAN},
+ {type_hiking_alpine, AF_PEDESTRIAN},
+ {type_hiking_alpine_demanding, AF_PEDESTRIAN},
+ {type_hiking_alpine_difficult, AF_PEDESTRIAN},
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-07-27 20:07:11
|
Revision: 5550
http://sourceforge.net/p/navit/code/5550
Author: martin-s
Date: 2013-07-27 20:07:09 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
Fix:Core:Correctly initialize profile_options if enabled from xml
Modified Paths:
--------------
trunk/navit/navit/vehicleprofile.c
Modified: trunk/navit/navit/vehicleprofile.c
===================================================================
--- trunk/navit/navit/vehicleprofile.c 2013-07-14 21:08:13 UTC (rev 5549)
+++ trunk/navit/navit/vehicleprofile.c 2013-07-27 20:07:09 UTC (rev 5550)
@@ -295,6 +295,12 @@
return this_->name;
}
+void
+vehicleprofile_init(struct vehicleprofile *this_)
+{
+ vehicleprofile_update(this_);
+}
+
struct object_func vehicleprofile_func = {
attr_vehicleprofile,
(object_func_new)vehicleprofile_new,
@@ -304,7 +310,7 @@
(object_func_set_attr)vehicleprofile_set_attr,
(object_func_add_attr)vehicleprofile_add_attr,
(object_func_remove_attr)vehicleprofile_remove_attr,
- (object_func_init)NULL,
+ (object_func_init)vehicleprofile_init,
(object_func_destroy)NULL,
(object_func_dup)NULL,
(object_func_ref)navit_object_ref,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-14 21:08:15
|
Revision: 5549
http://sourceforge.net/p/navit/code/5549
Author: sleske
Date: 2013-07-14 21:08:13 +0000 (Sun, 14 Jul 2013)
Log Message:
-----------
Refactor:core:Remove unused function search_list_get_unique and helpers.
Modified Paths:
--------------
trunk/navit/navit/search.c
Modified: trunk/navit/navit/search.c
===================================================================
--- trunk/navit/navit/search.c 2013-07-14 21:07:59 UTC (rev 5548)
+++ trunk/navit/navit/search.c 2013-07-14 21:08:13 UTC (rev 5549)
@@ -1013,137 +1013,6 @@
return 0;
}
-static char *
-search_list_get_unique_truncate(char *common, char *result)
-{
- dbg(1,"%s vs %s\n",common,result);
- while (*common) {
- if (g_utf8_get_char(common) != g_utf8_get_char(result)) {
- dbg(1,"truncating at %s vs %s\n",common,result);
- return common;
- }
- result=g_utf8_next_char(result);
- common=g_utf8_next_char(common);
- }
- return common;
-}
-
-static char *
-search_list_get_unique_append(char *list, char *append)
-{
- char *c=list;
- int llen=list?strlen(list):0;
- int len=g_utf8_next_char(append)-append;
- gunichar a=g_utf8_get_char(append);
- while(c && *c) {
- if (g_utf8_get_char(c) == a)
- return list;
- c=g_utf8_next_char(c);
- }
- list=g_renew(char, list, llen+len+1);
- strncpy(list+llen,append,len);
- list[llen+len]='\0';
- return list;
-}
-
-char *
-search_list_get_unique(struct search_list *this_, char *unique)
-{
- int level=this_->level;
- struct search_list_level *le=&this_->levels[level];
- struct search_list_country *slc;
- struct search_list_town *slt;
- struct search_list_street *sls;
- struct search_list_house_number *slh;
- char *retf=NULL,*ret=NULL;
- char *strings[4]={NULL,};
- char *search=g_utf8_casefold(unique?unique:le->attr->u.str,-1);
- char *name,*max;
- int search_len=strlen(search);
- int i,count=sizeof(strings)/sizeof(char *);
- GList *l;
-
- dbg(0,"enter level=%d %s %s\n",level,search,unique);
- l=le->list;
- while (l) {
- switch (level) {
- case 0:
- slc=l->data;
- strings[0]=g_strdup(slc->name);
- strings[1]=g_strdup(slc->car);
- strings[2]=g_strdup(slc->iso2);
- strings[3]=g_strdup(slc->iso3);
- break;
- case 1:
- slt=l->data;
- name=slt->common.town_name;
- for (i = 0 ; i < 3 ; i++)
- strings[i]=linguistics_expand_special(name, i);
- break;
- case 2:
- sls=l->data;
- name=sls->name;
- for (i = 0 ; i < 3 ; i++)
- strings[i]=linguistics_expand_special(name, i);
- break;
- case 3:
- slh=l->data;
- name=slh->house_number;
- for (i = 0 ; i < 3 ; i++)
- strings[i]=linguistics_expand_special(name, i);
- break;
- default:
- dbg(0,"entry\n");
- }
- dbg(1,"entry %s %s %s %s\n",strings[0],strings[1],strings[2],strings[3]);
- max=NULL;
- for (i = 0 ; i < count ; i++) {
- char *str=strings[i];
- while (str) {
- char *strf=g_utf8_casefold(str,-1);
- dbg(1,"word %s\n",strf);
- if (!strncmp(strf, search, search_len)) {
- dbg(1,"match\n");
- if (unique) {
- dbg(1,"possible next %s %s ret %s\n",strf+search_len,str+search_len,ret);
- ret=search_list_get_unique_append(ret, strf+search_len);
- ret=search_list_get_unique_append(ret, str+search_len);
- dbg(1,"ret now %s\n",ret);
- } else {
- if (!ret) {
- ret=g_strdup(str);
- retf=g_utf8_casefold(ret,-1);
- dbg(1,"ret now %s\n",ret);
- } else {
- char *end=search_list_get_unique_truncate(retf,strf);
- dbg(1,"%d characters\n",end-retf);
- if (!max || max < end)
- max=end;
- }
- }
- }
- g_free(strf);
- str=linguistics_next_word(str);
- }
- g_free(strings[i]);
- }
- if (!unique) {
- if (max) {
- dbg(1,"max %s (%d characters)\n",max,max-retf);
- ret[max-retf]='\0';
- } else {
- dbg(1,"new max\n");
- }
- }
- dbg(1,"common %s\n",ret);
- l=g_list_next(l);
- }
- g_free(search);
- g_free(retf);
- dbg(0,"return %s\n",ret);
- return ret;
-}
-
/**
* @brief Get (next) result from a search.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-14 21:08:02
|
Revision: 5548
http://sourceforge.net/p/navit/code/5548
Author: sleske
Date: 2013-07-14 21:07:59 +0000 (Sun, 14 Jul 2013)
Log Message:
-----------
Fix:core:Add apostrophes (ASCII 39&96) as word separators for address search.|Fixes #507.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_search.c
trunk/navit/navit/linguistics.c
trunk/navit/navit/linguistics.h
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2013-07-13 20:38:11 UTC (rev 5547)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2013-07-14 21:07:59 UTC (rev 5548)
@@ -325,7 +325,7 @@
}
if((p=strstr(exp,folded_query))!=NULL) {
p+=strlen(folded_query);
- if(!*p||strchr(" -/()",*p)) {
+ if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
dbg(1,"exact matching word found inside string %s\n",exp);
wr->datai=512;
}
Modified: trunk/navit/navit/linguistics.c
===================================================================
--- trunk/navit/navit/linguistics.c 2013-07-13 20:38:11 UTC (rev 5547)
+++ trunk/navit/navit/linguistics.c 2013-07-14 21:07:59 UTC (rev 5548)
@@ -449,7 +449,7 @@
char *
linguistics_next_word(char *str)
{
- int len=strcspn(str, " -/()");
+ int len=strcspn(str, LINGUISTICS_WORD_SEPARATORS_ASCII);
if (!str[len] || !str[len+1])
return NULL;
return str+len+1;
Modified: trunk/navit/navit/linguistics.h
===================================================================
--- trunk/navit/navit/linguistics.h 2013-07-13 20:38:11 UTC (rev 5547)
+++ trunk/navit/navit/linguistics.h 2013-07-14 21:07:59 UTC (rev 5548)
@@ -1,6 +1,7 @@
#ifdef __cplusplus
extern "C" {
#endif
+#define LINGUISTICS_WORD_SEPARATORS_ASCII " -/()'`"
char *linguistics_expand_special(const char *str, int mode);
char *linguistics_next_word(char *str);
void linguistics_init(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-13 20:38:13
|
Revision: 5547
http://sourceforge.net/p/navit/code/5547
Author: sleske
Date: 2013-07-13 20:38:11 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
Fix:core:Fix signed integer overflow in distance calculation.|Concludes fix for #1145.
Modified Paths:
--------------
trunk/navit/navit/transform.c
Modified: trunk/navit/navit/transform.c
===================================================================
--- trunk/navit/navit/transform.c 2013-07-13 20:37:52 UTC (rev 5546)
+++ trunk/navit/navit/transform.c 2013-07-13 20:38:11 UTC (rev 5547)
@@ -1106,13 +1106,29 @@
return ret;
}
+static int
+transform_overflow_possible_if_squared(int count, ...) {
+ va_list ap;
+ int i, value, result = 0;
+
+ va_start (ap, count);
+ for (i = 0; i < count; i++) {
+ value = va_arg (ap, int);
+ if (abs(value)>32767) {
+ result = 1;
+ }
+ }
+ va_end (ap);
+ return result;
+}
+
int
transform_distance_sq(struct coord *c1, struct coord *c2)
{
int dx=c1->x-c2->x;
int dy=c1->y-c2->y;
- if (dx > 32767 || dy > 32767 || dx < -32767 || dy < -32767)
+ if (transform_overflow_possible_if_squared(2, dx, dy))
return INT_MAX;
else
return dx*dx+dy*dy;
@@ -1148,6 +1164,10 @@
wx=ref->x-l0->x;
wy=ref->y-l0->y;
+ if (transform_overflow_possible_if_squared(4, vx, vy, wx, wy)) {
+ return INT_MAX;
+ }
+
c1=vx*wx+vy*wy;
if ( c1 <= 0 ) {
if (lpnt)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-13 20:37:54
|
Revision: 5546
http://sourceforge.net/p/navit/code/5546
Author: sleske
Date: 2013-07-13 20:37:52 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
Fix:gui_internal:Fix signed integer overflow in gui_internal_gesture_ring_add.|Part of fix for #1145.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_gesture.c
trunk/navit/navit/gui/internal/gui_internal_gesture.h
trunk/navit/navit/gui/internal/gui_internal_priv.h
Modified: trunk/navit/navit/gui/internal/gui_internal_gesture.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_gesture.c 2013-07-13 20:37:35 UTC (rev 5545)
+++ trunk/navit/navit/gui/internal/gui_internal_gesture.c 2013-07-13 20:37:52 UTC (rev 5546)
@@ -44,11 +44,11 @@
void
gui_internal_gesture_ring_add(struct gui_priv *this, struct point *p)
{
- int msec;
+ long long msec;
#ifndef HAVE_API_WIN32_CE
struct timeval tv;
gettimeofday(&tv,NULL);
- msec=tv.tv_sec*1000+tv.tv_usec/1000;
+ msec=((long long)tv.tv_sec)*1000+tv.tv_usec/1000;
#else
msec=GetTickCount();
#endif
@@ -60,11 +60,11 @@
}
this->gesture_ring[this->gesture_ring_last].p=*p;
this->gesture_ring[this->gesture_ring_last].msec=msec;
- dbg(2,"msec=%d x=%d y=%d\n",msec,p->x,p->y);
+ dbg(2,"msec=%Ld x=%d y=%d\n",msec,p->x,p->y);
};
int
-gui_internal_gesture_get_vector(struct gui_priv *this, int msec, struct point *p0, int *dx, int *dy)
+gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct point *p0, int *dx, int *dy)
{
struct gesture_elem *g;
int x,y,dt;
@@ -88,7 +88,7 @@
*p0=g->p;
}
msec=g->msec;
- dbg(2,"%d %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(2,"%Ld %d %d\n",g->msec, g->p.x, g->p.y);
for(i=1;(g=gui_internal_gesture_ring_get(this,i))!=NULL;i++) {
if( msec-g->msec > 1000 )
break;
@@ -98,7 +98,7 @@
if(p0) {
*p0=g->p;
}
- dbg(2,"%d %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(2,"%Ld %d %d\n",g->msec, g->p.x, g->p.y);
}
return dt;
}
Modified: trunk/navit/navit/gui/internal/gui_internal_gesture.h
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_gesture.h 2013-07-13 20:37:35 UTC (rev 5545)
+++ trunk/navit/navit/gui/internal/gui_internal_gesture.h 2013-07-13 20:37:52 UTC (rev 5546)
@@ -3,6 +3,6 @@
struct point;
void gui_internal_gesture_ring_clear(struct gui_priv *this);
void gui_internal_gesture_ring_add(struct gui_priv *this, struct point *p);
-int gui_internal_gesture_get_vector(struct gui_priv *this, int msec, struct point *p0, int *dx, int *dy);
+int gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct point *p0, int *dx, int *dy);
int gui_internal_gesture_do(struct gui_priv *this);
/* end of prototypes */
Modified: trunk/navit/navit/gui/internal/gui_internal_priv.h
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_priv.h 2013-07-13 20:37:35 UTC (rev 5545)
+++ trunk/navit/navit/gui/internal/gui_internal_priv.h 2013-07-13 20:37:52 UTC (rev 5546)
@@ -147,7 +147,7 @@
/* gestures */
struct gesture_elem {
- int msec;
+ long long msec;
struct point p;
} gesture_ring[GESTURE_RINGSIZE];
int gesture_ring_last, gesture_ring_first;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-13 20:37:39
|
Revision: 5545
http://sourceforge.net/p/navit/code/5545
Author: sleske
Date: 2013-07-13 20:37:35 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
Fix:core:Only draw vehicle if it has a position. Avoids integer overflow caused by bogus coordinates.|Part of fix for #1145.
Modified Paths:
--------------
trunk/navit/navit/navit.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2013-07-13 20:37:21 UTC (rev 5544)
+++ trunk/navit/navit/navit.c 2013-07-13 20:37:35 UTC (rev 5545)
@@ -2933,6 +2933,11 @@
callback_list_remove(this_->attr_cbl, cb);
}
+static int
+coord_not_set(struct coord c){
+ return !(c.x || c.y);
+}
+
/**
* Toggle the cursor update : refresh the map each time the cursor has moved (instead of only when it reaches a border)
*
@@ -2946,7 +2951,7 @@
struct point cursor_pnt;
enum projection pro;
- if (this_->blocked)
+ if (this_->blocked||coord_not_set(nv->coord))
return;
if (pnt)
cursor_pnt=*pnt;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-07-13 20:37:24
|
Revision: 5544
http://sourceforge.net/p/navit/code/5544
Author: sleske
Date: 2013-07-13 20:37:21 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
Fix:core:Integrate transform_setup into transform_new. Avoids two-step initialization and access to undefined variables in struct transform.|Part of fix for #1145.
Modified Paths:
--------------
trunk/navit/navit/navit.c
trunk/navit/navit/osd/core/osd_core.c
trunk/navit/navit/transform.c
trunk/navit/navit/transform.h
trunk/navit/navit/vehicle.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2013-06-30 23:07:15 UTC (rev 5543)
+++ trunk/navit/navit/navit.c 2013-07-13 20:37:21 UTC (rev 5544)
@@ -1405,15 +1405,12 @@
this_->radius = 30;
this_->border = 16;
- this_->trans = transform_new();
- this_->trans_cursor = transform_new();
- transform_set_projection(this_->trans_cursor, pro);
transform_from_geo(pro, &g, &co);
center.x=co.x;
center.y=co.y;
center.pro = pro;
-
- transform_setup(this_->trans, ¢er, zoom, (this_->orientation != -1) ? this_->orientation : 0);
+ this_->trans = transform_new(¢er, zoom, (this_->orientation != -1) ? this_->orientation : 0);
+ this_->trans_cursor = transform_new(¢er, zoom, (this_->orientation != -1) ? this_->orientation : 0);
this_->bookmarks=bookmarks_new(&this_->self, NULL, this_->trans);
Modified: trunk/navit/navit/osd/core/osd_core.c
===================================================================
--- trunk/navit/navit/osd/core/osd_core.c 2013-06-30 23:07:15 UTC (rev 5543)
+++ trunk/navit/navit/osd/core/osd_core.c 2013-07-13 20:37:21 UTC (rev 5544)
@@ -3555,6 +3555,7 @@
struct graphics *gra;
struct attr attr;
struct map_selection sel;
+ struct pcoord center={ projection_mg, 0, 0};
struct color red={0xffff,0x0,0x0,0xffff};
this->nav=nav;
@@ -3576,10 +3577,10 @@
this->red=graphics_gc_new(gra);
graphics_gc_set_foreground(this->red,&red);
graphics_gc_set_linewidth(this->red,3);
- this->trans=transform_new();
memset(&sel, 0, sizeof(sel));
sel.u.p_rect.rl.x=opc->osd_item.w;
sel.u.p_rect.rl.y=opc->osd_item.h;
+ this->trans=transform_new(¢er, 16, 0);
transform_set_screen_selection(this->trans, &sel);
graphics_set_rect(opc->osd_item.gr, &sel.u.p_rect);
#if 0
Modified: trunk/navit/navit/transform.c
===================================================================
--- trunk/navit/navit/transform.c 2013-06-30 23:07:15 UTC (rev 5543)
+++ trunk/navit/navit/transform.c 2013-07-13 20:37:21 UTC (rev 5544)
@@ -169,21 +169,18 @@
}
struct transformation *
-transform_new(void)
+transform_new(struct pcoord *center, int scale, int yaw)
{
struct transformation *this_;
this_=g_new0(struct transformation, 1);
transform_set_screen_dist(this_, 100);
this_->order_base=14;
-#if 0
- this_->pitch=20;
-#endif
-#if 0
- this_->roll=30;
- this_->hog=1000;
-#endif
- transform_setup_matrix(this_);
+ this_->pro=center->pro;
+ this_->map_center.x=center->x;
+ this_->map_center.y=center->y;
+ this_->scale=scale/16.0;
+ transform_set_yaw(this_, yaw);
return this_;
}
@@ -852,16 +849,6 @@
}
void
-transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw)
-{
- t->pro=c->pro;
- t->map_center.x=c->x;
- t->map_center.y=c->y;
- t->scale=scale/16.0;
- transform_set_yaw(t, yaw);
-}
-
-void
transform_setup_source_rect(struct transformation *t)
{
int i;
Modified: trunk/navit/navit/transform.h
===================================================================
--- trunk/navit/navit/transform.h 2013-06-30 23:07:15 UTC (rev 5543)
+++ trunk/navit/navit/transform.h 2013-07-13 20:37:21 UTC (rev 5544)
@@ -39,7 +39,7 @@
struct pcoord;
struct point;
struct transformation;
-struct transformation *transform_new(void);
+struct transformation *transform_new(struct pcoord *center, int scale, int yaw);
int transform_get_hog(struct transformation *this_);
void transform_set_hog(struct transformation *this_, int hog);
int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
Modified: trunk/navit/navit/vehicle.c
===================================================================
--- trunk/navit/navit/vehicle.c 2013-06-30 23:07:15 UTC (rev 5543)
+++ trunk/navit/navit/vehicle.c 2013-07-13 20:37:21 UTC (rev 5544)
@@ -126,11 +126,10 @@
}
this_->attrs=attr_list_dup(attrs);
- this_->trans=transform_new();
center.pro=projection_screen;
center.x=0;
center.y=0;
- transform_setup(this_->trans, ¢er, 16, 0);
+ this_->trans=transform_new(¢er, 16, 0);
vehicle_set_default_name(this_);
dbg(1, "leave\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-30 23:07:20
|
Revision: 5543
http://sourceforge.net/p/navit/code/5543
Author: sleske
Date: 2013-06-30 23:07:15 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------
Refactor:core:Fix warnings, remove dead code.
Modified Paths:
--------------
trunk/navit/navit/attr.c
trunk/navit/navit/xmlconfig.c
Modified: trunk/navit/navit/attr.c
===================================================================
--- trunk/navit/navit/attr.c 2013-06-30 23:07:02 UTC (rev 5542)
+++ trunk/navit/navit/attr.c 2013-06-30 23:07:15 UTC (rev 5543)
@@ -191,13 +191,13 @@
Relative values are from 0x40000001 - 0x80000000, with 0x60000000 being 0 */
if (strchr(value, '%')) {
if ((ret->u.num > 0x20000000) || (ret->u.num < -0x1FFFFFFF)) {
- dbg(0, "Relative possibly-relative attribute with invalid value %i\n", ret->u.num);
+ dbg(0, "Relative possibly-relative attribute with invalid value %li\n", ret->u.num);
}
ret->u.num += 0x60000000;
} else {
if ((ret->u.num > 0x40000000) || (ret->u.num < -0x40000000)) {
- dbg(0, "Non-relative possibly-relative attribute with invalid value %i\n", ret->u.num);
+ dbg(0, "Non-relative possibly-relative attribute with invalid value %li\n", ret->u.num);
}
}
} else if (attr >= attr_type_boolean_begin) { // also check for yes and no
Modified: trunk/navit/navit/xmlconfig.c
===================================================================
--- trunk/navit/navit/xmlconfig.c 2013-06-30 23:07:02 UTC (rev 5542)
+++ trunk/navit/navit/xmlconfig.c 2013-06-30 23:07:15 UTC (rev 5543)
@@ -887,14 +887,7 @@
static int
xpointer_element_match(const char *xpointer, int len, struct xistate *elem)
{
- int start,tlen,tlen2;
-#if 0
- char test2[len+1];
-
- strncpy(test2, xpointer, len);
- test2[len]='\0';
- dbg(0,"%s\n", test2);
-#endif
+ int start,tlen;
start=strcspn(xpointer, "[");
if (start > len)
start=len;
@@ -904,15 +897,14 @@
return 1;
if (xpointer[len-1] != ']')
return 0;
- tlen=len-start-2;
for (;;) {
start++;
- tlen2=strcspn(xpointer+start,"]");
- if (start + tlen2 > len)
+ tlen=strcspn(xpointer+start,"]");
+ if (start + tlen > len)
return 1;
- if (!xpointer_test(xpointer+start, tlen2, elem))
+ if (!xpointer_test(xpointer+start, tlen, elem))
return 0;
- start+=tlen2+1;
+ start+=tlen+1;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-30 23:07:05
|
Revision: 5542
http://sourceforge.net/p/navit/code/5542
Author: sleske
Date: 2013-06-30 23:07:02 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------
Fix:core:Ignore unknown/invalid item types in config.|Fixes #1127.
Modified Paths:
--------------
trunk/navit/navit/attr.c
trunk/navit/navit/xmlconfig.c
Modified: trunk/navit/navit/attr.c
===================================================================
--- trunk/navit/navit/attr.c 2013-06-30 23:06:50 UTC (rev 5541)
+++ trunk/navit/navit/attr.c 2013-06-30 23:07:02 UTC (rev 5542)
@@ -105,6 +105,7 @@
struct attr *ret;
struct coord_geo *g;
struct coord c;
+ enum item_type item_type;
char *pos,*type_str,*str,*tok;
int min,max,count;
@@ -122,9 +123,14 @@
str=type_str;
while ((tok=strtok(str, ","))) {
ret->u.item_types=g_realloc(ret->u.item_types, (count+2)*sizeof(enum item_type));
- ret->u.item_types[count++]=item_from_name(tok);
- ret->u.item_types[count]=type_none;
- str=NULL;
+ item_type=item_from_name(tok);
+ if (item_type!=type_none) {
+ ret->u.item_types[count++]=item_type;
+ ret->u.item_types[count]=type_none;
+ } else {
+ dbg(0,"Unknown item type '%s' ignored.\n",tok);
+ }
+ str=NULL;
}
g_free(type_str);
break;
Modified: trunk/navit/navit/xmlconfig.c
===================================================================
--- trunk/navit/navit/xmlconfig.c 2013-06-30 23:06:50 UTC (rev 5541)
+++ trunk/navit/navit/xmlconfig.c 2013-06-30 23:07:02 UTC (rev 5542)
@@ -234,7 +234,11 @@
str=type_str;
while ((tok=strtok(str, ","))) {
itype=item_from_name(tok);
- navigation_set_announce(state->parent->element_attr.u.data, itype, level);
+ if (itype!=type_none) {
+ navigation_set_announce(state->parent->element_attr.u.data, itype, level);
+ } else {
+ dbg(0, "Invalid type for announcement: %s\n",tok);
+ }
str=NULL;
}
g_free(type_str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-30 23:06:53
|
Revision: 5541
http://sourceforge.net/p/navit/code/5541
Author: sleske
Date: 2013-06-30 23:06:50 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------
Fix:core:Log errors with level 0.
Modified Paths:
--------------
trunk/navit/navit/navit.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2013-06-29 21:28:15 UTC (rev 5540)
+++ trunk/navit/navit/navit.c 2013-06-30 23:06:50 UTC (rev 5541)
@@ -869,12 +869,12 @@
) {
if(!(ms=navit_get_mapset(this))) {
- dbg(1, "Command function map_add_curr_pos(): there is no active mapset\n");
+ dbg(0, "Command function map_add_curr_pos(): there is no active mapset\n");
return;
}
if((item_type = item_from_name(in[1]->u.str))==type_none) {
- dbg(1, "Command function map_add_curr_pos(): unknown item type\n");
+ dbg(0, "Command function map_add_curr_pos(): unknown item type\n");
return;
}
@@ -882,7 +882,7 @@
//no map with the given name found
if( ! curr_map) {
- dbg(1, "Command function map_add_curr_pos(): map not found\n");
+ dbg(0, "Command function map_add_curr_pos(): map not found\n");
return;
}
@@ -891,11 +891,11 @@
if(vehicle_get_attr(this->vehicle->vehicle,attr_position_coord_geo,&pos_attr,NULL)) {
transform_from_geo(projection_mg, pos_attr.u.coord_geo, &curr_coord);
} else {
- dbg(1, "Command function map_add_curr_pos(): vehicle position is not accessible\n");
+ dbg(0, "Command function map_add_curr_pos(): vehicle position is not accessible\n");
return;
}
} else {
- dbg(1, "Command function map_add_curr_pos(): no vehicle\n");
+ dbg(0, "Command function map_add_curr_pos(): no vehicle\n");
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-29 21:28:18
|
Revision: 5540
http://sourceforge.net/p/navit/code/5540
Author: sleske
Date: 2013-06-29 21:28:15 +0000 (Sat, 29 Jun 2013)
Log Message:
-----------
Refactor:core:Make transform() more readable and shorter by extracting loads of stuff.
Modified Paths:
--------------
trunk/navit/navit/transform.c
Modified: trunk/navit/navit/transform.c
===================================================================
--- trunk/navit/navit/transform.c 2013-06-16 21:39:56 UTC (rev 5539)
+++ trunk/navit/navit/transform.c 2013-06-29 21:28:15 UTC (rev 5540)
@@ -375,7 +375,7 @@
double e1 = (1-sqrt(1-eccSquared))/(1+sqrt(1-eccSquared));
double N1, T1, C1, R1, D, M;
double LongOrigin;
- double mu, phi1, phi1Rad;
+ double mu, phi1Rad;
double x, y;
double rad2deg = 180/M_PI;
@@ -395,7 +395,6 @@
phi1Rad = mu + (3*e1/2-27*e1*e1*e1/32)*sin(2*mu)
+ (21*e1*e1/16-55*e1*e1*e1*e1/32)*sin(4*mu)
+(151*e1*e1*e1/96)*sin(6*mu);
- phi1 = phi1Rad*rad2deg;
N1 = a/sqrt(1-eccSquared*sin(phi1Rad)*sin(phi1Rad));
T1 = tan(phi1Rad)*tan(phi1Rad);
@@ -415,97 +414,162 @@
geo->lng=Long;
}
+static struct coord
+transform_correct_projection(struct transformation *t, enum projection required_projection, struct coord c)
+{
+ struct coord result;
+ struct coord_geo g;
+ if (required_projection == t->pro) {
+ result=c;
+ } else {
+ transform_to_geo(required_projection, &c, &g);
+ transform_from_geo(t->pro, &g, &result);
+ }
+ return result;
+}
+
+static struct coord
+transform_shift_by_center_and_scale(struct transformation *t, struct coord c)
+{
+ struct coord result;
+ result.x = c.x - t->map_center.x;
+ result.y = c.y - t->map_center.y;
+ result.x >>= t->scale_shift;
+ result.y >>= t->scale_shift;
+ return result;
+}
+
+struct coord_3d {
+ int x;
+ int y;
+ int z;
+};
+
+
+static struct coord_3d
+transform_rotate(struct transformation *t, struct coord c)
+{
+ struct coord_3d result;
+ result.x=c.x*t->m00+c.y*t->m01+HOG(*t)*t->m02;
+ result.y=c.x*t->m10+c.y*t->m11+HOG(*t)*t->m12;
+ result.z=(c.x*t->m20+c.y*t->m21+HOG(*t)*t->m22);
+ result.z+=t->offz << POST_SHIFT;
+ dbg(3, "result: (%d,%d,%d)\n", result.x,result.y,result.z);
+ return result;
+}
+
+static struct coord_3d
+transform_z_clip(struct coord_3d c, struct coord_3d c_old, int zlimit)
+{
+ struct coord_3d result;
+ float clip_factor = (zlimit-c.z)/(c_old.z-c.z);
+ result.x=c.x+(c_old.x-c.x)*clip_factor;
+ result.y=c.y+(c_old.y-c.y)*clip_factor;
+ result.z=zlimit;
+ dbg(3,"clip result: (%d,%d,%d)\n", result.x, result.y, result.z);
+ return result;
+}
+
+static struct point
+transform_project_onto_view_plane(struct transformation *t, struct coord_3d c)
+{
+ struct point result;
+ result.x = (long long)c.x*t->xscale/c.z;
+ result.y = (long long)c.y*t->yscale/c.z;
+ return result;
+}
+
+static int
+transform_points_too_close(struct point screen_point, struct point screen_point_old, int mindist)
+{
+ if (!mindist){
+ return 0;
+ }
+ // approximation of Euclidean distance
+ return (abs(screen_point.x - screen_point_old.x) +
+ abs(screen_point.y - screen_point_old.y)) < mindist;
+}
+
+struct z_clip_result{
+ struct coord_3d clipped_coord;
+ int visible;
+ int process_coord_again;
+ int skip_coord;
+};
+
+static struct z_clip_result
+transform_z_clip_if_necessary(struct coord_3d coord, int zlimit, struct z_clip_result clip_result_old)
+{
+ int visibility_changed;
+ struct z_clip_result clip_result={{0,0}, 0, 0, 0};
+ clip_result.visible=(coord.z < zlimit ? 0:1);
+ visibility_changed=(clip_result_old.visible != -1)&&(clip_result.visible != clip_result_old.visible);
+ if (visibility_changed) {
+ clip_result.clipped_coord=transform_z_clip(coord, clip_result_old.clipped_coord, zlimit);
+ } else {
+ clip_result.clipped_coord=coord;
+ }
+ if (clip_result.visible && visibility_changed){
+ // line was clipped, but current point
+ // is visible -> process it again
+ clip_result.process_coord_again=1;
+ }else if (!clip_result.visible && !visibility_changed){
+ clip_result.skip_coord=1;
+ }
+ return clip_result;
+}
+
int
-transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return)
+transform(struct transformation *t, enum projection required_projection, struct coord *input,
+ struct point *result, int count, int mindist, int width, int *width_result)
{
- struct coord c1;
- int xcn, ycn;
- struct coord_geo g;
- int xc, yc, zc=0, xco=0, yco=0, zco=0;
+ struct coord projected_coord, shifted_coord;
+ struct coord_3d rotated_coord;
+ struct point screen_point;
int zlimit=t->znear;
- int visible, visibleo=-1;
- int i,j = 0,k=0;
+ struct z_clip_result clip_result, clip_result_old={{0,0}, -1, 0, 0};
+ int i,result_idx = 0,result_idx_last=0;
dbg(3,"count=%d\n", count);
for (i=0; i < count; i++) {
- dbg(3, "input coord %d: (%d, %d)\n", i, c[i].x, c[i].y);
- if (pro == t->pro) {
- xc=c[i].x;
- yc=c[i].y;
- } else {
- transform_to_geo(pro, &c[i], &g);
- transform_from_geo(t->pro, &g, &c1);
- xc=c1.x;
- yc=c1.y;
- }
- xc-=t->map_center.x;
- yc-=t->map_center.y;
- xc >>= t->scale_shift;
- yc >>= t->scale_shift;
+ dbg(3, "input coord %d: (%d, %d)\n", i, input[i].x, input[i].y);
+ projected_coord = transform_correct_projection(t, required_projection, input[i]);
+ shifted_coord = transform_shift_by_center_and_scale(t, projected_coord);
+ rotated_coord = transform_rotate(t, shifted_coord);
- xcn=xc*t->m00+yc*t->m01+HOG(*t)*t->m02;
- ycn=xc*t->m10+yc*t->m11+HOG(*t)*t->m12;
-
if (t->ddd) {
- zc=(xc*t->m20+yc*t->m21+HOG(*t)*t->m22);
- zc+=t->offz << POST_SHIFT;
- dbg(3,"zc(%d)=xc(%d)*m20(%d)+yc(%d)*m21(%d)\n", zc, xc, t->m20, yc, t->m21);
- /* visibility */
- visible=(zc < zlimit ? 0:1);
- if (visible != visibleo && visibleo != -1) {
- if (zco != zc) {
- xcn=xcn+(long long)(xco-xcn)*(zlimit-zc)/(zco-zc);
- ycn=ycn+(long long)(yco-ycn)*(zlimit-zc)/(zco-zc);
- }
- zc=zlimit;
- dbg(3,"clip result: (%d,%d,%d)\n", xcn,ycn,zc);
- xco=xcn;
- yco=ycn;
- zco=zc;
- if (visible)
- i--;
- visibleo=visible;
- } else {
- xco=xcn;
- yco=ycn;
- zco=zc;
- visibleo=visible;
- if (! visible)
- continue;
+ clip_result=transform_z_clip_if_necessary(rotated_coord, zlimit, clip_result_old);
+ clip_result_old=clip_result;
+ if(clip_result.process_coord_again){
+ i--;
+ } else if (clip_result.skip_coord){
+ continue;
}
- xc=(long long)xcn*t->xscale/zc;
- yc=(long long)ycn*t->yscale/zc;
+ screen_point = transform_project_onto_view_plane(t, clip_result.clipped_coord);
} else {
- xc=xcn;
- yc=ycn;
- xc>>=POST_SHIFT;
- yc>>=POST_SHIFT;
+ screen_point.x = rotated_coord.x>>POST_SHIFT;
+ screen_point.y = rotated_coord.y>>POST_SHIFT;
}
- xc+=t->offx;
- yc+=t->offy;
- dbg(3,"result: (%d, %d)\n", xc, yc);
+ screen_point.x+=t->offx;
+ screen_point.y+=t->offy;
+ dbg(3,"result: (%d, %d)\n", screen_point.x, screen_point.y);
- if (i != 0 && i != count-1 && mindist) {
- /* We expect values of mindist to be within 0..5 pixels for nice looking screens.
- That gives difference of about 1 pixel in worst case between abs(dx)+abs(dy) and sqrt(dx*dx+dy*dy).
- We expect significantly bigger values when drawing map while scrolling it. But it anyway will be ugly.
- Should anybody care about that inaccuracy? */
- if ( (abs(xc - p[k].x) + abs(yc - p[k].y)) < mindist &&
- (c[i+1].x != c[0].x || c[i+1].y != c[0].y))
+ if (i != 0 && i != count-1 &&
+ (input[i+1].x != input[0].x || input[i+1].y != input[0].y)) {
+ if (transform_points_too_close(screen_point, result[result_idx_last], mindist)){
continue;
- k=j;
+ }
}
-
- p[j].x=xc;
- p[j].y=yc;
- if (width_return) {
+ result[result_idx]=screen_point;
+ if (width_result) {
if (t->ddd)
- width_return[j]=width*t->wscale/zc;
+ width_result[result_idx]=width*t->wscale/rotated_coord.z;
else
- width_return[j]=width;
+ width_result[result_idx]=width;
}
- j++;
+ result_idx_last=result_idx;
+ result_idx++;
}
- return j;
+ return result_idx;
}
static void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-06-16 21:40:00
|
Revision: 5539
http://sourceforge.net/p/navit/code/5539
Author: mdankov
Date: 2013-06-16 21:39:56 +0000 (Sun, 16 Jun 2013)
Log Message:
-----------
Fix:port_win32:Fix "Dollar S" bugs in navigational messages by adding own versions of *printf functions to support/glib. Fixes #1123, #1114. |Thank you ftom for initial version of the patch.
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
trunk/navit/config.h.cmake
trunk/navit/configure.in
trunk/navit/navit/support/glib/CMakeLists.txt
trunk/navit/navit/support/glib/Makefile.am
trunk/navit/navit/support/glib/glibconfig.h
Added Paths:
-----------
trunk/navit/navit/support/glib/gnulib/
trunk/navit/navit/support/glib/gnulib/asnprintf.c
trunk/navit/navit/support/glib/gnulib/g-gnulib.h
trunk/navit/navit/support/glib/gnulib/printf-args.c
trunk/navit/navit/support/glib/gnulib/printf-args.h
trunk/navit/navit/support/glib/gnulib/printf-parse.c
trunk/navit/navit/support/glib/gnulib/printf-parse.h
trunk/navit/navit/support/glib/gnulib/printf.c
trunk/navit/navit/support/glib/gnulib/printf.h
trunk/navit/navit/support/glib/gnulib/vasnprintf.c
trunk/navit/navit/support/glib/gnulib/vasnprintf.h
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/CMakeLists.txt 2013-06-16 21:39:56 UTC (rev 5539)
@@ -492,6 +492,7 @@
enable_language(RC)
set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
+ set(GLIB_USE_OWN_PRINTF 1)
endif()
if (WIN32 AND NOT WINCE)
set(HAVE_PRAGMA_PACK 1)
Modified: trunk/navit/config.h.cmake
===================================================================
--- trunk/navit/config.h.cmake 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/config.h.cmake 2013-06-16 21:39:56 UTC (rev 5539)
@@ -7,6 +7,7 @@
#cmakedefine HAVE_API_WIN32 1
#cmakedefine HAVE_API_WIN32_CE 1
#cmakedefine HAVE_GLIB 1
+#cmakedefine GLIB_USE_OWN_PRINTF 1
#cmakedefine HAVE_GMODULE 1
#cmakedefine HAVE_GETCWD 1
#define CACHE_SIZE ${CACHE_SIZE}
Modified: trunk/navit/configure.in
===================================================================
--- trunk/navit/configure.in 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/configure.in 2013-06-16 21:39:56 UTC (rev 5539)
@@ -295,6 +295,10 @@
if test "x${win32}" != "xyes" -a "x${android}" != "xyes"; then
GLIB_LIBS="$GLIB_LIBS -lpthread"
fi
+ if test "x${win32}" == "xyes"; then
+ glib_use_own_printf=yes; glib_use_own_printf_reason="Win32/WinCE detected"
+ AC_DEFINE(GLIB_USE_OWN_PRINTF, 1, [Undef to make internal glib use system printf implementation.])
+ fi
fi
# gmodule
@@ -347,6 +351,7 @@
AM_CONDITIONAL(EVENT_GLIB, [test "x$glib" = "xyes"])
AM_CONDITIONAL(SUPPORT_GLIB, [test "x$glib" = "xno"])
+AM_CONDITIONAL(GLIB_USE_OWN_PRINTF, [test "x$glib_use_own_printf" = "xyes"])
AM_CONDITIONAL(SUPPORT_EZXML, [test "x$glib" = "xno"])
AC_CHECK_HEADER([sys/time.h],
Modified: trunk/navit/navit/support/glib/CMakeLists.txt
===================================================================
--- trunk/navit/navit/support/glib/CMakeLists.txt 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/navit/support/glib/CMakeLists.txt 2013-06-16 21:39:56 UTC (rev 5539)
@@ -1,3 +1,13 @@
-supportlib_add_library(support_glib fake.c galiasdef.c gatomic.c gerror.c ghash.c
+set(SUPPORT_GLIB_SRC fake.c galiasdef.c gatomic.c gerror.c ghash.c
glib_init.c glist.c gmem.c gmessages.c gprimes.c gprintf.c gslice.c gslist.c
- gstrfuncs.c gstring.c gutf8.c gutils.c)
+ gstrfuncs.c gstring.c gutf8.c gutils.c)
+if(WIN32 OR WINCE)
+ list(APPEND SUPPORT_GLIB_SRC gnulib/asnprintf.c gnulib/printf.c gnulib/printf-args.c gnulib/printf-parse.c gnulib/vasnprintf.c)
+ set(GLIB_NEED_PRINTF 1)
+endif()
+supportlib_add_library(support_glib ${SUPPORT_GLIB_SRC})
+if(GLIB_USE_OWN_PRINTF)
+else(GLIB_USE_OWN_PRINTF)
+ GET_TARGET_PROPERTY(GLIB_DEFS support_glib COMPILE_DEFINITIONS)
+ SET_TARGET_PROPERTIES(support_glib PROPERTIES COMPILE_DEFINITIONS "HAVE_GOOD_PRINTF;${GLIB_DEFS}")
+endif(GLIB_USE_OWN_PRINTF)
Modified: trunk/navit/navit/support/glib/Makefile.am
===================================================================
--- trunk/navit/navit/support/glib/Makefile.am 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/navit/support/glib/Makefile.am 2013-06-16 21:39:56 UTC (rev 5539)
@@ -7,3 +7,8 @@
fake.h galias.h gerror.h ghash.h glib.h glibconfig.h glibintl.h glist.h \
gmacros.h gmem.h gmessages.h gprintf.h gprintfint.h gquark.h gslice.h \
gslist.h gstrfuncs.h gthreadprivate.h gtypes.h
+if GLIB_USE_OWN_PRINTF
+ libsupport_glib_la_SOURCES += gnulib/asnprintf.c gnulib/printf-args.c gnulib/printf-args.h \
+ gnulib/printf-parse.c gnulib/printf-parse.h gnulib/vasnprintf.c gnulib/vasnprintf.h gnulib/printf.c \
+ gnulib/printf.h gnulib/g-gnulib.h
+endif
Modified: trunk/navit/navit/support/glib/glibconfig.h
===================================================================
--- trunk/navit/navit/support/glib/glibconfig.h 2013-06-14 18:50:51 UTC (rev 5538)
+++ trunk/navit/navit/support/glib/glibconfig.h 2013-06-16 21:39:56 UTC (rev 5539)
@@ -244,7 +244,10 @@
#define G_MODULE_SUFFIX "dll"
-#define HAVE_GOOD_PRINTF
+#ifndef GLIB_USE_OWN_PRINTF
+# define HAVE_GOOD_PRINTF
+#endif
+#define HAVE_ALLOCA
#define NO_SYS_SIGLIST_DECL
#define GLIB_STATIC_COMPILATION
#define G_DISABLE_CHECKS
Added: trunk/navit/navit/support/glib/gnulib/asnprintf.c
===================================================================
--- trunk/navit/navit/support/glib/gnulib/asnprintf.c (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/asnprintf.c 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,40 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "g-gnulib.h"
+
+/* Specification. */
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+
+char *
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+ va_list args;
+ char *result;
+
+ va_start (args, format);
+ result = vasnprintf (resultbuf, lengthp, format, args);
+ va_end (args);
+ return result;
+}
Added: trunk/navit/navit/support/glib/gnulib/g-gnulib.h
===================================================================
--- trunk/navit/navit/support/glib/gnulib/g-gnulib.h (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/g-gnulib.h 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,49 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 2003 Matthias Clasen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __G_GNULIB_H__
+
+#include "config.h"
+#include <stdlib.h>
+#include "glib/glib.h"
+
+/* Private namespace for gnulib functions */
+#define asnprintf _g_gnulib_asnprintf
+#define vasnprintf _g_gnulib_vasnprintf
+#define printf_parse _g_gnulib_printf_parse
+#define printf_fetchargs _g_gnulib_printf_fetchargs
+
+/* Use GLib memory allocation */
+#undef malloc
+#undef realloc
+#undef free
+#define malloc g_malloc
+#define realloc g_realloc
+#define free g_free
+
+/* Ensure only C99 snprintf gets used */
+#undef HAVE_SNPRINTF
+#ifdef HAVE_C99_SNPRINTF
+#define HAVE_SNPRINTF 1
+#else
+#define HAVE_SNPRINTF 0
+#endif
+
+
+#endif /* __G_GNULIB_H__ */
+
Added: trunk/navit/navit/support/glib/gnulib/printf-args.c
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf-args.c (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf-args.c 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,133 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "g-gnulib.h"
+
+/* Specification. */
+#include "printf-args.h"
+
+#ifdef STATIC
+STATIC
+#endif
+int
+printf_fetchargs (va_list args, arguments *a)
+{
+ unsigned int i;
+ argument *ap;
+
+ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
+ switch (ap->type)
+ {
+ case TYPE_SCHAR:
+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
+ break;
+ case TYPE_UCHAR:
+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+ break;
+ case TYPE_SHORT:
+ ap->a.a_short = va_arg (args, /*short*/ int);
+ break;
+ case TYPE_USHORT:
+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+ break;
+ case TYPE_INT:
+ ap->a.a_int = va_arg (args, int);
+ break;
+ case TYPE_UINT:
+ ap->a.a_uint = va_arg (args, unsigned int);
+ break;
+ case TYPE_LONGINT:
+ ap->a.a_longint = va_arg (args, long int);
+ break;
+ case TYPE_ULONGINT:
+ ap->a.a_ulongint = va_arg (args, unsigned long int);
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_LONGLONGINT:
+ ap->a.a_longlongint = va_arg (args, long long int);
+ break;
+ case TYPE_ULONGLONGINT:
+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+ break;
+#endif
+#ifdef HAVE_INT64_AND_I64
+ case TYPE_INT64:
+ ap->a.a_int64 = va_arg (args, __int64);
+ break;
+ case TYPE_UINT64:
+ ap->a.a_uint64 = va_arg (args, unsigned __int64);
+ break;
+#endif
+ case TYPE_DOUBLE:
+ ap->a.a_double = va_arg (args, double);
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ ap->a.a_longdouble = va_arg (args, long double);
+ break;
+#endif
+ case TYPE_CHAR:
+ ap->a.a_char = va_arg (args, int);
+ break;
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+#ifdef _WIN32
+ ap->a.a_wide_char = va_arg (args, int);
+#else
+ ap->a.a_wide_char = va_arg (args, wint_t);
+#endif
+ break;
+#endif
+ case TYPE_STRING:
+ ap->a.a_string = va_arg (args, const char *);
+ break;
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ break;
+#endif
+ case TYPE_POINTER:
+ ap->a.a_pointer = va_arg (args, void *);
+ break;
+ case TYPE_COUNT_SCHAR_POINTER:
+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ ap->a.a_count_short_pointer = va_arg (args, short *);
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ ap->a.a_count_int_pointer = va_arg (args, int *);
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
+#endif
+ default:
+ /* Unknown type. */
+ return -1;
+ }
+ return 0;
+}
Added: trunk/navit/navit/support/glib/gnulib/printf-args.h
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf-args.h (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf-args.h 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,142 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _PRINTF_ARGS_H
+#define _PRINTF_ARGS_H
+
+/* Get wchar_t. */
+#ifdef HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t. */
+#ifdef HAVE_WINT_T
+# include <wchar.h>
+#endif
+
+/* Get va_list. */
+#include <stdarg.h>
+
+
+/* Argument types */
+typedef enum
+{
+ TYPE_NONE,
+ TYPE_SCHAR,
+ TYPE_UCHAR,
+ TYPE_SHORT,
+ TYPE_USHORT,
+ TYPE_INT,
+ TYPE_UINT,
+ TYPE_LONGINT,
+ TYPE_ULONGINT,
+#ifdef HAVE_LONG_LONG
+ TYPE_LONGLONGINT,
+ TYPE_ULONGLONGINT,
+#endif
+#ifdef HAVE_INT64_AND_I64
+ TYPE_INT64,
+ TYPE_UINT64,
+#endif
+ TYPE_DOUBLE,
+#ifdef HAVE_LONG_DOUBLE
+ TYPE_LONGDOUBLE,
+#endif
+ TYPE_CHAR,
+#ifdef HAVE_WINT_T
+ TYPE_WIDE_CHAR,
+#endif
+ TYPE_STRING,
+#ifdef HAVE_WCHAR_T
+ TYPE_WIDE_STRING,
+#endif
+ TYPE_POINTER,
+ TYPE_COUNT_SCHAR_POINTER,
+ TYPE_COUNT_SHORT_POINTER,
+ TYPE_COUNT_INT_POINTER,
+ TYPE_COUNT_LONGINT_POINTER
+#ifdef HAVE_LONG_LONG
+, TYPE_COUNT_LONGLONGINT_POINTER
+#endif
+} arg_type;
+
+/* Polymorphic argument */
+typedef struct
+{
+ arg_type type;
+ union
+ {
+ signed char a_schar;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long int a_longint;
+ unsigned long int a_ulongint;
+#ifdef HAVE_LONG_LONG
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
+#endif
+#ifdef HAVE_INT64_AND_I64
+ __int64 a_int64;
+ unsigned __int64 a_uint64;
+#endif
+ float a_float;
+ double a_double;
+#ifdef HAVE_LONG_DOUBLE
+ long double a_longdouble;
+#endif
+ int a_char;
+#ifdef HAVE_WINT_T
+ wint_t a_wide_char;
+#endif
+ const char* a_string;
+#ifdef HAVE_WCHAR_T
+ const wchar_t* a_wide_string;
+#endif
+ void* a_pointer;
+ signed char * a_count_schar_pointer;
+ short * a_count_short_pointer;
+ int * a_count_int_pointer;
+ long int * a_count_longint_pointer;
+#ifdef HAVE_LONG_LONG
+ long long int * a_count_longlongint_pointer;
+#endif
+ }
+ a;
+}
+argument;
+
+typedef struct
+{
+ unsigned int count;
+ argument *arg;
+}
+arguments;
+
+
+/* Fetch the arguments, putting them into a. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_fetchargs (va_list args, arguments *a);
+
+#endif /* _PRINTF_ARGS_H */
Added: trunk/navit/navit/support/glib/gnulib/printf-parse.c
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf-parse.c (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf-parse.c 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,498 @@
+/* Formatted output to strings.
+ Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "g-gnulib.h"
+
+/* Specification. */
+#include "printf-parse.h"
+
+/* Get size_t, NULL. */
+#include <stddef.h>
+
+/* Get intmax_t. */
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+
+/* malloc(), realloc(), free(). */
+#include <stdlib.h>
+
+#ifdef STATIC
+STATIC
+#endif
+int
+printf_parse (const char *format, char_directives *d, arguments *a)
+{
+ const char *cp = format; /* pointer into format */
+ int arg_posn = 0; /* number of regular arguments consumed */
+ unsigned int d_allocated; /* allocated elements of d->dir */
+ unsigned int a_allocated; /* allocated elements of a->arg */
+ unsigned int max_width_length = 0;
+ unsigned int max_precision_length = 0;
+
+ d->count = 0;
+ d_allocated = 1;
+ d->dir = malloc (d_allocated * sizeof (char_directive));
+ if (d->dir == NULL)
+ /* Out of memory. */
+ return -1;
+
+ a->count = 0;
+ a_allocated = 0;
+ a->arg = NULL;
+
+#define REGISTER_ARG(_index_,_type_) \
+ { \
+ unsigned int n = (_index_); \
+ if (n >= a_allocated) \
+ { \
+ argument *memory; \
+ a_allocated = 2 * a_allocated; \
+ if (a_allocated <= n) \
+ a_allocated = n + 1; \
+ memory = (a->arg \
+ ? realloc (a->arg, a_allocated * sizeof (argument)) \
+ : malloc (a_allocated * sizeof (argument))); \
+ if (memory == NULL) \
+ /* Out of memory. */ \
+ goto error; \
+ a->arg = memory; \
+ } \
+ while (a->count <= n) \
+ a->arg[a->count++].type = TYPE_NONE; \
+ if (a->arg[n].type == TYPE_NONE) \
+ a->arg[n].type = (_type_); \
+ else if (a->arg[n].type != (_type_)) \
+ /* Ambiguous type for positional argument. */ \
+ goto error; \
+ }
+
+ while (*cp != '\0')
+ {
+ char c = *cp++;
+ if (c == '%')
+ {
+ int arg_index = -1;
+ char_directive *dp = &d->dir[d->count];/* pointer to next directive */
+
+ /* Initialize the next directive. */
+ dp->dir_start = cp - 1;
+ dp->flags = 0;
+ dp->width_start = NULL;
+ dp->width_end = NULL;
+ dp->width_arg_index = -1;
+ dp->precision_start = NULL;
+ dp->precision_end = NULL;
+ dp->precision_arg_index = -1;
+ dp->arg_index = -1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const char *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ unsigned int n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = 10 * n + (*np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+
+ /* Read the flags. */
+ for (;;)
+ {
+ if (*cp == '\'')
+ {
+ dp->flags |= FLAG_GROUP;
+ cp++;
+ }
+ else if (*cp == '-')
+ {
+ dp->flags |= FLAG_LEFT;
+ cp++;
+ }
+ else if (*cp == '+')
+ {
+ dp->flags |= FLAG_SHOWSIGN;
+ cp++;
+ }
+ else if (*cp == ' ')
+ {
+ dp->flags |= FLAG_SPACE;
+ cp++;
+ }
+ else if (*cp == '#')
+ {
+ dp->flags |= FLAG_ALT;
+ cp++;
+ }
+ else if (*cp == '0')
+ {
+ dp->flags |= FLAG_ZERO;
+ cp++;
+ }
+ else
+ break;
+ }
+
+ /* Parse the field width. */
+ if (*cp == '*')
+ {
+ dp->width_start = cp;
+ cp++;
+ dp->width_end = cp;
+ if (max_width_length < 1)
+ max_width_length = 1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const char *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ unsigned int n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = 10 * n + (*np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ dp->width_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->width_arg_index < 0)
+ dp->width_arg_index = arg_posn++;
+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+ }
+ else if (*cp >= '0' && *cp <= '9')
+ {
+ unsigned int width_length;
+
+ dp->width_start = cp;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->width_end = cp;
+ width_length = dp->width_end - dp->width_start;
+ if (max_width_length < width_length)
+ max_width_length = width_length;
+ }
+
+ /* Parse the precision. */
+ if (*cp == '.')
+ {
+ cp++;
+ if (*cp == '*')
+ {
+ dp->precision_start = cp - 1;
+ cp++;
+ dp->precision_end = cp;
+ if (max_precision_length < 2)
+ max_precision_length = 2;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const char *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ unsigned int n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = 10 * n + (*np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ dp->precision_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->precision_arg_index < 0)
+ dp->precision_arg_index = arg_posn++;
+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+ }
+ else
+ {
+ unsigned int precision_length;
+
+ dp->precision_start = cp - 1;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->precision_end = cp;
+ precision_length = dp->precision_end - dp->precision_start;
+ if (max_precision_length < precision_length)
+ max_precision_length = precision_length;
+ }
+ }
+
+ {
+ arg_type type;
+
+ /* Parse argument type/size specifiers. */
+ {
+ int flags = 0;
+
+ for (;;)
+ {
+ if (*cp == 'h')
+ {
+ flags |= (1 << (flags & 1));
+ cp++;
+ }
+ else if (*cp == 'L')
+ {
+ flags |= 4;
+ cp++;
+ }
+ else if (*cp == 'l')
+ {
+ flags += 8;
+ cp++;
+ }
+#ifdef HAVE_INT64_AND_I64
+ else if (cp[0] == 'I' &&
+ cp[1] == '6' &&
+ cp[2] == '4')
+ {
+ flags = 64;
+ cp += 3;
+ }
+#endif
+#ifdef HAVE_INTMAX_T
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#endif
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else
+ break;
+ }
+
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
+#ifdef HAVE_INT64_AND_I64
+ if (flags == 64)
+ type = TYPE_INT64;
+ else
+#endif
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_LONGINT;
+ else if (flags & 2)
+ type = TYPE_SCHAR;
+ else if (flags & 1)
+ type = TYPE_SHORT;
+ else
+ type = TYPE_INT;
+ break;
+ case 'o': case 'u': case 'x': case 'X':
+#ifdef HAVE_INT64_AND_I64
+ if (flags == 64)
+ type = TYPE_UINT64;
+ else
+#endif
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_ULONGINT;
+ else if (flags & 2)
+ type = TYPE_UCHAR;
+ else if (flags & 1)
+ type = TYPE_USHORT;
+ else
+ type = TYPE_UINT;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+#ifdef HAVE_LONG_DOUBLE
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGDOUBLE;
+ else
+#endif
+ type = TYPE_DOUBLE;
+ break;
+ case 'c':
+ if (flags >= 8)
+#ifdef HAVE_WINT_T
+ type = TYPE_WIDE_CHAR;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_CHAR;
+ break;
+#ifdef HAVE_WINT_T
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
+#endif
+ case 's':
+ if (flags >= 8)
+#ifdef HAVE_WCHAR_T
+ type = TYPE_WIDE_STRING;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_STRING;
+ break;
+#ifdef HAVE_WCHAR_T
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
+#endif
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_COUNT_LONGINT_POINTER;
+ else if (flags & 2)
+ type = TYPE_COUNT_SCHAR_POINTER;
+ else if (flags & 1)
+ type = TYPE_COUNT_SHORT_POINTER;
+ else
+ type = TYPE_COUNT_INT_POINTER;
+ break;
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
+ }
+
+ if (type != TYPE_NONE)
+ {
+ dp->arg_index = arg_index;
+ if (dp->arg_index < 0)
+ dp->arg_index = arg_posn++;
+ REGISTER_ARG (dp->arg_index, type);
+ }
+ dp->conversion = c;
+ dp->dir_end = cp;
+ }
+
+ d->count++;
+ if (d->count >= d_allocated)
+ {
+ char_directive *memory;
+
+ d_allocated = 2 * d_allocated;
+ memory = realloc (d->dir, d_allocated * sizeof (char_directive));
+ if (memory == NULL)
+ /* Out of memory. */
+ goto error;
+ d->dir = memory;
+ }
+ }
+ }
+ d->dir[d->count].dir_start = cp;
+
+ d->max_width_length = max_width_length;
+ d->max_precision_length = max_precision_length;
+ return 0;
+
+error:
+ if (a->arg)
+ free (a->arg);
+ if (d->dir)
+ free (d->dir);
+ return -1;
+}
Added: trunk/navit/navit/support/glib/gnulib/printf-parse.h
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf-parse.h (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf-parse.h 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,74 @@
+/* Parse printf format string.
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _PRINTF_PARSE_H
+#define _PRINTF_PARSE_H
+
+#include "printf-args.h"
+
+/* Private namespace for gnulib functions */
+#define printf_parse _g_gnulib_printf_parse
+
+/* Flags */
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
+
+/* A parsed directive. */
+typedef struct
+{
+ const char* dir_start;
+ const char* dir_end;
+ int flags;
+ const char* width_start;
+ const char* width_end;
+ int width_arg_index;
+ const char* precision_start;
+ const char* precision_end;
+ int precision_arg_index;
+ char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
+ int arg_index;
+}
+char_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ unsigned int count;
+ char_directive *dir;
+ unsigned int max_width_length;
+ unsigned int max_precision_length;
+}
+char_directives;
+
+
+/* Parses the format string. Fills in the number N of directives, and fills
+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+ to the end of the format string. Also fills in the arg_type fields of the
+ arguments and the needed count of arguments. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_parse (const char *format, char_directives *d, arguments *a);
+
+#endif /* _PRINTF_PARSE_H */
Added: trunk/navit/navit/support/glib/gnulib/printf.c
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf.c (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf.c 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,154 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 2003 Matthias Clasen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GLib Team and others 2003. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "g-gnulib.h"
+#include "vasnprintf.h"
+#include "printf.h"
+
+int _g_gnulib_printf (char const *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = _g_gnulib_vprintf (format, args);
+ va_end (args);
+
+ return retval;
+}
+
+int _g_gnulib_fprintf (FILE *file, char const *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = _g_gnulib_vfprintf (file, format, args);
+ va_end (args);
+
+ return retval;
+}
+
+int _g_gnulib_sprintf (char *string, char const *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = _g_gnulib_vsprintf (string, format, args);
+ va_end (args);
+
+ return retval;
+}
+
+int _g_gnulib_snprintf (char *string, size_t n, char const *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = _g_gnulib_vsnprintf (string, n, format, args);
+ va_end (args);
+
+ return retval;
+}
+
+int _g_gnulib_vprintf (char const *format, va_list args)
+{
+ return _g_gnulib_vfprintf (stdout, format, args);
+}
+
+int _g_gnulib_vfprintf (FILE *file, char const *format, va_list args)
+{
+ char *result;
+ size_t length;
+
+ result = vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+
+ fwrite (result, 1, length, file);
+ free (result);
+
+ return length;
+}
+
+int _g_gnulib_vsprintf (char *string, char const *format, va_list args)
+{
+ char *result;
+ size_t length;
+
+ result = vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+
+ memcpy (string, result, length + 1);
+ free (result);
+
+ return length;
+}
+
+int _g_gnulib_vsnprintf (char *string, size_t n, char const *format, va_list args)
+{
+ char *result;
+ size_t length;
+
+ result = vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+
+ if (n > 0)
+ {
+ memcpy (string, result, MIN(length + 1, n));
+ string[n - 1] = 0;
+ }
+
+ free (result);
+
+ return length;
+}
+
+int _g_gnulib_vasprintf (char **result, char const *format, va_list args)
+{
+ size_t length;
+
+ *result = vasnprintf (NULL, &length, format, args);
+ if (*result == NULL)
+ return -1;
+
+ return length;
+}
+
+
+
+
+
Added: trunk/navit/navit/support/glib/gnulib/printf.h
===================================================================
--- trunk/navit/navit/support/glib/gnulib/printf.h (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/printf.h 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,57 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 2003 Matthias Clasen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __GNULIB_PRINTF_H__
+#define __GNULIB_PRINTF_H__
+
+#include <stdarg.h>
+#include <stdio.h>
+
+int _g_gnulib_printf (char const *format,
+ ...);
+int _g_gnulib_fprintf (FILE *file,
+ char const *format,
+ ...);
+int _g_gnulib_sprintf (char *string,
+ char const *format,
+ ...);
+int _g_gnulib_snprintf (char *string,
+ size_t n,
+ char const *format,
+ ...);
+int _g_gnulib_vprintf (char const *format,
+ va_list args);
+int _g_gnulib_vfprintf (FILE *file,
+ char const *format,
+ va_list args);
+int _g_gnulib_vsprintf (char *string,
+ char const *format,
+ va_list args);
+int _g_gnulib_vsnprintf (char *string,
+ size_t n,
+ char const *format,
+ va_list args);
+int _g_gnulib_vasprintf (char **result,
+ char const *format,
+ va_list args);
+
+
+#endif /* __GNULIB_PRINTF_H__ */
+
+
+
Added: trunk/navit/navit/support/glib/gnulib/vasnprintf.c
===================================================================
--- trunk/navit/navit/support/glib/gnulib/vasnprintf.c (rev 0)
+++ trunk/navit/navit/support/glib/gnulib/vasnprintf.c 2013-06-16 21:39:56 UTC (rev 5539)
@@ -0,0 +1,1084 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _WIN32
+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include "glib/galloca.h"
+
+#include "g-gnulib.h"
+
+/* Specification. */
+#include "vasnprintf.h"
+
+#include <stdio.h> /* snprintf(), sprintf() */
+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
+#include <string.h> /* memcpy(), strlen() */
+#include <errno.h> /* errno */
+#include <limits.h> /* CHAR_BIT */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#include "printf-parse.h"
+
+#ifdef HAVE_WCHAR_T
+# ifdef HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+/* For those losing systems which don't have 'alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+# define freea(p) /* nothing */
+#else
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
+
+#ifndef HAVE_LONG_LONG_FORMAT
+static int
+print_long_long (char *buf,
+ int len,
+ int width,
+ int precision,
+ unsigned long flags,
+ char conversion,
+ unsigned long long number)
+{
+ int negative = FALSE;
+ char buffer[128];
+ char *bufferend;
+ char *pointer;
+ int base;
+ static const char *upper = "0123456789ABCDEFX";
+ static const char *lower = "0123456789abcdefx";
+ const char *digits;
+ int i;
+ char *p;
+ int count;
+
+#define EMIT(c) \
+ if (p - buf == len - 1) \
+ { \
+ *p++ = '\0'; \
+ return len; \
+ } \
+ else \
+ *p++ = c;
+
+ p = buf;
+
+ switch (conversion)
+ {
+ case 'o':
+ base = 8;
+ digits = lower;
+ negative = FALSE;
+ break;
+ case 'x':
+ base = 16;
+ digits = lower;
+ negative = FALSE;
+ break;
+ case 'X':
+ base = 16;
+ digits = upper;
+ negative = FALSE;
+ break;
+ default:
+ base = 10;
+ digits = lower;
+ negative = (long long)number < 0;
+ if (negative)
+ number = -((long long)number);
+ break;
+ }
+
+ /* Build number */
+ pointer = bufferend = &buffer[sizeof(buffer) - 1];
+ *pointer-- = '\0';
+ for (i = 1; i < (int)sizeof(buffer); i++)
+ {
+ *pointer-- = digits[number % base];
+ number /= base;
+ if (number == 0)
+ break;
+ }
+
+ /* Adjust width */
+ width -= (bufferend - pointer) - 1;
+
+ /* Adjust precision */
+ if (precision != -1)
+ {
+ precision -= (bufferend - pointer) - 1;
+ if (precision < 0)
+ precision = 0;
+ flags |= FLAG_ZERO;
+ }
+
+ /* Adjust width further */
+ if (negative || (flags & FLAG_SHOWSIGN) || (flags & FLAG_SPACE))
+ width--;
+ if (flags & FLAG_ALT)
+ {
+ switch (base)
+ {
+ case 16:
+ width -= 2;
+ break;
+ case 8:
+ width--;
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* Output prefixes spaces if needed */
+ if (! ((flags & FLAG_LEFT) ||
+ ((flags & FLAG_ZERO) && (precision == -1))))
+ {
+ count = (precision == -1) ? 0 : precision;
+ while (width-- > count)
+ *p++ = ' ';
+ }
+
+ /* width has been adjusted for signs and alternatives */
+ if (negative)
+ {
+ EMIT ('-');
+ }
+ else if (flags & FLAG_SHOWSIGN)
+ {
+ EMIT('+');
+ }
+ else if (flags & FLAG_SPACE)
+ {
+ EMIT(' ');
+ }
+
+ if (flags & FLAG_ALT)
+ {
+ switch (base)
+ {
+ case 8:
+ EMIT('0');
+ break;
+ case 16:
+ EMIT('0');
+ EMIT(digits[16]);
+ break;
+ default:
+ break;
+ } /* switch base */
+ }
+
+ /* Output prefixed zero padding if needed */
+ if (flags & FLAG_ZERO)
+ {
+ if (precision == -1)
+ precision = width;
+ while (precision-- > 0)
+ {
+ EMIT('0');
+ width--;
+ }
+ }
+
+ /* Output the number itself */
+ while (*(++pointer))
+ {
+ EMIT(*pointer);
+ }
+
+ /* Output trailing spaces if needed */
+ if (flags & FLAG_LEFT)
+ {
+ while (width-- > 0)
+ EMIT(' ');
+ }
+
+ EMIT('\0');
+
+ return p - buf - 1;
+}
+#endif
+
+char *
+vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
+{
+ char_directives d;
+ arguments a;
+
+ if (printf_parse (format, &d, &a) < 0)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+#define CLEANUP() \
+ free (d.dir); \
+ if (a.arg) \
+ free (a.arg);
+
+ if (printf_fetchargs (args, &a) < 0)
+ {
+ CLEANUP ();
+ errno = EINVAL;
+ return NULL;
+ }
+
+ {
+ char *buf =
+ (char *) alloca (7 + d.max_width_length + d.max_precision_length + 6);
+ const char *cp;
+ unsigned int i;
+ char_directive *dp;
+ /* Output string accumulator. */
+ char *result;
+ size_t allocated;
+ size_t length;
+
+ if (resultbuf != NULL)
+ {
+ result = resultbuf;
+ allocated = *lengthp;
+ }
+ else
+ {
+ result = NULL;
+ allocated = 0;
+ }
+ length = 0;
+ /* Invariants:
+ result is either == resultbuf or == NULL or malloc-allocated.
+ If length > 0, then result != NULL. */
+
+#define ENSURE_ALLOCATION(needed) \
+ if ((needed) > allocated) \
+ { \
+ char *memory; \
+ \
+ allocated = (allocated > 0 ? 2 * allocated : 12); \
+ if ((needed) > allocated) \
+ allocated = (needed); \
+ if (result == resultbuf || result == NULL) \
+ memory = (char *) malloc (allocated); \
+ else \
+ memory = (char *) realloc (result, allocated); \
+ \
+ if (memory == NULL) \
+ { \
+ if (!(result == resultbuf || result == NULL)) \
+ free (result); \
+ freea (buf); \
+ CLEANUP (); \
+ errno = ENOMEM; \
+ return NULL; \
+ } \
+ if (result == resultbuf && length > 0) \
+ memcpy (memory, result, length); \
+ result = memory; \
+ }
+
+ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+ {
+ if (cp != dp->dir_start)
+ {
+ size_t n = dp->dir_start - cp;
+
+ ENSURE_ALLOCATION (length + n);
+ memcpy (result + length, cp, n);
+ length += n;
+ }
+ if (i == d.count)
+ break;
+
+ /* Execute a single directive. */
+ if (dp->conversion == '%')
+ {
+ if (!(dp->arg_index < 0))
+ abort ();
+ ENSURE_ALLOCATION (length + 1);
+ result[length] = '%';
+ length += 1;
+ }
+ else
+ {
+ if (!(dp->arg_index >= 0))
+ abort ();
+
+ if (dp->conversion == 'n')
+ {
+ switch (a.arg[dp->arg_index].type)
+ {
+ case TYPE_COUNT_SCHAR_POINTER:
+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
+#endif
+ default:
+ abort ();
+ }
+ }
+ else
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ char *p;
+ unsigned int prefix_count;
+ int prefixes[2];
+#if !HAVE_SNPRINTF
+ unsigned int tmp_length;
+ char tmpbuf[700];
+ char *tmp;
+
+ /* Allocate a temporary buffer of sufficient size for calling
+ sprintf. */
+ {
+ unsigned int width;
+ unsigned int precision;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index >= 0)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = (arg < 0 ? -arg : arg);
+ }
+ else
+ {
+ const char *digitp = dp->width_start;
+
+ do
+ width = width * 10 + (*digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index >= 0)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ precision = (arg < 0 ? 0 : arg);
+ }
+ else
+ {
+ const char *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = precision * 10 + (*digitp++ - '0');
+ }
+ }
+
+ switch (dp->conversion)
+ {
+ case 'd': case 'i': case 'u':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ break;
+
+ case 'o':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ break;
+
+ case 'x': case 'X':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ else
+# endif
+# ifdef HAVE_INT64_AND_I64
+ if (type == TYPE_INT64 || type == TYPE_UINT64)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned __int64) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ break;
+
+ case 'f': case 'F':
+# ifdef HAVE_LONG_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + precision
+ + 10; /* sign, decimal point etc. */
+ else
+# endif
+ tmp_length =
+ (unsigned int) (DBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + precision
+ + 10; /* sign, decimal point etc. */
+ break;
+
+ case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ tmp_length =
+ precision
+ + 12; /* sign, decimal point, exponent etc. */
+ break;
+
+ case 'c':
+# ifdef HAVE_WINT_T
+ if (type == TYPE_WIDE_CHAR)
+ tmp_length = MB_CUR_MAX;
+ else
+# endif
+ tmp_length = 1;
+ break;
+
+ case 's':
+# ifdef HAVE_WCHAR_T
+ if (type == TYPE_WIDE_STRING)
+ tmp_length =
+ (a.arg[dp->arg_index].a.a_wide_string == NULL
+ ? 6 /* wcslen(L"(null)") */
+ : local_wcslen (a.arg[dp->arg_index].a.a_wide_string))
+ * MB_CUR_MAX;
+ else
+# endif
+ tmp_length = a.arg[dp->arg_index].a.a_string == NULL
+ ? 6 /* strlen("(null)") */
+ : strlen (a.arg[dp->arg_index].a.a_string);
+ break;
+
+ case 'p':
+ tmp_length =
+ (unsigned int) (sizeof (void *) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading 0x */
+ break;
+
+ default:
+ abort ();
+ }
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length++; /* account for trailing NUL */
+ }
+
+ if (tmp_length <= sizeof (tmpbuf))
+ tmp = tmpbuf;
+ else
+ {
+ tmp = (char *) malloc (tmp_length);
+ if (tmp == NULL)
+ {
+ /* Out of memory. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ freea (buf);
+ CLEANUP ();
+ errno = ENOMEM;
+ return NULL;
+ }
+ }
+#endif
+
+ /* Construct the format string for calling snprintf or
+ sprintf. */
+ p = buf;
+ *p++ = '%';
+ if (dp->flags & FLAG_GROUP)
+ *p++ = '\'';
+ if (dp->flags & FLAG_LEFT)
+ *p++ = '-';
+ if (dp->flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ if (dp->flags & FLAG_SPACE)
+ *p++ = ' ';
+ if (dp->flags & FLAG_ALT)
+ *p++ = '#';
+ if (dp->flags & FLAG_ZERO)
+ *p++ = '0';
+ if (dp->width_start != dp->width_end)
+ {
+ size_t n = dp->width_end - dp->width_start;
+ memcpy (p, dp->width_start, n);
+ p += n;
+ }
+ if (dp->precision_start != dp->precision_end)
+ {
+ size_t n = dp->precision_end - dp->precision_start;
+ memcpy (p, dp->precision_start, n);
+ p += n;
+ }
+
+ switch (type)
+ {
+#ifdef HAVE_INT64_AND_I64
+ case TYPE_INT64:
+ case TYPE_UINT64:
+ *p++ = 'I';
+ *p++ = '6';
+ *p++ = '4';
+ break;
+#endif
+#ifdef HAVE_LONG_LONG
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+#ifdef HAVE_INT64_AND_I64 /* The system (sn)printf uses %I64. Also assume
+ * that long long == __int64.
+ */
+ *p++ = 'I';
+ *p++ = '6';
+ *p++ = '4';
+ break;
+#else
+ *p++ = 'l';
+ /*FALLTHROUGH*/
+#endif
+#endif
+ case TYPE_LONGINT:
+ case TYPE_ULONGINT:
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+#endif
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+#endif
+ *p++ = 'l';
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ *p++ = 'L';
+ break;
+#endif
+ default:
+ break;
+ }
+ *p = dp->conversion;
+#if HAVE_SNPRINTF
+ p[1] = '%';
+ p[2] = 'n';
+ p[3] = '\0';
+#else
+ p[1] = '\0';
+#endif
+
+ /* Construct the arguments for calling snprintf or sprintf. */
+ prefix_count = 0;
+ if (dp->width_arg_index >= 0)
+ {
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+ }
+ if (dp->precision_arg_index >= 0)
+ {
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+ }
+
+#if HAVE_SNPRINTF
+ /* Prepare checking whether snprintf returns the count
+ via %n. */
+ ENSURE_ALLOCATION (length + 1);
+ result[length] = '\0';
+#endif
+
+ for (;;)
+ {
+ size_t maxlen;
+ int count;
+#if HAVE_SNPRINTF
+ int retcount;
+#endif
+
+ maxlen = allocated - length;
+ count = -1;
+
+#if HAVE_SNPRINTF
+ retcount = 0;
+
+#define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ retcount = snprintf (result + length, maxlen, buf, \
+ arg, &count); \
+ break; \
+ case 1: \
+ retcount = snprintf (result + length, maxlen, buf, \
+ prefixes[0], arg, &count); \
+ break; \
+ case 2: \
+ retcount = snprintf (result + length, maxlen, buf, \
+ prefixes[0], prefixes[1], arg, \
+ &count); \
+ break; \
+ default: \
+ abort (); \
+ }
+#else
+#define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ count = sprintf (tmp, buf, arg); \
+ break; \
+ case 1: \
+ count = sprintf (tmp, buf, prefixes[0], arg); \
+ break; \
+ case 2: \
+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+ arg); \
+ break; \
+ default: \
+ abort (); \
+ }
+#endif
+
+ switch (type)
+ {
+ case TYPE_SCHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_schar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UCHAR:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_SHORT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_short;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_USHORT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_int;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGINT:
+ {
+ long int arg = a.arg[dp->arg_index].a.a_longint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGINT:
+ {
+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_INT64_AND_I64
+ case TYPE_INT64:
+ {
+ __int64 arg = a.arg[dp->arg_index].a.a_int64;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT64:
+ {
+ unsigned __int64 arg = a.arg[dp->arg_index].a.a_uint64;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+#ifdef HAVE_LONG_LONG
+#ifndef HAVE_LONG_LONG_FORMAT
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ int width;
+ int precision;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index >= 0)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = (arg < 0 ? -arg : arg);
+ }
+ else
+ {
+ const char *digitp = dp->width_start;
+
+ do
+ width = width * 10 + (*digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ precision = -1;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index >= 0)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ precision = (arg < 0 ? 0 : arg);
+ }
+ else
+ {
+ const char *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ do
+ precision = precision * 10 + (*digitp++ - '0');
+ while (digitp != dp->precision_end);
+ }
+ }
+
+#if HAVE_SNPRINTF
+ count = print_long_long (result + length, maxlen,
+ width, precision,
+ dp->flags,
+ dp->conversion,
+ arg);
+#else
+ count = print_long_long (tmp, tmp_length,
+ width, precision,
+ dp->flags,
+ dp->conversion,
+ arg);
+#endif
+ }
+ break;
+#else
+ case TYPE_LONGLONGINT:
+ {
+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+#endif
+ case TYPE_DOUBLE:
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_CHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ {
+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_STRING:
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string == NULL
+ ? "(null)"
+ : a.arg[dp->arg_index].a.a_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string == NULL
+ ? L"(null)"
+ : a.arg[dp->arg_index].a.a_wide_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ {
+ void *arg = a.arg[dp->arg_index].a.a_pointer;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ default:
+ abort ();
+ }
+
+#if HAVE_SNPRINTF
+ /* Portability: Not all implementations of snprintf()
+ are ISO C 99 compliant. Determine the number of
+ bytes that snprintf() has produced or w...
[truncated message content] |
|
From: <sl...@us...> - 2013-06-14 18:50:53
|
Revision: 5538
http://sourceforge.net/p/navit/code/5538
Author: sleske
Date: 2013-06-14 18:50:51 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Fix:build/cmake:Remove unnecessary warning for user-defined setting.
Modified Paths:
--------------
trunk/navit/cmake/navit_macros.cmake
Modified: trunk/navit/cmake/navit_macros.cmake
===================================================================
--- trunk/navit/cmake/navit_macros.cmake 2013-06-14 18:50:39 UTC (rev 5537)
+++ trunk/navit/cmake/navit_macros.cmake 2013-06-14 18:50:51 UTC (rev 5538)
@@ -17,8 +17,6 @@
set(${VARIABLE}_REASON ${REASON})
string(REPLACE "/" "_" VARIABLE_NAMES ${VARIABLE})
set(${VARIABLE_NAMES}_LIBS ${ARGN})
- else()
- message(WARNING "Do not change user defined settings for ${VARIABLE}")
endif()
set(${VARIABLE}_AUTODETECTED_VALUE ${ENABLE} CACHE INTERNAL "value autodetected by build script")
endmacro()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-14 18:50:42
|
Revision: 5537
http://sourceforge.net/p/navit/code/5537
Author: sleske
Date: 2013-06-14 18:50:39 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Refactor:core:Rename switch ENABLE_NLS to USE_NATIVE_LANGUAGE_SUPPORT for consistency.
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
trunk/navit/Makefile.am
trunk/navit/config.h.cmake
trunk/navit/configure.in
trunk/navit/navit/intl_cmake/relocatable.c
trunk/navit/navit/main.c
trunk/navit/navit/navit_nls.c
trunk/navit/navit/support/glib/glibintl.h
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/CMakeLists.txt 2013-06-14 18:50:39 UTC (rev 5537)
@@ -95,7 +95,7 @@
add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
add_module(autoload/osso "Default" FALSE)
add_module(map/garmin "Garmin library not found" FALSE)
-add_feature(ENABLE_NLS "Gettext not found and not on Windows" FALSE)
+add_feature(USE_NATIVE_LANGUAGE_SUPPORT "Gettext not found and not on Windows" FALSE)
INCLUDE (CPack)
INCLUDE (CheckIncludeFiles)
@@ -353,7 +353,7 @@
endif(LIBOSSO_FOUND)
if (GETTEXT_FOUND)
- set_with_reason(ENABLE_NLS "Gettext found" TRUE)
+ set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE)
endif(GETTEXT_FOUND)
#Independent modules
@@ -488,7 +488,7 @@
set(HAVE_PRAGMA_PACK 1)
add_plugin(support/xgetopt "Windows detected" TRUE)
endif(MSVC)
- set_with_reason(ENABLE_NLS "Windows detected" TRUE)
+ set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Windows detected" TRUE)
enable_language(RC)
set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
@@ -694,6 +694,6 @@
add_subdirectory (man)
-if (ENABLE_NLS)
+if (USE_NATIVE_LANGUAGE_SUPPORT)
add_subdirectory (po)
-endif(ENABLE_NLS)
+endif(USE_NATIVE_LANGUAGE_SUPPORT)
Modified: trunk/navit/Makefile.am
===================================================================
--- trunk/navit/Makefile.am 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/Makefile.am 2013-06-14 18:50:39 UTC (rev 5537)
@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS= -I m4
include $(top_srcdir)/Makefile.inc
SUBDIRS=
-if ENABLE_NLS
+if USE_NATIVE_LANGUAGE_SUPPORT
XCFLAGS=-DINSTALLPREFIX=INSTALLDIR
if SUPPORT_WIN32
XCFLAGS+=-DSUBLANG_BENGALI_BANGLADESH=0x03 -DSUBLANG_PUNJABI_PAKISTAN=0x03 -DSUBLANG_ROMANIAN_MOLDOVA=0x03
Modified: trunk/navit/config.h.cmake
===================================================================
--- trunk/navit/config.h.cmake 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/config.h.cmake 2013-06-14 18:50:39 UTC (rev 5537)
@@ -1,4 +1,4 @@
-#cmakedefine ENABLE_NLS 1
+#cmakedefine USE_NATIVE_LANGUAGE_SUPPORT 1
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_SYS_MOUNT_H 1
#cmakedefine HAVE_STDINT_H 1
Modified: trunk/navit/configure.in
===================================================================
--- trunk/navit/configure.in 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/configure.in 2013-06-14 18:50:39 UTC (rev 5537)
@@ -777,7 +777,7 @@
LINGUAS="$LINGUAS$lcode "
done
fi
- AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
+ AC_DEFINE(USE_NATIVE_LANGUAGE_SUPPORT, [1], [NLS Please])
echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
else
LINGUAS=""
@@ -813,7 +813,7 @@
fi
fi
-AM_CONDITIONAL(ENABLE_NLS, [test "x$enable_nls" = "xyes"])
+AM_CONDITIONAL(USE_NATIVE_LANGUAGE_SUPPORT, [test "x$enable_nls" = "xyes"])
AM_CONDITIONAL(XGETTEXT_GLADE, [test "x$xgettext_glade" = "xyes"])
AC_CHECK_HEADER(
byteswap.h,
Modified: trunk/navit/navit/intl_cmake/relocatable.c
===================================================================
--- trunk/navit/navit/intl_cmake/relocatable.c 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/navit/intl_cmake/relocatable.c 2013-06-14 18:50:39 UTC (rev 5537)
@@ -56,7 +56,7 @@
#if DEPENDS_ON_LIBICONV && HAVE_ICONV
# include <iconv.h>
#endif
-#if DEPENDS_ON_LIBINTL && ENABLE_NLS
+#if DEPENDS_ON_LIBINTL && USE_NATIVE_LANGUAGE_SUPPORT
# include <libintl.h>
#endif
@@ -152,7 +152,7 @@
#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
#endif
-#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
+#if DEPENDS_ON_LIBINTL && USE_NATIVE_LANGUAGE_SUPPORT && defined libintl_set_relocation_prefix
libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
#endif
}
Modified: trunk/navit/navit/main.c
===================================================================
--- trunk/navit/navit/main.c 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/navit/main.c 2013-06-14 18:50:39 UTC (rev 5537)
@@ -415,7 +415,7 @@
void
main_init_nls(void)
{
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
#ifdef FORCE_LOCALE
#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)
Modified: trunk/navit/navit/navit_nls.c
===================================================================
--- trunk/navit/navit/navit_nls.c 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/navit/navit_nls.c 2013-06-14 18:50:39 UTC (rev 5537)
@@ -12,7 +12,7 @@
char *
navit_nls_add_textdomain(const char *package, const char *dir)
{
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
char *ret=bindtextdomain(package, dir);
bind_textdomain_codeset(package, "UTF-8");
textdomains=g_list_append(textdomains, g_strdup(package));
@@ -23,7 +23,7 @@
void
navit_nls_remove_textdomain(const char *package)
{
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
if (!strcmp(i->data, package)) {
@@ -39,7 +39,7 @@
const char *
navit_nls_gettext(const char *msgid)
{
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
const char *ret=dgettext(i->data, msgid);
@@ -54,7 +54,7 @@
const char *
navit_nls_ngettext(const char *msgid, const char *msgid_plural, unsigned long int n)
{
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
const char *ret=dngettext(i->data, msgid, msgid_plural, n);
Modified: trunk/navit/navit/support/glib/glibintl.h
===================================================================
--- trunk/navit/navit/support/glib/glibintl.h 2013-06-14 18:50:24 UTC (rev 5536)
+++ trunk/navit/navit/support/glib/glibintl.h 2013-06-14 18:50:39 UTC (rev 5537)
@@ -9,7 +9,7 @@
G_CONST_RETURN gchar *glib_gettext (const gchar *str);
-#ifdef ENABLE_NLS
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
#include "navit_nls.h"
#undef _
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-14 18:50:27
|
Revision: 5536
http://sourceforge.net/p/navit/code/5536
Author: sleske
Date: 2013-06-14 18:50:24 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Fix:build/cmake:Make CMake variable ENABLE_NLS work.
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2013-06-14 18:50:13 UTC (rev 5535)
+++ trunk/navit/CMakeLists.txt 2013-06-14 18:50:24 UTC (rev 5536)
@@ -95,7 +95,7 @@
add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
add_module(autoload/osso "Default" FALSE)
add_module(map/garmin "Garmin library not found" FALSE)
-add_feature(ENABLE_NLS "default" TRUE)
+add_feature(ENABLE_NLS "Gettext not found and not on Windows" FALSE)
INCLUDE (CPack)
INCLUDE (CheckIncludeFiles)
@@ -352,6 +352,10 @@
set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES})
endif(LIBOSSO_FOUND)
+if (GETTEXT_FOUND)
+ set_with_reason(ENABLE_NLS "Gettext found" TRUE)
+endif(GETTEXT_FOUND)
+
#Independent modules
add_module(graphics/null "Default" TRUE)
add_module(osd/core "Default" TRUE)
@@ -484,7 +488,7 @@
set(HAVE_PRAGMA_PACK 1)
add_plugin(support/xgetopt "Windows detected" TRUE)
endif(MSVC)
- set(ENABLE_NLS TRUE)
+ set_with_reason(ENABLE_NLS "Windows detected" TRUE)
enable_language(RC)
set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
@@ -690,6 +694,6 @@
add_subdirectory (man)
-if (GETTEXT_FOUND)
+if (ENABLE_NLS)
add_subdirectory (po)
-endif(GETTEXT_FOUND)
+endif(ENABLE_NLS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-14 18:50:16
|
Revision: 5535
http://sourceforge.net/p/navit/code/5535
Author: sleske
Date: 2013-06-14 18:50:13 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Refactor:build/cmake:Better comments & variable name.
Modified Paths:
--------------
trunk/navit/cmake/navit_macros.cmake
Modified: trunk/navit/cmake/navit_macros.cmake
===================================================================
--- trunk/navit/cmake/navit_macros.cmake 2013-06-14 18:49:50 UTC (rev 5534)
+++ trunk/navit/cmake/navit_macros.cmake 2013-06-14 18:50:13 UTC (rev 5535)
@@ -1,14 +1,14 @@
macro(set_feature_switch_default VARIABLE REASON ENABLE)
- if ((NOT DEFINED ${VARIABLE}) # variable not in cache (first run)
- OR ((DEFINED ${VARIABLE}_ORIGINAL) AND # variable in cache -> check for change
- ((${VARIABLE}_ORIGINAL AND ${VARIABLE}) OR # poor man's boolean equal
- (NOT ${VARIABLE}_ORIGINAL AND NOT ${VARIABLE}))))
+ if ((NOT DEFINED ${VARIABLE}) # variable not in cache (first run)
+ OR ((DEFINED ${VARIABLE}_AUTODETECTED_VALUE) AND # variable in cache -> different from autodetected value?
+ ((${VARIABLE}_AUTODETECTED_VALUE AND ${VARIABLE}) OR # poor man's boolean equal
+ (NOT ${VARIABLE}_AUTODETECTED_VALUE AND NOT ${VARIABLE}))))
set(${VARIABLE}_REASON ${REASON})
set(${VARIABLE} ${ENABLE} CACHE BOOL "feature switch" FORCE)
else()
set(${VARIABLE}_REASON "User defined")
endif()
- set(${VARIABLE}_ORIGINAL ${ENABLE} CACHE INTERNAL "original value set by build script")
+ set(${VARIABLE}_AUTODETECTED_VALUE ${ENABLE} CACHE INTERNAL "value autodetected by build script")
endmacro()
macro(set_with_reason VARIABLE REASON ENABLE)
@@ -20,7 +20,7 @@
else()
message(WARNING "Do not change user defined settings for ${VARIABLE}")
endif()
- set(${VARIABLE}_ORIGINAL ${ENABLE} CACHE INTERNAL "original value set by build script")
+ set(${VARIABLE}_AUTODETECTED_VALUE ${ENABLE} CACHE INTERNAL "value autodetected by build script")
endmacro()
macro(add_feature FEATURE REASON ENABLE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-06-14 18:49:55
|
Revision: 5534
http://sourceforge.net/p/navit/code/5534
Author: sleske
Date: 2013-06-14 18:49:50 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Fix:build/cmake:Remember user settings (-Dxxx=xxx) across CMake runs.
Modified Paths:
--------------
trunk/navit/cmake/navit_macros.cmake
Modified: trunk/navit/cmake/navit_macros.cmake
===================================================================
--- trunk/navit/cmake/navit_macros.cmake 2013-06-09 18:52:12 UTC (rev 5533)
+++ trunk/navit/cmake/navit_macros.cmake 2013-06-14 18:49:50 UTC (rev 5534)
@@ -14,13 +14,13 @@
macro(set_with_reason VARIABLE REASON ENABLE)
if (DEFINED ${VARIABLE}_REASON AND NOT ${VARIABLE}_REASON STREQUAL "User defined")
set(${VARIABLE} ${ENABLE} CACHE BOOL "feature switch" FORCE)
- set(${VARIABLE}_ORIGINAL ${ENABLE} CACHE INTERNAL "original value set by build script")
set(${VARIABLE}_REASON ${REASON})
string(REPLACE "/" "_" VARIABLE_NAMES ${VARIABLE})
set(${VARIABLE_NAMES}_LIBS ${ARGN})
else()
message(WARNING "Do not change user defined settings for ${VARIABLE}")
endif()
+ set(${VARIABLE}_ORIGINAL ${ENABLE} CACHE INTERNAL "original value set by build script")
endmacro()
macro(add_feature FEATURE REASON ENABLE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-06-09 18:52:14
|
Revision: 5533
http://sourceforge.net/p/navit/code/5533
Author: martin-s
Date: 2013-06-09 18:52:12 +0000 (Sun, 09 Jun 2013)
Log Message:
-----------
Fix:graphics_gtk_drawing_area:Use gdk_pixbuf_loader instead of GInputStream for loading images from memory for better compatibility
Modified Paths:
--------------
trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
Modified: trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
===================================================================
--- trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2013-06-02 18:35:27 UTC (rev 5532)
+++ trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2013-06-09 18:52:12 UTC (rev 5533)
@@ -23,7 +23,6 @@
#include <signal.h>
#include <sys/time.h>
#include <gtk/gtk.h>
-#include <gio/gio.h>
#include <gdk/gdkkeysyms.h>
#include <locale.h> /* For WIN32 */
#if !defined(GDK_Book) || !defined(GDK_Calendar)
@@ -228,20 +227,21 @@
image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation)
{
GdkPixbuf *pixbuf;
- GInputStream *stream;
struct graphics_image_priv *ret;
const char *option;
if (!strcmp(name,"buffer:")) {
struct graphics_image_buffer *buffer=(struct graphics_image_buffer *)name;
- stream=g_memory_input_stream_new_from_data(buffer->start, buffer->len, NULL);
- if (!stream)
+ GdkPixbufLoader *loader=gdk_pixbuf_loader_new();
+ if (!loader)
return NULL;
- if (*w == -1 && *h == -1)
- pixbuf=gdk_pixbuf_new_from_stream(stream, NULL, NULL);
- else
- pixbuf=gdk_pixbuf_new_from_stream_at_scale(stream, *w, *h, TRUE, NULL, NULL);
-
+ if (*w != -1 || *h != -1)
+ gdk_pixbuf_loader_set_size(loader, *w, *h);
+ gdk_pixbuf_loader_write(loader, buffer->start, buffer->len, NULL);
+ gdk_pixbuf_loader_close(loader, NULL);
+ pixbuf=gdk_pixbuf_loader_get_pixbuf(loader);
+ g_object_ref(pixbuf);
+ g_object_unref(loader);
} else {
if (*w == -1 && *h == -1)
pixbuf=gdk_pixbuf_new_from_file(name, NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-06-02 18:35:36
|
Revision: 5532
http://navit.svn.sourceforge.net/navit/?rev=5532&view=rev
Author: martin-s
Date: 2013-06-02 18:35:27 +0000 (Sun, 02 Jun 2013)
Log Message:
-----------
Fix:graphics_gtk_drawing_area:Include required file
Modified Paths:
--------------
trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
Modified: trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
===================================================================
--- trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2013-06-02 08:59:45 UTC (rev 5531)
+++ trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2013-06-02 18:35:27 UTC (rev 5532)
@@ -23,6 +23,7 @@
#include <signal.h>
#include <sys/time.h>
#include <gtk/gtk.h>
+#include <gio/gio.h>
#include <gdk/gdkkeysyms.h>
#include <locale.h> /* For WIN32 */
#if !defined(GDK_Book) || !defined(GDK_Calendar)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-06-02 08:59:51
|
Revision: 5531
http://navit.svn.sourceforge.net/navit/?rev=5531&view=rev
Author: mdankov
Date: 2013-06-02 08:59:45 +0000 (Sun, 02 Jun 2013)
Log Message:
-----------
Fix:core:Format string in start_real.c|Thank you christianschwamborn
Modified Paths:
--------------
trunk/navit/navit/start_real.c
Modified: trunk/navit/navit/start_real.c
===================================================================
--- trunk/navit/navit/start_real.c 2013-06-01 21:57:54 UTC (rev 5530)
+++ trunk/navit/navit/start_real.c 2013-06-02 08:59:45 UTC (rev 5531)
@@ -184,7 +184,7 @@
for (;;) {
if (li == NULL) {
// We have not found an existing config file from all possibilities
- dbg(0,_("No config file navit.xml, navit.xml.local found\n"));
+ dbg(0, "%s", _("No config file navit.xml, navit.xml.local found\n"));
return 4;
}
// Try the next config file possibility from the list
@@ -209,7 +209,7 @@
}
g_list_free(list);
if (! config_get_attr(config, attr_navit, &navit, NULL) && !config_empty_ok) {
- dbg(0, _("Internal initialization failed, exiting. Check previous error messages.\n"));
+ dbg(0, "%s", _("Internal initialization failed, exiting. Check previous error messages.\n"));
exit(5);
}
conf.type=attr_config;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|