]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
replace %#s with portable solution
authorGuido van Rossum <guido@python.org>
Mon, 20 Feb 1995 23:43:29 +0000 (23:43 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 20 Feb 1995 23:43:29 +0000 (23:43 +0000)
Mac/Modules/macfsmodule.c

index ae3c3b65d178985cd41ffe0681af437a6e6eef33..e1ba4e173800894020992cea7f434c61faf63c74 100644 (file)
@@ -191,7 +191,7 @@ mfsa_dealloc(self)
        DEL(self);
 }
 
-static typeobject Mfsatype = {
+statichere typeobject Mfsatype = {
        OB_HEAD_INIT(&Typetype)
        0,                              /*ob_size*/
        "Alias",                        /*tp_name*/
@@ -199,15 +199,15 @@ static typeobject Mfsatype = {
        0,                              /*tp_itemsize*/
        /* methods */
        (destructor)mfsa_dealloc,       /*tp_dealloc*/
-       (printfunc)0,           /*tp_print*/
+       (printfunc)0,                   /*tp_print*/
        (getattrfunc)mfsa_getattr,      /*tp_getattr*/
-       (setattrfunc)0, /*tp_setattr*/
-       (cmpfunc)0,             /*tp_compare*/
-       (reprfunc)0,            /*tp_repr*/
-       0,                      /*tp_as_number*/
-       0,              /*tp_as_sequence*/
-       0,              /*tp_as_mapping*/
-       (hashfunc)0,            /*tp_hash*/
+       (setattrfunc)0,                 /*tp_setattr*/
+       (cmpfunc)0,                     /*tp_compare*/
+       (reprfunc)0,                    /*tp_repr*/
+       0,                              /*tp_as_number*/
+       0,                              /*tp_as_sequence*/
+       0,                              /*tp_as_mapping*/
+       (hashfunc)0,                    /*tp_hash*/
 };
 
 /* End of code for Alias objects */
@@ -394,9 +394,10 @@ mfss_repr(self)
 {
        char buf[512];
 
-       /* XXXX Does %#s work for all compilers? */
-       sprintf(buf, "FSSpec((%d, %d, '%#s'))", self->fsspec.vRefNum, 
-                               self->fsspec.parID, self->fsspec.name);
+       sprintf(buf, "FSSpec((%d, %d, '%.*s'))",
+               self->fsspec.vRefNum, 
+               self->fsspec.parID,
+               self->fsspec.name[0], self->fsspec.name+1);
        return newstringobject(buf);
 }
 
@@ -420,7 +421,7 @@ mfss_compare(v, w)
        return res;
 }
 
-static typeobject Mfsstype = {
+statichere typeobject Mfsstype = {
        OB_HEAD_INIT(&Typetype)
        0,                              /*ob_size*/
        "FSSpec",                       /*tp_name*/