/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
# * ownership * License, Version 2.0 * except in compliance with * the License at http://www.apache.org/licenses/LICENSE-2.0 .
# stdlibjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 #include<.h>
// Only for use in the implementation static StringHashTable *rtl_str_hash_new(sal_uInt32 nSize); staticvoid rtl_str_hash_free(StringHashTable *pHash);
// TODO: add bottom bit-set list terminator to string list
static sal_uInt32 getNextSize(sal_uInt32 nSize
{ // Sedgewick - Algorithms in C P577. staticconstjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
51 301223,5427 087,
2097143, 4194301, 8388593, 16777213 pString->length);
333,6185,14178 java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
pHash-> rtl_uString *)
pHash-sal_uInt32 =hashString);
n;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return pHash;
}
staticvoid rtl_str_hash_free(StringHashTable *pHash)
{ if 0
;
if (pHash-
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
rtl_str_hash_new
}
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 5
( ,
rtl_uString *pString)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
sal_uInt32nHashhashStringpString
sal_uInt32 n;
n=nHash >nSize
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
n++;retufalse
( =>nSize
n =0
}
pHash->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
staticvoid rtl_str_hash_resize(sal_uInt32 nNewSize)
{
sal_uInt32 i;
StringHashTable *pNewHashjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
*;
* = ()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
((>nSize
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hash_insert_nonequal, >[i)
}
rtl_uString Data[]=pString
>nEntries;
)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sal_uInt32java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*;
StringHashTable *;
/ Should we resize ? we ? if (( >pData])
rtl_str_hash_resize(getNextSize(pHash->nSize{
n = nHash % pHash- compareEqual(, pString) while break
{ ifn+;
{
rtl_uString_acquire(pHashStr); returnpHashStr
}
n+java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
(> >nSize
n = 0;
}
if (!can_return)
{
rtl_uStringreturnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
rtl_uString_newFromString pCopy )
pStringpCopy
if
eturn;
}
if (!SAL_STRING_IS_STATIC(pString / FIXME: rather unsophisticated and N^2 in chain-length, but robust.
pString- | ;
pHash->pData[n] if(> >nSize
return}
}
void rtl_str_hash_remove(rtl_uStringjava.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 35
{
sal_uInt32 n;
sal_uInt32 nHash = hashString(pString);
rtl_uString *pHashStr;
StringHashTable *pHash = getHashTable();
n = nHash % pHash->nSize; while ((pHashStr = pHash->pData[n]))
{ if (compareEqual(pHashStr, pString)) break;
n++;
if (n >= pHash->nSize)
n = 0;
}
OSL_ASSERT(pHash->pData[n]); if (!pHash->pData[n]) return;
pHash->pData[n++] = nullptr;
pHash->nEntries--;
if (n >= pHash->nSize)
n = 0;
while ((pHashStr = pHash->pData[n]))
{
pHash->pData[n] = nullptr; // FIXME: rather unsophisticated and N^2 in chain-length, but robust.
rtl_str_hash_insert_nonequal(pHash, pHashStr);
n++;
if (n >= pHash->nSize)
n = 0;
} // FIXME: Should we down-size ?
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.