[haiku-commits] r37602 - in haiku/trunk: headers/os/locale src/kits/locale src/tools/locale

Author: pulkomandy
Date: 2010-07-19 17:47:06 +0200 (Mon, 19 Jul 2010)
New Revision: 37602
Changeset: http://dev.haiku-os.org/changeset/37602

Modified:
   haiku/trunk/headers/os/locale/Catalog.h
   haiku/trunk/src/kits/locale/CatalogStub.cpp
   haiku/trunk/src/kits/locale/HashMapCatalog.cpp
   haiku/trunk/src/tools/locale/HashMapCatalog.cpp
Log:
 * Fix \x parsing in collectcatkeys again (thanks to Kaliber)
 * Hide the CatalogStub::GetCatalog method so that if liblocalestub.a is 
missing from a localized image, it will not try to steal the catalog of another 
one.


Modified: haiku/trunk/headers/os/locale/Catalog.h
===================================================================
--- haiku/trunk/headers/os/locale/Catalog.h     2010-07-19 15:31:08 UTC (rev 
37601)
+++ haiku/trunk/headers/os/locale/Catalog.h     2010-07-19 15:47:06 UTC (rev 
37602)
@@ -57,7 +57,8 @@
 // This must be included (statically linked) into each shared object needing
 // a catalog on its own (application, add-on, library, ...). The shared object
 // must also have a mimetype so that the catalog can be identified.
-class BCatalogStub {
+class BCatalogStub 
+{
        private:
                static BCatalog sCatalog;
                static vint32   sCatalogInitOnce;

Modified: haiku/trunk/src/kits/locale/CatalogStub.cpp
===================================================================
--- haiku/trunk/src/kits/locale/CatalogStub.cpp 2010-07-19 15:31:08 UTC (rev 
37601)
+++ haiku/trunk/src/kits/locale/CatalogStub.cpp 2010-07-19 15:47:06 UTC (rev 
37602)
@@ -19,10 +19,15 @@
 /* static */ BCatalog*
 BCatalogStub::GetCatalog()
 {
+       #if (__GNUC__ < 3)
+               asm volatile(".hidden GetCatalog__12BCatalogStub");
+       #else
+               asm volatile(".hidden _ZN12BCatalogStub10GetCatalogEv");
+       #endif
+
        return be_locale_roster->GetCatalog(&sCatalog, &sCatalogInitOnce);
 }
 
-
 /* static */ void
 BCatalogStub::ForceReload()
 {

Modified: haiku/trunk/src/kits/locale/HashMapCatalog.cpp
===================================================================
--- haiku/trunk/src/kits/locale/HashMapCatalog.cpp      2010-07-19 15:31:08 UTC 
(rev 37601)
+++ haiku/trunk/src/kits/locale/HashMapCatalog.cpp      2010-07-19 15:47:06 UTC 
(rev 37602)
@@ -164,7 +164,7 @@
                                char tmp[3];
                                tmp[0] = *(in+1);
                                tmp[1] = *(in+2);
-                               tmp[3] = '\0';
+                               tmp[2] = '\0';
                                unsigned int hexchar = strtoul(tmp, NULL, 16);
                                *out = hexchar;
                                // skip the number

Modified: haiku/trunk/src/tools/locale/HashMapCatalog.cpp
===================================================================
--- haiku/trunk/src/tools/locale/HashMapCatalog.cpp     2010-07-19 15:31:08 UTC 
(rev 37601)
+++ haiku/trunk/src/tools/locale/HashMapCatalog.cpp     2010-07-19 15:47:06 UTC 
(rev 37602)
@@ -168,7 +168,7 @@
                                char tmp[3];
                                tmp[0] = *(in+1);
                                tmp[1] = *(in+2);
-                               tmp[3] = '\0';
+                               tmp[2] = '\0';
                                unsigned int hexchar = strtoul(tmp, NULL, 16);
                                *out = hexchar;
                                // skip the number


Other related posts: