/trunk/ff_misc.c |
---|
36,7 → 36,7 |
// PICA Handle Suite 2.0 |
hdl->signature = HDLVERSION_SUITE2; |
if (gdata) gdata->lastKnownHandleVersion = hdl->signature; |
hdl->handle = pSHandleSuite2->New(nBytes); |
hdl->handle = pSHandleSuite2->New((int32)nBytes); |
gpb->sSPBasic->ReleaseSuite(kPIHandleSuite, kPSHandleSuiteVersion2); |
} |
else if ((gpb->sSPBasic != 0) && |
48,7 → 48,7 |
// PICA Handle Suite 1.0 |
hdl->signature = HDLVERSION_SUITE1; |
if (gdata) gdata->lastKnownHandleVersion = hdl->signature; |
hdl->handle = pSHandleSuite1->New(nBytes); |
hdl->handle = pSHandleSuite1->New((int32)nBytes); |
gpb->sSPBasic->ReleaseSuite(kPIHandleSuite, kPSHandleSuiteVersion1); |
} |
else { |
55,7 → 55,7 |
// Standard Handle Suite (deprecated) |
hdl->signature = HDLVERSION_STANDARD; |
if (gdata) gdata->lastKnownHandleVersion = hdl->signature; |
hdl->handle = gpb->handleProcs->newProc(nBytes); |
hdl->handle = gpb->handleProcs->newProc((int32)nBytes); |
} |
} |
139,7 → 139,7 |
) |
{ |
// PICA Handle Suite 2.0 |
OSErr ret = pSHandleSuite2->SetSize(hdl->handle, nBytes); |
OSErr ret = pSHandleSuite2->SetSize(hdl->handle, (int32)nBytes); |
gpb->sSPBasic->ReleaseSuite(kPIHandleSuite, kPSHandleSuiteVersion2); |
return ret; |
} |
153,7 → 153,7 |
) |
{ |
// PICA Handle Suite 1.0 |
OSErr ret = pSHandleSuite1->SetSize(hdl->handle, nBytes); |
OSErr ret = pSHandleSuite1->SetSize(hdl->handle, (int32)nBytes); |
gpb->sSPBasic->ReleaseSuite(kPIHandleSuite, kPSHandleSuiteVersion1); |
return ret; |
} |
160,7 → 160,7 |
} |
else if (hdl->signature == HDLVERSION_STANDARD) { |
// Standard Handle Suite (deprecated) |
return gpb->handleProcs->setSizeProc(hdl->handle, nBytes); |
return gpb->handleProcs->setSizeProc(hdl->handle, (int32)nBytes); |
} |
return errMissingParameter; |
} |
261,7 → 261,7 |
disposeHandle(&fh); |
} |
int32 PIGETHANDLESIZE(Handle h) { |
size_t PIGETHANDLESIZE(Handle h) { |
FFHandle fh; |
fh.signature = gdata->lastKnownHandleVersion; |
fh.handle = h; |
313,7 → 313,7 |
// PSBufferSuite2 was first documented in SDK CS 6, |
// pb->bufferProcs->allocateProc64 and spaceProc64 were documented in SDK CS 6, |
// pb->bufferSpace64 and pb->maxSpace64 were documented in SDK CC 2017. |
unsigned32 siz = nBytes; |
unsigned32 siz = (unsigned32)nBytes; |
buf->signature = BUFVERSION_SUITE64; |
if (gdata) gdata->lastKnownBufferVersion = buf->signature; |
buf->suite = (Ptr)pSBufferSuite64->New(&siz, siz); |
330,7 → 330,7 |
) |
{ |
// PICA Buffer Suite 1.0 (32 bit) |
unsigned32 siz = nBytes; |
unsigned32 siz = (unsigned32)nBytes; |
buf->signature = BUFVERSION_SUITE32; |
if (gdata) gdata->lastKnownBufferVersion = buf->signature; |
buf->suite = (Ptr)pSBufferSuite32->New(&siz, siz); |
355,7 → 355,7 |
// Standard Buffer Suite 32 bit (deprecated) |
buf->signature = BUFVERSION_STD32; |
if (gdata) gdata->lastKnownBufferVersion = buf->signature; |
if (gpb->bufferProcs->allocateProc(nBytes, &buf->standard) != noErr) { |
if (gpb->bufferProcs->allocateProc((int32)nBytes, &buf->standard) != noErr) { |
buf->signature = BUFVERSION_NULL; |
buf->standard = NULL; |
} |
/trunk/ff_misc.h |
---|
60,7 → 60,7 |
// These functions are for code backwards compatibility: |
Handle PINEWHANDLE(int32 size); |
void PIDISPOSEHANDLE(Handle h); |
int32 PIGETHANDLESIZE(Handle h); |
size_t PIGETHANDLESIZE(Handle h); |
OSErr PISETHANDLESIZE(Handle h, int32 newSize); |
Ptr PILOCKHANDLE(Handle h, Boolean moveHigh); |
void PIUNLOCKHANDLE(Handle h); |
/trunk/read.c |
---|
549,8 → 549,8 |
// isFormula=false => outputFile is C string. TXT linebreaks become spaces. |
// isFormula=true => outputFile is C string. TXT line breaks become CRLF line breaks |
Boolean _picoReadProperty(char* inputFile, int maxInput, const char* property, char* outputFile, size_t maxOutput, Boolean isFormula) { |
int i; |
Boolean _picoReadProperty(char* inputFile, size_t maxInput, const char* property, char* outputFile, size_t maxOutput, Boolean isFormula) { |
size_t i; |
char* outputwork; |
char* sline; |
char* svalue; |
587,11 → 587,11 |
// Controls: |
for (i = 0; i < 8; i++) { |
k1 = (char*)malloc(strlen("Control X:") + 1); |
sprintf(k1, "Control %d:", i); |
sprintf(k1, "Control %d:", (int)i); |
x = strstr(inputwork, k1); |
if (x) { |
k2 = (char*)malloc(strlen("ctl[X]: ") + 1); |
sprintf(k2, "ctl[%d]: ", i); |
sprintf(k2, "ctl[%d]: ", (int)i); |
memcpy(x, k2, strlen(k2)); |
x += strlen("ctl[X]"); |
_ffdcomp_removebrackets(x, inputwork + maxInput - 1); |
602,11 → 602,11 |
// Maps: |
for (i = 0; i < 4; i++) { |
k1 = (char*)malloc(strlen("Map X:") + 1); |
sprintf(k1, "Map %d:", i); |
sprintf(k1, "Map %d:", (int)i); |
x = strstr(inputwork, k1); |
if (x) { |
k2 = (char*)malloc(strlen("map[X]:") + 1); |
sprintf(k2, "map[%d]:", i); |
sprintf(k2, "map[%d]:", (int)i); |
memcpy(x, k2, strlen(k2)); |
x += strlen("map[X]"); |
_ffdcomp_removebrackets(x, inputwork + maxInput - 1); |
715,7 → 715,7 |
if (FSpOpenDF(&sfr->sfFile, fsRdPerm, &refnum) == noErr) { |
if ((h = readfileintohandle(refnum))) { |
FILECOUNT count = PIGETHANDLESIZE(h); |
FILECOUNT count = (FILECOUNT)PIGETHANDLESIZE(h); |
char* q = PILOCKHANDLE(h, false); |
char out[256]; |
/trunk/save.c |
---|
46,7 → 46,8 |
} |
OSErr saveparams_afs_pff(Handle h){ |
char outbuf[CHOPLINES*2+2],*q,*p,*r,*start; |
char outbuf[CHOPLINES * 2 + 2] = ""; |
char *q, * p, * r, * start; |
size_t n, chunk, j; |
int i; |
OSErr e; |
70,7 → 71,8 |
/* expressions, broken into lines no longer than CHOPLINES characters */ |
for( i=0 ; i<4 ; ++i ){ |
if( (r = expr[i]) ) |
if ((r = expr[i])) { |
chunk = 0; // to avoid that compiler complains |
for( n = strlen(r) ; n ; n -= chunk ){ |
chunk = n> (int)CHOPLINES ? (int)CHOPLINES : n; |
for( j = chunk,q = outbuf ; j-- ; ) |
78,17 → 80,20 |
*q++ = '\\'; |
*q++ = 'r'; |
++r; |
}else if (*r == LF) { |
} |
else if (*r == LF) { |
// This can only happen with Windows or Linux. |
// Native Linux is not supported, and Windows always combines LF with CR. So we can ignore LF. |
++r; |
}else |
} |
else |
*q++ = *r++; |
*q++ = CR; |
*q = 0; |
p = cat(p,outbuf); |
} |
} |
else |
p = cat(p,(char*)("(null expr)\r")); // this shouldn't happen |
*p++ = CR; |
198,12 → 203,12 |
OSErr savehandleintofile(Handle h,FILEREF r){ |
Ptr p; |
long n; |
FILECOUNT n; |
OSErr e; |
if (!h) return nilHandleErr; |
p = PILOCKHANDLE(h,false); |
n = PIGETHANDLESIZE(h); |
n = (FILECOUNT)PIGETHANDLESIZE(h); |
e = FSWrite(r,&n,p); |
PIUNLOCKHANDLE(h); |
return e; |
/trunk/scripting.c |
---|
47,7 → 47,7 |
} |
char* get_cstring(PIReadDescriptor token) { |
int n; |
size_t n; |
Ptr p; |
char* str = NULL; |
Handle h; |