Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 2123:fd5ab7e828fc legacy-trunk
cosmetic changes so these modules will work with the strict new naming scheme
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 10 Jan 1995 20:56:29 +0000 |
| parents | 7ea369d05c2e |
| children | 990099ed7810 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Tue Jan 10 17:43:33 1995 +0000 +++ b/Modules/socketmodule.c Tue Jan 10 20:56:29 1995 +0000 @@ -580,7 +580,7 @@ if (buf == NULL) return NULL; res = getsockopt(s->sock_fd, level, optname, - (ANY *)getstringvalue(buf), &buflen); + (ANY *)PyString_AsString(buf), &buflen); if (res < 0) { Py_DECREF(buf); return PySocket_Err(); @@ -732,7 +732,7 @@ static PyObject * BUILD_FUNC_DEF_2(PySocketSock_makefile,PySocketSockObject *,s, PyObject *,args) { - extern int fclose PROTO((FILE *)); + extern int fclose Py_PROTO((FILE *)); char *mode; int fd; FILE *fp; @@ -762,7 +762,7 @@ if (buf == NULL) return NULL; Py_BEGIN_ALLOW_THREADS - n = recv(s->sock_fd, getstringvalue(buf), len, flags); + n = recv(s->sock_fd, PyString_AsString(buf), len, flags); Py_END_ALLOW_THREADS if (n < 0) return PySocket_Err(); @@ -937,12 +937,12 @@ PyObject *addro; struct sockaddr *addr; char buf[512]; - object *t, *comma, *v; + PyObject *t, *comma, *v; int i, len; sprintf(buf, "<socket object, fd=%d, family=%d, type=%d, protocol=%d>", s->sock_fd, s->sock_family, s->sock_type, s->sock_proto); - t = newstringobject(buf); + t = PyString_FromString(buf); return t; }
