Some small Mac cleanups

main
Blake McBride 2015-05-30 14:31:26 -05:00
parent 2e7ac11277
commit 6726b13e50
4 changed files with 10 additions and 14 deletions

View File

@ -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 */

View File

@ -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 ; \

View File

@ -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) {

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
/*****************************************************************************
Define VIDEO, which compiles in some kind of video code, even if