From: Peter Howkins Date: Tue, 18 Sep 2012 11:00:05 +0000 (+0100) Subject: dtudcexch/dtudcfonted: Resolve 78 compiler warnings. X-Git-Tag: 2.2.0c~55^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5e14a88e2cea8ea9e77fb78234090010f1f8755e;p=oweals%2Fcde.git dtudcexch/dtudcfonted: Resolve 78 compiler warnings. --- diff --git a/cde/programs/dtudcexch/exportbdf.c b/cde/programs/dtudcexch/exportbdf.c index 95016d61..ef5ad51f 100644 --- a/cde/programs/dtudcexch/exportbdf.c +++ b/cde/programs/dtudcexch/exportbdf.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef SVR4 #if !defined( SYSV ) #include diff --git a/cde/programs/dtudcexch/selectx.c b/cde/programs/dtudcexch/selectx.c index b815bc27..5968634d 100644 --- a/cde/programs/dtudcexch/selectx.c +++ b/cde/programs/dtudcexch/selectx.c @@ -245,7 +245,7 @@ void makelist(ListData *ld) existcode_num = 0; for (i = 0; i < ld->allcode_num; i++) { code = *allcodep; - pattern = FalReadFont(fid, code, NULL, NULL); + pattern = FalReadFont(fid, code, 0, 0); if (fal_utyexists == 0) { *existcodep = *allcodep; existcodep++; @@ -294,7 +294,7 @@ char *i2s(int code) for (i = 0; ; i++) { if (tmp < 16) { buf[i] = i2c(tmp); - buf[i+1] = NULL; + buf[i+1] = 0; break; } buf[i] = i2c(tmp % 16); @@ -309,7 +309,7 @@ char *i2s(int code) *cp = buf[i]; cp++; } - *cp = NULL; + *cp = 0; return (number); } diff --git a/cde/programs/dtudcfonted/include/bdfgpf.h b/cde/programs/dtudcfonted/include/bdfgpf.h index 19f0ca0a..cf2b9928 100644 --- a/cde/programs/dtudcfonted/include/bdfgpf.h +++ b/cde/programs/dtudcfonted/include/bdfgpf.h @@ -181,7 +181,7 @@ extern char *bdftopcf; #define SNFFONTC_ERROR -26 #define SCAN_TO_NONSP(p) {\ - while (*(p) != NULL) {\ + while (*(p) != 0) {\ if ((*(p) == ' ') || (*(p) == TAB_CD) || (*(p) == 0xa1)) {\ (p)++;\ } else {\ @@ -191,7 +191,7 @@ extern char *bdftopcf; } #define SCAN_TO_SP(p) {\ - while (*(p) != NULL) {\ + while (*(p) != 0) {\ if ((*(p) == ' ') || (*(p) == TAB_CD) || (*(p) == 0xa1)) {\ break;\ } else {\ diff --git a/cde/programs/dtudcfonted/include/udcopt.h b/cde/programs/dtudcfonted/include/udcopt.h index df72bf47..ce7c3687 100644 --- a/cde/programs/dtudcfonted/include/udcopt.h +++ b/cde/programs/dtudcfonted/include/udcopt.h @@ -188,7 +188,7 @@ /* * help message */ -#define COMM_HELP_MSG{ \ +#define COMM_HELP_MSG { \ USAGE(" [-codeset number] [-help]\n"); \ USAGE("\n"); \ } diff --git a/cde/programs/dtudcfonted/libfal/_fallcGeneric.c b/cde/programs/dtudcfonted/libfal/_fallcGeneric.c index 10d811a0..17d9ed8b 100644 --- a/cde/programs/dtudcfonted/libfal/_fallcGeneric.c +++ b/cde/programs/dtudcfonted/libfal/_fallcGeneric.c @@ -687,7 +687,7 @@ int num; FontScope scope; ret = (ExtdSegment)Xmalloc(sizeof(ExtdSegmentRec)); if(ret == NULL){ - return (NULL); + return (0); } if(strchr(value[0],':')){ ret->name = (char *)Xmalloc(strlen(value[0])+1); @@ -696,7 +696,7 @@ int num; } strcpy(ret->name,value[0]); ptr = strchr(ret->name,':'); - *ptr = NULL; + *ptr = 0; ptr++; if( !_fallcNCompareISOLatin1(ptr, "none", 4) ){ ret->side = XlcNONE ; @@ -939,7 +939,7 @@ load_generic(lcd) char tmp[128]; tmpb = (codeset->byteM)[M-1].byteinfo ; /* default 0x00 - 0xff */ - sscanf(value[ii],"\\x%lx,\\x%lx",&start,&end); + sscanf(value[ii], "\\x%lx,\\x%lx", (long unsigned *) &start, (long unsigned *) &end); tmpb[ii].start = (unsigned char)start; tmpb[ii].end = (unsigned char)end; } diff --git a/cde/programs/dtudcfonted/libfal/_fallcUTF.c b/cde/programs/dtudcfonted/libfal/_fallcUTF.c index 5d310ffb..21b50e3d 100644 --- a/cde/programs/dtudcfonted/libfal/_fallcUTF.c +++ b/cde/programs/dtudcfonted/libfal/_fallcUTF.c @@ -172,7 +172,7 @@ long fb_default; for(i = 0; i < NRUNE; i++) table[i] = -1; - while((rv = fscanf(fptr, "%lx", &value)) != EOF) { + while((rv = fscanf(fptr, "%lx", (long unsigned *) &value)) != EOF) { if(rv != 0 && value >= 0) { table[value] = j++; } else { @@ -532,11 +532,11 @@ long fb_default; register int i = 0; int j = 0; int rv = 0; - long value; + long value; for(i = 0; i < NRUNE; i++) from_tbl[i] = -1; - while((rv = fscanf(fptr, "%lx", &value)) != EOF) { + while((rv = fscanf(fptr, "%lx", (long unsigned *) &value)) != EOF) { if(rv != 0) { (*to_tbl)[j++] = value; } else { diff --git a/cde/programs/dtudcfonted/libfal/_falomGeneric.c b/cde/programs/dtudcfonted/libfal/_falomGeneric.c index 151ec0de..fe536c7e 100644 --- a/cde/programs/dtudcfonted/libfal/_falomGeneric.c +++ b/cde/programs/dtudcfonted/libfal/_falomGeneric.c @@ -608,7 +608,7 @@ static char return NULL; strcpy(pattern, font_name); - memset(fields, NULL, sizeof(char *) * 14); + memset(fields, 0, sizeof(char *) * 14); ptr = pattern; while(isspace(*ptr)) { ptr++; @@ -644,7 +644,7 @@ static char strcpy(str_point, "*"); fields[POINT_SIZE_FIELD - 1] = str_point; - rotate_font[0] = NULL; + rotate_font[0] = '\0'; for(field_num = 0 ; field_num < CHARSET_ENCODING_FIELD && fields[field_num] ; field_num++) { sprintf(rotate_font, "%s-%s", rotate_font, fields[field_num]); diff --git a/cde/programs/dtudcfonted/libfal/falfont.c b/cde/programs/dtudcfonted/libfal/falfont.c index 476533c4..f605a55c 100644 --- a/cde/programs/dtudcfonted/libfal/falfont.c +++ b/cde/programs/dtudcfonted/libfal/falfont.c @@ -2369,7 +2369,7 @@ FalFontData *fdata; if ((fp = open_fonts_list()) == NULL) { return FAL_ERROR ; } - memset( pname, NULL, sizeof( pname ) ); + memset( pname, 0, sizeof( pname ) ); while ( fgets( buf, FAL_LINE_MAX, fp ) != ( char * ) NULL ) { int eq; @@ -2523,7 +2523,7 @@ FalFontData *fdata; fls->list = p_bak ; } - memset( buf, NULL, sizeof(buf)); + memset( buf, 0, sizeof(buf)); while( fgets( buf, FAL_LINE_MAX, fp ) != (char *)NULL ) { int tmp_num, eq ; @@ -2535,7 +2535,7 @@ FalFontData *fdata; /* parse string of font file */ if( (ep = strchr( buf, ' ' )) == (char *)NULL ) continue ; - else *ep = NULL ; + else *ep = 0 ; /* refuse font file (not gpf) */ if( ( strcmp( FILE_SUFFIX(buf), PCFSUFFIX ) != 0 ) && @@ -2563,7 +2563,7 @@ FalFontData *fdata; case _FAL_TRY_NEXT : if( (func & SRCHFNAME) || (func & FONTOFID) ) FreeString( fontFileName ) ; fal_clear_data( &tmp_data ); - memset( buf, NULL, sizeof(buf)); + memset( buf, 0, sizeof(buf)); continue ; case 0: if( (func & FONTOFID) ) FreeString( fontFileName ) ; @@ -2577,7 +2577,7 @@ FalFontData *fdata; if( !(func & FONTOFID) && (codeset_num == 0) ){ if( (func & SRCHFNAME) ) FreeString( fontFileName ) ; fal_clear_data( &tmp_data ); - memset( buf, NULL, sizeof(buf)); + memset( buf, 0, sizeof(buf)); continue ; } @@ -2639,7 +2639,7 @@ FalFontData *fdata; if( fal_read_fidinf( fid, &fontid_inf ) != FAL_ERROR ) fdata->cd_set = fontid_inf.cd_set ; else { - fdata->cd_set = NULL ; + fdata->cd_set = 0 ; goto FalError ; } fclose(fp) ; @@ -3091,7 +3091,7 @@ unsigned int *glidx ; /* * get string of "CHARSET_REGISTRY" */ - memset( &tmp_data, NULL, sizeof(FalFontData) ) ; + memset( &tmp_data, 0, sizeof(FalFontData) ) ; if( cmpfid != fid ){ if( falReadGpfProp( FAL_READ_FONTINFO, finf, FAL_FONT_PRM, &tmp_data ) ) { @@ -3158,7 +3158,7 @@ unsigned int *code ; /* * get string of "CHARSET_REGISTRY" */ - memset( &tmp_data, NULL, sizeof(tmp_data) ) ; + memset( &tmp_data, 0, sizeof(tmp_data) ) ; if( falReadGpfProp( FAL_READ_FONTINFO, finf, FAL_FONT_PRM, &tmp_data ) ) { fal_clear_data( &tmp_data ) ; return FAL_ERROR; diff --git a/cde/programs/dtudcfonted/libfal/include/os.h b/cde/programs/dtudcfonted/libfal/include/os.h index 310d552c..9fc4e58f 100644 --- a/cde/programs/dtudcfonted/libfal/include/os.h +++ b/cde/programs/dtudcfonted/libfal/include/os.h @@ -98,7 +98,9 @@ pragma on(alloca); #if defined(__GNUC__) || defined(__uxp__) +#if !defined(linux) #define alloca ___builtin_alloca +#endif #define ALLOCATE_LOCAL(size) alloca((int)(size)) #define DEALLOCATE_LOCAL(ptr) /* as nothing */ #else /* ! __GNUC__ ! __uxp__ */ diff --git a/cde/programs/dtudcfonted/libfal/syncx.c b/cde/programs/dtudcfonted/libfal/syncx.c index 48400d3e..85bdbf60 100644 --- a/cde/programs/dtudcfonted/libfal/syncx.c +++ b/cde/programs/dtudcfonted/libfal/syncx.c @@ -44,10 +44,10 @@ void _falmbDefaultDrawImageString() { return ; } /* Atom */ falInternAtom() { return 0 ; } int _falwcGenericDrawString() { return 0 ; } char **_falParseBaseFontNameList() { return NULL ; } -/* XFontStruct * */ falLoadQueryFont() { return NULL ; } +/* XFontStruct * */ falLoadQueryFont() { return 0 ; } falFreeFont() { return 0 ; } falFreeFontInfo() { return 0 ; } -/* char ** */ falListFonts() { return NULL ; } +/* char ** */ falListFonts() { return 0 ; } void _falmbGenericDrawImageString() { return ; } void _falwcDefaultDrawImageString() { return ; } int _falmbDefaultDrawString() { return 0 ; } @@ -56,7 +56,7 @@ void falFreeStringList() { return ; } /* falrmStringToQuark() { return 0 ; } */ /* falrmPermStringToQuark() { return 0 ; } */ int _falwcDefaultDrawString() { return 0 ; } -/* char * */ falGetAtomName() { return NULL ; } +/* char * */ falGetAtomName() { return 0 ; } int _falwcGenericTextExtents() { return 0 ; } int _falmbGenericTextExtents() { return 0 ; } void _falwcGenericDrawImageString() { return ; } @@ -67,7 +67,7 @@ int _falwcDefaultTextExtents() { return 0 ; } int _falmbDefaultTextEscapement() { return 0 ; } int _falwcGenericTextEscapement() { return 0 ; } int _falmbDefaultTextExtents() { return 0 ; } -/* char ** */ falListFontsWithInfo() { return NULL ; } +/* char ** */ falListFontsWithInfo() { return 0 ; } int _falwcDefaultTextEscapement() { return 0 ; } /* Status */ _falwcGenericTextPerCharExtents(){ return 0 ; } /* _fallcMapOSLocaleName() { return 0 ; } */ diff --git a/cde/programs/dtudcfonted/libfuty/oakfuty.c b/cde/programs/dtudcfonted/libfuty/oakfuty.c index 4a9be044..aa2ca718 100644 --- a/cde/programs/dtudcfonted/libfuty/oakfuty.c +++ b/cde/programs/dtudcfonted/libfuty/oakfuty.c @@ -627,12 +627,12 @@ int bsize; } } - ptn[bsize - 1] = NULL; + ptn[bsize - 1] = 0; for (i=0, skip=0; ibdf_height; i++) { if (skip) { for(j=0; jp_height; i++) { if (skip) { for (j=0; j