aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/FreeType
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-28 17:32:23 +0100
committermarha <marha@users.sourceforge.net>2014-03-28 17:32:23 +0100
commitd02e6760412c7a96abbc4d0add5dd8d5e83bbe27 (patch)
tree4b6d1589095565bbd7064aa6b7217b69910bbae3 /libXfont/src/FreeType
parent13d96866ca5d0e2be51f20a72da9e0f7032a16ea (diff)
downloadvcxsrv-d02e6760412c7a96abbc4d0add5dd8d5e83bbe27.tar.gz
vcxsrv-d02e6760412c7a96abbc4d0add5dd8d5e83bbe27.tar.bz2
vcxsrv-d02e6760412c7a96abbc4d0add5dd8d5e83bbe27.zip
Update following packages:
libXfont-1.4.7 xproto-7.0.25
Diffstat (limited to 'libXfont/src/FreeType')
-rw-r--r--libXfont/src/FreeType/ftfuncs.c17
-rw-r--r--libXfont/src/FreeType/xttcap.c61
-rw-r--r--libXfont/src/FreeType/xttcap.h13
3 files changed, 31 insertions, 60 deletions
diff --git a/libXfont/src/FreeType/ftfuncs.c b/libXfont/src/FreeType/ftfuncs.c
index 918e3f37e..44e5e0288 100644
--- a/libXfont/src/FreeType/ftfuncs.c
+++ b/libXfont/src/FreeType/ftfuncs.c
@@ -2050,7 +2050,7 @@ restrict_code_range_by_str(int count,unsigned short *refFirstCol,
{
int nRanges = 0;
int result = 0;
- fsRange *ranges = NULL;
+ fsRange *ranges = NULL, *oldRanges;
char const *p, *q;
p = q = str;
@@ -2119,10 +2119,13 @@ restrict_code_range_by_str(int count,unsigned short *refFirstCol,
fflush(stderr);
#endif
nRanges++;
+ oldRanges = ranges;
ranges = realloc(ranges, nRanges*sizeof(*ranges));
- if (NULL == ranges)
+ if (NULL == ranges) {
+ free(oldRanges);
break;
- {
+ }
+ else {
fsRange *r = ranges+nRanges-1;
r->min_char_low = minpoint & 0xff;
@@ -2204,7 +2207,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
strcpy(*dynStrRealFileName+dirLen, p2+1);
capHead = p1;
} else {
- *dynStrRealFileName = xstrdup(fileName);
+ *dynStrRealFileName = strdup(fileName);
if( *dynStrRealFileName == NULL ) {
result = AllocError;
goto quit;
@@ -2289,13 +2292,11 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
}
}
else{
- *dynStrFTFileName = malloc(strlen(*dynStrRealFileName)+1);
+ *dynStrFTFileName = strdup(*dynStrRealFileName);
if( *dynStrFTFileName == NULL ){
result = AllocError;
goto quit;
}
- **dynStrFTFileName = '\0';
- strcat(*dynStrFTFileName,*dynStrRealFileName);
}
}
/*
@@ -2549,7 +2550,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
if (SPropRecValList_search_record(&listPropRecVal,
&contRecValue,
"CodeRange")) {
- *dynStrTTCapCodeRange = xstrdup(SPropContainer_value_str(contRecValue));
+ *dynStrTTCapCodeRange = strdup(SPropContainer_value_str(contRecValue));
if( *dynStrTTCapCodeRange == NULL ) {
result = AllocError;
goto quit;
diff --git a/libXfont/src/FreeType/xttcap.c b/libXfont/src/FreeType/xttcap.c
index c2a412091..104dc89e4 100644
--- a/libXfont/src/FreeType/xttcap.c
+++ b/libXfont/src/FreeType/xttcap.c
@@ -1,7 +1,7 @@
/* ===EmacsMode: -*- Mode: C; tab-width:4; c-basic-offset: 4; -*- === */
/* ===FileName: ===
Copyright (c) 1998 Takuya SHIOZAKI, All Rights reserved.
- Copyright (c) 1998 X-TrueType Server Project, All rights reserved.
+ Copyright (c) 1998 X-TrueType Server Project, All rights reserved.
Copyright (c) 2003 After X-TT Project, All rights reserved.
===Notice
@@ -133,7 +133,7 @@ get_record_type_by_name(SPropertyRecord const ** const refRefRecord, /*result*/
{
Bool result = False;
int i;
-
+
*refRefRecord = NULL;
for (i=0; i<numOfValidRecords; i++) {
if (!strcasecmp(validRecords[i].strRecordName, strName)) {
@@ -142,7 +142,7 @@ get_record_type_by_name(SPropertyRecord const ** const refRefRecord, /*result*/
break;
}
}
-
+
return result;
}
@@ -161,7 +161,7 @@ SPropRecValList_add_record(SDynPropRecValList *pThisList,
{
int val;
char *endPtr;
-
+
val = strtol(strValue, &endPtr, 0);
if ('\0' != *endPtr) {
fprintf(stderr,
@@ -178,7 +178,7 @@ SPropRecValList_add_record(SDynPropRecValList *pThisList,
{
double val;
char *endPtr;
-
+
val = strtod(strValue, &endPtr);
if ('\0' != *endPtr) {
fprintf(stderr,
@@ -194,7 +194,7 @@ SPropRecValList_add_record(SDynPropRecValList *pThisList,
case eRecTypeBool:
{
Bool val;
-
+
if (!strcasecmp(strValue, "yes"))
val = True;
else if (!strcasecmp(strValue, "y"))
@@ -233,15 +233,14 @@ SPropRecValList_add_record(SDynPropRecValList *pThisList,
case eRecTypeString:
{
char *p;
-
- if (NULL == (p = malloc(strlen(strValue)+1))) {
+
+ if (NULL == (p = strdup(strValue))) {
fprintf(stderr,
"truetype font property : "
"cannot allocate memory.\n");
result = True;
goto quit;
}
- strcpy(p, strValue);
SPropContainer_value_str(&tmpContainerE) = p;
}
break;
@@ -257,7 +256,7 @@ SPropRecValList_add_record(SDynPropRecValList *pThisList,
{
/* add to list */
SPropRecValListNodeP *newNode;
-
+
if (NULL == (newNode = malloc(sizeof(*newNode)))) {
fprintf(stderr,
"truetype font property : "
@@ -301,11 +300,11 @@ get_one_line(FILE *is, char *buf)
Bool flInDoubleQuote = False;
Bool flBackSlash = False;
Bool flFirstElement = True;
-
+
*buf = '\0';
for (;;) {
int c = fgetc(is);
-
+
if (ferror(is)) {
fprintf(stderr, "truetype font property file : read error.\n");
result = True;
@@ -446,7 +445,7 @@ parse_one_line(SDynPropRecValList *pThisList, FILE *is)
Bool result = False;
char *buf = NULL;
char *recordHead, *valueHead = NULL;
-
+
if (NULL == (buf = malloc(LEN_LINEBUF))) {
fprintf(stderr,
"truetype font property file : cannot allocate memory.\n");
@@ -483,7 +482,7 @@ parse_one_line(SDynPropRecValList *pThisList, FILE *is)
}
quit:
free(buf);
- abort:
+ abort:
return result;
}
@@ -494,7 +493,7 @@ SPropRecValList_read_prop_file(SDynPropRecValList *pThisList,
{
Bool result = False;
FILE *is;
-
+
#if 1
if (!strcmp(strFileName, "-"))
is = stdin;
@@ -530,7 +529,7 @@ Bool /* True == Error, False == Success */
SPropRecValList_new(SDynPropRecValList *pThisList)
{
Bool result = False;
-
+
pThisList->headNode = NULL;
return result;
@@ -582,7 +581,7 @@ SPropRecValList_search_record(SRefPropRecValList *pThisList,
{
Bool result = False;
SPropRecValListNodeP *p;
-
+
*refRecValue = NULL;
for (p=pThisList->headNode; NULL!=p; p=p->nextNode) {
if (!strcasecmp(p->containerE.refRecordType->strRecordName,
@@ -605,7 +604,7 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList,
Bool result = False;
/* SPropertyRecord const *refRecordType; */
char const *term;
-
+
if (NULL == (term = strrchr(strCapHead, ':')))
goto abort;
@@ -646,7 +645,7 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList,
char *duplicated = malloc((nextColon-strCapHead)+1);
{
char *value;
-
+
memcpy(duplicated, strCapHead, nextColon-strCapHead);
duplicated[nextColon-strCapHead] = '\0';
if (NULL != (value=strchr(duplicated, '='))) {
@@ -654,7 +653,7 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList,
value++;
} else
value = &duplicated[nextColon-strCapHead];
-
+
for (i=0; i<numOfCorrespondRelations; i++) {
if (!strcasecmp(correspondRelations[i].capVariable,
duplicated)) {
@@ -676,30 +675,10 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList,
}
strCapHead = nextColon+1;
}
-
+
/* quit: */
abort:
return result;
}
-
-/**************************************************************************
- Functions (xttmisc)
- */
-
-/* strdup clone with using the allocator of X server */
-char *
-XttXstrdup(char const *str)
-{
- char *result;
-
- result = malloc(strlen(str)+1);
-
- if (result)
- strcpy(result, str);
-
- return result;
-}
-
-
/* end of file */
diff --git a/libXfont/src/FreeType/xttcap.h b/libXfont/src/FreeType/xttcap.h
index 6a09cf610..2822540bb 100644
--- a/libXfont/src/FreeType/xttcap.h
+++ b/libXfont/src/FreeType/xttcap.h
@@ -1,8 +1,8 @@
/* ===EmacsMode: -*- Mode: C; tab-width:4; c-basic-offset: 4; -*- === */
/* ===FileName: ===
Copyright (c) 1998 Takuya SHIOZAKI, All Rights reserved.
- Copyright (c) 1998 X-TrueType Server Project, All rights reserved.
- Copyright (c) 2003 After X-TT Project, All rights reserved.
+ Copyright (c) 1998 X-TrueType Server Project, All rights reserved.
+ Copyright (c) 2003 After X-TT Project, All rights reserved.
===Notice
Redistribution and use in source and binary forms, with or without
@@ -116,15 +116,6 @@ SPropRecValList_dump(SRefPropRecValList *refList);
#define SPropContainer_value_str(contRecVal)\
((contRecVal)->uValue.dynStringValue)
-/******************************************************
- Prototypes (xttmisc)
- */
-
-/* strdup clone */
-char * XttXstrdup(char const *str);
-#undef xstrdup
-#define xstrdup(s) XttXstrdup((char const*)s)
-
#endif /* !def _XTTCAP_H_ */
/* end of file */