aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-02-07 14:46:19 +0100
committerSverker Eriksson <[email protected]>2013-02-07 14:46:19 +0100
commitb0693061137de237c38965c556c7d6ded8977394 (patch)
tree18bb5289d54c522fd39d5893d48a4783b4909a54 /lib/erl_interface/src
parent68b804f34d4ec420d86953e3f519179a40fbee8f (diff)
downloadotp-b0693061137de237c38965c556c7d6ded8977394.tar.gz
otp-b0693061137de237c38965c556c7d6ded8977394.tar.bz2
otp-b0693061137de237c38965c556c7d6ded8977394.zip
erl_interface: Change enum erlang_char_encoding to a typedef
to make the API independent of the actual type of erlang_char_encoding
Diffstat (limited to 'lib/erl_interface/src')
-rw-r--r--lib/erl_interface/src/decode/decode_atom.c14
-rw-r--r--lib/erl_interface/src/encode/encode_atom.c10
-rw-r--r--lib/erl_interface/src/legacy/erl_eterm.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c6
-rw-r--r--lib/erl_interface/src/misc/ei_x_encode.c8
-rw-r--r--lib/erl_interface/src/misc/putget.h8
-rw-r--r--lib/erl_interface/src/prog/ei_fake_prog.c2
7 files changed, 25 insertions, 25 deletions
diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c
index af4fc114d1..44fd4df12c 100644
--- a/lib/erl_interface/src/decode/decode_atom.c
+++ b/lib/erl_interface/src/decode/decode_atom.c
@@ -28,14 +28,14 @@ int ei_decode_atom(const char *buf, int *index, char *p)
}
int ei_decode_atom_as(const char *buf, int *index, char* p, int destlen,
- enum erlang_char_encoding want_enc,
- enum erlang_char_encoding* was_encp,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding want_enc,
+ erlang_char_encoding* was_encp,
+ erlang_char_encoding* res_encp)
{
const char *s = buf + *index;
const char *s0 = s;
int len;
- enum erlang_char_encoding got_enc;
+ erlang_char_encoding got_enc;
switch (get8(s)) {
case ERL_ATOM_EXT:
@@ -92,7 +92,7 @@ int ei_decode_atom_as(const char *buf, int *index, char* p, int destlen,
int utf8_to_latin1(char* dst, const char* src, int slen, int destlen,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding* res_encp)
{
const char* const dst_start = dst;
const char* const dst_end = dst + destlen;
@@ -128,7 +128,7 @@ int utf8_to_latin1(char* dst, const char* src, int slen, int destlen,
}
int latin1_to_utf8(char* dst, const char* src, int slen, int destlen,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding* res_encp)
{
const char* const src_end = src + slen;
const char* const dst_start = dst;
@@ -163,7 +163,7 @@ int latin1_to_utf8(char* dst, const char* src, int slen, int destlen,
int ei_internal_get_atom(const char** bufp, char* p,
- enum erlang_char_encoding* was_encp)
+ erlang_char_encoding* was_encp)
{
int ix = 0;
if (ei_decode_atom_as(*bufp, &ix, p, MAXATOMLEN_UTF8, ERLANG_UTF8, was_encp, NULL) < 0)
diff --git a/lib/erl_interface/src/encode/encode_atom.c b/lib/erl_interface/src/encode/encode_atom.c
index 32f5ae2af1..df4b0af5db 100644
--- a/lib/erl_interface/src/encode/encode_atom.c
+++ b/lib/erl_interface/src/encode/encode_atom.c
@@ -45,15 +45,15 @@ int ei_encode_atom_len(char *buf, int *index, const char *p, int len)
}
int ei_encode_atom_as(char *buf, int *index, const char *p,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
return ei_encode_atom_len_as(buf, index, p, strlen(p), from_enc, to_enc);
}
int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
char *s = buf + *index;
char *s0 = s;
@@ -138,7 +138,7 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
int
ei_internal_put_atom(char** bufp, const char* p, int slen,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding to_enc)
{
int ix = 0;
if (ei_encode_atom_len_as(*bufp, &ix, p, slen, ERLANG_UTF8, to_enc) < 0)
diff --git a/lib/erl_interface/src/legacy/erl_eterm.c b/lib/erl_interface/src/legacy/erl_eterm.c
index 9e778a299e..7ca4f430de 100644
--- a/lib/erl_interface/src/legacy/erl_eterm.c
+++ b/lib/erl_interface/src/legacy/erl_eterm.c
@@ -154,7 +154,7 @@ ETERM *erl_mk_atom (const char *s)
char* erl_atom_ptr_latin1(Erl_Atom_data* a)
{
if (a->latin1 == NULL) {
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
a->lenL = utf8_to_latin1(NULL, a->utf8, a->lenU, a->lenU, &enc);
if (a->lenL < 0) {
a->lenL = 0;
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index c051c3a597..e207b5f0f1 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -660,7 +660,7 @@ static int read_atom(unsigned char** ext, Erl_Atom_data* a)
{
char buf[MAXATOMLEN_UTF8];
int offs = 0;
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
int ret = ei_decode_atom_as((char*)*ext, &offs, buf, MAXATOMLEN_UTF8,
ERLANG_LATIN1|ERLANG_UTF8, NULL, &enc);
*ext += offs;
@@ -1423,8 +1423,8 @@ static int cmpbytes(unsigned char* s1,int l1,unsigned char* s2,int l2)
static int cmpatoms(unsigned char* s1, int l1, unsigned char tag1,
unsigned char* s2, int l2, unsigned char tag2)
{
- enum erlang_char_encoding enc1 = tag2enc(tag1);
- enum erlang_char_encoding enc2 = tag2enc(tag2);
+ erlang_char_encoding enc1 = tag2enc(tag1);
+ erlang_char_encoding enc2 = tag2enc(tag2);
if (enc1 == enc2) {
return cmpbytes(s1, l1,s2,l2);
diff --git a/lib/erl_interface/src/misc/ei_x_encode.c b/lib/erl_interface/src/misc/ei_x_encode.c
index 4e6f4a1d36..14d0b56b8f 100644
--- a/lib/erl_interface/src/misc/ei_x_encode.c
+++ b/lib/erl_interface/src/misc/ei_x_encode.c
@@ -217,15 +217,15 @@ int ei_x_encode_atom_len(ei_x_buff* x, const char* s, int len)
}
int ei_x_encode_atom_as(ei_x_buff* x, const char* s,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
return ei_x_encode_atom_len_as(x, s, strlen(s), from_enc, to_enc);
}
int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
int i = x->index;
if (ei_encode_atom_len_as(NULL, &i, s, len, from_enc, to_enc) == -1)
diff --git a/lib/erl_interface/src/misc/putget.h b/lib/erl_interface/src/misc/putget.h
index 587bf1a0f8..c751e03093 100644
--- a/lib/erl_interface/src/misc/putget.h
+++ b/lib/erl_interface/src/misc/putget.h
@@ -105,10 +105,10 @@
((EI_ULONGLONG)((unsigned char *)(s))[-2] << 8) | \
(EI_ULONGLONG)((unsigned char *)(s))[-1]))
-int utf8_to_latin1(char* dst, const char* src, int slen, int destlen, enum erlang_char_encoding* res_encp);
-int latin1_to_utf8(char* dst, const char* src, int slen, int destlen, enum erlang_char_encoding* res_encp);
-int ei_internal_get_atom(const char** bufp, char* p, enum erlang_char_encoding*);
-int ei_internal_put_atom(char** bufp, const char* p, int slen, enum erlang_char_encoding);
+int utf8_to_latin1(char* dst, const char* src, int slen, int destlen, erlang_char_encoding* res_encp);
+int latin1_to_utf8(char* dst, const char* src, int slen, int destlen, erlang_char_encoding* res_encp);
+int ei_internal_get_atom(const char** bufp, char* p, erlang_char_encoding*);
+int ei_internal_put_atom(char** bufp, const char* p, int slen, erlang_char_encoding);
#define get_atom ei_internal_get_atom
#define put_atom ei_internal_put_atom
diff --git a/lib/erl_interface/src/prog/ei_fake_prog.c b/lib/erl_interface/src/prog/ei_fake_prog.c
index 52a46fc341..56d4eb7db4 100644
--- a/lib/erl_interface/src/prog/ei_fake_prog.c
+++ b/lib/erl_interface/src/prog/ei_fake_prog.c
@@ -96,7 +96,7 @@ int main(void)
EI_ULONGLONG *ulonglongp = (EI_ULONGLONG*)NULL;
EI_ULONGLONG ulonglongx = 0;
#endif
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
intx = erl_errno;