diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-11-30 16:04:57 +0100 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-11-30 16:04:57 +0100 |
commit | 6c48a64f2616d1bd0ba9cf9610fd53fc359e1270 (patch) | |
tree | 5b48edbb5a6f57a8d3101a1f13f6ebee6e86f059 /registry | |
parent | 219fe91ce289dd7b908aa9cc69c79409ff94068c (diff) |
#i115784# registry: fixed std::vector<> usage.
Diffstat (limited to 'registry')
-rw-r--r-- | registry/tools/checksingleton.cxx | 4 | ||||
-rw-r--r-- | registry/tools/regcompare.cxx | 42 |
2 files changed, 23 insertions, 23 deletions
diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx index b4fb1d6b04b2..680201c590d5 100644 --- a/registry/tools/checksingleton.cxx +++ b/registry/tools/checksingleton.cxx @@ -182,9 +182,9 @@ static sal_Bool checkSingletons(Options_Impl const & options, RegistryKey& singl if ((e != REG_VALUE_NOT_EXISTS) && (e != REG_INVALID_VALUE) && (valueType == RG_VALUETYPE_BINARY)) { std::vector< sal_uInt8 > value(size); - typeKey.getValue(tmpName, value.data()); // @@@ broken api: write to buffer w/o buffer size. + typeKey.getValue(tmpName, &value[0]); // @@@ broken api: write to buffer w/o buffer size. - RegistryTypeReader reader(value.data(), value.size(), sal_False); + RegistryTypeReader reader(&value[0], value.size(), sal_False); if ( reader.isValid() && reader.getTypeClass() == RT_TYPE_SINGLETON ) { RegistryKey entryKey; diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index 233d0f7152f3..86c06c272163 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -1410,16 +1410,16 @@ static sal_uInt32 checkValueDifference( if ( bEqual) { std::vector< sal_uInt8 > value1(size1); - key1.getValue(tmpName, value1.data()); + key1.getValue(tmpName, &value1[0]); std::vector< sal_uInt8 > value2(size2); - key2.getValue(tmpName, value2.data()); + key2.getValue(tmpName, &value2[0]); - bEqual = (rtl_compareMemory(value1.data(), value2.data(), value1.size()) == 0 ); + bEqual = (rtl_compareMemory(&value1[0], &value2[0], value1.size()) == 0 ); if ( !bEqual && valueType1 == RG_VALUETYPE_BINARY && valueType2 == RG_VALUETYPE_BINARY ) { - typereg::Reader reader1(value1.data(), value1.size(), false, TYPEREG_VERSION_1); - typereg::Reader reader2(value2.data(), value2.size(), false, TYPEREG_VERSION_1); + typereg::Reader reader1(&value1[0], value1.size(), false, TYPEREG_VERSION_1); + typereg::Reader reader2(&value2[0], value2.size(), false, TYPEREG_VERSION_1); if ( reader1.isValid() && reader2.isValid() ) { return checkBlob(options, key1.getName(), reader1, size1, reader2, size2); @@ -1450,33 +1450,33 @@ static sal_uInt32 checkValueDifference( case RG_VALUETYPE_LONG: { std::vector< sal_uInt8 > value1(size1); - key1.getValue(tmpName, value1.data()); + key1.getValue(tmpName, &value1[0]); fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_LONG\n"); fprintf( stdout, " Size = %lu\n", sal::static_int_cast< unsigned long >(size1)); - fprintf(stdout, " Data = %p\n", value1.data()); + fprintf(stdout, " Data = %p\n", &value1[0]); } break; case RG_VALUETYPE_STRING: { std::vector< sal_uInt8 > value1(size1); - key1.getValue(tmpName, value1.data()); + key1.getValue(tmpName, &value1[0]); fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_STRING\n"); fprintf( stdout, " Size = %lu\n", sal::static_int_cast< unsigned long >(size1)); - fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(value1.data())); + fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(&value1[0])); } break; case RG_VALUETYPE_UNICODE: { std::vector< sal_uInt8 > value1(size1); - key1.getValue(tmpName, value1.data()); + key1.getValue(tmpName, &value1[0]); - OUString uStrValue(reinterpret_cast<sal_Unicode const*>(value1.data())); + OUString uStrValue(reinterpret_cast<sal_Unicode const*>(&value1[0])); fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_UNICODE\n"); fprintf( stdout, " Size = %lu\n", @@ -1552,33 +1552,33 @@ static sal_uInt32 checkValueDifference( case RG_VALUETYPE_LONG: { std::vector< sal_uInt8 > value2(size2); - key2.getValue(tmpName, value2.data()); + key2.getValue(tmpName, &value2[0]); fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_LONG\n"); fprintf( stdout, " Size = %lu\n", sal::static_int_cast< unsigned long >(size2)); - fprintf(stdout, " Data = %p\n", value2.data()); + fprintf(stdout, " Data = %p\n", &value2[0]); } break; case RG_VALUETYPE_STRING: { std::vector< sal_uInt8 > value2(size2); - key2.getValue(tmpName, value2.data()); + key2.getValue(tmpName, &value2[0]); fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_STRING\n"); fprintf( stdout, " Size = %lu\n", sal::static_int_cast< unsigned long >(size2)); - fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(value2.data())); + fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(&value2[0])); } break; case RG_VALUETYPE_UNICODE: { std::vector< sal_uInt8 > value2(size2); - key2.getValue(tmpName, value2.data()); + key2.getValue(tmpName, &value2[0]); - OUString uStrValue(reinterpret_cast<sal_Unicode const*>(value2.data())); + OUString uStrValue(reinterpret_cast<sal_Unicode const*>(&value2[0])); fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_UNICODE\n"); fprintf( stdout, " Size = %lu\n", @@ -1692,7 +1692,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key { bool published = false; std::vector< sal_uInt8 > value(size); - if (subKey.getValue(rtl::OUString(), value.data()) != REG_NO_ERROR) + if (subKey.getValue(rtl::OUString(), &value[0]) != REG_NO_ERROR) { if (options.forceOutput()) { @@ -1706,7 +1706,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key } else { - published = typereg::Reader(value.data(), value.size(), false, TYPEREG_VERSION_1).isPublished(); + published = typereg::Reader(&value[0], value.size(), false, TYPEREG_VERSION_1).isPublished(); } if (published) { @@ -1793,7 +1793,7 @@ static sal_uInt32 checkDifferences( else if (type == RG_VALUETYPE_BINARY) { std::vector< sal_uInt8 > value(size); - if (subKey.getValue(rtl::OUString(), value.data()) != REG_NO_ERROR) + if (subKey.getValue(rtl::OUString(), &value[0]) != REG_NO_ERROR) { if (options.forceOutput()) { @@ -1808,7 +1808,7 @@ static sal_uInt32 checkDifferences( } else { - typereg::Reader reader(value.data(), value.size(), false, TYPEREG_VERSION_1); + typereg::Reader reader(&value[0], value.size(), false, TYPEREG_VERSION_1); if (reader.getTypeClass() == RT_TYPE_MODULE) { if (options.checkUnpublished() || hasPublishedChildren(options, subKey)) |