Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
50905b55
Kaydet (Commit)
50905b55
authored
Mar 31, 2002
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert from using METH_OLDARGS to METH_NOARGS.
These should be safe.
üst
01b2694a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
85 deletions
+44
-85
clmodule.c
Modules/clmodule.c
+15
-25
fmmodule.c
Modules/fmmodule.c
+18
-32
timingmodule.c
Modules/timingmodule.c
+11
-28
No files found.
Modules/clmodule.c
Dosyayı görüntüle @
50905b55
...
...
@@ -183,13 +183,10 @@ cl_DecompressImage(PyObject *self, PyObject *args)
}
static
PyObject
*
doClose
(
clobject
*
self
,
PyObject
*
args
,
int
(
*
close_func
)(
CL_Handle
))
doClose
(
clobject
*
self
,
int
(
*
close_func
)(
CL_Handle
))
{
CheckCompressor
(
self
);
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
error_handler_called
=
0
;
if
((
*
close_func
)(
self
->
ob_compressorHdl
)
==
FAILURE
||
error_handler_called
)
{
...
...
@@ -209,15 +206,15 @@ doClose(clobject *self, PyObject *args, int (*close_func)(CL_Handle))
}
static
PyObject
*
clm_CloseCompressor
(
PyObject
*
self
,
PyObject
*
args
)
clm_CloseCompressor
(
PyObject
*
self
)
{
return
doClose
(
SELF
,
args
,
clCloseCompressor
);
return
doClose
(
SELF
,
clCloseCompressor
);
}
static
PyObject
*
clm_CloseDecompressor
(
PyObject
*
self
,
PyObject
*
args
)
clm_CloseDecompressor
(
PyObject
*
self
)
{
return
doClose
(
SELF
,
args
,
clCloseDecompressor
);
return
doClose
(
SELF
,
clCloseDecompressor
);
}
static
PyObject
*
...
...
@@ -479,7 +476,7 @@ clm_GetParamID(PyObject *self, PyObject *args)
}
static
PyObject
*
clm_QueryParams
(
PyObject
*
self
,
PyObject
*
args
)
clm_QueryParams
(
PyObject
*
self
)
{
int
bufferlength
;
int
*
PVbuffer
;
...
...
@@ -488,9 +485,6 @@ clm_QueryParams(PyObject *self, PyObject *args)
CheckCompressor
(
SELF
);
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
error_handler_called
=
0
;
bufferlength
=
clQueryParams
(
SELF
->
ob_compressorHdl
,
0
,
0
);
if
(
error_handler_called
)
...
...
@@ -574,13 +568,9 @@ clm_GetName(PyObject *self, PyObject *args)
}
static
PyObject
*
clm_QuerySchemeFromHandle
(
PyObject
*
self
,
PyObject
*
args
)
clm_QuerySchemeFromHandle
(
PyObject
*
self
)
{
CheckCompressor
(
SELF
);
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
PyInt_FromLong
(
clQuerySchemeFromHandle
(
SELF
->
ob_compressorHdl
));
}
...
...
@@ -600,8 +590,8 @@ clm_ReadHeader(PyObject *self, PyObject *args)
}
static
PyMethodDef
compressor_methods
[]
=
{
{
"close"
,
clm_CloseCompressor
,
METH_
OLD
ARGS
},
/* alias */
{
"CloseCompressor"
,
clm_CloseCompressor
,
METH_
OLD
ARGS
},
{
"close"
,
clm_CloseCompressor
,
METH_
NO
ARGS
},
/* alias */
{
"CloseCompressor"
,
clm_CloseCompressor
,
METH_
NO
ARGS
},
{
"Compress"
,
clm_Compress
,
METH_OLDARGS
},
{
"GetDefault"
,
clm_GetDefault
,
METH_OLDARGS
},
{
"GetMinMax"
,
clm_GetMinMax
,
METH_OLDARGS
},
...
...
@@ -609,16 +599,16 @@ static PyMethodDef compressor_methods[] = {
{
"GetParam"
,
clm_GetParam
,
METH_OLDARGS
},
{
"GetParamID"
,
clm_GetParamID
,
METH_OLDARGS
},
{
"GetParams"
,
clm_GetParams
,
METH_OLDARGS
},
{
"QueryParams"
,
clm_QueryParams
,
METH_
OLD
ARGS
},
{
"QuerySchemeFromHandle"
,
clm_QuerySchemeFromHandle
,
METH_
OLD
ARGS
},
{
"QueryParams"
,
clm_QueryParams
,
METH_
NO
ARGS
},
{
"QuerySchemeFromHandle"
,
clm_QuerySchemeFromHandle
,
METH_
NO
ARGS
},
{
"SetParam"
,
clm_SetParam
,
METH_OLDARGS
},
{
"SetParams"
,
clm_SetParams
,
METH_OLDARGS
},
{
NULL
,
NULL
}
/* sentinel */
};
static
PyMethodDef
decompressor_methods
[]
=
{
{
"close"
,
clm_CloseDecompressor
,
METH_
OLD
ARGS
},
/* alias */
{
"CloseDecompressor"
,
clm_CloseDecompressor
,
METH_
OLD
ARGS
},
{
"close"
,
clm_CloseDecompressor
,
METH_
NO
ARGS
},
/* alias */
{
"CloseDecompressor"
,
clm_CloseDecompressor
,
METH_
NO
ARGS
},
{
"Decompress"
,
clm_Decompress
,
METH_OLDARGS
},
{
"GetDefault"
,
clm_GetDefault
,
METH_OLDARGS
},
{
"GetMinMax"
,
clm_GetMinMax
,
METH_OLDARGS
},
...
...
@@ -627,8 +617,8 @@ static PyMethodDef decompressor_methods[] = {
{
"GetParamID"
,
clm_GetParamID
,
METH_OLDARGS
},
{
"GetParams"
,
clm_GetParams
,
METH_OLDARGS
},
{
"ReadHeader"
,
clm_ReadHeader
,
METH_OLDARGS
},
{
"QueryParams"
,
clm_QueryParams
,
METH_
OLD
ARGS
},
{
"QuerySchemeFromHandle"
,
clm_QuerySchemeFromHandle
,
METH_
OLD
ARGS
},
{
"QueryParams"
,
clm_QueryParams
,
METH_
NO
ARGS
},
{
"QuerySchemeFromHandle"
,
clm_QuerySchemeFromHandle
,
METH_
NO
ARGS
},
{
"SetParam"
,
clm_SetParam
,
METH_OLDARGS
},
{
"SetParams"
,
clm_SetParams
,
METH_OLDARGS
},
{
NULL
,
NULL
}
/* sentinel */
...
...
Modules/fmmodule.c
Dosyayı görüntüle @
50905b55
...
...
@@ -49,22 +49,18 @@ fh_scalefont(fhobject *self, PyObject *args)
/* XXX fmmakefont */
static
PyObject
*
fh_setfont
(
fhobject
*
self
,
PyObject
*
args
)
fh_setfont
(
fhobject
*
self
)
{
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
fmsetfont
(
self
->
fh_fh
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
fh_getfontname
(
fhobject
*
self
,
PyObject
*
args
)
fh_getfontname
(
fhobject
*
self
)
{
char
fontname
[
256
];
int
len
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
len
=
fmgetfontname
(
self
->
fh_fh
,
sizeof
fontname
,
fontname
);
if
(
len
<
0
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"error in fmgetfontname"
);
...
...
@@ -74,12 +70,10 @@ fh_getfontname(fhobject *self, PyObject *args)
}
static
PyObject
*
fh_getcomment
(
fhobject
*
self
,
PyObject
*
args
)
fh_getcomment
(
fhobject
*
self
)
{
char
comment
[
256
];
int
len
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
len
=
fmgetcomment
(
self
->
fh_fh
,
sizeof
comment
,
comment
);
if
(
len
<
0
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"error in fmgetcomment"
);
...
...
@@ -89,11 +83,9 @@ fh_getcomment(fhobject *self, PyObject *args)
}
static
PyObject
*
fh_getfontinfo
(
fhobject
*
self
,
PyObject
*
args
)
fh_getfontinfo
(
fhobject
*
self
)
{
fmfontinfo
info
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
if
(
fmgetfontinfo
(
self
->
fh_fh
,
&
info
)
<
0
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"error in fmgetfontinfo"
);
return
NULL
;
...
...
@@ -126,11 +118,11 @@ fh_getstrwidth(fhobject *self, PyObject *args)
}
static
PyMethodDef
fh_methods
[]
=
{
{
"scalefont"
,
(
PyCFunction
)
fh_scalefont
,
METH_OLDARGS
},
{
"setfont"
,
(
PyCFunction
)
fh_setfont
,
METH_OLD
ARGS
},
{
"getfontname"
,
(
PyCFunction
)
fh_getfontname
,
METH_
OLD
ARGS
},
{
"getcomment"
,
(
PyCFunction
)
fh_getcomment
,
METH_OLD
ARGS
},
{
"getfontinfo"
,
(
PyCFunction
)
fh_getfontinfo
,
METH_
OLD
ARGS
},
{
"scalefont"
,
(
PyCFunction
)
fh_scalefont
,
METH_OLDARGS
},
{
"setfont"
,
(
PyCFunction
)
fh_setfont
,
METH_NO
ARGS
},
{
"getfontname"
,
(
PyCFunction
)
fh_getfontname
,
METH_
NO
ARGS
},
{
"getcomment"
,
(
PyCFunction
)
fh_getcomment
,
METH_NO
ARGS
},
{
"getfontinfo"
,
(
PyCFunction
)
fh_getfontinfo
,
METH_
NO
ARGS
},
#if 0
{"getwholemetrics", (PyCFunction)fh_getwholemetrics, METH_OLDARGS},
#endif
...
...
@@ -170,10 +162,8 @@ static PyTypeObject Fhtype = {
/* Font Manager functions */
static
PyObject
*
fm_init
(
PyObject
*
self
,
PyObject
*
args
)
fm_init
(
PyObject
*
self
)
{
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
fminit
();
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -224,11 +214,9 @@ clientproc(char *fontname)
}
static
PyObject
*
fm_enumerate
(
PyObject
*
self
,
PyObject
*
args
)
fm_enumerate
(
PyObject
*
self
)
{
PyObject
*
res
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
fontlist
=
PyList_New
(
0
);
if
(
fontlist
==
NULL
)
return
NULL
;
...
...
@@ -250,20 +238,18 @@ fm_setpath(PyObject *self, PyObject *args)
}
static
PyObject
*
fm_fontpath
(
PyObject
*
self
,
PyObject
*
args
)
fm_fontpath
(
PyObject
*
self
)
{
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
PyString_FromString
(
fmfontpath
());
}
static
PyMethodDef
fm_methods
[]
=
{
{
"init"
,
fm_init
,
METH_OLD
ARGS
},
{
"findfont"
,
fm_findfont
,
METH_OLDARGS
},
{
"enumerate"
,
fm_enumerate
,
METH_
OLD
ARGS
},
{
"prstr"
,
fm_prstr
,
METH_OLDARGS
},
{
"setpath"
,
fm_setpath
,
METH_OLDARGS
},
{
"fontpath"
,
fm_fontpath
,
METH_OLD
ARGS
},
{
"init"
,
fm_init
,
METH_NO
ARGS
},
{
"findfont"
,
fm_findfont
,
METH_OLDARGS
},
{
"enumerate"
,
fm_enumerate
,
METH_
NO
ARGS
},
{
"prstr"
,
fm_prstr
,
METH_OLDARGS
},
{
"setpath"
,
fm_setpath
,
METH_OLDARGS
},
{
"fontpath"
,
fm_fontpath
,
METH_NO
ARGS
},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
Modules/timingmodule.c
Dosyayı görüntüle @
50905b55
...
...
@@ -8,63 +8,46 @@
#include "timing.h"
static
PyObject
*
start_timing
(
PyObject
*
self
,
PyObject
*
args
)
start_timing
(
PyObject
*
self
)
{
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
Py_INCREF
(
Py_None
);
BEGINTIMING
;
return
Py_None
;
}
static
PyObject
*
finish_timing
(
PyObject
*
self
,
PyObject
*
args
)
finish_timing
(
PyObject
*
self
)
{
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
ENDTIMING
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
seconds
(
PyObject
*
self
,
PyObject
*
args
)
seconds
(
PyObject
*
self
)
{
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
PyInt_FromLong
(
TIMINGS
);
}
static
PyObject
*
milli
(
PyObject
*
self
,
PyObject
*
args
)
milli
(
PyObject
*
self
)
{
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
PyInt_FromLong
(
TIMINGMS
);
}
static
PyObject
*
micro
(
PyObject
*
self
,
PyObject
*
args
)
micro
(
PyObject
*
self
)
{
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
PyInt_FromLong
(
TIMINGUS
);
}
static
PyMethodDef
timing_methods
[]
=
{
{
"start"
,
start_timing
,
METH_OLD
ARGS
},
{
"finish"
,
finish_timing
,
METH_OLD
ARGS
},
{
"seconds"
,
seconds
,
METH_OLD
ARGS
},
{
"milli"
,
milli
,
METH_OLD
ARGS
},
{
"micro"
,
micro
,
METH_OLD
ARGS
},
{
"start"
,
(
PyCFunction
)
start_timing
,
METH_NO
ARGS
},
{
"finish"
,
(
PyCFunction
)
finish_timing
,
METH_NO
ARGS
},
{
"seconds"
,
(
PyCFunction
)
seconds
,
METH_NO
ARGS
},
{
"milli"
,
(
PyCFunction
)
milli
,
METH_NO
ARGS
},
{
"micro"
,
(
PyCFunction
)
micro
,
METH_NO
ARGS
},
{
NULL
,
NULL
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment