]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
More Pstring() stuff and some cosmetics
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 18 Jan 1995 13:58:04 +0000 (13:58 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 18 Jan 1995 13:58:04 +0000 (13:58 +0000)
Mac/Include/macdefs.h
Mac/Modules/macmodule.c
Mac/Python/macguesstabsize.c
Mac/Python/macsetfiletype.c

index 6a5682f8b621c914041228c69d27f7a3e81f4b0b..b64a47e69293ecea4cde546ab4caa78a3f6c0f70 100644 (file)
@@ -17,6 +17,9 @@
 #include <errno.h>
 #include <string.h>
 
+/* We may be able to use a std routine in think, don't know */
+unsigned char *Pstring(char *);
+
 /* Macro to find out whether we can do HFS-only calls: */
 #define FSFCBLen (* (short *) 0x3f6)
 #define hfsrunning() (FSFCBLen > 0)
index 8db0cea426c94a3f3189f99ba0cc0469d4861aee..fbb408b5b7c1a437c7c1c5694dfd6f55a349b829 100644 (file)
@@ -447,6 +447,18 @@ mac_write(self, args)
 }
 #endif /* !__MWERKS__ */
 
+#ifdef MALLOC_DEBUG
+static object *
+mac_mstats(self, args)
+       object*self;
+       object *args;
+{
+       mstats("python");
+       INCREF(None);
+       return None;
+}
+#endif MALLOC_DEBUG
+
 static struct methodlist mac_methods[] = {
        {"chdir",       mac_chdir},
 #ifndef __MWERKS__
@@ -477,6 +489,9 @@ static struct methodlist mac_methods[] = {
 #ifndef __MWERKS__
        {"write",       mac_write},
 #endif
+#ifdef MALLOC_DEBUG
+       {"mstats",      mac_mstats},
+#endif
 
        {NULL,          NULL}            /* Sentinel */
 };
@@ -485,7 +500,7 @@ static struct methodlist mac_methods[] = {
 void
 initmac()
 {
-       object *m, *d, *v;
+       object *m, *d;
        
        m = initmodule("mac", mac_methods);
        d = getmoduledict(m);
index 56b39a152141449ca61d4d726fbf38d2b63d82f1..70314f6bbc27636db04151e4df1385971631ba06 100644 (file)
@@ -17,14 +17,12 @@ guesstabsize(path)
        s[0] = strlen(path);
        memcpy(s+1, path, s[0]);
        refnum = OpenResFile(s);
-/* printf("%s --> refnum=%d\n", path, refnum); */
        if (refnum == -1)
                return 0;
        UseResFile(refnum);
        h = GetIndResource('ETAB', 1);
        if (h != 0) {
                tabsize = (*(short**)h)[1];
-/* printf("tabsize=%d\n", tabsize); */
        }
        CloseResFile(refnum);
        return tabsize;
index 70647b92c36bc0818cf9770695005f7f966acf98..328f02290db76382599cb2f0a87e4b2f7f57d03a 100644 (file)
@@ -14,7 +14,7 @@ long creator, type;
        FInfo info;
        unsigned char *pname;
        
-       pname = (StringPtr) c2pstr(name);
+       pname = (StringPtr) Pstring(name);
        if ( GetFInfo(pname, 0, &info) < 0 )
                return -1;
        info.fdType = type;