diff --git a/src/duk_error.h b/src/duk_error.h index 63591687..99c54c78 100644 --- a/src/duk_error.h +++ b/src/duk_error.h @@ -16,7 +16,7 @@ #define DUK_ERROR_H_INCLUDED /* - * Error codes (defined in duktape.h) + * Error codes: defined in duktape.h * * Error codes are used as a shorthand to throw exceptions from inside * the implementation. The appropriate Ecmascript object is constructed @@ -25,11 +25,6 @@ * by calling code. */ -/* FIXME: remove */ -/* for function return codes */ -#define DUK_ERR_OK 0 /* call successful */ -#define DUK_ERR_FAIL 1 /* call failed */ - /* * Normal error * diff --git a/src/duk_heap_markandsweep.c b/src/duk_heap_markandsweep.c index a8da72b2..8688e1b9 100644 --- a/src/duk_heap_markandsweep.c +++ b/src/duk_heap_markandsweep.c @@ -887,7 +887,7 @@ int duk_heap_mark_and_sweep(duk_heap *heap, int flags) { #ifdef DUK_USE_VOLUNTARY_GC heap->mark_and_sweep_trigger_counter = DUK_HEAP_MARK_AND_SWEEP_TRIGGER_SKIP; #endif - return DUK_ERR_OK; + return 0; /* OK */ } DUK_DPRINT("garbage collect (mark-and-sweep) starting, requested flags: 0x%08x, effective flags: 0x%08x", @@ -1077,7 +1077,7 @@ int duk_heap_mark_and_sweep(duk_heap *heap, int flags) { DUK_DPRINT("garbage collect (mark-and-sweep) finished: %d objects kept, %d strings kept, no voluntary trigger", (int) count_keep_obj, (int) count_keep_str); #endif - return DUK_ERR_OK; + return 0; /* OK */ } #else /* DUK_USE_MARK_AND_SWEEP */ diff --git a/src/duk_heap_stringtable.c b/src/duk_heap_stringtable.c index d974a3ba..ca7c1fef 100644 --- a/src/duk_heap_stringtable.c +++ b/src/duk_heap_stringtable.c @@ -267,11 +267,11 @@ static int duk__resize_strtab_raw(duk_heap *heap, duk_uint32_t new_size) { heap->st_size = new_size; heap->st_used = new_used; /* may be less, since DELETED entries are NULLed by rehash */ - return DUK_ERR_OK; + return 0; /* OK */ error: DUK_FREE(heap, new_entries); - return DUK_ERR_FAIL; + return 1; /* FAIL */ } static int duk__resize_strtab(duk_heap *heap) { @@ -314,7 +314,7 @@ static int duk__recheck_strtab_size(duk_heap *heap, duk_uint32_t new_used) { /* load factor too low or high, count actually used entries and resize */ return duk__resize_strtab(heap); } else { - return DUK_ERR_OK; + return 0; /* OK */ } }