From c090a0fd840440a924c08cc9bc6c256d16635a7a Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 26 Jul 2010 22:05:39 +0000 Subject: [PATCH] * updated ICU build packages with newer builds that try a bit harder to avoid warnings and incorporate some of the ICU-patches we had in our repo before we upgraded to 4.4.1 * fixed remaining warnings when building locale kit * activated EnableWerror for locale kit * added 'Unicode' license, which is the second license in use by ICU git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37763 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/BuildSetup | 2 +- build/jam/OptionalBuildFeatures | 6 ++-- data/system/data/licenses/Unicode | 48 +++++++++++++++++++++++++++ headers/os/locale/Locale.h | 4 +++ src/bin/locale/collectcatkeys.cpp | 6 ++-- src/kits/locale/Country.cpp | 2 +- src/kits/locale/LocaleRoster.cpp | 5 --- src/tools/locale/DefaultCatalog.cpp | 6 ++-- src/tools/locale/PlainTextCatalog.cpp | 2 +- src/tools/locale/linkcatkeys.cpp | 6 ++-- 10 files changed, 67 insertions(+), 20 deletions(-) create mode 100644 data/system/data/licenses/Unicode diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index d3aaafccac..d71b3d5fa8 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -1377,7 +1377,7 @@ if $(HAIKU_NO_WERROR) != 1 { EnableWerror src kits device ; EnableWerror src kits game ; EnableWerror src kits interface ; -# EnableWerror src kits locale ; + EnableWerror src kits locale ; EnableWerror src kits mail ; # EnableWerror src kits media ; # gcc2 EnableWerror src kits midi ; diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 8ef984f126..fb2b4260ab 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -50,9 +50,9 @@ if $(HAIKU_BUILD_FEATURE_SSL) { # ICU # Note ICU isn't actually optional, but is still an external package -HAIKU_ICU_GCC_2_PACKAGE = icu-4.4.1-x86-gcc2-2010-07-15.zip ; -HAIKU_ICU_GCC_4_PACKAGE = icu-4.4.1-x86-gcc4-2010-07-15.zip ; -HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.4.1-2010-07-15.zip ; +HAIKU_ICU_GCC_2_PACKAGE = icu-4.4.1-x86-gcc2-2010-07-26.zip ; +HAIKU_ICU_GCC_4_PACKAGE = icu-4.4.1-x86-gcc4-2010-07-26.zip ; +HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.4.1-2010-07-26.zip ; if $(TARGET_ARCH) != x86 { Echo "ICU not available for $(TARGET_ARCH)" ; diff --git a/data/system/data/licenses/Unicode b/data/system/data/licenses/Unicode new file mode 100644 index 0000000000..900059f882 --- /dev/null +++ b/data/system/data/licenses/Unicode @@ -0,0 +1,48 @@ +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + + Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/ . Unicode Software includes any source code +published in the Unicode Standard or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/. + + NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES +("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND +AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU +DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES +OR SOFTWARE. + + COPYRIGHT AND PERMISSION NOTICE + + Copyright © 1991-2009 Unicode, Inc. All rights reserved. Distributed under +the Terms of Use in http://www.unicode.org/copyright.html. + + Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and any associated documentation (the "Data Files") or +Unicode software and any associated documentation (the "Software") to deal in +the Data Files or Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files or +Software are furnished to do so, provided that (a) the above copyright notice(s) +and this permission notice appear with all copies of the Data Files or Software, +(b) both the above copyright notice(s) and this permission notice appear in +associated documentation, and (c) there is clear notice in each modified Data +File or in the Software as well as in the documentation associated with the Data +File(s) or Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR +SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. \ No newline at end of file diff --git a/headers/os/locale/Locale.h b/headers/os/locale/Locale.h index ee0fc6a74f..1ff9ab0ad5 100644 --- a/headers/os/locale/Locale.h +++ b/headers/os/locale/Locale.h @@ -1,3 +1,7 @@ +/* + * Copyright 2003-2010, Haiku, Inc. + * Distributed under the terms of the MIT License. + */ #ifndef _B_LOCALE_H_ #define _B_LOCALE_H_ diff --git a/src/bin/locale/collectcatkeys.cpp b/src/bin/locale/collectcatkeys.cpp index 97e7b2b4f9..6fd00bce74 100644 --- a/src/bin/locale/collectcatkeys.cpp +++ b/src/bin/locale/collectcatkeys.cpp @@ -184,10 +184,10 @@ collectAllCatalogKeys(BString& inputStr) if (fetchKey(in)) { if (haveID) { if (showKeys) - printf("CatKey(%d)\n", id); + printf("CatKey(%ld)\n", id); res = catalog->SetString(id, ""); if (res != B_OK) { - fprintf(stderr, "couldn't add key %d - error: %s\n", + fprintf(stderr, "couldn't add key %ld - error: %s\n", id, strerror(res)); exit(-1); } @@ -301,7 +301,7 @@ main(int argc, char **argv) if (showSummary) { int32 count = catalog->CountItems(); if (count) - fprintf(stderr, "%d key%s found and written to %s\n", + fprintf(stderr, "%ld key%s found and written to %s\n", count, (count==1 ? "": "s"), outputFile.String()); else fprintf(stderr, "no keys found\n"); diff --git a/src/kits/locale/Country.cpp b/src/kits/locale/Country.cpp index fb309b680a..54c973a2c5 100644 --- a/src/kits/locale/Country.cpp +++ b/src/kits/locale/Country.cpp @@ -1063,7 +1063,7 @@ BCountry::GetTimeZones(BList& timezones) std::map timeZoneMap; // The map allows us to remove duplicates and get a count of the // remaining zones after that - while (tzName = icuTimeZoneList->next(NULL, error)) { + while ((tzName = icuTimeZoneList->next(NULL, error)) != NULL) { if (error == U_ZERO_ERROR) { BString readableName; BTimeZone* timeZone = new BTimeZone(tzName); diff --git a/src/kits/locale/LocaleRoster.cpp b/src/kits/locale/LocaleRoster.cpp index 417bc26600..4ebe416c02 100644 --- a/src/kits/locale/LocaleRoster.cpp +++ b/src/kits/locale/LocaleRoster.cpp @@ -370,11 +370,6 @@ RosterData::InitializeCatalogAddOns() } } fCatalogAddOnInfos.SortItems(CompareInfos); - - for (int32 i = 0; i(fCatalogAddOnInfos.ItemAt(i)); - } } diff --git a/src/tools/locale/DefaultCatalog.cpp b/src/tools/locale/DefaultCatalog.cpp index 2ab23b6b6f..3510fc2b49 100644 --- a/src/tools/locale/DefaultCatalog.cpp +++ b/src/tools/locale/DefaultCatalog.cpp @@ -142,7 +142,7 @@ DefaultCatalog::ReadFromFile(const char *path) } if (res < sz) { fprintf(stderr, - "only got %lu instead of %Lu bytes from catalog-file %s\n", res, sz, + "only got %u instead of %Lu bytes from catalog-file %s\n", res, sz, path); return res; } @@ -329,7 +329,7 @@ DefaultCatalog::Unflatten(BDataIO *dataIO) if (foundFingerprint != 0 && fFingerprint != 0 && foundFingerprint != fFingerprint) { fprintf(stderr, "default-catalog(sig=%s, lang=%s) " - "has mismatching fingerprint (%ld instead of the requested %ld)" + "has mismatching fingerprint (%d instead of the requested %d)" ", so this catalog is skipped.\n", fSignature.String(), fLanguageName.String(), foundFingerprint, fFingerprint); @@ -369,7 +369,7 @@ DefaultCatalog::Unflatten(BDataIO *dataIO) uint32 checkFP = ComputeFingerprint(); if (fFingerprint != checkFP) { fprintf(stderr, "default-catalog(sig=%s, lang=%s) " - "has wrong fingerprint after load (%ld instead of the %ld). " + "has wrong fingerprint after load (%d instead of %d). " "The catalog data may be corrupted, so this catalog is " "skipped.\n", fSignature.String(), fLanguageName.String(), checkFP, diff --git a/src/tools/locale/PlainTextCatalog.cpp b/src/tools/locale/PlainTextCatalog.cpp index 7e8bbc55c2..7abb1bb49e 100644 --- a/src/tools/locale/PlainTextCatalog.cpp +++ b/src/tools/locale/PlainTextCatalog.cpp @@ -231,7 +231,7 @@ PlainTextCatalog::ReadFromFile(const char *path) uint32 checkFP = ComputeFingerprint(); if (fFingerprint != checkFP) { fprintf(stderr, "plaintext-catalog(sig=%s, lang=%s) " - "has wrong fingerprint after load (%lX instead of %lX). " + "has wrong fingerprint after load (%X instead of %X). " "The catalog data may be corrupted, so this catalog is " "skipped.\n", fSignature.String(), fLanguageName.String(), checkFP, diff --git a/src/tools/locale/linkcatkeys.cpp b/src/tools/locale/linkcatkeys.cpp index ff68beb886..6fe3d6a20a 100644 --- a/src/tools/locale/linkcatkeys.cpp +++ b/src/tools/locale/linkcatkeys.cpp @@ -88,7 +88,7 @@ main(int argc, char **argv) if (inputFiles.empty() || !catalogSig || !outputFile.Length()) usage(); - DefaultCatalog targetCatImpl(outputFile.String(), catalogSig, + DefaultCatalog targetCatImpl(outputFile.String(), catalogSig, catalogLang.String()); if ((res = targetCatImpl.InitCheck()) != B_OK) { fprintf(stderr, "couldn't construct target-catalog %s - error: %s\n", @@ -98,7 +98,7 @@ main(int argc, char **argv) uint32 count = inputFiles.size(); for (uint32 i = 0; i < count; ++i) { - PlainTextCatalog inputCatalog(inputFiles[i], catalogSig, + PlainTextCatalog inputCatalog(inputFiles[i], catalogSig, catalogLang.String()); if ((res = inputCatalog.ReadFromFile()) != B_OK) { fprintf(stderr, "couldn't load source-catalog %s - error: %s\n", @@ -160,7 +160,7 @@ main(int argc, char **argv) if (showSummary) { int32 count = targetCatImpl.CountItems(); if (count) { - fprintf(stderr, "%ld key%s found and written to %s\n", + fprintf(stderr, "%d key%s found and written to %s\n", count, (count==1 ? "": "s"), outputFile.String()); } else fprintf(stderr, "no keys found\n");