[uim-commit] r2739 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Jan 2 21:41:12 PST 2006
Author: yamaken
Date: 2006-01-02 21:41:08 -0800 (Mon, 02 Jan 2006)
New Revision: 2739
Modified:
branches/r5rs/sigscheme/alloc.c
branches/r5rs/sigscheme/error.c
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigscheme.h
- (SCM_ASSERT_ALLOCATED, SCM_ENSURE_ALLOCATED): Rename
SCM_ASSERT_ALLOCATED to SCM_ENSURE_ALLOCATED
* sigscheme/sigschemeinternal.h
- (ASSERT_ALLOCATED, ENSURE_ALLOCATED):
* Rename ASSERT_ALLOCATED to ENSURE_ALLOCATED
* Follow the renaming
* sigscheme/error.c
* sigscheme/alloc.c
- Follow the renamings by following script
perl -i -pe 's/ASSERT_ALLOCATED\b/ENSURE_ALLOCATED/g' sigscheme/*.[ch]
Modified: branches/r5rs/sigscheme/alloc.c
===================================================================
--- branches/r5rs/sigscheme/alloc.c 2006-01-02 19:24:44 UTC (rev 2738)
+++ branches/r5rs/sigscheme/alloc.c 2006-01-03 05:41:08 UTC (rev 2739)
@@ -85,7 +85,7 @@
*/
/* FIXME: replace the '16' with sizeof(ScmCell) if not required */
posix_memalign(&p, 16, size);
- SCM_ASSERT_ALLOCATED(p);
+ SCM_ENSURE_ALLOCATED(p);
#if SCM_DEBUG
/* check for buggy allocator */
assert(!((uintptr_t)p % 16));
@@ -105,7 +105,7 @@
void *p;
p = malloc(size);
- ASSERT_ALLOCATED(p);
+ ENSURE_ALLOCATED(p);
return p;
}
@@ -116,7 +116,7 @@
void *p;
p = calloc(number, size);
- ASSERT_ALLOCATED(p);
+ ENSURE_ALLOCATED(p);
return p;
}
@@ -127,7 +127,7 @@
void *p;
p = realloc(ptr, size);
- ASSERT_ALLOCATED(p);
+ ENSURE_ALLOCATED(p);
return p;
}
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2006-01-02 19:24:44 UTC (rev 2738)
+++ branches/r5rs/sigscheme/error.c 2006-01-03 05:41:08 UTC (rev 2739)
@@ -295,7 +295,7 @@
ScmObj reason_holder;
asprintf(&reason, "%s: (file: %s, line: %d)", msg, filename, line);
- ASSERT_ALLOCATED(reason);
+ ENSURE_ALLOCATED(reason);
/* reason will implicitly be freed via the object on GC */
reason_holder = MAKE_IMMUTABLE_STRING(reason);
@@ -314,7 +314,7 @@
va_start(va, msg);
vasprintf(&reason, msg, va);
va_end(va);
- ASSERT_ALLOCATED(reason);
+ ENSURE_ALLOCATED(reason);
err_obj = scm_make_error_obj(MAKE_IMMUTABLE_STRING(reason), SCM_NULL);
scm_raise_error(err_obj);
@@ -329,7 +329,7 @@
ScmObj err_obj;
asprintf(&reason, "in %s: %s", func_name, msg);
- ASSERT_ALLOCATED(reason);
+ ENSURE_ALLOCATED(reason);
err_obj = scm_make_error_obj(MAKE_IMMUTABLE_STRING(reason), LIST_1(obj));
scm_raise_error(err_obj);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2006-01-02 19:24:44 UTC (rev 2738)
+++ branches/r5rs/sigscheme/sigscheme.h 2006-01-03 05:41:08 UTC (rev 2739)
@@ -99,8 +99,7 @@
#define SCM_ENSURE(cond) \
((cond) || scm_die("invalid condition", __FILE__, __LINE__))
-/* FIXME: Rename to SCM_ENSURE_ALLOCATED() */
-#define SCM_ASSERT_ALLOCATED(p) \
+#define SCM_ENSURE_ALLOCATED(p) \
((p) || (scm_fatal_error(SCM_ERRMSG_MEMORY_EXHAUSTED), 1))
#define SCM_ERROBJP(obj) (NFALSEP(scm_p_error_objectp(obj)))
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-02 19:24:44 UTC (rev 2738)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-03 05:41:08 UTC (rev 2739)
@@ -370,8 +370,7 @@
/* error handlings */
#define SCM_ERR_HEADER "Error: "
-/* FIXME: Rename to ENSURE_ALLOCATED() */
-#define ASSERT_ALLOCATED SCM_ASSERT_ALLOCATED
+#define ENSURE_ALLOCATED SCM_ENSURE_ALLOCATED
/*=======================================
List Constructor
More information about the uim-commit
mailing list