From 6726b13e50f50f51af75246b3371077b393758d9 Mon Sep 17 00:00:00 2001 From: Blake McBride Date: Sat, 30 May 2015 14:31:26 -0500 Subject: [PATCH] Some small Mac cleanups --- src/err.c | 2 +- src/makefile.osx | 4 ++++ src/zosx.c | 10 +++++----- src/zport.h | 8 -------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/err.c b/src/err.c index 7a900df..b42866c 100644 --- a/src/err.c +++ b/src/err.c @@ -126,7 +126,7 @@ unsigned char *ELine; /* error message text */ WORD HlpLvl; ptrdiff_t lenn; HlpLvl = (EhFlag & 3) ? (EhFlag & 3) : 2; - lenn = (HlpLvl < 2) ? 4 : strlen(ELine); + lenn = (HlpLvl < 2) ? 4 : strlen((char *)ELine); ZDspBf(ELine, lenn); if (HlpLvl == 3) { /* if paragraph */ ErrVrb(ErrNum); /* display paragraph */ diff --git a/src/makefile.osx b/src/makefile.osx index 300ad59..b734a75 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -32,6 +32,7 @@ CC= gcc CFLAGS= ${OSVERS} ${DEBG} ${CCHEK} -O -DOSX -DCURSES TERMOBJS = -lncurses +CFLAGS += -Wno-dangling-else COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c -g @@ -69,6 +70,9 @@ genclp: genclp.o genclp.o: genclp.c +zosx.o : zosx.c + $(CC) $(CFLAGS) $(CPPFLAGS) -Wno-parentheses -Wno-pointer-sign -Wno-deprecated-declarations -c $< + clean: @for i in makedep? ${OBJECTS} ; do \ if [ -f $$i ] ; then rm $$i ; fi ; \ diff --git a/src/zosx.c b/src/zosx.c index 268212e..80a062f 100644 --- a/src/zosx.c +++ b/src/zosx.c @@ -369,7 +369,7 @@ VVOID ZDoCmd(charptr GBfBeg, charptr GBfPtr) /* die and pass command to OS */ * 6. we shouldn't be here, exit */ buf[128] = *GBfPtr = '\0'; - (void)strncpy(buf, GBfBeg, 128); + (void)strncpy(buf, (char *)GBfBeg, 128); if ((space_p = strchr(buf,' ')) != NULL) { *space_p++ = '\0'; } @@ -912,7 +912,7 @@ DEFAULT OfIndx; /* index into OFiles array */ ver++; strcat(TmpFsp, ";"); MakDBf((LONG)ver, 10); - strncat(TmpFsp, DBfBeg, DBfPtr-DBfBeg); + strncat(TmpFsp, (char *)DBfBeg, DBfPtr-DBfBeg); *(TmpFsp+ln+(1+DBfPtr-DBfBeg)+1) = '\0'; } } @@ -923,7 +923,7 @@ DEFAULT OfIndx; /* index into OFiles array */ #endif if (rename(OFiles[OfIndx].OTNam, TmpFsp)) { /* TAA changed to use rename */ ZErMsg(); - ZDspBf("Edit saved in ", 14); + ZDspBf((unsigned char *)"Edit saved in ", 14); ZDspBf(OFiles[OfIndx].OFNam, strlen(OFiles[OfIndx].OFNam)); ErrMsg(ERR_UCO); @@ -999,7 +999,7 @@ BOOLEAN RepFNF; /* report "file not found" error? */ DbgFEn(2,DbgFNm,DbgSBf); #endif *FBfPtr = '\0'; /* terminate the file name */ - if ((IFiles[IfIndx] = fopen(FBfBeg, "r")) != NULL) { + if ((IFiles[IfIndx] = fopen((char *)FBfBeg, "r")) != NULL) { DBGFEX(1,DbgFNm,"SUCCESS"); IFisCR[IfIndx] = 0; return SUCCESS; @@ -1009,7 +1009,7 @@ BOOLEAN RepFNF; /* report "file not found" error? */ char TmpBfr[FILENAME_MAX]; ptrdiff_t TmpLen = FBfPtr-FBfBeg; BOOLEAN noDot; - if (noDot = strchr(FBfBeg,'.') == NULL) { /* if no dot */ + if (noDot = strchr((char *)FBfBeg,'.') == NULL) { /* if no dot */ (void)strcat(FBfBeg,".tec"); /* append .tec */ FBfPtr += 4; if ((IFiles[IfIndx] = fopen(FBfBeg, "r")) != NULL) { diff --git a/src/zport.h b/src/zport.h index 4e21c63..f5dbd29 100644 --- a/src/zport.h +++ b/src/zport.h @@ -123,17 +123,9 @@ functions which need the standard library are in the Z*.C system-specific code files which explicitly #include these header files. *****************************************************************************/ -#if (CHECKSUM_CODE || CONSISTENCY_CHECKING || DEBUGGING) -#if defined(unix) -extern int printf(); -/*extern int sprintf();*/ -extern int puts(); -#else #include #include #include -#endif -#endif /***************************************************************************** Define VIDEO, which compiles in some kind of video code, even if