Skip to content

Instantly share code, notes, and snippets.

@hhatto
Created June 1, 2018 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hhatto/1f0cb1e0f32922269b4c89bc02aadced to your computer and use it in GitHub Desktop.
Save hhatto/1f0cb1e0f32922269b4c89bc02aadced to your computer and use it in GitHub Desktop.
patch for Python 1.2 build on macOSX
diff --git a/Modules/rgbimgmodule.c b/Modules/rgbimgmodule.c
index 62e9e0b..331f9dc 100644
--- a/Modules/rgbimgmodule.c
+++ b/Modules/rgbimgmodule.c
@@ -499,7 +499,7 @@ int z;
while(1) {
pixel = *iptr++;
if ( !(count = (pixel & 0x7f)) )
- return;
+ return 0;
if(pixel & 0x80) {
while(count>=8) {
optr[0*4] = iptr[0];
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index df27caf..68abc21 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -410,7 +410,7 @@ file_read(f, args)
*/
static object *
-getline(f, n)
+l_getline(f, n)
fileobject *f;
int n;
{
@@ -531,7 +531,7 @@ filegetline(f, n)
}
if (((fileobject*)f)->f_fp == NULL)
return err_closed();
- return getline((fileobject *)f, n);
+ return l_getline((fileobject *)f, n);
}
/* Python method */
@@ -556,7 +556,7 @@ file_readline(f, args)
}
}
- return getline(f, n);
+ return l_getline(f, n);
}
static object *
@@ -574,7 +574,7 @@ file_readlines(f, args)
if ((list = newlistobject(0)) == NULL)
return NULL;
for (;;) {
- line = getline(f, 0);
+ line = l_getline(f, 0);
if (line != NULL && getstringsize(line) == 0) {
DECREF(line);
break;
diff --git a/Parser/pgen.c b/Parser/pgen.c
index db08d77..b7ef50d 100644
--- a/Parser/pgen.c
+++ b/Parser/pgen.c
@@ -226,7 +226,7 @@ compile_rhs(ll, nf, n, pa, pb)
REQ(n, ALT);
compile_alt(ll, nf, n, pa, pb);
if (--i <= 0)
- return;
+ return 0;
n++;
a = *pa;
b = *pb;
@@ -308,7 +308,7 @@ compile_item(ll, nf, n, pa, pb)
else {
compile_atom(ll, nf, n, pa, pb);
if (--i <= 0)
- return;
+ return 0;
n++;
addnfaarc(nf, *pb, *pa, EMPTY);
if (n->n_type == STAR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment