[Libreoffice-commits] core.git: unoidl/source

2023-11-16 Thread Stephan Bergmann (via logerrit)
 unoidl/source/sourceprovider-parser.y |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 363b4078be25b41f3226485abd3818964d7d9cd3
Author: Stephan Bergmann 
AuthorDate: Thu Nov 16 21:24:04 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 17 08:12:20 2023 +0100

Manual extended loplugin:ostr change

Change-Id: I003851390566dfe2b98cecc88afc8153f061ad68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159522
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index abe17e3558d8..f3510cb17b7e 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -3967,9 +3967,9 @@ name:
 
 identifier:
   TOK_IDENTIFIER
-| TOK_GET { $$ = new OString("get"); }
-| TOK_PUBLISHED { $$ = new OString("published"); }
-| TOK_SET { $$ = new OString("set"); }
+| TOK_GET { $$ = new OString("get"_ostr); }
+| TOK_PUBLISHED { $$ = new OString("published"_ostr); }
+| TOK_SET { $$ = new OString("set"_ostr); }
 ;
 
 deprecated_opt:


[Libreoffice-commits] core.git: unoidl/source unotest/source unotools/source unoxml/qa

2022-11-05 Thread jsala (via logerrit)
 unoidl/source/unoidl-write.cxx   |   12 ++--
 unotest/source/cpp/filters-test.cxx  |2 +-
 unotest/source/cpp/officeconnection.cxx  |3 +--
 unotools/source/config/compatibility.cxx |2 +-
 unotools/source/config/fontcfg.cxx   |5 ++---
 unotools/source/config/lingucfg.cxx  |   10 +++---
 unotools/source/config/searchopt.cxx |6 ++
 unotools/source/misc/fontcvt.cxx |   19 +--
 unoxml/qa/unit/domtest.cxx   |8 
 9 files changed, 25 insertions(+), 42 deletions(-)

New commits:
commit 04a58d7eae2b26559efd48ff7cdd23cec1c2187c
Author: jsala 
AuthorDate: Sat Jun 25 13:35:01 2022 +0200
Commit: Hossein 
CommitDate: Sun Nov 6 01:22:27 2022 +0100

tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro

Also change some range based for.

Change-Id: I32c5cbe0033c40cde3f1fc86ec8af90e558f2652
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141666
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 84cad5bdda69..042b72c0471e 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -130,7 +130,7 @@ void write8(osl::File & file, sal_uInt64 value) {
 }
 unsigned char buf[1];
 buf[0] = value & 0xFF;
