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
64a9e38f
Kaydet (Commit)
64a9e38f
authored
Tem 18, 2004
tarafından
Hye-Shik Chang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace an extern magic to assigning declared pointer from array's.
And unifdef(1) compatibility blocks.
üst
22118bc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
cjkcodecs.h
Modules/cjkcodecs/cjkcodecs.h
+12
-26
No files found.
Modules/cjkcodecs/cjkcodecs.h
Dosyayı görüntüle @
64a9e38f
...
@@ -57,14 +57,8 @@ struct pair_encodemap {
...
@@ -57,14 +57,8 @@ struct pair_encodemap {
DBCHAR
code
;
DBCHAR
code
;
};
};
/* There are really static, and (re)declared so later by the expansions
static
const
MultibyteCodec
*
codec_list
;
* of the BEGIN_MAPPINGS_LIST and BEGIN_CODECS_LIST macros, but it's
static
const
struct
dbcs_map
*
mapping_list
;
* not legal C to declare a static array of unknown size. It would be
* better if the code were rearranged so as to not require declaration
* of these names before the macros define them.
*/
extern
const
MultibyteCodec
codec_list
[];
extern
const
struct
dbcs_map
mapping_list
[];
#define CODEC_INIT(encoding) \
#define CODEC_INIT(encoding) \
static int encoding##_codec_init(const void *config)
static int encoding##_codec_init(const void *config)
...
@@ -201,13 +195,16 @@ extern const struct dbcs_map mapping_list[];
...
@@ -201,13 +195,16 @@ extern const struct dbcs_map mapping_list[];
#define GET_INSIZE(c) 1
#define GET_INSIZE(c) 1
#endif
#endif
#define BEGIN_MAPPINGS_LIST static const struct dbcs_map mapping_list[] = {
#define BEGIN_MAPPINGS_LIST static const struct dbcs_map
_
mapping_list[] = {
#define MAPPING_ENCONLY(enc) {#enc, (void*)enc##_encmap, NULL},
#define MAPPING_ENCONLY(enc) {#enc, (void*)enc##_encmap, NULL},
#define MAPPING_DECONLY(enc) {#enc, NULL, (void*)enc##_decmap},
#define MAPPING_DECONLY(enc) {#enc, NULL, (void*)enc##_decmap},
#define MAPPING_ENCDEC(enc) {#enc, (void*)enc##_encmap, (void*)enc##_decmap},
#define MAPPING_ENCDEC(enc) {#enc, (void*)enc##_encmap, (void*)enc##_decmap},
#define END_MAPPINGS_LIST {"", NULL, NULL} };
#define END_MAPPINGS_LIST \
{"", NULL, NULL} }; \
static const struct dbcs_map *mapping_list = \
(const struct dbcs_map *)_mapping_list;
#define BEGIN_CODECS_LIST static const MultibyteCodec codec_list[] = {
#define BEGIN_CODECS_LIST static const MultibyteCodec
_
codec_list[] = {
#define _STATEFUL_METHODS(enc) \
#define _STATEFUL_METHODS(enc) \
enc##_encode, \
enc##_encode, \
enc##_encode_init, \
enc##_encode_init, \
...
@@ -231,7 +228,10 @@ extern const struct dbcs_map mapping_list[];
...
@@ -231,7 +228,10 @@ extern const struct dbcs_map mapping_list[];
enc##_codec_init, \
enc##_codec_init, \
_STATELESS_METHODS(enc) \
_STATELESS_METHODS(enc) \
},
},
#define END_CODECS_LIST {"", NULL,} };
#define END_CODECS_LIST \
{"", NULL,} }; \
static const MultibyteCodec *codec_list = \
(const MultibyteCodec *)_codec_list;
static
PyObject
*
static
PyObject
*
getmultibytecodec
(
void
)
getmultibytecodec
(
void
)
...
@@ -254,12 +254,6 @@ getcodec(PyObject *self, PyObject *encoding)
...
@@ -254,12 +254,6 @@ getcodec(PyObject *self, PyObject *encoding)
PyObject
*
codecobj
,
*
r
,
*
cofunc
;
PyObject
*
codecobj
,
*
r
,
*
cofunc
;
const
MultibyteCodec
*
codec
;
const
MultibyteCodec
*
codec
;
const
char
*
enc
;
const
char
*
enc
;
#ifdef NO_METH_O
PyObject
*
args
=
encoding
;
if
(
!
PyArg_ParseTuple
(
args
,
"O:getcodec"
,
&
encoding
))
return
NULL
;
#endif
if
(
!
PyString_Check
(
encoding
))
{
if
(
!
PyString_Check
(
encoding
))
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_SetString
(
PyExc_TypeError
,
...
@@ -286,22 +280,14 @@ getcodec(PyObject *self, PyObject *encoding)
...
@@ -286,22 +280,14 @@ getcodec(PyObject *self, PyObject *encoding)
if
(
codecobj
==
NULL
)
if
(
codecobj
==
NULL
)
return
NULL
;
return
NULL
;
#if PY_VERSION_HEX >= 0x02020000
r
=
PyObject_CallFunctionObjArgs
(
cofunc
,
codecobj
,
NULL
);
r
=
PyObject_CallFunctionObjArgs
(
cofunc
,
codecobj
,
NULL
);
#else
r
=
PyObject_CallFunction
(
cofunc
,
"O"
,
codecobj
);
#endif
Py_DECREF
(
codecobj
);
Py_DECREF
(
codecobj
);
return
r
;
return
r
;
}
}
static
struct
PyMethodDef
__methods
[]
=
{
static
struct
PyMethodDef
__methods
[]
=
{
#ifndef NO_METH_O
{
"getcodec"
,
(
PyCFunction
)
getcodec
,
METH_O
,
""
},
{
"getcodec"
,
(
PyCFunction
)
getcodec
,
METH_O
,
""
},
#else
{
"getcodec"
,
(
PyCFunction
)
getcodec
,
METH_VARARGS
,
""
},
#endif
{
NULL
,
NULL
},
{
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