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
b0aaec57
Kaydet (Commit)
b0aaec57
authored
Nis 02, 2002
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert more METH_OLDARGS & PyArg_Parse()
Please review.
üst
187ae561
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
69 deletions
+69
-69
clmodule.c
Modules/clmodule.c
+35
-35
imageop.c
Modules/imageop.c
+30
-30
sgimodule.c
Modules/sgimodule.c
+4
-4
No files found.
Modules/clmodule.c
Dosyayı görüntüle @
b0aaec57
...
@@ -104,7 +104,7 @@ cl_CompressImage(PyObject *self, PyObject *args)
...
@@ -104,7 +104,7 @@ cl_CompressImage(PyObject *self, PyObject *args)
char
*
frameBuffer
;
char
*
frameBuffer
;
PyObject
*
compressedBuffer
;
PyObject
*
compressedBuffer
;
if
(
!
PyArg_Parse
(
args
,
"(iiiifs#)
"
,
&
compressionScheme
,
if
(
!
PyArg_Parse
Tuple
(
args
,
"iiiifs#
"
,
&
compressionScheme
,
&
width
,
&
height
,
&
width
,
&
height
,
&
originalFormat
,
&
compressionRatio
,
&
frameBuffer
,
&
originalFormat
,
&
compressionRatio
,
&
frameBuffer
,
&
frameBufferSize
))
&
frameBufferSize
))
...
@@ -149,7 +149,7 @@ cl_DecompressImage(PyObject *self, PyObject *args)
...
@@ -149,7 +149,7 @@ cl_DecompressImage(PyObject *self, PyObject *args)
int
compressedBufferSize
,
frameBufferSize
;
int
compressedBufferSize
,
frameBufferSize
;
PyObject
*
frameBuffer
;
PyObject
*
frameBuffer
;
if
(
!
PyArg_Parse
(
args
,
"(iiiis#)
"
,
&
compressionScheme
,
&
width
,
&
height
,
if
(
!
PyArg_Parse
Tuple
(
args
,
"iiiis#
"
,
&
compressionScheme
,
&
width
,
&
height
,
&
originalFormat
,
&
compressedBuffer
,
&
originalFormat
,
&
compressedBuffer
,
&
compressedBufferSize
))
&
compressedBufferSize
))
return
NULL
;
return
NULL
;
...
@@ -670,7 +670,7 @@ doOpen(PyObject *self, PyObject *args, int (*open_func)(int, CL_Handle *),
...
@@ -670,7 +670,7 @@ doOpen(PyObject *self, PyObject *args, int (*open_func)(int, CL_Handle *),
int
scheme
;
int
scheme
;
clobject
*
new
;
clobject
*
new
;
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
new
=
PyObject_New
(
clobject
,
&
Cltype
);
new
=
PyObject_New
(
clobject
,
&
Cltype
);
...
@@ -711,7 +711,7 @@ cl_QueryScheme(PyObject *self, PyObject *args)
...
@@ -711,7 +711,7 @@ cl_QueryScheme(PyObject *self, PyObject *args)
int
headerlen
;
int
headerlen
;
int
scheme
;
int
scheme
;
if
(
!
PyArg_Parse
(
args
,
"s#"
,
&
header
,
&
headerlen
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#"
,
&
header
,
&
headerlen
))
return
NULL
;
return
NULL
;
scheme
=
clQueryScheme
(
header
);
scheme
=
clQueryScheme
(
header
);
...
@@ -728,7 +728,7 @@ cl_QueryMaxHeaderSize(PyObject *self, PyObject *args)
...
@@ -728,7 +728,7 @@ cl_QueryMaxHeaderSize(PyObject *self, PyObject *args)
{
{
int
scheme
;
int
scheme
;
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
return
PyInt_FromLong
(
clQueryMaxHeaderSize
(
scheme
));
return
PyInt_FromLong
(
clQueryMaxHeaderSize
(
scheme
));
...
@@ -743,7 +743,7 @@ cl_QueryAlgorithms(PyObject *self, PyObject *args)
...
@@ -743,7 +743,7 @@ cl_QueryAlgorithms(PyObject *self, PyObject *args)
PyObject
*
list
;
PyObject
*
list
;
int
i
;
int
i
;
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
algorithmMediaType
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"i"
,
&
algorithmMediaType
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -791,7 +791,7 @@ cl_QuerySchemeFromName(PyObject *self, PyObject *args)
...
@@ -791,7 +791,7 @@ cl_QuerySchemeFromName(PyObject *self, PyObject *args)
char
*
name
;
char
*
name
;
int
scheme
;
int
scheme
;
if
(
!
PyArg_Parse
(
args
,
"(is)
"
,
&
algorithmMediaType
,
&
name
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"is
"
,
&
algorithmMediaType
,
&
name
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -810,7 +810,7 @@ cl_GetAlgorithmName(PyObject *self, PyObject *args)
...
@@ -810,7 +810,7 @@ cl_GetAlgorithmName(PyObject *self, PyObject *args)
int
scheme
;
int
scheme
;
char
*
name
;
char
*
name
;
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
name
=
clGetAlgorithmName
(
scheme
);
name
=
clGetAlgorithmName
(
scheme
);
...
@@ -829,9 +829,9 @@ do_set(PyObject *self, PyObject *args, int (*func)(int, int, int))
...
@@ -829,9 +829,9 @@ do_set(PyObject *self, PyObject *args, int (*func)(int, int, int))
float
fvalue
;
float
fvalue
;
int
is_float
=
0
;
int
is_float
=
0
;
if
(
!
PyArg_Parse
(
args
,
"(iii)
"
,
&
scheme
,
&
paramID
,
&
value
))
{
if
(
!
PyArg_Parse
Tuple
(
args
,
"iii
"
,
&
scheme
,
&
paramID
,
&
value
))
{
PyErr_Clear
();
PyErr_Clear
();
if
(
!
PyArg_Parse
(
args
,
"(iif)
"
,
&
scheme
,
&
paramID
,
&
fvalue
))
{
if
(
!
PyArg_Parse
Tuple
(
args
,
"iif
"
,
&
scheme
,
&
paramID
,
&
fvalue
))
{
PyErr_Clear
();
PyErr_Clear
();
PyErr_SetString
(
PyExc_TypeError
,
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list (format '(iii)' or '(iif)')"
);
"bad argument list (format '(iii)' or '(iif)')"
);
...
@@ -884,7 +884,7 @@ cl_SetMax(PyObject *self, PyObject *args)
...
@@ -884,7 +884,7 @@ cl_SetMax(PyObject *self, PyObject *args)
static PyObject *cl_##name(PyObject *self, PyObject *args) \
static PyObject *cl_##name(PyObject *self, PyObject *args) \
{ \
{ \
int x; \
int x; \
if (!PyArg_Parse(args, "i", &x)) return NULL; \
if (!PyArg_Parse
Tuple
(args, "i", &x)) return NULL; \
return Py##handler(CL_##name(x)); \
return Py##handler(CL_##name(x)); \
}
}
...
@@ -892,7 +892,7 @@ static PyObject *cl_##name(PyObject *self, PyObject *args) \
...
@@ -892,7 +892,7 @@ static PyObject *cl_##name(PyObject *self, PyObject *args) \
static PyObject *cl_##name(PyObject *self, PyObject *args) \
static PyObject *cl_##name(PyObject *self, PyObject *args) \
{ \
{ \
int a1, a2; \
int a1, a2; \
if (!PyArg_Parse
(args, "(ii)
", &a1, &a2)) return NULL; \
if (!PyArg_Parse
Tuple(args, "ii
", &a1, &a2)) return NULL; \
return Py##handler(CL_##name(a1, a2)); \
return Py##handler(CL_##name(a1, a2)); \
}
}
...
@@ -926,30 +926,30 @@ cvt_type(PyObject *self, PyObject *args)
...
@@ -926,30 +926,30 @@ cvt_type(PyObject *self, PyObject *args)
#endif
#endif
static
PyMethodDef
cl_methods
[]
=
{
static
PyMethodDef
cl_methods
[]
=
{
{
"CompressImage"
,
cl_CompressImage
,
METH_
OLD
ARGS
},
{
"CompressImage"
,
cl_CompressImage
,
METH_
VAR
ARGS
},
{
"DecompressImage"
,
cl_DecompressImage
,
METH_
OLD
ARGS
},
{
"DecompressImage"
,
cl_DecompressImage
,
METH_
VAR
ARGS
},
{
"GetAlgorithmName"
,
cl_GetAlgorithmName
,
METH_
OLD
ARGS
},
{
"GetAlgorithmName"
,
cl_GetAlgorithmName
,
METH_
VAR
ARGS
},
{
"OpenCompressor"
,
cl_OpenCompressor
,
METH_
OLD
ARGS
},
{
"OpenCompressor"
,
cl_OpenCompressor
,
METH_
VAR
ARGS
},
{
"OpenDecompressor"
,
cl_OpenDecompressor
,
METH_
OLD
ARGS
},
{
"OpenDecompressor"
,
cl_OpenDecompressor
,
METH_
VAR
ARGS
},
{
"QueryAlgorithms"
,
cl_QueryAlgorithms
,
METH_
OLD
ARGS
},
{
"QueryAlgorithms"
,
cl_QueryAlgorithms
,
METH_
VAR
ARGS
},
{
"QueryMaxHeaderSize"
,
cl_QueryMaxHeaderSize
,
METH_
OLD
ARGS
},
{
"QueryMaxHeaderSize"
,
cl_QueryMaxHeaderSize
,
METH_
VAR
ARGS
},
{
"QueryScheme"
,
cl_QueryScheme
,
METH_
OLD
ARGS
},
{
"QueryScheme"
,
cl_QueryScheme
,
METH_
VAR
ARGS
},
{
"QuerySchemeFromName"
,
cl_QuerySchemeFromName
,
METH_
OLD
ARGS
},
{
"QuerySchemeFromName"
,
cl_QuerySchemeFromName
,
METH_
VAR
ARGS
},
{
"SetDefault"
,
cl_SetDefault
,
METH_
OLD
ARGS
},
{
"SetDefault"
,
cl_SetDefault
,
METH_
VAR
ARGS
},
{
"SetMax"
,
cl_SetMax
,
METH_
OLD
ARGS
},
{
"SetMax"
,
cl_SetMax
,
METH_
VAR
ARGS
},
{
"SetMin"
,
cl_SetMin
,
METH_
OLD
ARGS
},
{
"SetMin"
,
cl_SetMin
,
METH_
VAR
ARGS
},
{
"BytesPerSample"
,
cl_BytesPerSample
,
METH_
OLD
ARGS
},
{
"BytesPerSample"
,
cl_BytesPerSample
,
METH_
VAR
ARGS
},
{
"BytesPerPixel"
,
cl_BytesPerPixel
,
METH_
OLD
ARGS
},
{
"BytesPerPixel"
,
cl_BytesPerPixel
,
METH_
VAR
ARGS
},
{
"AudioFormatName"
,
cl_AudioFormatName
,
METH_
OLD
ARGS
},
{
"AudioFormatName"
,
cl_AudioFormatName
,
METH_
VAR
ARGS
},
{
"VideoFormatName"
,
cl_VideoFormatName
,
METH_
OLD
ARGS
},
{
"VideoFormatName"
,
cl_VideoFormatName
,
METH_
VAR
ARGS
},
{
"AlgorithmNumber"
,
cl_AlgorithmNumber
,
METH_
OLD
ARGS
},
{
"AlgorithmNumber"
,
cl_AlgorithmNumber
,
METH_
VAR
ARGS
},
{
"AlgorithmType"
,
cl_AlgorithmType
,
METH_
OLD
ARGS
},
{
"AlgorithmType"
,
cl_AlgorithmType
,
METH_
VAR
ARGS
},
{
"Algorithm"
,
cl_Algorithm
,
METH_
OLD
ARGS
},
{
"Algorithm"
,
cl_Algorithm
,
METH_
VAR
ARGS
},
{
"ParamNumber"
,
cl_ParamNumber
,
METH_
OLD
ARGS
},
{
"ParamNumber"
,
cl_ParamNumber
,
METH_
VAR
ARGS
},
{
"ParamType"
,
cl_ParamType
,
METH_
OLD
ARGS
},
{
"ParamType"
,
cl_ParamType
,
METH_
VAR
ARGS
},
{
"ParamID"
,
cl_ParamID
,
METH_
OLD
ARGS
},
{
"ParamID"
,
cl_ParamID
,
METH_
VAR
ARGS
},
#ifdef CLDEBUG
#ifdef CLDEBUG
{
"cvt_type"
,
cvt_type
,
METH_
OLD
ARGS
},
{
"cvt_type"
,
cvt_type
,
METH_
VAR
ARGS
},
#endif
#endif
{
NULL
,
NULL
}
/* Sentinel */
{
NULL
,
NULL
}
/* Sentinel */
};
};
...
...
Modules/imageop.c
Dosyayı görüntüle @
b0aaec57
...
@@ -35,7 +35,7 @@ imageop_crop(PyObject *self, PyObject *args)
...
@@ -35,7 +35,7 @@ imageop_crop(PyObject *self, PyObject *args)
int
ix
,
iy
,
xstep
,
ystep
;
int
ix
,
iy
,
xstep
,
ystep
;
PyObject
*
rv
;
PyObject
*
rv
;
if
(
!
PyArg_Parse
(
args
,
"(s#iiiiiii)
"
,
&
cp
,
&
len
,
&
size
,
&
x
,
&
y
,
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#iiiiiii
"
,
&
cp
,
&
len
,
&
size
,
&
x
,
&
y
,
&
newx1
,
&
newy1
,
&
newx2
,
&
newy2
)
)
&
newx1
,
&
newy1
,
&
newx2
,
&
newy2
)
)
return
0
;
return
0
;
...
@@ -90,7 +90,7 @@ imageop_scale(PyObject *self, PyObject *args)
...
@@ -90,7 +90,7 @@ imageop_scale(PyObject *self, PyObject *args)
int
oix
,
oiy
;
int
oix
,
oiy
;
PyObject
*
rv
;
PyObject
*
rv
;
if
(
!
PyArg_Parse
(
args
,
"(s#iiiii)
"
,
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#iiiii
"
,
&
cp
,
&
len
,
&
size
,
&
x
,
&
y
,
&
newx
,
&
newy
)
)
&
cp
,
&
len
,
&
size
,
&
x
,
&
y
,
&
newx
,
&
newy
)
)
return
0
;
return
0
;
...
@@ -136,7 +136,7 @@ imageop_tovideo(PyObject *self, PyObject *args)
...
@@ -136,7 +136,7 @@ imageop_tovideo(PyObject *self, PyObject *args)
PyObject
*
rv
;
PyObject
*
rv
;
if
(
!
PyArg_Parse
(
args
,
"(s#iii)
"
,
&
cp
,
&
len
,
&
width
,
&
maxx
,
&
maxy
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#iii
"
,
&
cp
,
&
len
,
&
width
,
&
maxx
,
&
maxy
)
)
return
0
;
return
0
;
if
(
width
!=
1
&&
width
!=
4
)
{
if
(
width
!=
1
&&
width
!=
4
)
{
...
@@ -190,7 +190,7 @@ imageop_grey2mono(PyObject *self, PyObject *args)
...
@@ -190,7 +190,7 @@ imageop_grey2mono(PyObject *self, PyObject *args)
int
i
,
bit
;
int
i
,
bit
;
if
(
!
PyArg_Parse
(
args
,
"(s#iii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
,
&
tres
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#iii
"
,
&
cp
,
&
len
,
&
x
,
&
y
,
&
tres
)
)
return
0
;
return
0
;
if
(
x
*
y
!=
len
)
{
if
(
x
*
y
!=
len
)
{
...
@@ -231,7 +231,7 @@ imageop_grey2grey4(PyObject *self, PyObject *args)
...
@@ -231,7 +231,7 @@ imageop_grey2grey4(PyObject *self, PyObject *args)
int
pos
;
int
pos
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
if
(
x
*
y
!=
len
)
{
if
(
x
*
y
!=
len
)
{
...
@@ -270,7 +270,7 @@ imageop_grey2grey2(PyObject *self, PyObject *args)
...
@@ -270,7 +270,7 @@ imageop_grey2grey2(PyObject *self, PyObject *args)
int
pos
;
int
pos
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
if
(
x
*
y
!=
len
)
{
if
(
x
*
y
!=
len
)
{
...
@@ -308,7 +308,7 @@ imageop_dither2mono(PyObject *self, PyObject *args)
...
@@ -308,7 +308,7 @@ imageop_dither2mono(PyObject *self, PyObject *args)
int
i
,
bit
;
int
i
,
bit
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
if
(
x
*
y
!=
len
)
{
if
(
x
*
y
!=
len
)
{
...
@@ -354,7 +354,7 @@ imageop_dither2grey2(PyObject *self, PyObject *args)
...
@@ -354,7 +354,7 @@ imageop_dither2grey2(PyObject *self, PyObject *args)
int
sum
=
0
,
nvalue
;
int
sum
=
0
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
if
(
x
*
y
!=
len
)
{
if
(
x
*
y
!=
len
)
{
...
@@ -393,7 +393,7 @@ imageop_mono2grey(PyObject *self, PyObject *args)
...
@@ -393,7 +393,7 @@ imageop_mono2grey(PyObject *self, PyObject *args)
PyObject
*
rv
;
PyObject
*
rv
;
int
i
,
bit
;
int
i
,
bit
;
if
(
!
PyArg_Parse
(
args
,
"(s#iiii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
,
&
v0
,
&
v1
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#iiii
"
,
&
cp
,
&
len
,
&
x
,
&
y
,
&
v0
,
&
v1
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -430,7 +430,7 @@ imageop_grey22grey(PyObject *self, PyObject *args)
...
@@ -430,7 +430,7 @@ imageop_grey22grey(PyObject *self, PyObject *args)
PyObject
*
rv
;
PyObject
*
rv
;
int
i
,
pos
,
value
=
0
,
nvalue
;
int
i
,
pos
,
value
=
0
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -466,7 +466,7 @@ imageop_grey42grey(PyObject *self, PyObject *args)
...
@@ -466,7 +466,7 @@ imageop_grey42grey(PyObject *self, PyObject *args)
PyObject
*
rv
;
PyObject
*
rv
;
int
i
,
pos
,
value
=
0
,
nvalue
;
int
i
,
pos
,
value
=
0
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -503,7 +503,7 @@ imageop_rgb2rgb8(PyObject *self, PyObject *args)
...
@@ -503,7 +503,7 @@ imageop_rgb2rgb8(PyObject *self, PyObject *args)
int
i
,
r
,
g
,
b
;
int
i
,
r
,
g
,
b
;
Py_UInt32
value
,
nvalue
;
Py_UInt32
value
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -545,7 +545,7 @@ imageop_rgb82rgb(PyObject *self, PyObject *args)
...
@@ -545,7 +545,7 @@ imageop_rgb82rgb(PyObject *self, PyObject *args)
int
i
,
r
,
g
,
b
;
int
i
,
r
,
g
,
b
;
Py_UInt32
value
,
nvalue
;
Py_UInt32
value
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -586,7 +586,7 @@ imageop_rgb2grey(PyObject *self, PyObject *args)
...
@@ -586,7 +586,7 @@ imageop_rgb2grey(PyObject *self, PyObject *args)
int
i
,
r
,
g
,
b
;
int
i
,
r
,
g
,
b
;
Py_UInt32
value
,
nvalue
;
Py_UInt32
value
,
nvalue
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -622,7 +622,7 @@ imageop_grey2rgb(PyObject *self, PyObject *args)
...
@@ -622,7 +622,7 @@ imageop_grey2rgb(PyObject *self, PyObject *args)
int
i
;
int
i
;
Py_UInt32
value
;
Py_UInt32
value
;
if
(
!
PyArg_Parse
(
args
,
"(s#ii)
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
if
(
!
PyArg_Parse
Tuple
(
args
,
"s#ii
"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
return
0
;
nlen
=
x
*
y
;
nlen
=
x
*
y
;
...
@@ -677,21 +677,21 @@ imageop_mul(object *self, object *args)
...
@@ -677,21 +677,21 @@ imageop_mul(object *self, object *args)
*/
*/
static
PyMethodDef
imageop_methods
[]
=
{
static
PyMethodDef
imageop_methods
[]
=
{
{
"crop"
,
imageop_crop
,
METH_
OLD
ARGS
},
{
"crop"
,
imageop_crop
,
METH_
VAR
ARGS
},
{
"scale"
,
imageop_scale
,
METH_
OLD
ARGS
},
{
"scale"
,
imageop_scale
,
METH_
VAR
ARGS
},
{
"grey2mono"
,
imageop_grey2mono
,
METH_
OLD
ARGS
},
{
"grey2mono"
,
imageop_grey2mono
,
METH_
VAR
ARGS
},
{
"grey2grey2"
,
imageop_grey2grey2
,
METH_
OLD
ARGS
},
{
"grey2grey2"
,
imageop_grey2grey2
,
METH_
VAR
ARGS
},
{
"grey2grey4"
,
imageop_grey2grey4
,
METH_
OLD
ARGS
},
{
"grey2grey4"
,
imageop_grey2grey4
,
METH_
VAR
ARGS
},
{
"dither2mono"
,
imageop_dither2mono
,
METH_
OLD
ARGS
},
{
"dither2mono"
,
imageop_dither2mono
,
METH_
VAR
ARGS
},
{
"dither2grey2"
,
imageop_dither2grey2
,
METH_
OLD
ARGS
},
{
"dither2grey2"
,
imageop_dither2grey2
,
METH_
VAR
ARGS
},
{
"mono2grey"
,
imageop_mono2grey
,
METH_
OLD
ARGS
},
{
"mono2grey"
,
imageop_mono2grey
,
METH_
VAR
ARGS
},
{
"grey22grey"
,
imageop_grey22grey
,
METH_
OLD
ARGS
},
{
"grey22grey"
,
imageop_grey22grey
,
METH_
VAR
ARGS
},
{
"grey42grey"
,
imageop_grey42grey
,
METH_
OLD
ARGS
},
{
"grey42grey"
,
imageop_grey42grey
,
METH_
VAR
ARGS
},
{
"tovideo"
,
imageop_tovideo
,
METH_
OLD
ARGS
},
{
"tovideo"
,
imageop_tovideo
,
METH_
VAR
ARGS
},
{
"rgb2rgb8"
,
imageop_rgb2rgb8
,
METH_
OLD
ARGS
},
{
"rgb2rgb8"
,
imageop_rgb2rgb8
,
METH_
VAR
ARGS
},
{
"rgb82rgb"
,
imageop_rgb82rgb
,
METH_
OLD
ARGS
},
{
"rgb82rgb"
,
imageop_rgb82rgb
,
METH_
VAR
ARGS
},
{
"rgb2grey"
,
imageop_rgb2grey
,
METH_
OLD
ARGS
},
{
"rgb2grey"
,
imageop_rgb2grey
,
METH_
VAR
ARGS
},
{
"grey2rgb"
,
imageop_grey2rgb
,
METH_
OLD
ARGS
},
{
"grey2rgb"
,
imageop_grey2rgb
,
METH_
VAR
ARGS
},
{
0
,
0
}
{
0
,
0
}
};
};
...
...
Modules/sgimodule.c
Dosyayı görüntüle @
b0aaec57
...
@@ -11,7 +11,7 @@ static PyObject *
...
@@ -11,7 +11,7 @@ static PyObject *
sgi_nap
(
PyObject
*
self
,
PyObject
*
args
)
sgi_nap
(
PyObject
*
self
,
PyObject
*
args
)
{
{
long
ticks
;
long
ticks
;
if
(
!
PyArg_Parse
(
args
,
"l
"
,
&
ticks
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"l:nap
"
,
&
ticks
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
sginap
(
ticks
);
sginap
(
ticks
);
...
@@ -30,7 +30,7 @@ sgi__getpty(PyObject *self, PyObject *args)
...
@@ -30,7 +30,7 @@ sgi__getpty(PyObject *self, PyObject *args)
int
nofork
;
int
nofork
;
char
*
name
;
char
*
name
;
int
fildes
;
int
fildes
;
if
(
!
PyArg_Parse
(
args
,
"(iii)
"
,
&
oflag
,
&
mode
,
&
nofork
))
if
(
!
PyArg_Parse
Tuple
(
args
,
"iii:_getpty
"
,
&
oflag
,
&
mode
,
&
nofork
))
return
NULL
;
return
NULL
;
errno
=
0
;
errno
=
0
;
name
=
_getpty
(
&
fildes
,
oflag
,
(
mode_t
)
mode
,
nofork
);
name
=
_getpty
(
&
fildes
,
oflag
,
(
mode_t
)
mode
,
nofork
);
...
@@ -42,8 +42,8 @@ sgi__getpty(PyObject *self, PyObject *args)
...
@@ -42,8 +42,8 @@ sgi__getpty(PyObject *self, PyObject *args)
}
}
static
PyMethodDef
sgi_methods
[]
=
{
static
PyMethodDef
sgi_methods
[]
=
{
{
"nap"
,
sgi_nap
,
METH_OLD
ARGS
},
{
"nap"
,
sgi_nap
,
METH_VAR
ARGS
},
{
"_getpty"
,
sgi__getpty
,
METH_OLD
ARGS
},
{
"_getpty"
,
sgi__getpty
,
METH_VAR
ARGS
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
...
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