Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d50e4e1

Browse files
committed
More Pstring() stuff and some cosmetics
1 parent 48d071d commit d50e4e1

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

Mac/Include/macdefs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#include <errno.h>
1818
#include <string.h>
1919

20+
/* We may be able to use a std routine in think, don't know */
21+
unsigned char *Pstring(char *);
22+
2023
/* Macro to find out whether we can do HFS-only calls: */
2124
#define FSFCBLen (* (short *) 0x3f6)
2225
#define hfsrunning() (FSFCBLen > 0)

Mac/Modules/macmodule.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,18 @@ mac_write(self, args)
447447
}
448448
#endif /* !__MWERKS__ */
449449

450+
#ifdef MALLOC_DEBUG
451+
static object *
452+
mac_mstats(self, args)
453+
object*self;
454+
object *args;
455+
{
456+
mstats("python");
457+
INCREF(None);
458+
return None;
459+
}
460+
#endif MALLOC_DEBUG
461+
450462
static struct methodlist mac_methods[] = {
451463
{"chdir", mac_chdir},
452464
#ifndef __MWERKS__
@@ -477,6 +489,9 @@ static struct methodlist mac_methods[] = {
477489
#ifndef __MWERKS__
478490
{"write", mac_write},
479491
#endif
492+
#ifdef MALLOC_DEBUG
493+
{"mstats", mac_mstats},
494+
#endif
480495

481496
{NULL, NULL} /* Sentinel */
482497
};
@@ -485,7 +500,7 @@ static struct methodlist mac_methods[] = {
485500
void
486501
initmac()
487502
{
488-
object *m, *d, *v;
503+
object *m, *d;
489504

490505
m = initmodule("mac", mac_methods);
491506
d = getmoduledict(m);

Mac/Python/macguesstabsize.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ guesstabsize(path)
1717
s[0] = strlen(path);
1818
memcpy(s+1, path, s[0]);
1919
refnum = OpenResFile(s);
20-
/* printf("%s --> refnum=%d\n", path, refnum); */
2120
if (refnum == -1)
2221
return 0;
2322
UseResFile(refnum);
2423
h = GetIndResource('ETAB', 1);
2524
if (h != 0) {
2625
tabsize = (*(short**)h)[1];
27-
/* printf("tabsize=%d\n", tabsize); */
2826
}
2927
CloseResFile(refnum);
3028
return tabsize;

Mac/Python/macsetfiletype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ long creator, type;
1414
FInfo info;
1515
unsigned char *pname;
1616

17-
pname = (StringPtr) c2pstr(name);
17+
pname = (StringPtr) Pstring(name);
1818
if ( GetFInfo(pname, 0, &info) < 0 )
1919
return -1;
2020
info.fdType = type;

0 commit comments

Comments
 (0)