From e3541da7400c1708e123048ba192309b2b427a73 Mon Sep 17 00:00:00 2001 From: mtardy Date: Thu, 9 Jul 2020 22:47:57 +0200 Subject: [PATCH] Remove some 'conversation' comments --- object.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/object.c b/object.c index f40a73d..efe1918 100644 --- a/object.c +++ b/object.c @@ -74,7 +74,6 @@ oop _checkType(oop ptr, type_t type) { } // added parens around expansion to protect assignment - #define get(PTR, TYPE, FIELD) (_checkType(PTR, TYPE)->TYPE.FIELD) #define set(PTR, TYPE, FIELD, VALUE) (_checkType(PTR, TYPE)->TYPE.FIELD = VALUE) @@ -257,16 +256,12 @@ ssize_t table_search(table_t *table, char *ident) // ssize_t result because -1 means 'error' ssize_t table_insert(table_t *table, oop object, size_t pos) { - // Should I use in my code a function starting with _ or is it a convention to prevent its usage ? - /// You should never really have to use that function except implicitly via get/set. - /// If you need to insist on a particular type, check it explicitly and produce a real error messge or assertion failure. assert(is(Symbol, object)); if (pos > table->size) { // don't need to check for pos < 0 because size_t is unsigned return -1; } if (table->size >= table->capacity) { - // on the first call table->array will be NULL and realloc() will behave like malloc() table->array = memcheck(realloc(table->array, sizeof(oop) * (table->capacity + SYMBOL_TABLE_CHUNK))); table->capacity += SYMBOL_TABLE_CHUNK; }