Author: yamakenz
Date: Sun Jul 22 06:25:15 2007
New Revision: 4779
Modified:
sigscheme-trunk/src/continuation.c
sigscheme-trunk/src/format.c
sigscheme-trunk/src/read.c
sigscheme-trunk/src/write.c
Log:
* This commit renames possibly conflict type names. See [uim-ja 22] and [uim-ja
23]
* src/read.c
- (enum LexerState, enum ScmLexerState): Renamed
* src/write.c
- (enum OutputType, enum ScmOutputType): Ditto
- (hash_entry, scm_hash_entry): Ditto
- (hash_table, scm_hash_table): Ditto
- (write_ss_context, scm_write_ss_context): Ditto
* src/format.c
- (enum format_args_type, enum scm_format_args_type): Ditto
- (struct format_args, struct scm_format_args): Ditto
* src/continuation.c
- (struct continuation_frame, struct scm_continuation_frame): Ditto
Modified: sigscheme-trunk/src/continuation.c
==============================================================================
--- sigscheme-trunk/src/continuation.c (original)
+++ sigscheme-trunk/src/continuation.c Sun Jul 22 06:25:15 2007
@@ -47,13 +47,13 @@
File Local Macro Definitions
=======================================*/
#define CONTINUATION_FRAME(cont) \
- ((struct continuation_frame *)SCM_CONTINUATION_OPAQUE(cont))
+ ((struct scm_continuation_frame *)SCM_CONTINUATION_OPAQUE(cont))
#define CONTINUATION_SET_FRAME SCM_CONTINUATION_SET_OPAQUE
/*=======================================
File Local Type Definitions
=======================================*/
-struct continuation_frame {
+struct scm_continuation_frame {
/*
* - To hint appropriate alignment on stack, a ScmObj is listed first
* - GC marking for these ScmObj are implicitly performed by stack scanning
@@ -264,7 +264,7 @@
scm_call_with_current_continuation(ScmObj proc, ScmEvalState *eval_state)
{
volatile ScmObj cont, ret;
- struct continuation_frame cont_frame;
+ struct scm_continuation_frame cont_frame;
cont_frame.dyn_ext = l_current_dynamic_extent;
cont_frame.ret_val = SCM_UNDEF;
@@ -313,7 +313,7 @@
SCM_EXPORT void
scm_call_continuation(ScmObj cont, ScmObj ret)
{
- struct continuation_frame *frame;
+ struct scm_continuation_frame *frame;
#if SCM_NESTED_CONTINUATION_ONLY
ScmObj dst;
#endif
Modified: sigscheme-trunk/src/format.c
==============================================================================
--- sigscheme-trunk/src/format.c (original)
+++ sigscheme-trunk/src/format.c Sun Jul 22 06:25:15 2007
@@ -163,13 +163,13 @@
#define FORMAT_STR_SKIP_CHAR(fmt) ((void)FORMAT_STR_READ(fmt))
-enum format_args_type {
+enum scm_format_args_type {
ARG_VA_LIST,
ARG_SCM_LIST
};
-struct format_args {
- enum format_args_type type;
+struct scm_format_args {
+ enum scm_format_args_type type;
union {
va_list *va;
ScmObj *scm;
@@ -211,11 +211,11 @@
static scm_ichar_t format_directive(ScmObj port, scm_ichar_t last_ch,
enum ScmFormatCapability fcap,
format_string_t *fmt,
- struct format_args args);
+ struct scm_format_args args);
#endif
static ScmObj format_internal(ScmObj port, enum ScmFormatCapability fcap,
const char *fmt,
- struct format_args args);
+ struct scm_format_args args);
/*=======================================
Function Definitions
@@ -469,7 +469,7 @@
static scm_ichar_t
format_directive(ScmObj port, scm_ichar_t last_ch,
enum ScmFormatCapability fcap,
- format_string_t *fmt, struct format_args args)
+ format_string_t *fmt, struct scm_format_args args)
{
const void *orig_pos;
char directive;
@@ -653,7 +653,7 @@
static ScmObj
format_internal(ScmObj port, enum ScmFormatCapability fcap,
- const char *fmt, struct format_args args)
+ const char *fmt, struct scm_format_args args)
{
scm_ichar_t c, last_c, handled;
format_string_t cur;
@@ -720,7 +720,7 @@
scm_lformat(ScmObj port,
enum ScmFormatCapability fcap, const char *fmt, ScmObj scm_args)
{
- struct format_args args;
+ struct scm_format_args args;
args.type = ARG_SCM_LIST;
args.lst.scm = &scm_args;
@@ -731,7 +731,7 @@
scm_vformat(ScmObj port,
enum ScmFormatCapability fcap, const char *fmt, va_list c_args)
{
- struct format_args args;
+ struct scm_format_args args;
args.type = ARG_VA_LIST;
#if HAVE_REFERENCEABLE_PASSED_VA_LIST
Modified: sigscheme-trunk/src/read.c
==============================================================================
--- sigscheme-trunk/src/read.c (original)
+++ sigscheme-trunk/src/read.c Sun Jul 22 06:25:15 2007
@@ -202,7 +202,7 @@
/*=======================================
File Local Type Definitions
=======================================*/
-enum LexerState {
+enum ScmLexerState {
LEX_ST_NORMAL,
LEX_ST_COMMENT
};
Modified: sigscheme-trunk/src/write.c
==============================================================================
--- sigscheme-trunk/src/write.c (original)
+++ sigscheme-trunk/src/write.c Sun Jul 22 06:25:15 2007
@@ -79,7 +79,7 @@
/*=======================================
File Local Type Definitions
=======================================*/
-enum OutputType {
+enum ScmOutputType {
UNKNOWN,
AS_WRITE, /* string is enclosed by ", char is written using #\ notation */
AS_DISPLAY /* string and char is written as-is */
@@ -91,18 +91,18 @@
typedef struct {
ScmObj key;
scm_intobj_t datum;
-} hash_entry;
+} scm_hash_entry;
typedef struct {
size_t size; /* capacity; MUST be a power of 2 */
size_t used; /* population */
- hash_entry *ents;
-} hash_table;
+ scm_hash_entry *ents;
+} scm_hash_table;
typedef struct {
- hash_table seen; /* a table of seen objects */
+ scm_hash_table seen; /* a table of seen objects */
scm_intobj_t next_index; /* the next index to use for #N# */
-} write_ss_context;
+} scm_write_ss_context;
#endif /* SCM_USE_SRFI38 */
/*=======================================
@@ -116,7 +116,7 @@
SCM_GLOBAL_VARS_BEGIN(static_write);
#define static
/* misc info in priting shared structures */
-static write_ss_context *l_write_ss_ctx;
+static scm_write_ss_context *l_write_ss_ctx;
#undef static
SCM_GLOBAL_VARS_END(static_write);
#define l_write_ss_ctx SCM_GLOBAL_VAR(static_write, l_write_ss_ctx)
@@ -126,33 +126,33 @@
/*=======================================
File Local Function Declarations
=======================================*/
-static void write_internal (ScmObj port, ScmObj obj, enum OutputType otype);
-static void write_obj (ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_internal (ScmObj port, ScmObj obj, enum ScmOutputType otype);
+static void write_obj (ScmObj port, ScmObj obj, enum ScmOutputType otype);
#if SCM_USE_CHAR
-static void write_char (ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_char (ScmObj port, ScmObj obj, enum ScmOutputType otype);
#endif
#if SCM_USE_STRING
-static void write_string (ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_string (ScmObj port, ScmObj obj, enum ScmOutputType otype);
#endif
-static void write_list (ScmObj port, ScmObj lst, enum OutputType otype);
+static void write_list (ScmObj port, ScmObj lst, enum ScmOutputType otype);
#if SCM_USE_VECTOR
-static void write_vector (ScmObj port, ScmObj vec, enum OutputType otype);
+static void write_vector (ScmObj port, ScmObj vec, enum ScmOutputType otype);
#endif
-static void write_port (ScmObj port, ScmObj obj, enum OutputType otype);
-static void write_constant (ScmObj port, ScmObj obj, enum OutputType otype);
-static void write_errobj (ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_port (ScmObj port, ScmObj obj, enum ScmOutputType otype);
+static void write_constant (ScmObj port, ScmObj obj, enum ScmOutputType otype);
+static void write_errobj (ScmObj port, ScmObj obj, enum ScmOutputType otype);
#if SCM_USE_HYGIENIC_MACRO
-static void write_farsymbol(ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_farsymbol(ScmObj port, ScmObj obj, enum ScmOutputType otype);
#endif
#if SCM_USE_SRFI38
-static void hash_grow(hash_table *tab);
-static hash_entry *hash_lookup(hash_table *tab,
- ScmObj key, scm_intobj_t datum, int flag);
-static void write_ss_scan(ScmObj obj, write_ss_context *ctx);
+static void hash_grow(scm_hash_table *tab);
+static scm_hash_entry *hash_lookup(scm_hash_table *tab,
+ ScmObj key, scm_intobj_t datum, int flag);
+static void write_ss_scan(ScmObj obj, scm_write_ss_context *ctx);
static scm_intobj_t get_shared_index(ScmObj obj);
-static void write_ss_internal(ScmObj port, ScmObj obj, enum OutputType otype);
+static void write_ss_internal(ScmObj port, ScmObj obj, enum ScmOutputType
otype);
#endif /* SCM_USE_SRFI38 */
/*=======================================
@@ -187,7 +187,7 @@
}
static void
-write_internal(ScmObj port, ScmObj obj, enum OutputType otype)
+write_internal(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
DECLARE_INTERNAL_FUNCTION("write");
@@ -201,7 +201,7 @@
}
static void
-write_obj(ScmObj port, ScmObj obj, enum OutputType otype)
+write_obj(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
ScmObj sym;
@@ -341,7 +341,7 @@
#if SCM_USE_CHAR
static void
-write_char(ScmObj port, ScmObj obj, enum OutputType otype)
+write_char(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
const ScmSpecialCharInfo *info;
scm_ichar_t c;
@@ -376,7 +376,7 @@
#if SCM_USE_STRING
static void
-write_string(ScmObj port, ScmObj obj, enum OutputType otype)
+write_string(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
#if SCM_USE_MULTIBYTE_CHAR
ScmCharCodec *codec;
@@ -440,7 +440,7 @@
#endif /* SCM_USE_STRING */
static void
-write_list(ScmObj port, ScmObj lst, enum OutputType otype)
+write_list(ScmObj port, ScmObj lst, enum ScmOutputType otype)
{
ScmObj car;
#if SCM_USE_SRFI38
@@ -499,7 +499,7 @@
#if SCM_USE_VECTOR
static void
-write_vector(ScmObj port, ScmObj vec, enum OutputType otype)
+write_vector(ScmObj port, ScmObj vec, enum ScmOutputType otype)
{
ScmObj *v;
scm_int_t len, i;
@@ -519,7 +519,7 @@
#endif /* SCM_USE_VECTOR */
static void
-write_port(ScmObj port, ScmObj obj, enum OutputType otype)
+write_port(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
char *info;
@@ -545,7 +545,7 @@
}
static void
-write_constant(ScmObj port, ScmObj obj, enum OutputType otype)
+write_constant(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
const char *str;
@@ -568,7 +568,7 @@
}
static void
-write_errobj(ScmObj port, ScmObj obj, enum OutputType otype)
+write_errobj(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
ScmObj err_obj_tag, reason, objs, trace_stack, elm;
DECLARE_INTERNAL_FUNCTION("write");
@@ -604,7 +604,7 @@
#if SCM_USE_HYGIENIC_MACRO
static void
-write_farsymbol(ScmObj port, ScmObj obj, enum OutputType otype)
+write_farsymbol(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
/* Assumes that ScmPackedEnv is an integer. */
scm_port_puts(port, "#<farsym");
@@ -617,16 +617,16 @@
#if SCM_USE_SRFI38
static void
-hash_grow(hash_table *tab)
+hash_grow(scm_hash_table *tab)
{
size_t old_size, new_size, i;
- hash_entry *old_ents;
+ scm_hash_entry *old_ents;
old_size = tab->size;
new_size = old_size * 2;
old_ents = tab->ents;
- tab->ents = scm_calloc(new_size, sizeof(hash_entry));
+ tab->ents = scm_calloc(new_size, sizeof(scm_hash_entry));
tab->size = new_size;
tab->used = 0;
@@ -639,12 +639,12 @@
/**
* @return A pointer to the entry, or NULL if not found.
*/
-static hash_entry *
-hash_lookup(hash_table *tab, ScmObj key, scm_intobj_t datum, int flag)
+static scm_hash_entry *
+hash_lookup(scm_hash_table *tab, ScmObj key, scm_intobj_t datum, int flag)
{
size_t i;
hashval_t hashval;
- hash_entry *ent;
+ scm_hash_entry *ent;
/* If we have > 32 bits, we'll discard some of them. The lower
* bits are zeroed for alignment or used for tag bits, and in the
@@ -691,12 +691,12 @@
* @param ctx Where to put the scan results.
*/
static void
-write_ss_scan(ScmObj obj, write_ss_context *ctx)
+write_ss_scan(ScmObj obj, scm_write_ss_context *ctx)
{
#if SCM_USE_VECTOR
scm_int_t i, len;
#endif
- hash_entry *ent;
+ scm_hash_entry *ent;
ScmObj err_obj_tag, reason, objs, trace_stack;
DECLARE_INTERNAL_FUNCTION("write-with-shared-structure");
@@ -773,7 +773,7 @@
static scm_intobj_t
get_shared_index(ScmObj obj)
{
- hash_entry *ent;
+ scm_hash_entry *ent;
if (l_write_ss_ctx) {
ent = hash_lookup(&l_write_ss_ctx->seen, obj, 0, HASH_FIND);
@@ -790,14 +790,14 @@
}
static void
-write_ss_internal(ScmObj port, ScmObj obj, enum OutputType otype)
+write_ss_internal(ScmObj port, ScmObj obj, enum ScmOutputType otype)
{
- write_ss_context ctx = {{0}};
+ scm_write_ss_context ctx = {{0}};
size_t i;
ctx.next_index = 1;
ctx.seen.size = 1 << 8; /* arbitrary initial size */
- ctx.seen.ents = scm_calloc(ctx.seen.size, sizeof(hash_entry));
+ ctx.seen.ents = scm_calloc(ctx.seen.size, sizeof(scm_hash_entry));
for (i = 0; i < ctx.seen.size; i++) {
ctx.seen.ents[i].key = SCM_INVALID;
}