mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtcudcfonted: Resolve compiler and coverity warnings
This commit is contained in:
parent
49d1ca38e4
commit
55c59be795
16 changed files with 127 additions and 115 deletions
|
@ -104,7 +104,7 @@ Widget w;
|
||||||
int low_code;
|
int low_code;
|
||||||
{
|
{
|
||||||
int hi_code;
|
int hi_code;
|
||||||
char *f;
|
char *f = NULL;
|
||||||
XImage image;
|
XImage image;
|
||||||
GC gc = XDefaultGC(display, 0);
|
GC gc = XDefaultGC(display, 0);
|
||||||
|
|
||||||
|
@ -124,8 +124,9 @@ int low_code;
|
||||||
|
|
||||||
if (open_font) {
|
if (open_font) {
|
||||||
f = (char *)FalReadFont(fid, hi_code | low_code, font_w, font_h);
|
f = (char *)FalReadFont(fid, hi_code | low_code, font_w, font_h);
|
||||||
if(f == (char *)FAL_ERROR)
|
if(f == NULL || f == (char *)FAL_ERROR) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if( EXISTS_FLAG == 0 ) {
|
if( EXISTS_FLAG == 0 ) {
|
||||||
memcpy(ptn, f, len);
|
memcpy(ptn, f, len);
|
||||||
image.data = (char *)ptn;
|
image.data = (char *)ptn;
|
||||||
|
@ -147,7 +148,7 @@ static void
|
||||||
SetPixmap(start_code)
|
SetPixmap(start_code)
|
||||||
{
|
{
|
||||||
int hi_code, low_code;
|
int hi_code, low_code;
|
||||||
char *f;
|
char *f = NULL;
|
||||||
XImage image;
|
XImage image;
|
||||||
GC gc = XDefaultGC(display, 0);
|
GC gc = XDefaultGC(display, 0);
|
||||||
|
|
||||||
|
@ -168,8 +169,9 @@ SetPixmap(start_code)
|
||||||
if (open_font) {
|
if (open_font) {
|
||||||
for (low_code=0; low_code < NUM; low_code++) {
|
for (low_code=0; low_code < NUM; low_code++) {
|
||||||
f = (char *)FalReadFont(fid, hi_code | low_code, font_w, font_h);
|
f = (char *)FalReadFont(fid, hi_code | low_code, font_w, font_h);
|
||||||
if(f == (char *)FAL_ERROR)
|
if(f == NULL || f == (char *)FAL_ERROR) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if( EXISTS_FLAG == 0 ) {
|
if( EXISTS_FLAG == 0 ) {
|
||||||
memcpy(ptn, f, len);
|
memcpy(ptn, f, len);
|
||||||
image.data = (char *)ptn;
|
image.data = (char *)ptn;
|
||||||
|
@ -316,7 +318,7 @@ Widget w;
|
||||||
XmString item[128];
|
XmString item[128];
|
||||||
XmString xcs;
|
XmString xcs;
|
||||||
int item_count, start_code, add_c;
|
int item_count, start_code, add_c;
|
||||||
char add[3];
|
char add[9];
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
XtSetArg(args[n], XmNmwmFunctions, MWM_FUNC_ALL | MWM_FUNC_CLOSE |
|
XtSetArg(args[n], XmNmwmFunctions, MWM_FUNC_ALL | MWM_FUNC_CLOSE |
|
||||||
|
@ -342,9 +344,9 @@ Widget w;
|
||||||
scroll = XmCreateScrolledList(base2, "scroll", args, n);
|
scroll = XmCreateScrolledList(base2, "scroll", args, n);
|
||||||
XtManageChild(scroll);
|
XtManageChild(scroll);
|
||||||
XtAddCallback(scroll, XmNbrowseSelectionCallback,
|
XtAddCallback(scroll, XmNbrowseSelectionCallback,
|
||||||
(XtCallbackProc)Code1Call, (XtPointer)start_code);
|
(XtCallbackProc)Code1Call, (XtPointer) (intptr_t) start_code);
|
||||||
XtAddCallback(scroll, XmNdefaultActionCallback,
|
XtAddCallback(scroll, XmNdefaultActionCallback,
|
||||||
(XtCallbackProc)Code1Call, (XtPointer)start_code);
|
(XtCallbackProc)Code1Call, (XtPointer) (intptr_t) start_code);
|
||||||
XmListSelectPos(scroll, 1, False);
|
XmListSelectPos(scroll, 1, False);
|
||||||
|
|
||||||
base3 = XtVaCreateManagedWidget("base3", xmRowColumnWidgetClass, base2,
|
base3 = XtVaCreateManagedWidget("base3", xmRowColumnWidgetClass, base2,
|
||||||
|
@ -377,7 +379,7 @@ Widget w;
|
||||||
add_c = 0;
|
add_c = 0;
|
||||||
for (i=0; i < NUM; i++) {
|
for (i=0; i < NUM; i++) {
|
||||||
if ((i % 16) == 0) {
|
if ((i % 16) == 0) {
|
||||||
sprintf(add, "%2.1X", add_c++);
|
snprintf(add, sizeof(add), "%2.1X", add_c++);
|
||||||
XtVaCreateManagedWidget(add, xmLabelWidgetClass, base3, NULL);
|
XtVaCreateManagedWidget(add, xmLabelWidgetClass, base3, NULL);
|
||||||
}
|
}
|
||||||
toggle[i] = XtVaCreateWidget("toggle",
|
toggle[i] = XtVaCreateWidget("toggle",
|
||||||
|
@ -387,13 +389,13 @@ Widget w;
|
||||||
XmNlabelType, XmPIXMAP,
|
XmNlabelType, XmPIXMAP,
|
||||||
XmNlabelPixmap, no_pix, NULL);
|
XmNlabelPixmap, no_pix, NULL);
|
||||||
XtAddCallback(toggle[i], XmNactivateCallback,
|
XtAddCallback(toggle[i], XmNactivateCallback,
|
||||||
(XtCallbackProc)Code2Call, (XtPointer)i);
|
(XtCallbackProc)Code2Call, (XtPointer) (intptr_t) i);
|
||||||
XtAddCallback(toggle[i], XmNarmCallback,
|
XtAddCallback(toggle[i], XmNarmCallback,
|
||||||
(XtCallbackProc)DrawCode, (XtPointer)i);
|
(XtCallbackProc)DrawCode, (XtPointer) (intptr_t) i);
|
||||||
XtAddCallback(toggle[i], XmNdisarmCallback,
|
XtAddCallback(toggle[i], XmNdisarmCallback,
|
||||||
(XtCallbackProc)DrawCode, (XtPointer)i);
|
(XtCallbackProc)DrawCode, (XtPointer) (intptr_t) i);
|
||||||
XtAddEventHandler(toggle[i], ExposureMask, False,
|
XtAddEventHandler(toggle[i], ExposureMask, False,
|
||||||
(XtEventHandler)DrawCode, (XtPointer)i);
|
(XtEventHandler)DrawCode, (XtPointer) (intptr_t) i);
|
||||||
}
|
}
|
||||||
XtManageChildren(toggle, NUM);
|
XtManageChildren(toggle, NUM);
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ char *argv[];
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ReadSnf.in_file == '\0' && xlfdname == '\0' ) {
|
if ( ReadSnf.in_file == NULL && xlfdname == NULL ) {
|
||||||
if ( code_area & SYSTM ) {
|
if ( code_area & SYSTM ) {
|
||||||
USAGE1("%s : The GPF output file name cannot be omitted.\n", argv[0] );
|
USAGE1("%s : The GPF output file name cannot be omitted.\n", argv[0] );
|
||||||
} else { /* string of charcter size */
|
} else { /* string of charcter size */
|
||||||
|
@ -526,6 +526,7 @@ int init_all;
|
||||||
close( pfd[1] );
|
close( pfd[1] );
|
||||||
close( 1 );
|
close( 1 );
|
||||||
if( dup( ofd ) < 0 ) {
|
if( dup( ofd ) < 0 ) {
|
||||||
|
close( ofd );
|
||||||
return DUP_ERROR;
|
return DUP_ERROR;
|
||||||
}
|
}
|
||||||
close( ofd );
|
close( ofd );
|
||||||
|
|
|
@ -204,7 +204,7 @@ char *argv[];
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Head.snf_file == NULL && xlfdname == '\0' ) {
|
if ( Head.snf_file == NULL && xlfdname == NULL ) {
|
||||||
if ( code_area & SYSTM ) {
|
if ( code_area & SYSTM ) {
|
||||||
USAGE1("%s : The SNF output file name cannot be omitted.\n", argv[0] );
|
USAGE1("%s : The SNF output file name cannot be omitted.\n", argv[0] );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -549,7 +549,7 @@ char *style ;
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ( gpfinf->in_file == '\0' && xlfdname == '\0' ) {
|
if ( gpfinf->in_file == NULL && xlfdname == NULL ) {
|
||||||
if ( code_area & SYSTM ) {
|
if ( code_area & SYSTM ) {
|
||||||
USAGE1("%s : The GPF output file name cannot be omitted.\n", com );
|
USAGE1("%s : The GPF output file name cannot be omitted.\n", com );
|
||||||
} else { /* string of charcter size */
|
} else { /* string of charcter size */
|
||||||
|
@ -703,6 +703,7 @@ int type ;
|
||||||
close( pfd[1] );
|
close( pfd[1] );
|
||||||
close( 1 );
|
close( 1 );
|
||||||
if( dup( out_fd ) < 0 ) {
|
if( dup( out_fd ) < 0 ) {
|
||||||
|
close( out_fd );
|
||||||
return DUP_ERROR;
|
return DUP_ERROR;
|
||||||
}
|
}
|
||||||
close( out_fd );
|
close( out_fd );
|
||||||
|
|
|
@ -350,7 +350,7 @@ static char *readfontfile( fname )
|
||||||
char *fname;
|
char *fname;
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
char *fp;
|
char *fp = NULL;
|
||||||
struct stat stat;
|
struct stat stat;
|
||||||
|
|
||||||
fd = open( fname,O_RDONLY );
|
fd = open( fname,O_RDONLY );
|
||||||
|
@ -390,6 +390,7 @@ char *fname;
|
||||||
if ( read( fd, fp, stat.st_size ) < 0 ) {
|
if ( read( fd, fp, stat.st_size ) < 0 ) {
|
||||||
USAGE("dtgpftobdf: can't read file.\n" );
|
USAGE("dtgpftobdf: can't read file.\n" );
|
||||||
close( fd );
|
close( fd );
|
||||||
|
free(fp);
|
||||||
return ( char * )-1;
|
return ( char * )-1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -864,9 +865,9 @@ unsigned int *fplistNum;
|
||||||
res->value = wkp->value;
|
res->value = wkp->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wklp->name = (CARD32)fpropvnPtr + wkp->name;
|
wklp->name = (CARD32) (intptr_t) fpropvnPtr + wkp->name;
|
||||||
if (wkp->indirect == TRUE) {
|
if (wkp->indirect == TRUE) {
|
||||||
wklp->value = (INT32)fpropvnPtr + wkp->value;
|
wklp->value = (INT32) (intptr_t) fpropvnPtr + wkp->value;
|
||||||
} else {
|
} else {
|
||||||
wklp->value = wkp->value;
|
wklp->value = wkp->value;
|
||||||
}
|
}
|
||||||
|
@ -942,12 +943,12 @@ PropTmp *proptmp;
|
||||||
|
|
||||||
f = proptmp->psize.value / 10.0;
|
f = proptmp->psize.value / 10.0;
|
||||||
if ( ( proptmp->psize.value % 10 ) != 0 ) {
|
if ( ( proptmp->psize.value % 10 ) != 0 ) {
|
||||||
sprintf( buf1,"%.1f",f );
|
snprintf( buf1, sizeof(buf1), "%.1f",f );
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf1,"%.0f",f);
|
snprintf( buf1, sizeof(buf1), "%.0f",f);
|
||||||
}
|
}
|
||||||
k = ( ( proptmp->resolution.value * 72.27 ) / 100.0 ) + 1;
|
k = ( ( proptmp->resolution.value * 72.27 ) / 100.0 ) + 1;
|
||||||
sprintf( buf2, "%d %d", k, k );
|
snprintf( buf2, sizeof(buf2), "%d %d", k, k );
|
||||||
fprintf( stdout,"SIZE %s %s\n", buf1, buf2 );
|
fprintf( stdout,"SIZE %s %s\n", buf1, buf2 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -964,26 +965,26 @@ unsigned int fplistNum;
|
||||||
int i, k;
|
int i, k;
|
||||||
|
|
||||||
bufp = buf;
|
bufp = buf;
|
||||||
k = sprintf( bufp,"STARTPROPERTIES %d\n", fplistNum+3 );
|
k = snprintf( bufp, sizeof(buf), "STARTPROPERTIES %d\n", fplistNum+3 );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
k = sprintf( bufp, "FONT_ASCENT %d\n", fip->fontAscent );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "FONT_ASCENT %d\n", fip->fontAscent );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
k = sprintf( bufp, "FONT_DESCENT %d\n", fip->fontDescent );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "FONT_DESCENT %d\n", fip->fontDescent );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
k = sprintf( bufp, "DEFAULT_CHAR %d\n", fip->chDefault );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "DEFAULT_CHAR %d\n", fip->chDefault );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
wkp = fplistPtr;
|
wkp = fplistPtr;
|
||||||
for ( i = 0; i < fplistNum; i++ ) {
|
for ( i = 0; i < fplistNum; i++ ) {
|
||||||
if ( wkp->indirect == TRUE ) {
|
if ( wkp->indirect == TRUE ) {
|
||||||
k = sprintf( bufp, "%s \"%s\"\n", wkp->name, wkp->value );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "%s \"%s\"\n", (char *) (intptr_t) wkp->name, (char *) (intptr_t) wkp->value );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
} else {
|
} else {
|
||||||
k = sprintf( bufp, "%s %d\n", wkp->name, wkp->value );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "%s %d\n", (char *) (intptr_t) wkp->name, wkp->value );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
}
|
}
|
||||||
wkp++;
|
wkp++;
|
||||||
}
|
}
|
||||||
k = sprintf( bufp, "ENDPROPERTIES\n" );
|
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "ENDPROPERTIES\n" );
|
||||||
bufp += k;
|
bufp += k;
|
||||||
*bufp = '\0';
|
*bufp = '\0';
|
||||||
fprintf( stdout, "%s", buf );
|
fprintf( stdout, "%s", buf );
|
||||||
|
@ -1094,7 +1095,7 @@ unsigned int glyphPad;
|
||||||
for ( i = 0; i < bbh; i++ ) {
|
for ( i = 0; i < bbh; i++ ) {
|
||||||
bufp = buf;
|
bufp = buf;
|
||||||
for ( j = 0; j < bml; j++ ) {
|
for ( j = 0; j < bml; j++ ) {
|
||||||
sprintf( bufp, "%s", cvtp[(unsigned char)glyph[j]] );
|
sprintf( bufp, "%s", (char *) cvtp[(unsigned char)glyph[j]] );
|
||||||
bufp += 2;
|
bufp += 2;
|
||||||
}
|
}
|
||||||
fprintf( stdout, "%.*s\n", bml*2, buf );
|
fprintf( stdout, "%.*s\n", bml*2, buf );
|
||||||
|
|
|
@ -250,7 +250,7 @@ char *argv[];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Head.in_file == NULL && xlfdname == '\0' ) {
|
if ( Head.in_file == NULL && xlfdname == NULL ) {
|
||||||
if ( code_area & SYSTM ) {
|
if ( code_area & SYSTM ) {
|
||||||
USAGE1("%s : The GPF output file name cannot be omitted.\n", argv[0] );
|
USAGE1("%s : The GPF output file name cannot be omitted.\n", argv[0] );
|
||||||
} else {
|
} else {
|
||||||
|
@ -605,23 +605,20 @@ FalGlyphRegion *gr ;
|
||||||
if( (code_num >= gr[i].start) && (code_num <= gr[i].end) )
|
if( (code_num >= gr[i].start) && (code_num <= gr[i].end) )
|
||||||
return( code_num );
|
return( code_num );
|
||||||
}
|
}
|
||||||
err_flg = 1 ;
|
|
||||||
}
|
}
|
||||||
if (err_flg) {
|
|
||||||
switch( mode ) {
|
switch( mode ) {
|
||||||
case 0:
|
case 0:
|
||||||
USAGE2("%s : The specification of the extract start code is improper.\"%s\"¡¥\n",
|
USAGE2("%s : The specification of the extract start code is improper.\"%s\"¡¥\n",
|
||||||
prog_name, code_str);
|
prog_name, code_str);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
USAGE2("%s : The specification of the extract end code is improper.\"%s\"¡¥\n",
|
USAGE2("%s : The specification of the extract end code is improper.\"%s\"¡¥\n",
|
||||||
prog_name, code_str);
|
prog_name, code_str);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
USAGE2("%s : The specification of the extract code is improper.\"%s\"¡¥\n",
|
USAGE2("%s : The specification of the extract code is improper.\"%s\"¡¥\n",
|
||||||
prog_name, code_str);
|
prog_name, code_str);
|
||||||
}
|
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,6 +623,7 @@ store_to_database(db)
|
||||||
if(new->name){
|
if(new->name){
|
||||||
Xfree(new->name);
|
Xfree(new->name);
|
||||||
}
|
}
|
||||||
|
Xfree(new);
|
||||||
}
|
}
|
||||||
if(parse_info.value){
|
if(parse_info.value){
|
||||||
if(*parse_info.value){
|
if(*parse_info.value){
|
||||||
|
|
|
@ -457,8 +457,8 @@ XLCdGenericPart *gen;
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
strcpy(cset_name,value[0]);
|
snprintf(cset_name, sizeof(cset_name), "%s", value[0]);
|
||||||
sprintf(name, "%s.%s", csd , "side");
|
snprintf(name, sizeof(name), "%s.%s", csd , "side");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
|
@ -495,21 +495,21 @@ XLCdGenericPart *gen;
|
||||||
/* side */
|
/* side */
|
||||||
charsetd->side = side ;
|
charsetd->side = side ;
|
||||||
/* length */
|
/* length */
|
||||||
sprintf(name, "%s.%s", csd , "length");
|
snprintf(name, sizeof(name), "%s.%s", csd , "length");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
charsetd->char_size = atoi(value[0]);
|
charsetd->char_size = atoi(value[0]);
|
||||||
}
|
}
|
||||||
/* gc_number */
|
/* gc_number */
|
||||||
sprintf(name, "%s.%s", csd , "gc_number");
|
snprintf(name, sizeof(name), "%s.%s", csd , "gc_number");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
charsetd->set_size = atoi(value[0]);
|
charsetd->set_size = atoi(value[0]);
|
||||||
}
|
}
|
||||||
/* string_encoding */
|
/* string_encoding */
|
||||||
sprintf(name, "%s.%s", csd , "string_encoding");
|
snprintf(name, sizeof(name), "%s.%s", csd , "string_encoding");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
|
@ -520,7 +520,7 @@ XLCdGenericPart *gen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* sequence */
|
/* sequence */
|
||||||
sprintf(name, "%s.%s", csd , "sequence");
|
snprintf(name, sizeof(name), "%s.%s", csd , "sequence");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
|
@ -537,7 +537,7 @@ XLCdGenericPart *gen;
|
||||||
string_to_encoding(value[0],tmp);
|
string_to_encoding(value[0],tmp);
|
||||||
}
|
}
|
||||||
/* encoding_name */
|
/* encoding_name */
|
||||||
sprintf(name, "%s.%s", csd , "encoding_name");
|
snprintf(name, sizeof(name), "%s.%s", csd , "encoding_name");
|
||||||
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
_fallcGetResource(lcd, "XLC_CHARSET_DEFINE", name, &value, &num);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
dbg_printValue(name,value,num);
|
dbg_printValue(name,value,num);
|
||||||
|
@ -698,6 +698,7 @@ int num;
|
||||||
if(strchr(value[0],':')){
|
if(strchr(value[0],':')){
|
||||||
ret->name = (char *)Xmalloc(strlen(value[0])+1);
|
ret->name = (char *)Xmalloc(strlen(value[0])+1);
|
||||||
if(ret->name == NULL){
|
if(ret->name == NULL){
|
||||||
|
XFree(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
strcpy(ret->name,value[0]);
|
strcpy(ret->name,value[0]);
|
||||||
|
@ -706,24 +707,27 @@ int num;
|
||||||
ptr++;
|
ptr++;
|
||||||
if( !_fallcNCompareISOLatin1(ptr, "none", 4) ){
|
if( !_fallcNCompareISOLatin1(ptr, "none", 4) ){
|
||||||
ret->side = XlcNONE ;
|
ret->side = XlcNONE ;
|
||||||
sprintf(cset_name,"%s:%s",ret->name,"none");
|
snprintf(cset_name,sizeof(cset_name),"%s:%s",ret->name,"none");
|
||||||
} else
|
} else
|
||||||
if( !_fallcNCompareISOLatin1(ptr, "GL", 2) ){
|
if( !_fallcNCompareISOLatin1(ptr, "GL", 2) ){
|
||||||
ret->side = XlcGL ;
|
ret->side = XlcGL ;
|
||||||
sprintf(cset_name,"%s:%s",ret->name,"GL");
|
snprintf(cset_name,sizeof(cset_name),"%s:%s",ret->name,"GL");
|
||||||
} else {
|
} else {
|
||||||
ret->side = XlcGR ;
|
ret->side = XlcGR ;
|
||||||
sprintf(cset_name,"%s:%s",ret->name,"GR");
|
snprintf(cset_name,sizeof(cset_name),"%s:%s",ret->name,"GR");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret->name = (char *)Xmalloc(strlen(value[0])+1);
|
ret->name = (char *)Xmalloc(strlen(value[0])+1);
|
||||||
if(ret->name == NULL){
|
if(ret->name == NULL){
|
||||||
|
XFree(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
strcpy(ret->name,value[0]);
|
strcpy(ret->name,value[0]);
|
||||||
}
|
}
|
||||||
ret->area = (FontScope)Xmalloc((num - 1)*sizeof(FontScopeRec));
|
ret->area = (FontScope)Xmalloc((num - 1)*sizeof(FontScopeRec));
|
||||||
if(ret->area == NULL){
|
if(ret->area == NULL){
|
||||||
|
XFree(ret->name);
|
||||||
|
XFree(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
ret->area_num = num - 1;
|
ret->area_num = num - 1;
|
||||||
|
@ -735,7 +739,10 @@ int num;
|
||||||
if(new){
|
if(new){
|
||||||
tmp = (char *)Xmalloc(strlen(cset_name)+1);
|
tmp = (char *)Xmalloc(strlen(cset_name)+1);
|
||||||
if(tmp == NULL){
|
if(tmp == NULL){
|
||||||
return 0;
|
XFree(ret->area);
|
||||||
|
XFree(ret->name);
|
||||||
|
XFree(ret);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
strcpy(tmp,cset_name);
|
strcpy(tmp,cset_name);
|
||||||
ret->charset->name = tmp;
|
ret->charset->name = tmp;
|
||||||
|
|
|
@ -79,6 +79,7 @@ from the X Consortium.
|
||||||
* Katsuhisa Yano TOSHIBA Corp.
|
* Katsuhisa Yano TOSHIBA Corp.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include "_fallibint.h"
|
#include "_fallibint.h"
|
||||||
#include "_fallcint.h"
|
#include "_fallcint.h"
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
|
@ -499,12 +500,12 @@ _fallcCopyFromArg(src, dst, size)
|
||||||
*((long *) dst) = (long) src;
|
*((long *) dst) = (long) src;
|
||||||
#ifdef LONG64
|
#ifdef LONG64
|
||||||
else if (size == sizeof(int))
|
else if (size == sizeof(int))
|
||||||
*((int *) dst) = (int) src;
|
*((int *) dst) = (int) (intptr_t) src;
|
||||||
#endif
|
#endif
|
||||||
else if (size == sizeof(short))
|
else if (size == sizeof(short))
|
||||||
*((short *) dst) = (short) src;
|
*((short *) dst) = (short) (intptr_t) src;
|
||||||
else if (size == sizeof(char))
|
else if (size == sizeof(char))
|
||||||
*((char *) dst) = (char) src;
|
*((char *) dst) = (char) (intptr_t) src;
|
||||||
else if (size == sizeof(XPointer))
|
else if (size == sizeof(XPointer))
|
||||||
*((XPointer *) dst) = (XPointer) src;
|
*((XPointer *) dst) = (XPointer) src;
|
||||||
else if (size > sizeof(XPointer))
|
else if (size > sizeof(XPointer))
|
||||||
|
|
|
@ -625,19 +625,20 @@ static char
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(field_num < CHARSET_ENCODING_FIELD)
|
if(field_num < CHARSET_ENCODING_FIELD) {
|
||||||
|
Xfree(pattern);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Pixel Size field : fields[6] */
|
/* Pixel Size field : fields[6] */
|
||||||
for(ptr = fields[PIXEL_SIZE_FIELD - 1] ; ptr && *ptr; ptr++) {
|
for(ptr = fields[PIXEL_SIZE_FIELD - 1] ; ptr && *ptr; ptr++) {
|
||||||
if(!isdigit(*ptr)) {
|
if(!isdigit(*ptr)) {
|
||||||
if(pattern)
|
Xfree(pattern);
|
||||||
Xfree(pattern);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pixel_size = atoi(fields[PIXEL_SIZE_FIELD - 1]);
|
pixel_size = atoi(fields[PIXEL_SIZE_FIELD - 1]);
|
||||||
sprintf(str_pixel, "[ 0 ~%d %d 0 ]", pixel_size, pixel_size);
|
snprintf(str_pixel, sizeof(str_pixel), "[ 0 ~%d %d 0 ]", pixel_size, pixel_size);
|
||||||
fields[6] = str_pixel;
|
fields[6] = str_pixel;
|
||||||
|
|
||||||
/* Point Size field : fields[7] */
|
/* Point Size field : fields[7] */
|
||||||
|
@ -647,7 +648,7 @@ static char
|
||||||
rotate_font[0] = '\0';
|
rotate_font[0] = '\0';
|
||||||
for(field_num = 0 ; field_num < CHARSET_ENCODING_FIELD &&
|
for(field_num = 0 ; field_num < CHARSET_ENCODING_FIELD &&
|
||||||
fields[field_num] ; field_num++) {
|
fields[field_num] ; field_num++) {
|
||||||
sprintf(rotate_font, "%s-%s", rotate_font, fields[field_num]);
|
snprintf(rotate_font, sizeof(rotate_font), "%s-%s", rotate_font, fields[field_num]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pattern)
|
if(pattern)
|
||||||
|
@ -713,7 +714,6 @@ parse_omit_name(oc, font_data, pattern)
|
||||||
|
|
||||||
if(is_match_charset(font_data, pattern) == True) {
|
if(is_match_charset(font_data, pattern) == True) {
|
||||||
strcpy(buf, pattern);
|
strcpy(buf, pattern);
|
||||||
length = strlen(pattern);
|
|
||||||
if (font_name = get_font_name(oc, buf)) {
|
if (font_name = get_font_name(oc, buf)) {
|
||||||
font_data->xlfd_name = (char *)Xmalloc(strlen(font_name) + 1);
|
font_data->xlfd_name = (char *)Xmalloc(strlen(font_name) + 1);
|
||||||
if(font_data->xlfd_name == NULL) {
|
if(font_data->xlfd_name == NULL) {
|
||||||
|
@ -1674,8 +1674,10 @@ char **value;
|
||||||
bufptr++ ;
|
bufptr++ ;
|
||||||
}
|
}
|
||||||
font_data->name = (char *) Xmalloc(len + 1);
|
font_data->name = (char *) Xmalloc(len + 1);
|
||||||
if (font_data->name == NULL)
|
if (font_data->name == NULL) {
|
||||||
|
XFree(font_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
strncpy(font_data->name, buf,len);
|
strncpy(font_data->name, buf,len);
|
||||||
font_data->name[len] = 0;
|
font_data->name[len] = 0;
|
||||||
if (bufptr && _fallcCompareISOLatin1(bufptr, "GL") == 0)
|
if (bufptr && _fallcCompareISOLatin1(bufptr, "GL") == 0)
|
||||||
|
@ -1726,7 +1728,7 @@ int num;
|
||||||
char **value, buf[BUFSIZ], *bufptr;
|
char **value, buf[BUFSIZ], *bufptr;
|
||||||
int count,i;
|
int count,i;
|
||||||
|
|
||||||
sprintf(buf, "fs%d.font.vertical_map", num);
|
snprintf(buf, sizeof(buf), "fs%d.font.vertical_map", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
dbg_printValue(buf,value,count);
|
dbg_printValue(buf,value,count);
|
||||||
|
@ -1734,7 +1736,7 @@ int num;
|
||||||
font_set->vmap = falread_EncodingInfo(count,value);
|
font_set->vmap = falread_EncodingInfo(count,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "fs%d.font.vertical_rotate", num);
|
snprintf(buf, sizeof(buf), "fs%d.font.vertical_rotate", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
dbg_printValue(buf,value,count);
|
dbg_printValue(buf,value,count);
|
||||||
|
@ -1771,11 +1773,11 @@ init_om(om)
|
||||||
|
|
||||||
for (num = 0; ; num++) {
|
for (num = 0; ; num++) {
|
||||||
|
|
||||||
sprintf(buf, "fs%d.charset.name", num);
|
snprintf(buf, sizeof(buf), "fs%d.charset.name", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
|
|
||||||
if( count < 1){
|
if( count < 1){
|
||||||
sprintf(buf, "fs%d.charset", num);
|
snprintf(buf, sizeof(buf), "fs%d.charset", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
break;
|
break;
|
||||||
|
@ -1794,7 +1796,7 @@ init_om(om)
|
||||||
while (count-- > 0){
|
while (count-- > 0){
|
||||||
*charset_list++ = _fallcGetCharSet(*value++);
|
*charset_list++ = _fallcGetCharSet(*value++);
|
||||||
}
|
}
|
||||||
sprintf(buf, "fs%d.charset.udc_area", num);
|
snprintf(buf, sizeof(buf), "fs%d.charset.udc_area", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if( count > 0){
|
if( count > 0){
|
||||||
UDCArea udc;
|
UDCArea udc;
|
||||||
|
@ -1817,10 +1819,10 @@ init_om(om)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "fs%d.font.primary", num);
|
snprintf(buf, sizeof(buf), "fs%d.font.primary", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count < 1){
|
if (count < 1){
|
||||||
sprintf(buf, "fs%d.font", num);
|
snprintf(buf, sizeof(buf), "fs%d.font", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
return False;
|
return False;
|
||||||
|
@ -1833,7 +1835,7 @@ init_om(om)
|
||||||
data->font_data = font_data;
|
data->font_data = font_data;
|
||||||
data->font_data_count = count;
|
data->font_data_count = count;
|
||||||
|
|
||||||
sprintf(buf, "fs%d.font.substitute", num);
|
snprintf(buf, sizeof(buf), "fs%d.font.substitute", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
font_data = falread_EncodingInfo(count,value);
|
font_data = falread_EncodingInfo(count,value);
|
||||||
|
@ -1842,7 +1844,7 @@ init_om(om)
|
||||||
data->substitute = font_data;
|
data->substitute = font_data;
|
||||||
data->substitute_num = count;
|
data->substitute_num = count;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "fs%d.font", num);
|
snprintf(buf, sizeof(buf), "fs%d.font", num);
|
||||||
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
_fallcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
data->substitute = NULL;
|
data->substitute = NULL;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include "syncx.h"
|
#include "syncx.h"
|
||||||
#include "_fallibint.h"
|
#include "_fallibint.h"
|
||||||
|
@ -410,7 +411,7 @@ unsigned long *codepoint;
|
||||||
|
|
||||||
memset(dst,0,25);
|
memset(dst,0,25);
|
||||||
|
|
||||||
lcd = (XLCd)_fallcGenericLoader(locale);
|
lcd = (XLCd) (uintptr_t) _fallcGenericLoader(locale);
|
||||||
|
|
||||||
fal_gi_to_vgi(lcd,locale,charset_str,codeset,
|
fal_gi_to_vgi(lcd,locale,charset_str,codeset,
|
||||||
glyph_index,&glyph_index,charsetname);
|
glyph_index,&glyph_index,charsetname);
|
||||||
|
@ -439,9 +440,9 @@ unsigned long *codepoint;
|
||||||
if( falnon_standard(lcd,charset)) {
|
if( falnon_standard(lcd,charset)) {
|
||||||
falmake_none_standard(from,charset,src);
|
falmake_none_standard(from,charset,src);
|
||||||
} else if(charset->ct_sequence){
|
} else if(charset->ct_sequence){
|
||||||
sprintf((char *)from,"%s%s",charset->ct_sequence,src);
|
snprintf((char *)from, sizeof(from32), "%s%s", charset->ct_sequence,src);
|
||||||
} else {
|
} else {
|
||||||
sprintf((char *)from,"%s\0",src);
|
snprintf((char *)from, sizeof(from32), "%s", src);
|
||||||
}
|
}
|
||||||
/* compound text -> multi byte */
|
/* compound text -> multi byte */
|
||||||
conv = _fallcOpenConverter(lcd, XlcNCompoundText, lcd, XlcNMultiByte);
|
conv = _fallcOpenConverter(lcd, XlcNCompoundText, lcd, XlcNMultiByte);
|
||||||
|
@ -640,7 +641,7 @@ int *num_gi;
|
||||||
dst = (unsigned char *)to32;
|
dst = (unsigned char *)to32;
|
||||||
memset(dst,0,25);
|
memset(dst,0,25);
|
||||||
|
|
||||||
lcd = (XLCd)_fallcGenericLoader(locale);
|
lcd = (XLCd) (uintptr_t) _fallcGenericLoader(locale);
|
||||||
|
|
||||||
for(i=0,j=0;i<4;i++){
|
for(i=0,j=0;i<4;i++){
|
||||||
byte = getbyte(codepoint,i);
|
byte = getbyte(codepoint,i);
|
||||||
|
@ -650,7 +651,7 @@ int *num_gi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
src[j] = 0;
|
src[j] = 0;
|
||||||
sprintf((char *)from,"%s\0",src);
|
snprintf((char *)from, sizeof(from32), "%s", src);
|
||||||
/* multi byte -> vgi */
|
/* multi byte -> vgi */
|
||||||
conv = _fallcOpenConverter(lcd, XlcNMultiByte, lcd, XlcNCharSet);
|
conv = _fallcOpenConverter(lcd, XlcNMultiByte, lcd, XlcNCharSet);
|
||||||
from_left = strlen((char *)from);
|
from_left = strlen((char *)from);
|
||||||
|
@ -674,13 +675,14 @@ int *num_gi;
|
||||||
_fallcDestroyLC(lcd);
|
_fallcDestroyLC(lcd);
|
||||||
|
|
||||||
*gi = (FalGIInf *)Xmalloc(sizeof(FalGIInf));
|
*gi = (FalGIInf *)Xmalloc(sizeof(FalGIInf));
|
||||||
(*gi)->charset_str = (char *)Xmalloc(strlen(charsetname)+1);
|
|
||||||
strcpy((*gi)->charset_str,charsetname);
|
|
||||||
(*gi)->glyph_index = glyph;
|
|
||||||
if(*gi == NULL){
|
if(*gi == NULL){
|
||||||
fal_utyerrno = 0x03 ;
|
fal_utyerrno = 0x03 ;
|
||||||
return(FAL_ERROR);
|
return(FAL_ERROR);
|
||||||
}
|
}
|
||||||
|
(*gi)->charset_str = (char *)Xmalloc(strlen(charsetname)+1);
|
||||||
|
strcpy((*gi)->charset_str,charsetname);
|
||||||
|
(*gi)->glyph_index = glyph;
|
||||||
|
|
||||||
*num_gi = 1;
|
*num_gi = 1;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,6 +343,10 @@ int lockflag;
|
||||||
if ( !(finf->fname = (char *)strdup( openfontfile )) ) {
|
if ( !(finf->fname = (char *)strdup( openfontfile )) ) {
|
||||||
fal_seterrcode( _FAL_MALOC_ER, 0,
|
fal_seterrcode( _FAL_MALOC_ER, 0,
|
||||||
FAL_ERR_MALLOC , FAL_FUNCNUM_OPNFNT ) ;
|
FAL_ERR_MALLOC , FAL_FUNCNUM_OPNFNT ) ;
|
||||||
|
free( openfontfile );
|
||||||
|
free( finf );
|
||||||
|
free( buf );
|
||||||
|
close( fd );
|
||||||
return (FalFontID)FAL_ERROR;
|
return (FalFontID)FAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,9 +505,7 @@ int lockflag;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_errfile_str( fal_err_file_buf, finf->fname ) ;
|
set_errfile_str( fal_err_file_buf, finf->fname ) ;
|
||||||
if ( finf->fname ) {
|
free( finf->fname );
|
||||||
free( finf->fname );
|
|
||||||
}
|
|
||||||
if ( finf->buf != NULL ) {
|
if ( finf->buf != NULL ) {
|
||||||
#if defined( SVR4 )
|
#if defined( SVR4 )
|
||||||
if ( finf->ismmap == TRUE ) {
|
if ( finf->ismmap == TRUE ) {
|
||||||
|
@ -520,15 +522,10 @@ int lockflag;
|
||||||
close( finf->fd );
|
close( finf->fd );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( finf->sptnBuf ) {
|
free( finf->sptnBuf );
|
||||||
free( finf->sptnBuf );
|
free( finf->dptnBuf );
|
||||||
}
|
free( finf->dbuf );
|
||||||
if ( finf->dptnBuf ){
|
|
||||||
free( finf->dptnBuf );
|
|
||||||
}
|
|
||||||
if ( finf->dbuf ) {
|
|
||||||
free( finf->dbuf );
|
|
||||||
}
|
|
||||||
free ( finf );
|
free ( finf );
|
||||||
}
|
}
|
||||||
if ( lockflag == 1 ) {
|
if ( lockflag == 1 ) {
|
||||||
|
@ -1069,15 +1066,9 @@ FalFontDataList *list;
|
||||||
if ( list->list != NULL ) {
|
if ( list->list != NULL ) {
|
||||||
for ( i = 0; i < list->num; i++ ) {
|
for ( i = 0; i < list->num; i++ ) {
|
||||||
/* free a structure's character of "FalFontData()" */
|
/* free a structure's character of "FalFontData()" */
|
||||||
if ( list->list[i].xlfdname ) {
|
free( list->list[i].xlfdname );
|
||||||
free( list->list[i].xlfdname );
|
free( list->list[i].style.name );
|
||||||
}
|
free( list->list[i].shape.name );
|
||||||
if ( list->list[i].style.name ) {
|
|
||||||
free( list->list[i].style.name );
|
|
||||||
}
|
|
||||||
if ( list->list[i].shape.name ) {
|
|
||||||
free( list->list[i].shape.name );
|
|
||||||
}
|
|
||||||
FAL_FREE_FONTLIST_OPTION( list ) ;
|
FAL_FREE_FONTLIST_OPTION( list ) ;
|
||||||
}
|
}
|
||||||
/* free a structure's array of "FalFontData()" */
|
/* free a structure's array of "FalFontData()" */
|
||||||
|
@ -1143,15 +1134,9 @@ fal_clear_data(tmp)
|
||||||
FalFontData *tmp;
|
FalFontData *tmp;
|
||||||
{
|
{
|
||||||
/* search a character */
|
/* search a character */
|
||||||
if ( tmp->xlfdname != NULL ) {
|
free(tmp->xlfdname);
|
||||||
free(tmp->xlfdname);
|
free(tmp->style.name);
|
||||||
}
|
free(tmp->shape.name);
|
||||||
if (tmp->style.name != NULL) {
|
|
||||||
free(tmp->style.name);
|
|
||||||
}
|
|
||||||
if (tmp->shape.name != NULL) {
|
|
||||||
free(tmp->shape.name);
|
|
||||||
}
|
|
||||||
FAL_CLEAR_DATA_OPTION( tmp ) ;
|
FAL_CLEAR_DATA_OPTION( tmp ) ;
|
||||||
memset(tmp, 0, sizeof(*tmp));
|
memset(tmp, 0, sizeof(*tmp));
|
||||||
return 0 ;
|
return 0 ;
|
||||||
|
@ -2296,6 +2281,7 @@ FalFontPath *pathlist ;
|
||||||
fal_clear_font_path( pathlist );
|
fal_clear_font_path( pathlist );
|
||||||
fal_utyerror = _FAL_MALOC_ER;
|
fal_utyerror = _FAL_MALOC_ER;
|
||||||
fal_utyerrno = FAL_ERR_MALLOC ;
|
fal_utyerrno = FAL_ERR_MALLOC ;
|
||||||
|
free(path);
|
||||||
return FAL_ERROR ;
|
return FAL_ERROR ;
|
||||||
}
|
}
|
||||||
pathlist->path = plist;
|
pathlist->path = plist;
|
||||||
|
@ -2982,6 +2968,7 @@ int islock ;
|
||||||
if( (flist[cnt] = (FontIDInfo *)malloc( sizeof(FontIDInfo) )) == NULL ) {
|
if( (flist[cnt] = (FontIDInfo *)malloc( sizeof(FontIDInfo) )) == NULL ) {
|
||||||
fal_utyerror = _FAL_MALOC_ER ;
|
fal_utyerror = _FAL_MALOC_ER ;
|
||||||
fal_utyerrno = FAL_ERR_MALLOC ;
|
fal_utyerrno = FAL_ERR_MALLOC ;
|
||||||
|
free(flist);
|
||||||
return FAL_ERROR ;
|
return FAL_ERROR ;
|
||||||
}
|
}
|
||||||
flist[cnt]->fid = fid ;
|
flist[cnt]->fid = fid ;
|
||||||
|
|
|
@ -778,7 +778,7 @@ char *propname;
|
||||||
if ( *buffer) { /* isStringProp */
|
if ( *buffer) { /* isStringProp */
|
||||||
return( propstr + getINT32( (unsigned char *)(buffer + 1), (CARD32)format) );
|
return( propstr + getINT32( (unsigned char *)(buffer + 1), (CARD32)format) );
|
||||||
}else{
|
}else{
|
||||||
return((char *)getINT32( (unsigned char *)(buffer + 1), (CARD32)format) );
|
return((char *)(intptr_t)getINT32( (unsigned char *)(buffer + 1), (CARD32)format) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer += 5 ; /* isStringProp + value */
|
buffer += 5 ; /* isStringProp + value */
|
||||||
|
@ -800,7 +800,7 @@ FalFontData *databuff ;
|
||||||
caddr_t stprop ;
|
caddr_t stprop ;
|
||||||
int lb, rb, as, ds ;
|
int lb, rb, as, ds ;
|
||||||
char *propptr ;
|
char *propptr ;
|
||||||
char *fnt, *fam ;
|
char *fnt = NULL, *fam ;
|
||||||
int nprops, bitmapSize, num_chars ;
|
int nprops, bitmapSize, num_chars ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -863,6 +863,7 @@ FalFontData *databuff ;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
Bail:
|
Bail:
|
||||||
|
free(fnt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -890,7 +891,7 @@ char *propname;
|
||||||
if( ProcRec->indirect ){
|
if( ProcRec->indirect ){
|
||||||
return( propstr + ProcRec->value ) ;
|
return( propstr + ProcRec->value ) ;
|
||||||
}else{
|
}else{
|
||||||
return( (char *)ProcRec->value ) ;
|
return( (char *) (intptr_t) ProcRec->value ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,9 @@ char *buf;
|
||||||
char *p;
|
char *p;
|
||||||
unsigned int getstat = 0;
|
unsigned int getstat = 0;
|
||||||
|
|
||||||
fgets(buf, BUFSIZE, head->input);
|
if (NULL == fgets(buf, BUFSIZE, head->input)) {
|
||||||
|
return(BDF_INVAL);
|
||||||
|
}
|
||||||
p = buf;
|
p = buf;
|
||||||
SCAN_TO_NONSP(p)
|
SCAN_TO_NONSP(p)
|
||||||
|
|
||||||
|
@ -1151,6 +1153,7 @@ char *wr_file ;
|
||||||
if( read(rfd, buf, statbuf.st_size) != statbuf.st_size ){
|
if( read(rfd, buf, statbuf.st_size) != statbuf.st_size ){
|
||||||
close(wfd) ;
|
close(wfd) ;
|
||||||
close(rfd) ;
|
close(rfd) ;
|
||||||
|
free(buf) ;
|
||||||
return -1 ;
|
return -1 ;
|
||||||
}
|
}
|
||||||
#if defined( SVR4 )
|
#if defined( SVR4 )
|
||||||
|
@ -1474,6 +1477,7 @@ char *com;
|
||||||
save_name, com );
|
save_name, com );
|
||||||
Unlink_Tmpfile ( save_name, com );
|
Unlink_Tmpfile ( save_name, com );
|
||||||
Unlink_Tmpfile ( tmp_name, com );
|
Unlink_Tmpfile ( tmp_name, com );
|
||||||
|
free(save_name);
|
||||||
return( (put_file_create_err_msg == DEVICE_FAIL)?
|
return( (put_file_create_err_msg == DEVICE_FAIL)?
|
||||||
put_file_create_err_msg : rtn );
|
put_file_create_err_msg : rtn );
|
||||||
}
|
}
|
||||||
|
@ -1490,6 +1494,7 @@ char *com;
|
||||||
Unlink_Tmpfile ( tmp_name, com );
|
Unlink_Tmpfile ( tmp_name, com );
|
||||||
Unlink_Tmpfile ( save_name, com );
|
Unlink_Tmpfile ( save_name, com );
|
||||||
}
|
}
|
||||||
|
free(save_name);
|
||||||
return( (put_file_create_err_msg == DEVICE_FAIL)?
|
return( (put_file_create_err_msg == DEVICE_FAIL)?
|
||||||
put_file_create_err_msg : rtn );
|
put_file_create_err_msg : rtn );
|
||||||
}
|
}
|
||||||
|
@ -1498,6 +1503,7 @@ char *com;
|
||||||
ret_val += Unlink_Tmpfile ( tmp_name, com );
|
ret_val += Unlink_Tmpfile ( tmp_name, com );
|
||||||
ret_val += Unlink_Tmpfile ( save_name, com );
|
ret_val += Unlink_Tmpfile ( save_name, com );
|
||||||
|
|
||||||
|
free(save_name);
|
||||||
return( (ret_val)? 1 : 0 );
|
return( (ret_val)? 1 : 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1658,6 +1664,7 @@ char *cmd;
|
||||||
}
|
}
|
||||||
FreeString( cmd_path ) ;
|
FreeString( cmd_path ) ;
|
||||||
}
|
}
|
||||||
|
free(cmd_path);
|
||||||
AllocString( cmd_path, path, NULL ) ;
|
AllocString( cmd_path, path, NULL ) ;
|
||||||
AddString( cmd_path, "/", NULL ) ;
|
AddString( cmd_path, "/", NULL ) ;
|
||||||
AddString( cmd_path, cmd, NULL ) ;
|
AddString( cmd_path, cmd, NULL ) ;
|
||||||
|
@ -1697,10 +1704,12 @@ char *cmd ;
|
||||||
}
|
}
|
||||||
if( stat( pbuf, &statbuf ) ){
|
if( stat( pbuf, &statbuf ) ){
|
||||||
USAGE2("%s: There is not \"%s\" command.\n", com, cmd ) ;
|
USAGE2("%s: There is not \"%s\" command.\n", com, cmd ) ;
|
||||||
|
free(pbuf);
|
||||||
return STAT_ERROR ;
|
return STAT_ERROR ;
|
||||||
}
|
}
|
||||||
if( !(statbuf.st_mode & S_IXUSR) ){
|
if( !(statbuf.st_mode & S_IXUSR) ){
|
||||||
USAGE2("%s: \"%s\" command don't have permission to execute.\n", com, cmd ) ;
|
USAGE2("%s: \"%s\" command don't have permission to execute.\n", com, cmd ) ;
|
||||||
|
free(pbuf);
|
||||||
return STAT_ERROR ;
|
return STAT_ERROR ;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -460,10 +460,10 @@ Widget owner;
|
||||||
AddLeftAttachWidget( wgeStaT_disp[i], wgeStaT_list[i], 0 ) ;
|
AddLeftAttachWidget( wgeStaT_disp[i], wgeStaT_list[i], 0 ) ;
|
||||||
XtAddEventHandler( wgeStaT_list[i],
|
XtAddEventHandler( wgeStaT_list[i],
|
||||||
ButtonPressMask|ButtonReleaseMask,
|
ButtonPressMask|ButtonReleaseMask,
|
||||||
False, EHeStaT_list, (XtPointer)i );
|
False, EHeStaT_list, (XtPointer) (intptr_t) i );
|
||||||
XtAddEventHandler( wgeStaT_disp[i],
|
XtAddEventHandler( wgeStaT_disp[i],
|
||||||
ButtonPressMask|ButtonReleaseMask,
|
ButtonPressMask|ButtonReleaseMask,
|
||||||
False, EHeStaT_list, (XtPointer)i );
|
False, EHeStaT_list, (XtPointer) (intptr_t) i );
|
||||||
|
|
||||||
if (i==0){
|
if (i==0){
|
||||||
XtVaGetValues(wgeStaT_disp[i],
|
XtVaGetValues(wgeStaT_disp[i],
|
||||||
|
@ -579,7 +579,7 @@ int code;
|
||||||
char str[8];
|
char str[8];
|
||||||
|
|
||||||
if (! code){
|
if (! code){
|
||||||
str[0] = NULL;
|
str[0] = '\0';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sprintf( str, "%4x:", code );
|
sprintf( str, "%4x:", code );
|
||||||
|
|
|
@ -345,7 +345,7 @@ int buttons_cnt;
|
||||||
if (strchr(LABEL(i), NMNIC(i))){
|
if (strchr(LABEL(i), NMNIC(i))){
|
||||||
sprintf(buf, "%s", LABEL(i));
|
sprintf(buf, "%s", LABEL(i));
|
||||||
}else{
|
}else{
|
||||||
sprintf(buf, "%s(%c)", LABEL(i), NMNIC(i));
|
sprintf(buf, "%s(%ld)", LABEL(i), NMNIC(i));
|
||||||
}
|
}
|
||||||
xms = XmStringCreateLocalized(buf);
|
xms = XmStringCreateLocalized(buf);
|
||||||
XtSetArg(args[n],XmNlabelString, xms); n++;
|
XtSetArg(args[n],XmNlabelString, xms); n++;
|
||||||
|
@ -515,7 +515,7 @@ int val;
|
||||||
XtSetArg(arg[n], XmNleftOffset, (XtArgVal)resource.draw_lftoff); n++;
|
XtSetArg(arg[n], XmNleftOffset, (XtArgVal)resource.draw_lftoff); n++;
|
||||||
drawarea = XmCreateDrawingArea(owner, name, arg, n);
|
drawarea = XmCreateDrawingArea(owner, name, arg, n);
|
||||||
XtManageChild( drawarea );
|
XtManageChild( drawarea );
|
||||||
XtAddEventHandler(drawarea, ExposureMask, FALSE, proc, (XtPointer)val);
|
XtAddEventHandler(drawarea, ExposureMask, FALSE, proc, (XtPointer) (intptr_t) val);
|
||||||
return(drawarea);
|
return(drawarea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue