[uim-commit] r1955 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Thu Nov 3 02:13:06 PST 2005
Author: yamaken
Date: 2005-11-03 02:13:02 -0800 (Thu, 03 Nov 2005)
New Revision: 1955
Modified:
branches/r5rs/sigscheme/datas.c
branches/r5rs/sigscheme/debug.c
branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigschemeinternal.h
- (PORTBUFFER_SIZE, scm_portbuffer): Removed
* sigscheme/datas.c
- (SigScm_InitStorage, SigScm_FinalizeStorage): Remove
scm_portbuffer handling
* sigscheme/debug.c
- (scm_portbuffer): Removed
- (print_ScmObj_internal, print_char, print_string, print_list):
Simplify with SigScm_PortPrintf()
Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c 2005-11-03 09:53:43 UTC (rev 1954)
+++ branches/r5rs/sigscheme/datas.c 2005-11-03 10:13:02 UTC (rev 1955)
@@ -274,7 +274,6 @@
{
initialize_special_constants();
allocate_heap(&scm_heaps, scm_heap_num, SCM_HEAP_SIZE, &scm_freelist);
- scm_portbuffer = (char*)malloc(sizeof(char) * PORTBUFFER_SIZE + 1);
#if 0 && SCM_COMPAT_SIOD_BUGS
SigScm_GC_Protect(&SigScm_true);
SigScm_true = Scm_NewInt(1);
@@ -301,7 +300,6 @@
finalize_heap();
finalize_symbol_hash();
finalize_protected_var();
- free(scm_portbuffer);
}
static void *malloc_aligned(size_t size)
Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c 2005-11-03 09:53:43 UTC (rev 1954)
+++ branches/r5rs/sigscheme/debug.c 2005-11-03 10:13:02 UTC (rev 1955)
@@ -98,9 +98,6 @@
static write_ss_context *write_ss_ctx; /* misc info in priting shared structures */
#endif
-/* buffer for snprintf */
-char *scm_portbuffer;
-
/*=======================================
File Local Function Declarations
=======================================*/
@@ -225,22 +222,19 @@
int index = get_shared_index(obj);
if (index > 0) {
/* defined datum */
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "#%d#", index);
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "#%d#", index);
return;
}
if (index < 0) {
/* defining datum, with the new index negated */
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "#%d=", -index);
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "#%d=", -index);
/* Print it; the next time it'll be defined. */
}
}
#endif
switch (SCM_TYPE(obj)) {
case ScmInt:
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "%d", SCM_INT_VALUE(obj));
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "%d", SCM_INT_VALUE(obj));
break;
case ScmCons:
print_list(port, obj, otype);
@@ -286,13 +280,11 @@
ERR("You cannot print ScmFreeCell, may be GC bug.");
break;
case ScmCPointer:
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "#<c_pointer %p>", SCM_C_POINTER_VALUE(obj));
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "#<c_pointer %p>", SCM_C_POINTER_VALUE(obj));
break;
case ScmCFuncPointer:
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "#<c_func_pointer %p>",
- SCM_REINTERPRET_CAST(void *, SCM_C_FUNCPOINTER_VALUE(obj)));
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "#<c_func_pointer %p>",
+ SCM_REINTERPRET_CAST(void *, SCM_C_FUNCPOINTER_VALUE(obj)));
break;
}
}
@@ -310,8 +302,7 @@
} else if(strcmp(SCM_CHAR_VALUE(obj), "\n") == 0) {
SCM_PORT_PRINT(port, "#\\newline");
} else {
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "#\\%s", SCM_CHAR_VALUE(obj));
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "#\\%s", SCM_CHAR_VALUE(obj));
}
break;
case AS_DISPLAY:
@@ -353,8 +344,7 @@
case '\t': SCM_PORT_PRINT(port, "\\t"); break;
case '\\': SCM_PORT_PRINT(port, "\\\\"); break;
default:
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, "%c", str[i]);
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, "%c", str[i]);
break;
}
}
@@ -401,14 +391,12 @@
index = get_shared_index(lst);
if (index > 0) {
/* defined datum */
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, ". #%d#", index);
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, ". #%d#", index);
goto close_parens_and_return;
}
if (index < 0) {
/* defining datum, with the new index negated */
- snprintf(scm_portbuffer, PORTBUFFER_SIZE, ". #%d=", -index);
- SCM_PORT_PRINT(port, scm_portbuffer);
+ SigScm_PortPrintf(port, ". #%d=", -index);
necessary_close_parens++;
goto cheap_recursion;
}
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-03 09:53:43 UTC (rev 1954)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-03 10:13:02 UTC (rev 1955)
@@ -82,10 +82,6 @@
extern ScmObj SigScm_null_values;
#endif
-/* debug.c */
-#define PORTBUFFER_SIZE 1024
-extern char *scm_portbuffer;
-
/*=======================================
Macro Declarations
=======================================*/
More information about the uim-commit
mailing list