-write(file, buf, SAL_N_ELEMENTS(buf));
+write(file, buf, std::size(buf));
 }
 
 void write16(osl::File & file, sal_uInt64 value) {
@@ -142,7 +142,7 @@ void write16(osl::File & file, sal_uInt64 value) {
 unsigned char buf[2];
 buf[0] = value & 0xFF;
 buf[1] = (value >> 8) & 0xFF;
-write(file, buf, SAL_N_ELEMENTS(buf));
+write(file, buf, std::size(buf));
 }
 
 void write32(osl::File & file, sal_uInt64 value) {
@@ -156,7 +156,7 @@ void write32(osl::File & file, sal_uInt64 value) {
 buf[1] = (value >> 8) & 0xFF;
 buf[2] = (value >> 16) & 0xFF;
 buf[3] = (value >> 24) & 0xFF;
-write(file, buf, SAL_N_ELEMENTS(buf));
+write(file, buf, std::size(buf));
 }
 
 void write64(osl::File & file, sal_uInt64 value) {
@@ -169,7 +169,7 @@ void write64(osl::File & file, sal_uInt64 value) {
 buf[5] = (value >> 40) & 0xFF;
 buf[6] = (value >> 48) & 0xFF;
 buf[7] = (value >> 56) & 0xFF;
-write(file, buf, SAL_N_ELEMENTS(buf));
+write(file, buf, std::size(buf));
 }
 
 void writeIso60599Binary32(osl::File & file, float value) {
@@ -182,7 +182,7 @@ void writeIso60599Binary32(osl::File & file, float value) {
 std::swap(sa.buf[0], sa.buf[3]);
 std::swap(sa.buf[1], sa.buf[2]);
 #endif
-write(file, sa.buf, SAL_N_ELEMENTS(sa.buf));
+write(file, sa.buf, std::size(sa.buf));
 }
 
 void writeIso60599Binary64(osl::File & file, double value) {
@@ -197,7 +197,7 @@ void writeIso60599Binary64(osl::File & file, double value) {
 std::swap(sa.buf[2], sa.buf[5]);
 std::swap(sa.buf[3], sa.buf[4]);
 #endif
-write(file, sa.buf, SAL_N_ELEMENTS(sa.buf));
+write(file, sa.buf, std::size(sa.buf));
 }
 
 OString toAscii(OUString const & name) {
diff --git a/unotest/source/cpp/filters-test.cxx 
b/unotest/source/cpp/filters-test.cxx
index 7adbd9ca4d4d..1eaaa6219783 100644
--- a/unotest/source/cpp/filters-test.cxx
+++ b/unotest/source/cpp/filters-test.cxx
@@ -29,7 +29,7 @@ static void decode(const OUString& rIn, const OUString )
 //mcrypt --bare -a arcfour -o hex -k 435645 -s 3
 const sal_uInt8 aKey[3] = {'C', 'V', 'E'};
 
-rtlCipherError result = rtl_cipher_init(cipher, 
rtl_Cipher_DirectionDecode, aKey, SAL_N_ELEMENTS(aKey), nullptr, 0);
+rtlCipherError result = rtl_cipher_init(cipher, 
rtl_Cipher_DirectionDecode, aKey, std::size(aKey), nullptr, 0);
 
 CPPUNIT_ASSERT_EQUAL_MESSAGE("cipher init failed", rtl_Cipher_E_None, 
result);
 
diff --git a/unotest/source/cpp/officeconnection.cxx 
b/unotest/source/cpp/officeconnection.cxx
index 649d636d0fa6..850b19440d00 100644
--- a/unotest/source/cpp/officeconnection.cxx
+++ b/unotest/source/cpp/officeconnection.cxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -81,7 +80,7 @@ void OfficeConnection::setUp() {
 osl_executeProcess(
 toAbsoluteFileUrl(
 argSoffice.copy(RTL_CONSTASCII_LENGTH("path:"))).pData,
-args, SAL_N_ELEMENTS(args), 0, nullptr, nullptr, envs, envs == 
nullptr ? 0 : 1,
+args, std::size(args), 0, nullptr, nullptr, envs, envs == 
nullptr ? 0 : 1,
 _));
 } else if (argSoffice.match("connect:")) {
 desc = argSoffice.copy(RTL_CONSTASCII_LENGTH("connect:"));
diff --git a/unotools/source/config/compatibility.cxx 
b/unotools/source/config/compatibility.cxx
index a5ac6ea895b4..4f0e1d2ac20c 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -96,7 +96,7 @@ OUString SvtCompatibilityEntry::getName( const Index rIdx )
 };
 
 /* Size of 

[Libreoffice-commits] core.git: unoidl/source

2021-10-14 Thread Stephan Bergmann (via logerrit)
 unoidl/source/sourceprovider-scanner.l |4 
 1 file changed, 4 deletions(-)

New commits:
commit 620179240670bd00f60555f1f5c5b0268492f97c
Author: Stephan Bergmann 
AuthorDate: Tue Sep 14 17:15:08 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 14 20:39:18 2021 +0200

Enforce the UNOIDL identifier scheme

...which reserves identifiers containing underscores and starting with a
lowercase letter for the implementation.  That TODO can finally be resolved 
now
after 04af4e4f55f3ef319a78edd4d0109e2e7eba90b6 "[API CHANGE] Fix all bad 
UNOIDL
identifiers across offapi".

Change-Id: Id63ba96aa77f8666fbdfa90f7b260af42e6856bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122362
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourceprovider-scanner.l 
b/unoidl/source/sourceprovider-scanner.l
index 847138b56dd0..bdedfcffc919 100644
--- a/unoidl/source/sourceprovider-scanner.l
+++ b/unoidl/source/sourceprovider-scanner.l
@@ -195,13 +195,9 @@ ALNUM {DIGIT}|{ALPHA}
 }
 
 ({ALPHA}|"_")({ALNUM}|"_")* {
-#if 1 //TODO
-yylval->sval=new OString(yytext);return TOK_IDENTIFIER;
-#else
 yyextra->errorMessage = "illegal identifier "
 + OUString(yytext, yyleng, RTL_TEXTENCODING_ASCII_US);
 return TOK_ERROR;
-#endif
 }
 
 0+[LUlu]? |


[Libreoffice-commits] core.git: unoidl/source

2021-09-20 Thread Stephan Bergmann (via logerrit)
 unoidl/source/sourcetreeprovider.cxx |  118 ---
 1 file changed, 111 insertions(+), 7 deletions(-)

New commits:
commit 7b10f119040144ff7db1da4c0a2bbdd488dcdf0f
Author: Stephan Bergmann 
AuthorDate: Tue Sep 14 17:11:12 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 21 07:49:27 2021 +0200

Implement the SourceTreeProvider Cursor

Change-Id: Ibf54bd1e852ea23fb37c7222625895d240452424
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122361
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index 9531d057c979..404938c376cc 100644
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -94,18 +94,24 @@ bool exists(OUString const & uri, bool directory) {
 
 class Cursor: public MapCursor {
 public:
-Cursor() {}
+Cursor(Manager& manager, OUString const & uri): manager_(manager), 
directory_(uri) {
+auto const rc = directory_.open();
+SAL_WARN_IF(
+rc != osl::FileBase::E_None, "unoidl", "open(" << uri << ") failed 
with " << +rc);
+}
 
 private:
 virtual ~Cursor() noexcept override {}
 
-virtual rtl::Reference getNext(OUString *) override
-{ return rtl::Reference(); } //TODO
+virtual rtl::Reference getNext(OUString *) override;
+
+Manager& manager_;
+osl::Directory directory_;
 };
 
 class SourceModuleEntity: public ModuleEntity {
 public:
-SourceModuleEntity() {}
+SourceModuleEntity(Manager& manager, OUString const & uri): 
manager_(manager), uri_(uri) {}
 
 private:
 virtual ~SourceModuleEntity() noexcept override {}
@@ -114,9 +120,107 @@ private:
 { return std::vector(); } //TODO
 
 virtual rtl::Reference< MapCursor > createCursor() const override
-{ return new Cursor; }
+{ return new Cursor(manager_, uri_); }
+
+Manager& manager_;
+OUString uri_;
 };
 
+bool isValidFileName(OUString const & name, bool directory) {
+for (sal_Int32 i = 0;; ++i) {
+if (i == name.getLength()) {
+if (i == 0) {
+return false;
+}
+return directory;
+}
+auto const c = name[i];
+if (c == '.') {
+if (i == 0 || name[i - 1] == '_') {
+return false;
+}
+return !directory && name.subView(i + 1) == u"idl";
+} else if (c == '_') {
+//TODO: Ignore case of name[0] only for case-insensitive file 
systems:
+if (i == 0 || name[i - 1] == '_') {
+return false;
+}
+} else if (rtl::isAsciiDigit(c)) {
+if (i == 0) {
+return false;
+}
+} else if (!rtl::isAsciiAlpha(c)) {
+return false;
+}
+}
+}
+
+}
+
+rtl::Reference Cursor::getNext(OUString * name) {
+assert(name != nullptr);
+for (;;) {
+osl::DirectoryItem i;
+auto rc = directory_.getNextItem(i);
+switch (rc) {
+case osl::FileBase::E_None:
+{
+osl::FileStatus stat(
+osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName |
+osl_FileStatus_Mask_FileURL);
+rc = i.getFileStatus(stat);
+if (rc != osl::FileBase::E_None) {
+SAL_WARN(
+"unoidl",
+"getFileSatus in <" << directory_.getURL() << "> 
failed with " << +rc);
+continue;
+}
+auto const dir = stat.getFileType() == 
osl::FileStatus::Directory;
+if (!isValidFileName(stat.getFileName(), dir)) {
+continue;
+}
+if (dir) {
+//TODO: Using osl::FileStatus::getFileName can likely 
cause issues on case-
+// insensitive/preserving file systems, see the free 
getFileName function above
+// (which likely goes unnoticed if module identifiers 
follow the convention of
+// being all-lowercase):
+*name = stat.getFileName();
+return new SourceModuleEntity(manager_, stat.getFileURL());
+} else {
+SourceProviderScannerData data(_);
+if (!parse(stat.getFileURL(), )) {
+SAL_WARN("unoidl", "cannot parse <" << 
stat.getFileURL() << ">");
+continue;
+}
+auto ent = data.entities.end();
+for (auto j = data.entities.begin(); j != 
data.entities.end(); ++j) {
+if (j->second.kind == 
SourceProviderEntity::KIND_EXTERNAL
+|| j->second.kind == 
SourceProviderEntity::KIND_MODULE)
+{
+continue;
+  

[Libreoffice-commits] core.git: unoidl/source

2021-02-10 Thread Stephan Bergmann (via logerrit)
 unoidl/source/sourceprovider-parser.y |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit f59dd9c2d928432ae2ebc311cdfe65dc74f3db33
Author: Stephan Bergmann 
AuthorDate: Thu Feb 11 07:52:26 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 11 08:45:01 2021 +0100

Silence some -Wimplicit-fallthrough

("fallthrough annotation in unreachable code")

Change-Id: I707451cf7f5215e228763049b9903240de1987cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110747
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 565ac9d8dec9..9d1dd5ae49d0 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -16,6 +16,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -1923,8 +1924,7 @@ typedefDefn:
   case 
unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
   break;
   case unoidl::detail::SourceProviderEntity::KIND_MODULE:
-  assert(false && "this cannot happen");
-  [[fallthrough]];
+  O3TL_UNREACHABLE;
   default:
   assert(t.entity->entity.is() || t.entity->pad.is());
   unpub
@@ -1943,8 +1943,7 @@ typedefDefn:
   }
   break;
   case unoidl::detail::SourceProviderType::TYPE_PARAMETER:
-  assert(false && "this cannot happen");
-  [[fallthrough]];
+  O3TL_UNREACHABLE;
   default:
   break;
   }
@@ -3855,8 +3854,7 @@ type:
   ok = true;
   break;
   case unoidl::Entity::SORT_TYPEDEF:
-  assert(false && "this cannot happen");
-  [[fallthrough]];
+  O3TL_UNREACHABLE;
   default:
   break;
   }
@@ -4441,8 +4439,7 @@ bool parse(OUString const & uri, 
SourceProviderScannerData * data) {
 case 0:
 break;
 default:
-assert(false);
-[[fallthrough]];
+O3TL_UNREACHABLE;
 case 1:
 throw FileFormatException(
 uri,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2020-12-13 Thread Stephan Bergmann (via logerrit)
 unoidl/source/sourcetreeprovider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 44a0daae00fa7990482ef31149fc3ac526fe8e3f
Author: Stephan Bergmann 
AuthorDate: Sun Dec 13 19:20:25 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Dec 13 22:24:54 2020 +0100

loplugin:stringview (macOS)

Change-Id: I5a1ffe6d9c140ea7ec7ca22a4e631b3d2c3579ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107657
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index 7ec67db22062..498ab33b03bc 100644
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -49,7 +49,7 @@ OUString getFileName(OUString const & uri, osl::FileStatus 
const & status) {
 return status.getFileName();
 }
 OString dir(OUStringToOString(path, osl_getThreadTextEncoding()));
-OString name(OUStringToOString(uri.copy(i), osl_getThreadTextEncoding()));
+OString name(OUStringToOString(uri.subView(i), 
osl_getThreadTextEncoding()));
 DIR * d = opendir(dir.getStr());
 if (d == nullptr) {
 SAL_WARN("unoidl", "cannot opendir(" << dir << ")");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2020-10-18 Thread mariamfahmy (via logerrit)
 unoidl/source/legacyprovider.hxx |5 +
 unoidl/source/sourcefileprovider.hxx |5 +
 unoidl/source/sourceprovider-parser-requires.hxx |5 +
 3 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 8feb66ac2f08a2fde2567d2c358aab53b3e42c48
Author: mariamfahmy 
AuthorDate: Sat Oct 17 13:49:04 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Oct 18 10:24:35 2020 +0200

tdf#124176: Using pragma once

Change-Id: I634d2eebfa71ebdbe6dc334f3bc29e70a06a94ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104461
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/unoidl/source/legacyprovider.hxx b/unoidl/source/legacyprovider.hxx
index ffee1affb7d0..41310ecdee70 100644
--- a/unoidl/source/legacyprovider.hxx
+++ b/unoidl/source/legacyprovider.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_UNOIDL_SOURCE_LEGACYPROVIDER_HXX
-#define INCLUDED_UNOIDL_SOURCE_LEGACYPROVIDER_HXX
+#pragma once
 
 #include 
 
@@ -39,6 +38,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unoidl/source/sourcefileprovider.hxx 
b/unoidl/source/sourcefileprovider.hxx
index bb3403b2d0d9..4229301ded50 100644
--- a/unoidl/source/sourcefileprovider.hxx
+++ b/unoidl/source/sourcefileprovider.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_UNOIDL_SOURCE_SOURCEFILEPROVIDER_HXX
-#define INCLUDED_UNOIDL_SOURCE_SOURCEFILEPROVIDER_HXX
+#pragma once
 
 #include 
 
@@ -39,6 +38,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unoidl/source/sourceprovider-parser-requires.hxx 
b/unoidl/source/sourceprovider-parser-requires.hxx
index 8bfb10a823c5..52b8c79e2a93 100644
--- a/unoidl/source/sourceprovider-parser-requires.hxx
+++ b/unoidl/source/sourceprovider-parser-requires.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_UNOIDL_SOURCE_SOURCEPROVIDER_PARSER_REQUIRES_HXX
-#define INCLUDED_UNOIDL_SOURCE_SOURCEPROVIDER_PARSER_REQUIRES_HXX
+#pragma once
 
 #include 
 
@@ -135,6 +134,4 @@ struct SourceProviderType {
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2020-01-25 Thread Onur Yilmaz (via logerrit)
 unoidl/source/unoidlprovider.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit ef86e72fb06e1b59d1587828d1a9089b50767144
Author: Onur Yilmaz 
AuthorDate: Sat Jan 25 15:27:50 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sat Jan 25 17:44:11 2020 +0100

tdf#124176: Use pragma once instead of include guards

Change-Id: I093227c37d9ddb056aaa0c13ec413164dfc6780e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87393
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/unoidl/source/unoidlprovider.hxx b/unoidl/source/unoidlprovider.hxx
index 4e2fce161323..0013af54284f 100644
--- a/unoidl/source/unoidlprovider.hxx
+++ b/unoidl/source/unoidlprovider.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_UNOIDL_SOURCE_UNOIDLPROVIDER_HXX
-#define INCLUDED_UNOIDL_SOURCE_UNOIDLPROVIDER_HXX
+#pragma once
 
 #include 
 
@@ -54,6 +53,4 @@ private:
 
 } }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2019-07-26 Thread Caolán McNamara (via logerrit)
 unoidl/source/sourceprovider-parser.y |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit dec009996b35c35e8bd060ccf4dac0f0ed7da573
Author: Caolán McNamara 
AuthorDate: Fri Jul 26 08:41:07 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 26 13:26:01 2019 +0200

cid#1448388 Assignment of overlapping memory

Change-Id: I9946af03ed5ac6823e610d6c8bf24afae463777e
Reviewed-on: https://gerrit.libreoffice.org/76354
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 965a3b9b8c37..e9812570ed3c 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -203,8 +203,11 @@ bool coerce(
 }
 break;
 case unoidl::detail::SourceProviderExpr::TYPE_FLOAT:
-lhs->fval = lhs->ival;
-ok = true;
+{
+auto tmp = lhs->ival;
+lhs->fval = tmp;
+ok = true;
+}
 break;
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: unoidl/source

2019-07-24 Thread Caolán McNamara (via logerrit)
 unoidl/source/sourceprovider-parser.y |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit d397372f5cf9ff1fa67720c76768c3cc29f7de59
Author: Caolán McNamara 
AuthorDate: Wed Jul 24 09:09:06 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 24 17:04:24 2019 +0200

cid#1448548 Assignment of overlapping memory

Change-Id: I146abd4635db993a5a0c5e612bb3f6dc23cdfe24
Reviewed-on: https://gerrit.libreoffice.org/76227
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 94573b1ea147..965a3b9b8c37 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -228,8 +228,11 @@ bool coerce(
 ok = true;
 break;
 case unoidl::detail::SourceProviderExpr::TYPE_FLOAT:
-lhs->fval = lhs->uval;
-ok = true;
+{
+auto nTmp = lhs->uval;
+lhs->fval = nTmp;
+ok = true;
+}
 break;
 }
 break;
@@ -239,12 +242,18 @@ bool coerce(
 ok = false;
 break;
 case unoidl::detail::SourceProviderExpr::TYPE_INT:
-rhs->fval = rhs->ival;
-ok = true;
+{
+auto tmp = rhs->ival;
+rhs->fval = tmp;
+ok = true;
+}
 break;
 case unoidl::detail::SourceProviderExpr::TYPE_UINT:
-rhs->fval = rhs->uval;
-ok = true;
+{
+auto tmp = rhs->uval;
+rhs->fval = tmp;
+ok = true;
+}
 break;
 case unoidl::detail::SourceProviderExpr::TYPE_FLOAT:
 ok = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: unoidl/source

2018-03-16 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ba2166ab40b58279da2aeb700c23d49515eb640f
Author: Stephan Bergmann 
Date:   Fri Mar 16 16:18:45 2018 +0100

Typo in error message

Change-Id: Ia56a47b46989027588afc291bf8f82299903cdaa

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index b558a4ccfc29..529d2045a273 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -1699,7 +1699,7 @@ interfaceAttribute:
   error(
   @2, yyscanner,
   ("interface attribute can only be flagged as [attribute,"
-   " optional]"));
+   " bound, readonly]"));
   YYERROR;
   }
   switch (t.type) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2017-10-19 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 96e68b9949b86afd3006415c733a2a710e8817f3
Author: Stephan Bergmann 
Date:   Thu Oct 12 15:39:00 2017 +0200

loplugin:includeform: manual changes to 
unoidl/source/sourceprovider-parser.y

Change-Id: If3980360b79a7ffcd433055e4ab912301a1bed74
Reviewed-on: https://gerrit.libreoffice.org/43555
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index c491d23daea8..b558a4ccfc29 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -14,7 +14,7 @@
 
 %{
 
-#include "sal/config.h"
+#include 
 
 #include 
 #include 
@@ -26,7 +26,7 @@
 #include 
 #include 
 
-#include 
+#include "sourceprovider-parser-requires.hxx"
 
 %}
 
@@ -52,9 +52,9 @@
 
 %{
 
-#include "osl/file.h"
-#include "osl/thread.h"
-#include "sal/log.hxx"
+#include 
+#include 
+#include 
 
 #include "sourceprovider-scanner.hxx"
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2017-02-05 Thread Jochen Nitschke
 unoidl/source/sourceprovider-scanner.l |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b524ace6f575a4ff1469fc637955328a511b9ff6
Author: Jochen Nitschke 
Date:   Sun Feb 5 17:31:52 2017 +0100

loplugin:nullptr

seen on tinderbox Linux-F19-x86_64_14-with-check

Change-Id: Ica9c2707b43317f7dd1cf99440c6cdb7fe28e0bc
Reviewed-on: https://gerrit.libreoffice.org/33938
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/unoidl/source/sourceprovider-scanner.l 
b/unoidl/source/sourceprovider-scanner.l
index d9b60ba..a4f6368 100644
--- a/unoidl/source/sourceprovider-scanner.l
+++ b/unoidl/source/sourceprovider-scanner.l
@@ -45,7 +45,7 @@ namespace unoidl { namespace detail {
 static std::size_t sourceProviderScannerInput(
 SourceProviderScannerData * data, char * buffer, std::size_t size)
 {
-assert(data != 0);
+assert(data != nullptr);
 if (data->sourcePosition == data->sourceEnd) {
 return YY_NULL;
 }
@@ -67,10 +67,10 @@ int nonZeroIntegerLiteral(
 char const * text, std::size_t length, sal_Int16 radix, sal_uInt64 * value,
 unoidl::detail::SourceProviderScannerData * data)
 {
-assert(text != 0);
+assert(text != nullptr);
 assert(length != 0);
-assert(value != 0);
-assert(data != 0);
+assert(value != nullptr);
+assert(data != nullptr);
 std::size_t n = length;
 switch (text[length - 1]) {
 case 'L':
@@ -224,7 +224,7 @@ ALNUM {DIGIT}|{ALPHA}
 {DIGIT}*"."{DIGIT}+([Ee][+\-]?{DIGIT}+)?[Ff]? {
 rtl_math_ConversionStatus s;
 yylval->fval = rtl_math_stringToDouble(
-yytext, yytext + yyleng, '.', 0, , 0);
+yytext, yytext + yyleng, '.', 0, , nullptr);
 if (s == rtl_math_ConversionStatus_OutOfRange) {
 yyextra->errorMessage = "out-of-range floating-point literal "
 + OUString(yytext, yyleng, RTL_TEXTENCODING_ASCII_US);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2016-05-12 Thread Stephan Bergmann
 unoidl/source/unoidl-check.cxx |5 ++---
 unoidl/source/unoidl-read.cxx  |9 -
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit f7b3cef45b26321f76ec24e5fd027b1c096d3118
Author: Stephan Bergmann 
Date:   Thu May 12 14:11:38 2016 +0200

Massage code to avoid warnings

Change-Id: I112f5e7c845184b9aa5285ecfa40b5bbb34ffde1

diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx
index ff01d24..6504f0f 100644
--- a/unoidl/source/unoidl-check.cxx
+++ b/unoidl/source/unoidl-check.cxx
@@ -206,9 +206,6 @@ void checkMap(
 std::exit(EXIT_FAILURE);
 }
 switch (entA->getSort()) {
-case unoidl::Entity::SORT_MODULE:
-assert(false && "this cannot happen");
-//deliberate fall-through anyway
 case unoidl::Entity::SORT_ENUM_TYPE:
 {
 rtl::Reference ent2A(
@@ -886,6 +883,8 @@ void checkMap(
 }
 break;
 }
+case unoidl::Entity::SORT_MODULE:
+assert(false && "this cannot happen");
 }
 }
 }
diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index 32bd012..93bbc19 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -243,8 +243,6 @@ void scanMap(
  ->isPublished())
 .first);
 switch (ent->getSort()) {
-case unoidl::Entity::SORT_MODULE:
-assert(false && "this cannot happen");
 case unoidl::Entity::SORT_ENUM_TYPE:
 case unoidl::Entity::SORT_CONSTANT_GROUP:
 break;
@@ -365,6 +363,8 @@ void scanMap(
 insertEntityDependency(manager, i, ent2->getBase());
 break;
 }
+case unoidl::Entity::SORT_MODULE:
+assert(false && "this cannot happen");
 }
 }
 }
@@ -575,9 +575,6 @@ void writeEntity(
 rtl::Reference ent(
 static_cast(i->second.entity.get()));
 switch (ent->getSort()) {
-case unoidl::Entity::SORT_MODULE:
-assert(false && "this cannot happen");
-//deliberate fall-through anyway
 case unoidl::Entity::SORT_ENUM_TYPE:
 {
 rtl::Reference ent2(
@@ -1010,6 +1007,8 @@ void writeEntity(
 std::cout << "; };";
 break;
 }
+case unoidl::Entity::SORT_MODULE:
+assert(false && "this cannot happen");
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2016-02-05 Thread Stephan Bergmann
 unoidl/source/legacyprovider.cxx  |6 
 unoidl/source/sourcefileprovider.cxx  |   22 -
 unoidl/source/sourceprovider-parser.y |  260 ++---
 unoidl/source/unoidl-check.cxx|  188 +--
 unoidl/source/unoidl-read.cxx |  362 ++---
 unoidl/source/unoidl-write.cxx|  413 --
 unoidl/source/unoidl.cxx  |   14 -
 7 files changed, 442 insertions(+), 823 deletions(-)

New commits:
commit 189918f5acd3bc1bee7a8a90f18ba29d0fe2c759
Author: Stephan Bergmann 
Date:   Sat Feb 6 07:21:53 2016 +0100

Clean up for loops in unoidl

Change-Id: I9c2e0a10699580026fbf38f0c857ac148de74f9c

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 7b2d45b..7edcdb6 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -384,7 +384,7 @@ rtl::Reference< Entity > readEntity(
 }
 std::vector< PlainStructTypeEntity::Member > mems;
 n = reader.getFieldCount();
-for (sal_uInt16 j = 0; j < n; ++j) {
+for (sal_uInt16 j = 0; j != n; ++j) {
 mems.emplace_back(
 reader.getFieldName(j),
 reader.getFieldTypeName(j).replace('/', '.'),
@@ -403,13 +403,13 @@ rtl::Reference< Entity > readEntity(
  " with key " + sub.getName()));
 }
 std::vector< OUString > params;
-for (sal_uInt16 j = 0; j < n; ++j) {
+for (sal_uInt16 j = 0; j != n; ++j) {
 params.push_back(
 reader.getReferenceTypeName(j).replace('/', '.'));
 }
 std::vector< PolymorphicStructTypeTemplateEntity::Member > 
mems;
 n = reader.getFieldCount();
-for (sal_uInt16 j = 0; j < n; ++j) {
+for (sal_uInt16 j = 0; j != n; ++j) {
 mems.emplace_back(
 reader.getFieldName(j),
 reader.getFieldTypeName(j).replace('/', '.'),
diff --git a/unoidl/source/sourcefileprovider.cxx 
b/unoidl/source/sourcefileprovider.cxx
index 18a6d66..3a3d639 100644
--- a/unoidl/source/sourcefileprovider.cxx
+++ b/unoidl/source/sourcefileprovider.cxx
@@ -63,11 +63,8 @@ private:
 
 std::vector Module::getMemberNames() const {
 std::vector names;
-for (std::map< OUString, rtl::Reference >::const_iterator i(
- map.begin());
- i != map.end(); ++i)
-{
-names.push_back(i->first);
+for (auto & i: map) {
+names.push_back(i.first);
 }
 return names;
 }
@@ -81,18 +78,15 @@ SourceFileProvider::SourceFileProvider(
 if (!parse(uri, )) {
 throw NoSuchFileException(uri);
 }
-for (std::map::iterator i(
- data.entities.begin());
- i != data.entities.end(); ++i)
-{
-if (i->second.kind == SourceProviderEntity::KIND_LOCAL) {
-assert(i->second.entity.is());
-assert(i->second.entity->getSort() != Entity::SORT_MODULE);
+for (auto & i: data.entities) {
+if (i.second.kind == SourceProviderEntity::KIND_LOCAL) {
+assert(i.second.entity.is());
+assert(i.second.entity->getSort() != Entity::SORT_MODULE);
 std::map< OUString, rtl::Reference > * map = _;
 for (sal_Int32 j = 0;;) {
-OUString id(i->first.getToken(0, '.', j));
+OUString id(i.first.getToken(0, '.', j));
 if (j == -1) {
-map->insert(std::make_pair(id, i->second.entity));
+map->insert(std::make_pair(id, i.second.entity));
 break;
 }
 std::map< OUString, rtl::Reference >::const_iterator k(
diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 945ebea..1a662d7 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -262,9 +262,7 @@ unoidl::detail::SourceProviderEntity * findEntity_(
 assert(name != 0);
 OUString n;
 if (!name->startsWith(".", )) {
-for (std::vector::reverse_iterator i(data->modules.rbegin());
- i != data->modules.rend(); ++i)
-{
+for (auto i(data->modules.rbegin()); i != data->modules.rend(); ++i) {
 n = *i + "." + *name;
 std::map::iterator 
j(
 data->entities.find(n));
@@ -837,12 +835,9 @@ bool checkInstantiatedPolymorphicStructTypeArgument(
 if (type.type
 == 
unoidl::detail::SourceProviderType::TYPE_INSTANTIATED_POLYMORPHIC_STRUCT)
 {
-for (std::vector::const_iterator i(
- type.subtypes.begin());
- i != 

[Libreoffice-commits] core.git: unoidl/source

2016-02-05 Thread Stephan Bergmann
 unoidl/source/unoidl-check.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 68dbaa9681bec5e303aa4675c1dcbbf98991cb7b
Author: Stephan Bergmann 
Date:   Sat Feb 6 08:51:42 2016 +0100

Fix prev. commit

Change-Id: I1dd71d6e35ac2dc5f27a11a3dd269247b1b35d39

diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx
index e5f8bb0..ff01d24 100644
--- a/unoidl/source/unoidl-check.cxx
+++ b/unoidl/source/unoidl-check.cxx
@@ -1105,11 +1105,13 @@ void checkIds(
  ->getDirectProperties().size())
   : 0);
 assert(n <= ent2B->getDirectProperties().size());
-for (auto & i: ent2B->getDirectProperties()) {
-if (!valid(i.name)) {
+for (auto i(ent2B->getDirectProperties().begin() +n);
+ i != ent2B->getDirectProperties().end(); ++i)
+{
+if (!valid(i->name)) {
 std::cerr
 << "accumulation-based service " << name
-<< " direct property " << i.name
+<< " direct property " << i->name
 << " uses an invalid identifier" << std::endl;
 std::exit(EXIT_FAILURE);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-11-21 Thread Stephan Bergmann
 unoidl/source/legacyprovider.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit b296006f44d2c248547596698717fd544e49fc64
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Nov 21 12:41:17 2014 +0100

Silence unhelpful cid#1213376 untrusted loop bound warnings

Change-Id: I0a1fcebb268bea942d4bc2d6bf835c3ffb24df3e

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 9db8495..cad04e6 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -262,6 +262,9 @@ rtl::Reference Entity  readEntity(
 {
 sal_uInt16 m
 = reader.getMethodExceptionCount(k);
+// coverity[tainted_data] cid#1213376
+// unhelpfully warns about an untrusted loop
+// bound here:
 for (sal_uInt16 l = 0; l != m; ++l) {
 getExcs.push_back(
 reader.getMethodExceptionTypeName(k, 
l).
@@ -273,6 +276,9 @@ rtl::Reference Entity  readEntity(
 {
 sal_uInt16 m
 = reader.getMethodExceptionCount(k);
+// coverity[tainted_data] cid#1213376
+// unhelpfully warns about an untrusted loop
+// bound here:
 for (sal_uInt16 l = 0; l != m; ++l) {
 setExcs.push_back(
 reader.getMethodExceptionTypeName(k, 
l).
@@ -307,6 +313,8 @@ rtl::Reference Entity  readEntity(
 std::vector InterfaceTypeEntity::Method::Parameter 
 params;
 sal_uInt16 m = reader.getMethodParameterCount(j);
+// coverity[tainted_data] cid#1213376 unhelpfully warns
+// about an untrusted loop bound here:
 for (sal_uInt16 k = 0; k != m; ++k) {
 RTParamMode mode = reader.getMethodParameterFlags(j, 
k);
 InterfaceTypeEntity::Method::Parameter::Direction dir;
@@ -339,6 +347,8 @@ rtl::Reference Entity  readEntity(
 }
 std::vector OUString  excs;
 m = reader.getMethodExceptionCount(j);
+// coverity[tainted_data] cid#1213376 unhelpfully warns
+// about an untrusted loop bound here:
 for (sal_uInt16 k = 0; k != m; ++k) {
 excs.push_back(
 reader.getMethodExceptionTypeName(j, k).replace(
@@ -613,6 +623,8 @@ rtl::Reference Entity  readEntity(
 SingleInterfaceBasedServiceEntity::Constructor::
 Parameter  params;
 sal_uInt16 m = reader.getMethodParameterCount(j);
+// coverity[tainted_data] cid#1213376 unhelpfully warns
+// about an untrusted loop bound here:
 for (sal_uInt16 k = 0; k != m; ++k) {
 RTParamMode mode
 = reader.getMethodParameterFlags(j, k);
@@ -653,6 +665,8 @@ rtl::Reference Entity  readEntity(
 }
 std::vector OUString  excs;
 m = reader.getMethodExceptionCount(j);
+// coverity[tainted_data] cid#1213376 unhelpfully warns
+// about an untrusted loop bound here:
 for (sal_uInt16 k = 0; k != m; ++k) {
 excs.push_back(
 reader.getMethodExceptionTypeName(j, 
k).replace(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-11-20 Thread Stephan Bergmann
 unoidl/source/unoidl-read.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit a702b41c7746fc5e450438551b1badbf9ca0dda1
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Nov 20 10:27:31 2014 +0100

This should ideally be consistency-checked in UnoidlProvider

...but is not, for performance reasons.

Change-Id: I2518eb1f1a2f84cfd836c390a418a2fcb516b82c

diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index e301ba5..99a2024 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -606,9 +606,14 @@ void writeEntity(
 std::mapOUString, Entity::iterator k(entities.find(*j));
 if (k != entities.end()  !k-second.written) {
 OUString id(openModulesFor(modules, *j));
-assert(
-k-second.entity-getSort()
-== unoidl::Entity::SORT_INTERFACE_TYPE);
+if (k-second.entity-getSort()
+!= unoidl::Entity::SORT_INTERFACE_TYPE)
+{
+std::cerr
+ Entity   *j   should be an interface type
+ std::endl;
+std::exit(EXIT_FAILURE);
+}
 writePublished(
 static_castunoidl::PublishableEntity *(
 k-second.entity.get()));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-11-19 Thread Stephan Bergmann
 unoidl/source/unoidl-read.cxx |   29 -
 1 file changed, 20 insertions(+), 9 deletions(-)

New commits:
commit f9fb1fcb8e0558a719cc6b423064d19433ce5e37
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 19 11:13:19 2014 +0100

Guard against cyclic entity dependencies

...in unoidl-read, although it would be better (but more expensive at start-
up) to check consistency in unoidl::Manager.

Change-Id: I5f5894fcd51af3aa999fe30621f52bfd11d0e610

diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index 113acee..e301ba5 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -136,16 +136,19 @@ OUString decomposeType(
 }
 
 struct Entity {
+enum class Sorted { NO, ACTIVE, YES };
+
 explicit Entity(
 rtl::Referenceunoidl::Entity const  theEntity, bool theRelevant):
-entity(theEntity), relevant(theRelevant), sorted(false), written(false)
+entity(theEntity), relevant(theRelevant), sorted(Sorted::NO),
+written(false)
 {}
 
 rtl::Referenceunoidl::Entity const entity;
 std::setOUString dependencies;
 std::setOUString interfaceDependencies;
 bool relevant;
-bool sorted;
+Sorted sorted;
 bool written;
 };
 
@@ -160,7 +163,7 @@ void insertEntityDependency(
 if (weakInterfaceDependency) {
 rtl::Referenceunoidl::Entity ent(manager-findEntity(name));
 if (!ent.is()) {
-std::cerr  unknown entity   name  std::endl;
+std::cerr  Unknown entity   name  std::endl;
 std::exit(EXIT_FAILURE);
 }
 ifc = ent-getSort() == unoidl::Entity::SORT_INTERFACE_TYPE;
@@ -404,7 +407,7 @@ void scanMap(
 void propagateRelevant(std::mapOUString, Entity  entities, Entity  entity) 
{
 if (!entity.relevant) {
 entity.relevant = true;
-if (entity.sorted) {
+if (entity.sorted != Entity::Sorted::YES) {
 for (std::setOUString::iterator i(entity.dependencies.begin());
  i != entity.dependencies.end(); ++i)
 {
@@ -422,10 +425,9 @@ void visit(
 std::mapOUString, Entity::iterator const  iterator,
 std::vectorOUString  result)
 {
-if (!iterator-second.sorted) {
-// Doesn't bother to verify the graph is acyclic (which it is 
guaranteed
-// to be for a consistent set of entities); a non-DAG will lead to
-// infinite recursion/stack overflow:
+switch (iterator-second.sorted) {
+case Entity::Sorted::NO:
+iterator-second.sorted = Entity::Sorted::ACTIVE;
 for (std::setOUString::iterator i(
  iterator-second.dependencies.begin());
  i != iterator-second.dependencies.end(); ++i)
@@ -438,8 +440,17 @@ void visit(
 visit(entities, j, result);
 }
 }
-iterator-second.sorted = true;
+iterator-second.sorted = Entity::Sorted::YES;
 result.push_back(iterator-first);
+break;
+case Entity::Sorted::ACTIVE:
+std::cerr
+ Entity   iterator-first   recursively depends on itself
+ std::endl;
+std::exit(EXIT_FAILURE);
+// fall-through avoids warnings
+default:
+break;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-11-18 Thread Stephan Bergmann
 unoidl/source/unoidlprovider.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit a177c4c77236617fcdb34c89ea2746614a232051
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 18 16:33:28 2014 +0100

Avoid overflow

Change-Id: Ia80682aeb87225b9bde7398186e121b1d3bdc2ad

diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx
index deda03a..aef380d 100644
--- a/unoidl/source/unoidlprovider.cxx
+++ b/unoidl/source/unoidlprovider.cxx
@@ -630,7 +630,9 @@ rtl::Reference Entity  readEntity(
 throw FileFormatException(
 file-uri, UNOIDL format: too many items in module);
 }
-if (offset + 5 + 8 * n  file-size) { //TODO: overflow
+if (sal_uInt64(offset) + 5 + 8 * sal_uInt64(n)  file-size)
+// cannot overflow
+{
 throw FileFormatException(
 file-uri,
 UNOIDL format: module map offset + size too large);
@@ -954,7 +956,9 @@ rtl::Reference Entity  readEntity(
 file-uri,
 UNOIDL format: too many constants in constant group);
 }
-if (offset + 5 + 8 * n  file-size) { //TODO: overflow
+if (sal_uInt64(offset) + 5 + 8 * sal_uInt64(n)  file-size)
+// cannot overflow
+{
 throw FileFormatException(
 file-uri,
 (UNOIDL format: constant group map offset + size too
@@ -1237,7 +1241,9 @@ rtl::Reference Entity  
UnoidlProvider::findEntity(OUString const  name) const
 }
 }
 mapSize = file_-read32(off + 1);
-if (8 * mapSize  file_-size - off - 5) { //TODO: overflow
+if (sal_uInt64(off) + 5 + 8 * sal_uInt64(mapSize)  file_-size)
+// cannot overflow
+{
 throw FileFormatException(
 file_-uri, UNOIDL format: map offset + size too large);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-07-07 Thread Douglas Mencken
 unoidl/source/sourcetreeprovider.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b7c82d8d6241de2ec873d11a92a754e6a13547fb
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Mon Jul 7 05:37:32 2014 -0400

fix build error 'strlen' is not a member of 'std' locally

Change-Id: I587ef2c38fd9377eef2073a49cd8497b2bd4bf9f
Reviewed-on: https://gerrit.libreoffice.org/10076
Reviewed-by: Stephan Bergmann sberg...@redhat.com
Tested-by: Stephan Bergmann sberg...@redhat.com

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index 246f6f0..e9d0094 100644
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -11,6 +11,7 @@
 
 #include map
 #include vector
+#include cstring
 
 #include osl/file.h
 #include osl/file.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-02-24 Thread Douglas Mencken
 unoidl/source/sourceprovider-parser.y |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8bf34faa1e87a2b7940445c38517177ad238ed32
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Sun Feb 23 17:01:51 2014 -0500

Yet another one undefined comparison of 'const' and a 'non-const' iterators

Fixes:
no match for ‘operator!=’ in ‘i != std::vector_Tp, 
_Alloc::rend() [with _Tp = rtl::OUString, _Alloc = 
std::allocatorrtl::OUString]()’

Change-Id: I7b4ba07ebe51c73893a3d6b77dcf5681b7638efb
Signed-off-by: Stephan Bergmann sberg...@redhat.com

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 15bb011..dba0b29 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -261,7 +261,7 @@ unoidl::detail::SourceProviderEntity * findEntity_(
 assert(name != 0);
 OUString n;
 if (!name-startsWith(., n)) {
-for (std::vectorOUString::const_reverse_iterator 
i(data-modules.rbegin());
+for (std::vectorOUString::reverse_iterator i(data-modules.rbegin());
  i != data-modules.rend(); ++i)
 {
 n = *i + . + *name;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2014-01-08 Thread Stephan Bergmann
 unoidl/source/unoidl-check.cxx |   63 +++--
 1 file changed, 36 insertions(+), 27 deletions(-)

New commits:
commit 54101206ec3a4a5d8e2948d411dc8b51992add0e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 8 10:01:11 2014 +0100

OK to add optional bases to published old-style services

Change-Id: Ie6f5f2a634171d9618f3229bcc18ad48fff80d35

diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx
index f1264d2..33487f5 100644
--- a/unoidl/source/unoidl-check.cxx
+++ b/unoidl/source/unoidl-check.cxx
@@ -9,6 +9,7 @@
 
 #include sal/config.h
 
+#include algorithm
 #include cassert
 #include cstdlib
 #include iostream
@@ -137,6 +138,16 @@ OUString showDirection(
 }
 }
 
+struct EqualsAnnotation {
+EqualsAnnotation(OUString const  name): name_(name) {}
+
+bool operator ()(unoidl::AnnotatedReference const  ref)
+{ return ref.name == name_; }
+
+private:
+OUString name_;
+};
+
 void checkMap(
 rtl::Referenceunoidl::Provider const  providerB, OUString const  
prefix,
 rtl::Referenceunoidl::MapCursor const  cursor)
@@ -697,12 +708,12 @@ void checkMap(
 }
 }
 if (ent2A-getDirectOptionalBaseServices().size()
-!= ent2B-getDirectOptionalBaseServices().size())
+ ent2B-getDirectOptionalBaseServices().size())
 {
 std::cerr
  accumulation-based service   name
  ( number of direct optional base services
- changed from )
+ shrank from )
  ent2A-getDirectOptionalBaseServices().size()
   to 
  ent2B-getDirectOptionalBaseServices().size()
@@ -710,21 +721,20 @@ void checkMap(
 std::exit(EXIT_FAILURE);
 }
 for 
(std::vectorunoidl::AnnotatedReference::const_iterator
- i(ent2A-getDirectOptionalBaseServices().begin()),
- j(ent2B-getDirectOptionalBaseServices().begin());
+ i(ent2A-getDirectOptionalBaseServices().begin());
  i != ent2A-getDirectOptionalBaseServices().end();
- ++i, ++j)
+ ++i)
 {
-if (i-name != j-name) {
+if (std::find_if(
+ent2B-getDirectOptionalBaseServices().begin(),
+ent2B-getDirectOptionalBaseServices().end(),
+EqualsAnnotation(i-name))
+== ent2B-getDirectOptionalBaseServices().end())
+{
 std::cerr
  accumulation-based service   name
-  direct optional base service #
- (i
-- (ent2A-getDirectOptionalBaseServices()
-   .begin())
-+ 1)
-  changed from   i-name   to 
- j-name  std::endl;
+  direct optional base service   i-name
+  was removed  std::endl;
 std::exit(EXIT_FAILURE);
 }
 }
@@ -763,12 +773,12 @@ void checkMap(
 }
 }
 if (ent2A-getDirectOptionalBaseInterfaces().size()
-!= ent2B-getDirectOptionalBaseInterfaces().size())
+ ent2B-getDirectOptionalBaseInterfaces().size())
 {
 std::cerr
  accumulation-based service   name
  ( number of direct optional base interfaces
- changed from )
+ shrank from )
  ent2A-getDirectOptionalBaseInterfaces().size()
   to 
  ent2B-getDirectOptionalBaseInterfaces().size()
@@ -777,22 +787,21 @@ void checkMap(
 }
 for 
(std::vectorunoidl::AnnotatedReference::const_iterator
  i(ent2A-getDirectOptionalBaseInterfaces()
-   .begin()),
- j(ent2B-getDirectOptionalBaseInterfaces()
.begin());
  i != ent2A-getDirectOptionalBaseInterfaces().end();
- ++i, ++j)
-{
-if (i-name != j-name) {

[Libreoffice-commits] core.git: unoidl/source

2013-11-27 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 766cdc8a603b17710f8c60558c07e4b64cdda54b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 27 09:00:39 2013 +0100

Silence false may be used uninitialized warnings

Change-Id: Ie708de4a7fbd34e1ab3c417688de79d5bdf0e0b8

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 77fcd7e..15bb011 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -174,7 +174,7 @@ bool coerce(
 {
 assert(lhs != 0);
 assert(rhs != 0);
-bool ok;
+bool ok = bool(); // avoid warnings
 switch (lhs-type) {
 case unoidl::detail::SourceProviderExpr::TYPE_BOOL:
 ok = rhs-type != unoidl::detail::SourceProviderExpr::TYPE_BOOL;
@@ -431,7 +431,10 @@ Found findEntity(
  + argName));
 return FOUND_ERROR;
 } else {
-
unoidl::detail::SourceProviderType::Type argT;
+
unoidl::detail::SourceProviderType::Type
+argT
+= 
unoidl::detail::SourceProviderType::Type();
+// avoid warnings
 switch (argEnt-kind) {
 case 
unoidl::detail::SourceProviderEntity::KIND_LOCAL:
 if (e-pad.is()) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-11-26 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 3950919134457204885eb988f17731d3cf9e1ba4
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 26 14:08:07 2013 +0100

Remove outdated TODO (@deprecated annotation are handled fine)

Change-Id: Iab32e6974a181e437630aaae2ea73eb6062ec0ee

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 8e6c0c4..2bcbcdd 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -7,7 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/*TODO: @deprecated annotations */
 /*TODO: check Exception, RuntimeException, XInterface defns */
 
 %locations
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-10-24 Thread Stephan Bergmann
 unoidl/source/unoidl.cxx |  112 ---
 1 file changed, 78 insertions(+), 34 deletions(-)

New commits:
commit bdd55e28fc7788c2968daaf87b782f8e6189ee2d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Oct 24 09:48:13 2013 +0200

fdo#67725 unoidl::AggregatingCursor must wrap modules for aggregation, too

Otherwise cppuhelper::TypeManager::createTypeDescriptionEnumeration, 
sitting on
top such an AggregatingCursor, will miss any entities from provider P' in 
module
M if any previous provider P contains the same module M.

That happened when climaker generates cli_oootypes.dll, where the 
enumeration
missed everything from offapi in top-level module com because it had 
already
seen udkapi's com, and only reported the handful of entities under 
offapi's
other top-level module org (which does not appear in udkapi).

Change-Id: If538391bde22bcc346417b5988cf12023f0d4172

diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx
index 7c3e2e5..6d716d4 100644
--- a/unoidl/source/unoidl.cxx
+++ b/unoidl/source/unoidl.cxx
@@ -28,41 +28,101 @@ namespace unoidl {
 
 namespace {
 
+class AggregatingModule: public ModuleEntity {
+public:
+AggregatingModule(
+std::vector rtl::Reference Provider   const  providers,
+OUString const  name):
+providers_(providers), name_(name)
+{}
+
+private:
+virtual ~AggregatingModule() throw () {}
+
+virtual std::vector OUString  getMemberNames() const;
+
+virtual rtl::Reference MapCursor  createCursor() const;
+
+std::vector rtl::Reference Provider   providers_;
+OUString name_;
+};
+
+std::vector OUString  AggregatingModule::getMemberNames() const {
+std::set OUString  names;
+for (std::vector rtl::Reference Provider  ::const_iterator i(
+ providers_.begin());
+ i != providers_.end(); ++i)
+{
+rtl::Reference Entity  ent((*i)-findEntity(name_));
+if (ent.is()  ent-getSort() == Entity::SORT_MODULE) {
+std::vector OUString  ns(
+static_cast ModuleEntity * (ent.get())-getMemberNames());
+names.insert(ns.begin(), ns.end());
+}
+}
+return std::vector OUString (names.begin(), names.end());
+}
+
 class AggregatingCursor: public MapCursor {
 public:
 AggregatingCursor(
-std::vector rtl::Reference MapCursor   const  cursors):
-cursors_(cursors), iterator_(cursors_.begin())
-{}
+std::vector rtl::Reference Provider   const  providers,
+OUString const  name):
+providers_(providers), name_(name), iterator_(providers_.begin())
+{ findCursor(); }
 
 private:
 virtual ~AggregatingCursor() throw () {}
 
-virtual rtl::Reference Entity  getNext(rtl::OUString * name);
+virtual rtl::Reference Entity  getNext(OUString * name);
 
-std::vector rtl::Reference MapCursor   cursors_;
-std::vector rtl::Reference MapCursor  ::iterator iterator_;
-std::set rtl::OUString  seenMembers;
+void findCursor();
+
+std::vector rtl::Reference Provider   providers_;
+OUString name_;
+std::vector rtl::Reference Provider  ::iterator iterator_;
+rtl::Reference MapCursor  cursor_;
+std::set OUString  seen_;
 };
 
-rtl::Reference Entity  AggregatingCursor::getNext(rtl::OUString * name) {
-for (;;) {
-if (iterator_ == cursors_.end()) {
-return rtl::Reference Entity ();
-}
-rtl::OUString n;
-rtl::Reference Entity  ent((*iterator_)-getNext(n));
+rtl::Reference Entity  AggregatingCursor::getNext(OUString * name) {
+while (cursor_.is()) {
+OUString n;
+rtl::Reference Entity  ent(cursor_-getNext(n));
 if (ent.is()) {
-if (seenMembers.insert(n).second) {
+if (seen_.insert(n).second) {
 if (name != 0) {
 *name = n;
 }
-return ent;
+return ent-getSort() == Entity::SORT_MODULE
+? new AggregatingModule(
+providers_, (name_.isEmpty() ? name_ : name_ + .) + 
n)
+: ent;
 }
 } else {
-++iterator_;
+cursor_.clear();
+findCursor();
 }
 }
+return rtl::Reference Entity ();
+}
+
+void AggregatingCursor::findCursor() {
+for (; !cursor_.is()  iterator_ != providers_.end(); ++iterator_) {
+if (name_.isEmpty()) {
+cursor_ = (*iterator_)-createRootCursor();
+} else {
+rtl::Reference Entity  ent((*iterator_)-findEntity(name_));
+if (ent.is()  ent-getSort() == Entity::SORT_MODULE) {
+cursor_ = static_cast ModuleEntity * (ent.get())-
+createCursor();
+}
+}
+}
+}
+
+rtl::Reference MapCursor  AggregatingModule::createCursor() const {
+return new AggregatingCursor(providers_, 

[Libreoffice-commits] core.git: unoidl/source

2013-09-20 Thread Stephan Bergmann
 unoidl/source/sourceprovider-scanner.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e9ba193f5e61d7855be694a2c414b9e1bc198d5e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Sep 20 16:56:29 2013 +0200

keep C++03 compilers happy

Change-Id: I62af395105f51e802b874424b993dcf7e687a78b

diff --git a/unoidl/source/sourceprovider-scanner.hxx 
b/unoidl/source/sourceprovider-scanner.hxx
index 0c08a13..ed5105f 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -177,13 +177,13 @@ public:
 name(theName), annotations(theAnnotations)
 {}
 
-rtl::OUString const name;
+rtl::OUString name;
 
 std::vector Parameter  parameters;
 
 std::vector rtl::OUString  exceptions;
 
-std::vector rtl::OUString  const annotations;
+std::vector rtl::OUString  annotations;
 };
 
 explicit SourceProviderSingleInterfaceBasedServiceEntityPad(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-19 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0395d4ba7b55736c53a53beb427ce750158e769f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 19 08:09:24 2013 +0200

typo

Change-Id: I79660ddd3ec9f78452fa484b33a9720cbf8ddc80

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index da16932..9c7e00e 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -590,7 +590,7 @@ Found findEntity(
 } else if (typeNucleus == hyper) {
 t = unoidl::detail::SourceProviderType(
 unoidl::detail::SourceProviderType::TYPE_HYPER);
-} else if (typeNucleus == usigned hyper) {
+} else if (typeNucleus == unsigned hyper) {
 t = unoidl::detail::SourceProviderType(
 
unoidl::detail::SourceProviderType::TYPE_UNSIGNED_HYPER);
 } else if (typeNucleus == float) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-19 Thread Stephan Bergmann
 unoidl/source/sourcetreeprovider.cxx |   73 ---
 1 file changed, 67 insertions(+), 6 deletions(-)

New commits:
commit 63f1fc40fbed426e702de3d22c4bc487c2fe446c
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 19 12:37:46 2013 +0200

Prevent conflicts on case-preserving file systems

Change-Id: Ia40f0ce43086fd73cba60011001640a945fb3e26

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index dd87ea3..f9ae3e9 100755
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -25,10 +25,74 @@
 #include sourceprovider-scanner.hxx
 #include sourcetreeprovider.hxx
 
+#if defined MACOSX
+#include dirent.h
+#include osl/thread.h
+#endif
+
 namespace unoidl { namespace detail {
 
 namespace {
 
+//TODO: Bad hack to work around osl::FileStatus::getFileName not determining 
the
+// original spelling of a file name (not even with
+// osl_FileStatus_Mask_Validate):
+OUString getFileName(OUString const  uri, osl::FileStatus  status) {
+#if defined MACOSX
+ sal_Int32 i = uri.lastIndexOf('/') + 1;
+ OUString path;
+ if (osl::FileBase::getSystemPathFromFileURL(uri.copy(0, i), path)
+ != osl::FileBase::E_None)
+ {
+ SAL_WARN(
+ unoidl,
+ cannot getSystemPathFromFileURL(  uri.copy(0, i)  ));
+ return status.getFileName();
+ }
+ OString dir(OUStringToOString(path, osl_getThreadTextEncoding()));
+ OString name(OUStringToOString(uri.copy(i), osl_getThreadTextEncoding()));
+ DIR * d = opendir(dir.getStr());
+ if (d == 0) {
+ SAL_WARN(unoidl, cannot opendir(  dir  ));
+ return status.getFileName();
+ }
+ for (;;) {
+ dirent ent;
+ dirent * p;
+ int e = readdir_r(d, ent, p);
+ if (e != 0) {
+ SAL_WARN(unoidl, cannot readdir_r);
+ closedir(d);
+ return status.getFileName();
+ }
+ if (p == 0) {
+ SAL_WARN(
+ unoidl, cannot find   name   via readdir of   
dir);
+ closedir(d);
+ return status.getFileName();
+ }
+ if (name.equalsIgnoreAsciiCase(p-d_name)) {
+ closedir(d);
+ return OUString(
+ p-d_name, std::strlen(p-d_name),
+ osl_getThreadTextEncoding());
+ }
+ }
+#else
+return status.getFileName();
+#endif
+}
+
+bool exists(OUString const  uri, bool directory) {
+osl::DirectoryItem item;
+osl::FileStatus status(
+osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName);
+return osl::DirectoryItem::get(uri, item) == osl::FileBase::E_None
+ item.getFileStatus(status) == osl::FileBase::E_None
+ (status.getFileType() == osl::FileStatus::Directory) == directory
+ getFileName(uri, status) == uri.copy(uri.lastIndexOf('/') + 1);
+}
+
 class Cursor: public MapCursor {
 public:
 Cursor() {}
@@ -119,12 +183,9 @@ rtl::ReferenceEntity 
SourceTreeProvider::findEntity(OUString const  name)
 }
 OUString uri(uri_ + buf.makeStringAndClear());
 rtl::ReferenceEntity ent;
-osl::DirectoryItem item;
-osl::FileStatus status(osl_FileStatus_Mask_Type);
-if (osl::DirectoryItem::get(uri, item) == osl::FileBase::E_None
- item.getFileStatus(status) == osl::FileBase::E_None
- status.getFileType() == osl::FileStatus::Directory)
-{
+// Prevent conflicts between foo/ and Foo.idl on case-preserving file
+// systems:
+if (exists(uri, true)  !exists(uri + .idl, false)) {
 ent = new SourceModuleEntity;
 } else {
 uri += .idl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-19 Thread Stephan Bergmann
 unoidl/source/sourcetreeprovider.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b345b3b6bceddcce8966243304c9112e58a33304
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 19 12:40:07 2013 +0200

-Werror,-Wunused-parameter

Change-Id: I331d769132d3b18c870c70c7abcbd9539135af55

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index f9ae3e9..850e983 100755
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -79,6 +79,7 @@ OUString getFileName(OUString const  uri, osl::FileStatus  
status) {
  }
  }
 #else
+(void) uri;
 return status.getFileName();
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-19 Thread Stephan Bergmann
 unoidl/source/sourcetreeprovider.cxx |   77 +--
 1 file changed, 38 insertions(+), 39 deletions(-)

New commits:
commit 9960535bf562e91c19e119cbbcbefe07ac6ddb39
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 19 12:41:12 2013 +0200

Fix indentation

Change-Id: I7814547ef29ec728a5a815196427b661bf285256

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index 850e983..2cfe938 100755
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -39,45 +39,44 @@ namespace {
 // osl_FileStatus_Mask_Validate):
 OUString getFileName(OUString const  uri, osl::FileStatus  status) {
 #if defined MACOSX
- sal_Int32 i = uri.lastIndexOf('/') + 1;
- OUString path;
- if (osl::FileBase::getSystemPathFromFileURL(uri.copy(0, i), path)
- != osl::FileBase::E_None)
- {
- SAL_WARN(
- unoidl,
- cannot getSystemPathFromFileURL(  uri.copy(0, i)  ));
- return status.getFileName();
- }
- OString dir(OUStringToOString(path, osl_getThreadTextEncoding()));
- OString name(OUStringToOString(uri.copy(i), osl_getThreadTextEncoding()));
- DIR * d = opendir(dir.getStr());
- if (d == 0) {
- SAL_WARN(unoidl, cannot opendir(  dir  ));
- return status.getFileName();
- }
- for (;;) {
- dirent ent;
- dirent * p;
- int e = readdir_r(d, ent, p);
- if (e != 0) {
- SAL_WARN(unoidl, cannot readdir_r);
- closedir(d);
- return status.getFileName();
- }
- if (p == 0) {
- SAL_WARN(
- unoidl, cannot find   name   via readdir of   
dir);
- closedir(d);
- return status.getFileName();
- }
- if (name.equalsIgnoreAsciiCase(p-d_name)) {
- closedir(d);
- return OUString(
- p-d_name, std::strlen(p-d_name),
- osl_getThreadTextEncoding());
- }
- }
+sal_Int32 i = uri.lastIndexOf('/') + 1;
+OUString path;
+if (osl::FileBase::getSystemPathFromFileURL(uri.copy(0, i), path)
+!= osl::FileBase::E_None)
+{
+SAL_WARN(
+unoidl,
+cannot getSystemPathFromFileURL(  uri.copy(0, i)  ));
+return status.getFileName();
+}
+OString dir(OUStringToOString(path, osl_getThreadTextEncoding()));
+OString name(OUStringToOString(uri.copy(i), osl_getThreadTextEncoding()));
+DIR * d = opendir(dir.getStr());
+if (d == 0) {
+SAL_WARN(unoidl, cannot opendir(  dir  ));
+return status.getFileName();
+}
+for (;;) {
+dirent ent;
+dirent * p;
+int e = readdir_r(d, ent, p);
+if (e != 0) {
+SAL_WARN(unoidl, cannot readdir_r);
+closedir(d);
+return status.getFileName();
+}
+if (p == 0) {
+SAL_WARN(
+unoidl, cannot find   name   via readdir of   dir);
+closedir(d);
+return status.getFileName();
+}
+if (name.equalsIgnoreAsciiCase(p-d_name)) {
+closedir(d);
+return OUString(
+p-d_name, std::strlen(p-d_name), 
osl_getThreadTextEncoding());
+}
+}
 #else
 (void) uri;
 return status.getFileName();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-18 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 65da01fa1d6e5da6c70694e6e494adc70c4b236a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Sep 18 11:10:20 2013 +0200

-Wshadow

Change-Id: I8299079b46be4ccb7070f5497d089166a953c939

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index b093349..da16932 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -3701,10 +3701,10 @@ bool parse(OUString const  uri, 
SourceProviderScannerData * data) {
 // Checking errno for the specific EINVAL, ENOMEM documented for
 // yylex_init_extra would not work as those values are not defined
 // by the C++ Standard:
-int e = errno;
+int e2 = errno;
 throw FileFormatException(
 uri,
-yylex_init_extra failed with errno  + OUString::number(e));
+yylex_init_extra failed with errno  + OUString::number(e2));
 }
 int e2 = yyparse(yyscanner);
 yylex_destroy(yyscanner);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-17 Thread Julien Nabet
 unoidl/source/sourcetreeprovider.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 805738b0ee3504e34a0960fe82f092fb319f9fc9
Author: Julien Nabet serval2...@yahoo.fr
Date:   Tue Sep 17 07:46:07 2013 +0200

-Werror=shadow

Change-Id: Ia344d5a68118ba9896672ebbf4cccaf0511f8186

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index d389f0c..dd87ea3 100755
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -130,10 +130,10 @@ rtl::ReferenceEntity 
SourceTreeProvider::findEntity(OUString const  name)
 uri += .idl;
 SourceProviderScannerData data(manager_);
 if (parse(uri, data)) {
-std::mapOUString, SourceProviderEntity::const_iterator i(
+std::mapOUString, SourceProviderEntity::const_iterator j(
 data.entities.find(name));
-if (i != data.entities.end()) {
-ent = i-second.entity;
+if (j != data.entities.end()) {
+ent = j-second.entity;
 }
 SAL_WARN_IF(
 !ent.is(), unoidl,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-17 Thread Khaled Hosny
 unoidl/source/sourceprovider-parser.y |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be55ed02c0cdc590c044491b9b8f7cc8b3c4
Author: Khaled Hosny khaledho...@eglug.org
Date:   Tue Sep 17 11:48:15 2013 +0200

Fix build with Bison 3

The Bison 3 generated sources do not seem to define YYID, so our
YYLLOC_DEFAULT definition was broken. No idea what any of this means,
but sberg said I can safely remove the YYID usage, so if it kills your
pet, you know whom to blame.

Change-Id: I464564be941e0a49da264057923bf8e8e82d5ffd

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 92deb23..c2e1d7e 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -59,7 +59,7 @@
 #include sourceprovider-scanner.hxx
 
 #define YYLLOC_DEFAULT(Current, Rhs, N) \
-do { (Current) = YYRHSLOC((Rhs), YYID((N)) ? 1 : 0); } while (YYID(0))
+do { (Current) = YYRHSLOC((Rhs), (N) ? 1 : 0); } while (0)
 
 void yyerror(YYLTYPE * locp, yyscan_t yyscanner, char const * msg) {
 assert(locp != 0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-17 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit ce09d2f07efdb9bfefe2c20515ebc3e1922a8c79
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 17 22:34:23 2013 +0200

 vs.  typos

Change-Id: I7475114158d64b8dbe64cd9d1de3415454c762f4

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index c2e1d7e..b093349 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -2502,31 +2502,31 @@ serviceProperty:
   YYERROR;
   }
   int att = 0;
-  if (($2  unoidl::detail::FLAG_BOUND) != 0) {
+  if (($2  unoidl::detail::FLAG_BOUND) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_BOUND;
   }
-  if (($2  unoidl::detail::FLAG_CONSTRAINED) != 0) {
+  if (($2  unoidl::detail::FLAG_CONSTRAINED) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_CONSTRAINED;
   }
-  if (($2  unoidl::detail::FLAG_MAYBEAMBIGUOUS) != 0) {
+  if (($2  unoidl::detail::FLAG_MAYBEAMBIGUOUS) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_MAYBE_AMBIGUOUS;
   }
-  if (($2  unoidl::detail::FLAG_MAYBEDEFAULT) != 0) {
+  if (($2  unoidl::detail::FLAG_MAYBEDEFAULT) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_MAYBE_DEFAULT;
   }
-  if (($2  unoidl::detail::FLAG_MAYBEVOID) != 0) {
+  if (($2  unoidl::detail::FLAG_MAYBEVOID) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_MAYBE_VOID;
   }
-  if (($2  unoidl::detail::FLAG_OPTIONAL) != 0) {
+  if (($2  unoidl::detail::FLAG_OPTIONAL) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_OPTIONAL;
   }
-  if (($2  unoidl::detail::FLAG_READONLY) != 0) {
+  if (($2  unoidl::detail::FLAG_READONLY) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_READ_ONLY;
   }
-  if (($2  unoidl::detail::FLAG_REMOVABLE) != 0) {
+  if (($2  unoidl::detail::FLAG_REMOVABLE) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_REMOVABLE;
   }
-  if (($2  unoidl::detail::FLAG_TRANSIENT) != 0) {
+  if (($2  unoidl::detail::FLAG_TRANSIENT) != 0) {
   att |= 
unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_TRANSIENT;
   }
   switch (t.type) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-17 Thread Stephan Bergmann
 unoidl/source/unoidl-read.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit b7ae5b5c92d6b02bb89cbd2d560a59b80a5015c2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 17 22:46:23 2013 +0200

Clean up includes

Change-Id: I784ba245526f6fbf933ee485df1604e82980d931

diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index aaab9a8..36aabaf 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -17,19 +17,14 @@
 #include utility
 #include vector
 
-#include config_version.h
-#include osl/endian.h
 #include osl/file.h
 #include osl/file.hxx
 #include osl/process.h
 #include rtl/process.h
-#include rtl/string.h
-#include rtl/string.hxx
-#include rtl/textenc.h
-#include rtl/textcvt.h
+#include rtl/ref.hxx
 #include rtl/ustring.hxx
-#include sal/macros.h
 #include sal/main.h
+#include sal/types.h
 #include unoidl/unoidl.hxx
 
 namespace {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-17 Thread Stephan Bergmann
 unoidl/source/unoidl-read.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit aa49a5fa0f7eed05665a83a0b2703c760ee24b6c
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 17 23:16:43 2013 +0200

Missing include

Change-Id: I93d35ca7b784fc6d1b228347053ef0f76904f039

diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index 36aabaf..f9c538b 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -11,6 +11,7 @@
 
 #include cassert
 #include cstddef
+#include cstdlib
 #include iostream
 #include map
 #include set
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-12 Thread Stephan Bergmann
 unoidl/source/sourceprovider-parser.y |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7071bebc00ef86e8ce10b66766882cf96214998b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 12 17:54:54 2013 +0200

Fix C++11'ism

Change-Id: Ia2ecbbc9262b4e2b794914030f88e1c9d792cb5e

diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 6029151..7d5f108 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -1654,7 +1654,7 @@ attributeAccessDecl:
   assert(!pad-attributes.empty());
   pad-attributes.back().getExceptions = *$2;
   delete $2;
-  $$ = unoidl::detail::SourceProviderAccessDecls::ACCESS_DECL_GET;
+  $$ = unoidl::detail::ACCESS_DECL_GET;
   }
 | TOK_SET exceptionSpec ';'
   {
@@ -1673,7 +1673,7 @@ attributeAccessDecl:
+  cannot have set access declaration));
   YYERROR;
   }
-  $$ = unoidl::detail::SourceProviderAccessDecls::ACCESS_DECL_SET;
+  $$ = unoidl::detail::ACCESS_DECL_SET;
   }
 ;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-09-12 Thread Tor Lillqvist
 unoidl/source/sourceprovider-scanner.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b302e856f3cf8c0dcea745a94a9823f3cb01cac1
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Sep 12 21:27:58 2013 +0300

WaE: C4805: '!=' : unsafe mix of type 'bool' and type 'sal_Bool' in 
operation

Change-Id: I3fd7508a3b9c362661ad1bfa66901be9f938b8e6

diff --git a/unoidl/source/sourceprovider-scanner.hxx 
b/unoidl/source/sourceprovider-scanner.hxx
index 4509361..152b9cf 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -59,7 +59,7 @@ public:
 rtl::Referenceunoidl::PlainStructTypeEntity const  theBaseEntity):
 SourceProviderEntityPad(published), baseName(theBaseName),
 baseEntity(theBaseEntity)
-{ assert(theBaseName.isEmpty() != theBaseEntity.is()); }
+{ assert(theBaseName.isEmpty() != (bool) theBaseEntity.is()); }
 
 OUString const baseName;
 rtl::Referenceunoidl::PlainStructTypeEntity const baseEntity;
@@ -91,7 +91,7 @@ public:
 rtl::Referenceunoidl::ExceptionTypeEntity const  theBaseEntity):
 SourceProviderEntityPad(published), baseName(theBaseName),
 baseEntity(theBaseEntity)
-{ assert(theBaseName.isEmpty() != theBaseEntity.is()); }
+{ assert(theBaseName.isEmpty() != (bool) theBaseEntity.is()); }
 
 OUString const baseName;
 rtl::Referenceunoidl::ExceptionTypeEntity const baseEntity;
@@ -122,7 +122,7 @@ public:
 SourceProviderEntityPad(published),
 singleBase(!singleBaseName.isEmpty())
 {
-assert(singleBaseName.isEmpty() != singleBaseEntity.is());
+assert(singleBaseName.isEmpty() != (bool) singleBaseEntity.is());
 if (singleBase) {
 mandatoryBases.push_back(
 Base(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-07-09 Thread Stephan Bergmann
 unoidl/source/legacyprovider.cxx |   32 
 1 file changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 87bad231d6f81c611ba145aea483a568623ca42e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jul 9 19:48:21 2013 +0200

fdo#65589: Treat legacy types.rdb w/o /UCR key as empty

...as they are encountered in the wild.

Change-Id: Iae46d3b4b4aca18a09680caabc0e343f8a534989

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index e78dfe5..b92302d 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -96,16 +96,18 @@ Cursor::Cursor(
 RegistryKey const  key):
 manager_(manager), ucr_(ucr), key_(key), index_(0)
 {
-prefix_ = key_.getName();
-if (!prefix_.endsWith(/)) {
-prefix_ += /;
-}
-RegError e = key_.getKeyNames(, names_);
-if (e != REG_NO_ERROR) {
-throw FileFormatException(
-key_.getRegistryName(),
-(legacy format: cannot get sub-key names of  + key_.getName()
- + :  + OUString::number(e)));
+if (ucr_.isValid()) {
+prefix_ = key_.getName();
+if (!prefix_.endsWith(/)) {
+prefix_ += /;
+}
+RegError e = key_.getKeyNames(, names_);
+if (e != REG_NO_ERROR) {
+throw FileFormatException(
+key_.getRegistryName(),
+(legacy format: cannot get sub-key names of  + key_.getName()
+ + :  + OUString::number(e)));
+}
 }
 }
 
@@ -797,7 +799,11 @@ LegacyProvider::LegacyProvider(
 uri, legacy format: cannot open root key:  + 
OUString::number(e));
 }
 e = root.openKey(UCR, ucr_);
-if (e != REG_NO_ERROR) {
+switch (e) {
+case REG_NO_ERROR:
+case REG_KEY_NOT_EXISTS: // such effectively empty files exist in the wild
+break;
+default:
 throw FileFormatException(
 uri, legacy format: cannot open UCR key:  + OUString::number(e));
 }
@@ -810,7 +816,9 @@ rtl::Reference MapCursor  
LegacyProvider::createRootCursor() const {
 rtl::Reference Entity  LegacyProvider::findEntity(OUString const  name)
 const
 {
-return readEntity(manager_, ucr_, ucr_, name.replace('.', '/'), true);
+return ucr_.isValid()
+? readEntity(manager_, ucr_, ucr_, name.replace('.', '/'), true)
+: rtl::Reference Entity ();
 }
 
 LegacyProvider::~LegacyProvider() throw () {}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-04-24 Thread Stephan Bergmann
 unoidl/source/reg2unoidl.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit d7186fe43618eeb9082c34a65ccb303f7bbc770d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 24 15:16:31 2013 +0200

Copy/paste error

Change-Id: I0c6e0ecc5c9e6289a2afe733d4752351416900a8

diff --git a/unoidl/source/reg2unoidl.cxx b/unoidl/source/reg2unoidl.cxx
index 0f0b53e..a311147 100644
--- a/unoidl/source/reg2unoidl.cxx
+++ b/unoidl/source/reg2unoidl.cxx
@@ -150,10 +150,10 @@ void write64(osl::File  file, sal_uInt64 value) {
 buf[1] = (value  8)  0xFF;
 buf[2] = (value  16)  0xFF;
 buf[3] = (value  24)  0xFF;
-buf[3] = (value  32)  0xFF;
-buf[3] = (value  40)  0xFF;
-buf[3] = (value  48)  0xFF;
-buf[3] = (value  56)  0xFF;
+buf[4] = (value  32)  0xFF;
+buf[5] = (value  40)  0xFF;
+buf[6] = (value  48)  0xFF;
+buf[7] = (value  56)  0xFF;
 write(file, buf, SAL_N_ELEMENTS(buf));
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-04-02 Thread Stephan Bergmann
 unoidl/source/legacyprovider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6275ffee61554490af69b51eb669e4a0a0a33eb6
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Apr 2 16:11:46 2013 +0200

types.rdb format flags default service ctors as RT_MODE_TWOWAY

Change-Id: I94bc12af1dde2139b86c8d6522b61d874933ed6d

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 4b7fc3e..251ddae 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -551,7 +551,7 @@ rtl::Reference Entity  readEntity(
 std::vector SingleInterfaceBasedServiceEntity::Constructor 
 ctors;
 sal_uInt16 n = reader.getMethodCount();
-if (n == 1  reader.getMethodFlags(0) == 0
+if (n == 1  reader.getMethodFlags(0) == RT_MODE_TWOWAY
  reader.getMethodName(0).isEmpty()
  reader.getMethodReturnTypeName(0) == void
  reader.getMethodParameterCount(0) == 0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-04-02 Thread Stephan Bergmann
 unoidl/source/legacyprovider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fee628c8741d10b7e1ede9a0c20e26d8dbe3fa10
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Apr 2 17:47:54 2013 +0200

Off-by-one error

Change-Id: I2abd81782baf421ff4e70b158709dbe6da5e14e3

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 251ddae..0aa6ec5 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -591,7 +591,7 @@ rtl::Reference Entity  readEntity(
 if ((mode  RT_PARAM_REST) != 0
  !(m == 1
   ((reader.getMethodParameterTypeName(
-  j, 1))
+  j, 0))
  == any)))
 {
 throw FileFormatException(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-03-09 Thread Marc-André Laverdière
 unoidl/source/reg2unoidl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c93643db82d9af2f9369b5daf6298f6b86510f14
Author: Marc-André Laverdière marc-an...@atc.tcs.com
Date:   Fri Mar 8 19:37:59 2013 -0500

coverity#989730 and coverity#989729: Uninitialized scalar field

Change-Id: Iaecfa720b898746d457de731734b332226d3e9c2
Reviewed-on: https://gerrit.libreoffice.org/2607
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/unoidl/source/reg2unoidl.cxx b/unoidl/source/reg2unoidl.cxx
index 730d42e..0f0b53e 100644
--- a/unoidl/source/reg2unoidl.cxx
+++ b/unoidl/source/reg2unoidl.cxx
@@ -248,7 +248,7 @@ void writeKind(
 
 struct Item {
 explicit Item(rtl::Reference unoidl::Entity  const  theEntity):
-entity(theEntity)
+entity(theEntity),nameOffset(0),dataOffset(0)
 {}
 
 rtl::Reference unoidl::Entity  entity;
@@ -258,7 +258,7 @@ struct Item {
 
 struct ConstItem {
 explicit ConstItem(unoidl::ConstantValue const  theConstant):
-constant(theConstant)
+constant(theConstant),nameOffset(0),dataOffset(0)
 {}
 
 unoidl::ConstantValue constant;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-03-01 Thread Stephan Bergmann
 unoidl/source/reg2unoidl.cxx |   37 -
 1 file changed, 20 insertions(+), 17 deletions(-)

New commits:
commit 97b3bf8b03afef45565821d5e17bffa5d8e90474
Author: Stephan Bergmann sberg...@redhat.com
Date:   Sat Mar 2 00:01:08 2013 +0100

Don't use local types as template arguments (C++11 only feature)

Change-Id: I19b7105b62464234cb72de701b07176f951a7951

diff --git a/unoidl/source/reg2unoidl.cxx b/unoidl/source/reg2unoidl.cxx
index b0a013d..c73909a 100644
--- a/unoidl/source/reg2unoidl.cxx
+++ b/unoidl/source/reg2unoidl.cxx
@@ -246,19 +246,31 @@ void writeKind(
 write8(file, v);
 }
 
+struct Item {
+explicit Item(rtl::Reference unoidl::Entity  const  theEntity):
+entity(theEntity)
+{}
+
+rtl::Reference unoidl::Entity  entity;
+sal_uInt64 nameOffset;
+sal_uInt64 dataOffset;
+};
+
+struct ConstItem {
+explicit ConstItem(unoidl::ConstantValue const  theConstant):
+constant(theConstant)
+{}
+
+unoidl::ConstantValue constant;
+sal_uInt64 nameOffset;
+sal_uInt64 dataOffset;
+};
+
 sal_uInt64 writeMap(
 osl::File  file, rtl::Reference unoidl::MapCursor  const  cursor,
 std::size_t * rootSize)
 {
 assert(cursor.is());
-struct Item {
-explicit Item(rtl::Reference unoidl::Entity  const  theEntity):
-entity(theEntity)
-{}
-rtl::Reference unoidl::Entity  entity;
-sal_uInt64 nameOffset;
-sal_uInt64 dataOffset;
-};
 std::map OUString, Item  map;
 for (;;) {
 OUString name;
@@ -468,15 +480,6 @@ sal_uInt64 writeMap(
 rtl::Reference unoidl::ConstantGroupEntity  ent2(
 static_cast unoidl::ConstantGroupEntity * (
 i-second.entity.get()));
-struct ConstItem {
-explicit ConstItem(
-unoidl::ConstantValue const  theConstant):
-constant(theConstant)
-{}
-unoidl::ConstantValue constant;
-sal_uInt64 nameOffset;
-sal_uInt64 dataOffset;
-};
 std::map OUString, ConstItem  cmap;
 for (std::vector unoidl::ConstantGroupEntity::Member ::
  const_iterator j(ent2-getMembers().begin());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-03-01 Thread Julien Nabet
 unoidl/source/reg2unoidl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 380b858de9f6aae1ee74d3d8f0f7cf75fb68f207
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Mar 2 07:45:30 2013 +0100

Fix shadowed declaration of e

Change-Id: I42740c0b01d33c90e6ad9f86a658ef27c2673fd3

diff --git a/unoidl/source/reg2unoidl.cxx b/unoidl/source/reg2unoidl.cxx
index c73909a..730d42e 100644
--- a/unoidl/source/reg2unoidl.cxx
+++ b/unoidl/source/reg2unoidl.cxx
@@ -753,9 +753,9 @@ SAL_IMPLEMENT_MAIN() {
 std::size_t size;
 try {
 off = writeMap(f, prov-createRootCursor(), size);
-} catch (unoidl::FileFormatException  e) {
+} catch (unoidl::FileFormatException  e1) {
 std::cerr
- Bad input   e.getUri()  :   e.getDetail()
+ Bad input   e1.getUri()  :   e1.getDetail()
  std::endl;
 std::exit(EXIT_FAILURE);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: unoidl/source

2013-03-01 Thread Tor Lillqvist
 unoidl/source/legacyprovider.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit b2265f06ea45d36edb579d2a385fcc62a7308513
Author: Tor Lillqvist t...@iki.fi
Date:   Sat Mar 2 09:39:11 2013 +0200

Avoid C++11 scoped enums

Change-Id: I6f7db048e1f9dfcd47acbfe432c3abeb350979de

diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 0f620bc..4b7fc3e 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -294,16 +294,13 @@ rtl::Reference Entity  readEntity(
 InterfaceTypeEntity::Method::Parameter::Direction dir;
 switch (mode) {
 case RT_PARAM_IN:
-dir = InterfaceTypeEntity::Method::Parameter::
-Direction::DIRECTION_IN;
+dir = 
InterfaceTypeEntity::Method::Parameter::DIRECTION_IN;
 break;
 case RT_PARAM_OUT:
-dir = InterfaceTypeEntity::Method::Parameter::
-Direction::DIRECTION_OUT;
+dir = 
InterfaceTypeEntity::Method::Parameter::DIRECTION_OUT;
 break;
 case RT_PARAM_INOUT:
-dir = InterfaceTypeEntity::Method::Parameter::
-Direction::DIRECTION_IN_OUT;
+dir = 
InterfaceTypeEntity::Method::Parameter::DIRECTION_IN_OUT;
 break;
 default:
 throw FileFormatException(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits