From ac8590d1f6a98b341349371e035a4daf02c34d5a Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 28 Nov 2006 13:46:41 +0000 Subject: [PATCH] fix wide_char support for name/2. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1729 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/stdpreds.c | 26 +++++++++++++++----------- H/Heap.h | 8 +------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/C/stdpreds.c b/C/stdpreds.c index a582b03cb..58c46887a 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -11,8 +11,11 @@ * File: stdpreds.c * * comments: General-purpose C implemented system predicates * * * -* Last rev: $Date: 2006-11-27 17:42:03 $,$Author: vsc $ * +* Last rev: $Date: 2006-11-28 13:46:41 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.114 2006/11/27 17:42:03 vsc +* support for UNICODE, and other bug fixes. +* * Revision 1.113 2006/11/16 14:26:00 vsc * fix handling of infinity in name/2 and friends. * @@ -874,13 +877,9 @@ p_name(void) return FALSE; } i = IntegerOfTerm(Head); - if (i < 0 || i >= 255) { - if (i<0) { - Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,Head,"name/2"); - return FALSE; - } else { - ws = ch_to_wide(String, s); - } + if (i < 0) { + Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,Head,"name/2"); + return FALSE; } if (ws) { if (ws > (wchar_t *)AuxSp-1024) { @@ -888,10 +887,15 @@ p_name(void) } *ws++ = i; } else { - if (s > (char *)AuxSp-1024) { - goto expand_auxsp; + if (i > MAX_ISO_LATIN1) { + ws = ch_to_wide(String, s); + *ws++ = i; + } else { + if (s > (char *)AuxSp-1024) { + goto expand_auxsp; + } + *s++ = i; } - *s++ = i; } t = TailOfTerm(t); } diff --git a/H/Heap.h b/H/Heap.h index 7ee1a3d60..82423788b 100644 --- a/H/Heap.h +++ b/H/Heap.h @@ -10,7 +10,7 @@ * File: Heap.h * * mods: * * comments: Heap Init Structure * -* version: $Id: Heap.h,v 1.109 2006-11-27 17:42:03 vsc Exp $ * +* version: $Id: Heap.h,v 1.110 2006-11-28 13:46:41 vsc Exp $ * *************************************************************************/ /* information that can be stored in Code Space */ @@ -131,10 +131,8 @@ typedef struct worker_local_struct { #if defined(YAPOR) || defined(THREADS) /* otherwise, use global variables for speed */ unsigned long int tot_marked, tot_oldies; /* number of heap objects marked */ -#if DEBUG #ifdef COROUTINING unsigned long int tot_smarked; -#endif #endif struct choicept *wl_current_B; #if defined(TABLING) || defined(SBA) @@ -291,9 +289,7 @@ typedef struct various_codes { struct pred_entry *creep_code; struct pred_entry *undef_code; struct pred_entry *spy_code; -#if DEBUG UInt new_cps, live_cps, dirty_cps, freed_cps; -#endif int system_profiling; int system_call_counting; int system_pred_goal_expansion_all; @@ -507,9 +503,7 @@ typedef struct various_codes { struct logic_upd_index *db_erased_ilist; UInt expand_clauses_sz; struct stream_desc *yap_streams; -#ifdef DEBUG int debugger_output_msg; -#endif UInt n_of_file_aliases; UInt sz_of_file_aliases; struct AliasDescS * file_aliases;