From e2d87d2b2a71adacc5e6a4dc174c5c575cf34f84 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 9 May 2005 20:01:28 +0000 Subject: [PATCH] =?UTF-8?q?Reference-counting=20in=20Befehlen.=20Derzeit?= =?UTF-8?q?=20nur=20f=C3=BCr=20Befehle=20ohne=20Parameter.=20jetzt=20mit?= =?UTF-8?q?=20define=20SHARE=5FORDERS=20aktivierbar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/order.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/kernel/order.c b/src/common/kernel/order.c index 46b32dbdd..81fe60178 100644 --- a/src/common/kernel/order.c +++ b/src/common/kernel/order.c @@ -21,16 +21,19 @@ #include #include +#define SHORT_STRINGS +#define SHARE_ORDERS + typedef struct locale_data { +#ifdef SHARE_ORDERS struct order_data * short_orders[MAXKEYWORDS]; +#endif const struct locale * lang; } locale_data; static struct locale_data * locale_array[16]; static int nlocales = 0; -#undef SHORT_STRINGS - typedef struct order_data { char * _str; keyword_t _keyword; @@ -178,15 +181,16 @@ parse_order(const char * s, const struct locale * lang) ord = (order*)malloc(sizeof(order)); ord->_persistent = persistent; ord->next = NULL; + ord->data = NULL; +#ifdef SHARE_ORDERS if (kwd!=NOKEYWORD && *sptr == 0) { ord->data = locale_array[i]->short_orders[kwd]; if (ord->data != NULL) { ++ord->data->_refcount; } - } else { - ord->data = NULL; } +#endif if (ord->data==NULL) { ord->data = (order_data*)malloc(sizeof(order_data)); @@ -194,10 +198,12 @@ parse_order(const char * s, const struct locale * lang) ord->data->_str = NULL; ord->data->_refcount = 1; ord->data->_keyword = kwd; +#ifdef SHARE_ORDERS if (kwd!=NOKEYWORD && *sptr == 0) { locale_array[i]->short_orders[kwd] = ord->data; ++ord->data->_refcount; } +#endif #ifdef SHORT_STRINGS if (ord->data->_keyword==NOKEYWORD) { ord->data->_str = strdup(s);