Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#1114 closed defect/bug (fixed)

WinCE Route Description turn point error

Reported by: алексей черепанов Owned by:
Priority: major Milestone:
Component: port/wince Version: git master
Severity: Keywords:
Cc:

Description

On WinCE when select Route Description turn points are

"Turn $s$s $s$s"

and don't contain any information.

Attachments (1)

patch_svn5496_printf_wince.diff (92.9 KB) - added by ftom.myopenid.com 5 years ago.
patch generated by svn diff, uses glib/gnulib printf for wince build

Download all attachments as: .zip

Change History (12)

comment:1 Changed 5 years ago by tryagain

Same as #1115, I can't reproduce, most probably you've ran out of memory...

comment:2 Changed 5 years ago by алексей черепанов

I set cache_size="500000" as you propose in http://trac.navit-project.org/ticket/1115 and there is no effect. There was no this bug a few week ago. I was very surprised when I found it today.

Last edited 5 years ago by алексей черепанов (previous) (diff)

comment:3 Changed 5 years ago by алексей черепанов

I have explored SVN and found that error starts with r5467, previous r5463 shows route description correctly.

Last edited 5 years ago by алексей черепанов (previous) (diff)

comment:4 Changed 5 years ago by алексей черепанов

It is very strange. Something is wrong with glib support on WinCE. Format specification %n$s doesn't work correctly. I made it work with this patch.

Index: navit/navigation.c
===================================================================
--- navit/navigation.c  (revision 5490)
+++ navit/navigation.c  (working copy)
@@ -1675,10 +1675,12 @@
 
                if (level != -2) {
                        /* 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' */
-                       ret=g_strdup_printf(_("Turn %1$s%2$s %3$s%4$s"), strength, dir, d, destination ? destination:"");
+//                     ret=g_strdup_printf(_("Turn %1$s%2$s %3$s%4$s"), strength, dir, d, destination ? destination:"");
+                       ret=g_strdup_printf(_("Turn %s%s %s%s"), strength, dir, d, destination ? destination:"");
                } else {
                        /* TRANSLATORS: First argument is strength, second direction, third how many roads to skip, fourth destination */
-                       ret=g_strdup_printf(_("then turn %1$s%2$s %3$s%4$s"), strength, dir, d, destination ? destination:"");
+//                     ret=g_strdup_printf(_("then turn %1$s%2$s %3$s%4$s"), strength, dir, d, destination ? destination:"");
+                       ret=g_strdup_printf(_("then turn %s%s %s%s"), strength, dir, d, destination ? destination:"");
                }
                g_free(destination);
        } else {
Index: po/ru.po.in
===================================================================
--- po/ru.po.in (revision 5490)
+++ po/ru.po.in (working copy)
@@ -243,13 +243,13 @@
 
 #. 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 "Сверните %1$s%2$s %3$s%4$s"
+msgid "Turn %s%s %s%s"
+msgstr "Поверните %s %s %s %s"
 
 #. TRANSLATORS: First argument is strength, second direction, third how many roads to skip, fourth destination
 #, c-format
-msgid "then turn %1$s%2$s %3$s%4$s"
-msgstr "после чего поверните %1$s%2$s на %3$s%4$s"
+msgid "then turn %s%s %s%s"
+msgstr "после чего поверните %s%s на %s%s"
 
 #, c-format
 msgid "You have reached your destination %s"

comment:5 Changed 5 years ago by ftom.myopenid.com

Same here on my Windows Embedded CE 6.0 Core device.

I am not sure, but it seems that the define HAVE_GOOD_PRINTF (used in support/glib/gprintfint.h) is set, so the printf functions of the library coming with the compiler are used.

The CeGCC uses newlib. There is a switch "_WANT_IO_POS_ARGS" to (de)activate positional arguments: http://sourceforge.net/p/cegcc/code/HEAD/tree/trunk/cegcc/src/newlib/newlib/newlib.hin Perhaps this option is deactivated in the compiler package 0.59.1?

Changed 5 years ago by ftom.myopenid.com

patch generated by svn diff, uses glib/gnulib printf for wince build

comment:6 Changed 5 years ago by ftom.myopenid.com

I have added a patch which uses the glib/gnulib printf implementation instead of the compiler/toolchains printf. The gnulib-printf files comes from the offical glib package. It supports positional arguments and fixes the described issue on my Win CE device.

comment:7 Changed 5 years ago by алексей черепанов

Thanks. It works.

comment:8 Changed 5 years ago by hyperentang.wordpress.com

I am seeing this problem in navit-svn-5532 downloaded today. winCE core 5.0. If I understand above, this should have been fixed?

comment:9 Changed 5 years ago by алексей черепанов

I compiled Navit with this patch and got working executable. But this patch is not included in SVN yet.

comment:10 Changed 5 years ago by tryagain

  • Resolution set to fixed
  • Status changed from new to closed

Hi!

Thank you for your help in tracing it down and for the patch. Patch was modified to not compile the dead *printf code on OSes (Android, for example), for which builds depend on support/glib but do not require printf replacement.

Fixed with r5539.

comment:11 Changed 4 years ago by tryagain

By the time r5539 was commited we already had printf positional arguments implementation imported with libintl as part of autotools and its copy under navit/intl_cmake.

So I have reverted the r5539 and fixed the bug again with r5554, avoiding unnecessary import of similar code under glib.

tryagain.

Note: See TracTickets for help on using tickets.