* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
#include <assert.h>
static FcBool
-FcStrHashed (const FcChar8 *name);
+FcHashOwnsName(const FcChar8 *name);
FcPattern *
FcPatternCreate (void)
{
switch (v.type) {
case FcTypeString:
- if (!FcStrHashed (v.u.s))
+ if (!FcHashOwnsName(v.u.s))
FcStrFree ((FcChar8 *) v.u.s);
break;
case FcTypeMatrix:
{
switch (v.type) {
case FcTypeString:
- v.u.s = FcStrCopy (v.u.s);
+ v.u.s = FcStrStaticName (v.u.s);
if (!v.u.s)
v.type = FcTypeVoid;
break;
{
switch (l->value.type) {
case FcTypeString:
- if (!FcStrHashed ((FcChar8 *)l->value.u.s))
+ if (!FcHashOwnsName((FcChar8 *)l->value.u.s))
FcStrFree ((FcChar8 *)l->value.u.s);
break;
case FcTypeMatrix:
static FcChar32
FcValueHash (const FcValue *v)
{
- switch (fc_storage_type(v)) {
+ switch (v->type) {
case FcTypeVoid:
return 0;
case FcTypeInteger:
memset(new, 0, sizeof (FcValueList));
FcMemAlloc (FC_MEM_VALLIST, sizeof (FcValueList));
- /* dup string */
- if (value.type == FcTypeString)
- {
- value.u.s = FcStrStaticName (value.u.s);
- if (!value.u.s)
- value.type = FcTypeVoid;
- }
- else
- value = FcValueSave (value);
+ value = FcValueSave (value);
if (value.type == FcTypeVoid)
goto bail1;
}
}
}
- return p;
+ return ret;
bail0:
FcPatternDestroy (ret);
} *FcObjectBuckets[OBJECT_HASH_SIZE];
static FcBool
-FcStrHashed (const FcChar8 *name)
+FcHashOwnsName (const FcChar8 *name)
{
FcChar32 hash = FcStringHash (name);
struct objectBucket **p;
struct objectBucket *b;
for (p = &FcObjectBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next))
- if (b->hash == hash && !strcmp ((char *)name, (char *) (b + 1)))
+ if (b->hash == hash && ((char *)name == (char *) (b + 1)))
return FcTrue;
return FcFalse;
}