summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
commit217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2 (patch)
tree4737b4a91359c94953623ab9ee297e9a90f319e4 /PC
parent1a3284ed69d545e4ef59869998cb8c29233a45fa (diff)
downloadcpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.zip
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.gz
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.bz2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
Diffstat (limited to 'PC')
-rw-r--r--PC/_msi.c8
-rw-r--r--PC/_subprocess.c16
-rw-r--r--PC/_winreg.c10
-rwxr-xr-xPC/msvcrtmodule.c10
4 files changed, 22 insertions, 22 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 70e0cc4..8dc7734 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -335,7 +335,7 @@ msierror(int status)
static PyObject*
record_getfieldcount(msiobj* record, PyObject* args)
{
- return PyInt_FromLong(MsiRecordGetFieldCount(record->h));
+ return PyLong_FromLong(MsiRecordGetFieldCount(record->h));
}
static PyObject*
@@ -502,7 +502,7 @@ summary_getproperty(msiobj* si, PyObject *args)
switch(type) {
case VT_I2: case VT_I4:
- return PyInt_FromLong(ival);
+ return PyLong_FromLong(ival);
case VT_FILETIME:
PyErr_SetString(PyExc_NotImplementedError, "FILETIME result");
return NULL;
@@ -526,7 +526,7 @@ summary_getpropertycount(msiobj* si, PyObject *args)
if (status != ERROR_SUCCESS)
return msierror(status);
- return PyInt_FromLong(result);
+ return PyLong_FromLong(result);
}
static PyObject*
@@ -544,7 +544,7 @@ summary_setproperty(msiobj* si, PyObject *args)
0, NULL, PyString_AsString(data));
} else if (PyInt_CheckExact(data)) {
status = MsiSummaryInfoSetProperty(si->h, field, VT_I4,
- PyInt_AsLong(data), NULL, NULL);
+ PyLong_AsLong(data), NULL, NULL);
} else {
PyErr_SetString(PyExc_TypeError, "unsupported type");
return NULL;
diff --git a/PC/_subprocess.c b/PC/_subprocess.c
index e711e13..fec7b22 100644
--- a/PC/_subprocess.c
+++ b/PC/_subprocess.c
@@ -79,7 +79,7 @@ sp_handle_detach(sp_handle_object* self, PyObject* args)
self->handle = NULL;
/* note: return the current handle, as an integer */
- return PyInt_FromLong((long) handle);
+ return PyLong_FromLong((long) handle);
}
static PyObject*
@@ -119,7 +119,7 @@ sp_handle_getattr(sp_handle_object* self, char* name)
static PyObject*
sp_handle_as_int(sp_handle_object* self)
{
- return PyInt_FromLong((long) self->handle);
+ return PyLong_FromLong((long) self->handle);
}
static PyNumberMethods sp_handle_as_number;
@@ -164,7 +164,7 @@ sp_GetStdHandle(PyObject* self, PyObject* args)
}
/* note: returns integer, not handle object */
- return PyInt_FromLong((long) handle);
+ return PyLong_FromLong((long) handle);
}
static PyObject *
@@ -253,7 +253,7 @@ getint(PyObject* obj, char* name)
PyErr_Clear(); /* FIXME: propagate error? */
return 0;
}
- ret = (int) PyInt_AsLong(value);
+ ret = (int) PyLong_AsLong(value);
Py_DECREF(value);
return ret;
}
@@ -462,7 +462,7 @@ sp_GetExitCodeProcess(PyObject* self, PyObject* args)
if (! result)
return PyErr_SetFromWindowsErr(GetLastError());
- return PyInt_FromLong(exit_code);
+ return PyLong_FromLong(exit_code);
}
static PyObject *
@@ -484,7 +484,7 @@ sp_WaitForSingleObject(PyObject* self, PyObject* args)
if (result == WAIT_FAILED)
return PyErr_SetFromWindowsErr(GetLastError());
- return PyInt_FromLong((int) result);
+ return PyLong_FromLong((int) result);
}
static PyObject *
@@ -493,7 +493,7 @@ sp_GetVersion(PyObject* self, PyObject* args)
if (! PyArg_ParseTuple(args, ":GetVersion"))
return NULL;
- return PyInt_FromLong((int) GetVersion());
+ return PyLong_FromLong((int) GetVersion());
}
static PyObject *
@@ -534,7 +534,7 @@ static PyMethodDef sp_functions[] = {
static void
defint(PyObject* d, const char* name, int value)
{
- PyObject* v = PyInt_FromLong((long) value);
+ PyObject* v = PyLong_FromLong((long) value);
if (v) {
PyDict_SetItemString(d, (char*) name, v);
Py_DECREF(v);
diff --git a/PC/_winreg.c b/PC/_winreg.c
index 4deb5a9..e1145b1 100644
--- a/PC/_winreg.c
+++ b/PC/_winreg.c
@@ -614,8 +614,8 @@ PyWinObject_CloseHKEY(PyObject *obHandle)
ok = PyHKEY_Close(obHandle);
}
#if SIZEOF_LONG >= SIZEOF_HKEY
- else if (PyInt_Check(obHandle)) {
- long rc = RegCloseKey((HKEY)PyInt_AsLong(obHandle));
+ else if (PyLong_Check(obHandle)) {
+ long rc = RegCloseKey((HKEY)PyLong_AsLong(obHandle));
ok = (rc == ERROR_SUCCESS);
if (!ok)
PyErr_SetFromWindowsErrWithFunction(rc, "RegCloseKey");
@@ -810,9 +810,9 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
switch (typ) {
case REG_DWORD:
if (retDataSize == 0)
- obData = PyInt_FromLong(0);
+ obData = PyLong_FromLong(0);
else
- obData = PyInt_FromLong(*(int *)retDataBuf);
+ obData = PyLong_FromLong(*(int *)retDataBuf);
break;
case REG_SZ:
case REG_EXPAND_SZ:
@@ -1362,7 +1362,7 @@ static struct PyMethodDef winreg_methods[] = {
static void
insint(PyObject * d, char * name, long value)
{
- PyObject *v = PyInt_FromLong(value);
+ PyObject *v = PyLong_FromLong(value);
if (!v || PyDict_SetItemString(d, name, v))
PyErr_Clear();
Py_XDECREF(v);
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index ef73c6f..ae6b911 100755
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -74,7 +74,7 @@ msvcrt_setmode(PyObject *self, PyObject *args)
if (flags == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- return PyInt_FromLong(flags);
+ return PyLong_FromLong(flags);
}
// Convert an OS file handle to a C runtime file descriptor.
@@ -92,7 +92,7 @@ msvcrt_open_osfhandle(PyObject *self, PyObject *args)
if (fd == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- return PyInt_FromLong(fd);
+ return PyLong_FromLong(fd);
}
// Convert a C runtime file descriptor to an OS file handle.
@@ -126,7 +126,7 @@ msvcrt_kbhit(PyObject *self, PyObject *args)
return NULL;
ok = _kbhit();
- return PyInt_FromLong(ok);
+ return PyLong_FromLong(ok);
}
static PyObject *
@@ -192,7 +192,7 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
static void
insertint(PyObject *d, char *name, int value)
{
- PyObject *v = PyInt_FromLong((long) value);
+ PyObject *v = PyLong_FromLong((long) value);
if (v == NULL) {
/* Don't bother reporting this error */
PyErr_Clear();
@@ -214,7 +214,7 @@ msvcrt_setreportfile(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ii", &type, &file))
return NULL;
res = _CrtSetReportFile(type, (_HFILE)file);
- return PyInt_FromLong((long)res);
+ return PyLong_FromLong((long)res);
Py_INCREF(Py_None);
return Py_None;
}