[uim-commit] r2336 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sat Dec 3 12:25:57 PST 2005
Author: yamaken
Date: 2005-12-03 12:25:52 -0800 (Sat, 03 Dec 2005)
New Revision: 2336
Modified:
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/read.c
Log:
* sigscheme/read.c
- (CASE_ISSPACE, read_word): Removed
* sigscheme/TODO
- Update
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2005-12-03 20:11:35 UTC (rev 2335)
+++ branches/r5rs/sigscheme/TODO 2005-12-03 20:25:52 UTC (rev 2336)
@@ -88,8 +88,6 @@
Assigned to YamaKen:
-* Fix large fixed-size buffer on stack without limit checking in read.c
-
* Add integer->char and char->integer procedures with multibyte support
- Write test
Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c 2005-12-03 20:11:35 UTC (rev 2335)
+++ branches/r5rs/sigscheme/read.c 2005-12-03 20:25:52 UTC (rev 2336)
@@ -32,21 +32,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
===========================================================================*/
-/*
- * FIXME: Large fixed-size buffer on stack without limit checking
- *
- * Fix some functions contained in this file since:
- *
- * - danger
- * - some embedded platform cannot allocate such large stack (approx. 20KB)
- * - inefficient from the viewpoint of memory locality (cache, page, power
- * consumption etc)
- *
- * Search "FIXME" on this file to locate the codes. I wonder other Scheme
- * implementations may have sophisticated code. Please consider porting them to
- * save development cost, since this part is not the primary value of
- * SigScheme. -- YamaKen 2005-09-05
- */
/*=======================================
System Include
@@ -87,11 +72,6 @@
#define WHITESPACE_CHARS " \t\n\r\v\f"
#define DELIMITER_CHARS "()\";" WHITESPACE_CHARS
-/* Compatible with isspace(3). Use this to prevent incorrect space handlings */
-#define CASE_ISSPACE \
- case ' ': case '\t': case '\n': case '\r': case '\v': case '\f'
-
-/* FIXME: discard at first of each reader instead of caller */
#define DISCARD_LOOKAHEAD(port) (SCM_PORT_GET_CHAR(port))
/*=======================================
@@ -103,7 +83,6 @@
=======================================*/
static int skip_comment_and_space(ScmObj port);
static void read_sequence(ScmObj port, char *buf, int len);
-static char* read_word(ScmObj port);
static size_t read_token(ScmObj port, int *err,
char *buf, size_t buf_size, const char *delim);
#if SCM_USE_SRFI75
@@ -448,7 +427,6 @@
ERR("invalid character literal: #\\%s", buf);
}
-/* FIXME: extend buffer on demand */
static ScmObj read_string(ScmObj port)
{
ScmObj obj;
@@ -596,36 +574,6 @@
return read_symbol(port);
}
-
-static char *read_word(ScmObj port)
-{
- char stringbuf[1024]; /* FIXME! */
- int stringlen = 0;
- int c = 0;
- char *dst = NULL;
-
- while (1) {
- c = SCM_PORT_PEEK_CHAR(port);
-
- CDBG((SCM_DBG_PARSER, "c = %c", c));
-
- switch (c) {
- case EOF: /* don't became an error for handling c-eval, like Scm_eval_c_string("some-symbol"); */
- case '(': case ')': case '\"': case '\'': case ';':
- CASE_ISSPACE:
- SCM_PORT_UNGETC(port, c);
- stringbuf[stringlen] = '\0';
- dst = strdup(stringbuf);
- return dst;
-
- default:
- DISCARD_LOOKAHEAD(port);
- stringbuf[stringlen++] = (char)c;
- break;
- }
- }
-}
-
static size_t read_token(ScmObj port, int *err,
char *buf, size_t buf_size, const char *delim)
{
More information about the uim-commit
mailing list