fix wide_char support for name/2.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1729 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2006-11-28 13:46:41 +00:00
parent 72e4159967
commit ac8590d1f6
2 changed files with 16 additions and 18 deletions

View File

@ -11,8 +11,11 @@
* File: stdpreds.c * * File: stdpreds.c *
* comments: General-purpose C implemented system predicates * * 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 $ * $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 * Revision 1.113 2006/11/16 14:26:00 vsc
* fix handling of infinity in name/2 and friends. * fix handling of infinity in name/2 and friends.
* *
@ -874,25 +877,26 @@ p_name(void)
return FALSE; return FALSE;
} }
i = IntegerOfTerm(Head); i = IntegerOfTerm(Head);
if (i < 0 || i >= 255) { if (i < 0) {
if (i<0) {
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,Head,"name/2"); Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,Head,"name/2");
return FALSE; return FALSE;
} else {
ws = ch_to_wide(String, s);
}
} }
if (ws) { if (ws) {
if (ws > (wchar_t *)AuxSp-1024) { if (ws > (wchar_t *)AuxSp-1024) {
goto expand_auxsp; goto expand_auxsp;
} }
*ws++ = i; *ws++ = i;
} else {
if (i > MAX_ISO_LATIN1) {
ws = ch_to_wide(String, s);
*ws++ = i;
} else { } else {
if (s > (char *)AuxSp-1024) { if (s > (char *)AuxSp-1024) {
goto expand_auxsp; goto expand_auxsp;
} }
*s++ = i; *s++ = i;
} }
}
t = TailOfTerm(t); t = TailOfTerm(t);
} }
if (ws) { if (ws) {

View File

@ -10,7 +10,7 @@
* File: Heap.h * * File: Heap.h *
* mods: * * mods: *
* comments: Heap Init Structure * * 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 */ /* information that can be stored in Code Space */
@ -131,10 +131,8 @@ typedef struct worker_local_struct {
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
/* otherwise, use global variables for speed */ /* otherwise, use global variables for speed */
unsigned long int tot_marked, tot_oldies; /* number of heap objects marked */ unsigned long int tot_marked, tot_oldies; /* number of heap objects marked */
#if DEBUG
#ifdef COROUTINING #ifdef COROUTINING
unsigned long int tot_smarked; unsigned long int tot_smarked;
#endif
#endif #endif
struct choicept *wl_current_B; struct choicept *wl_current_B;
#if defined(TABLING) || defined(SBA) #if defined(TABLING) || defined(SBA)
@ -291,9 +289,7 @@ typedef struct various_codes {
struct pred_entry *creep_code; struct pred_entry *creep_code;
struct pred_entry *undef_code; struct pred_entry *undef_code;
struct pred_entry *spy_code; struct pred_entry *spy_code;
#if DEBUG
UInt new_cps, live_cps, dirty_cps, freed_cps; UInt new_cps, live_cps, dirty_cps, freed_cps;
#endif
int system_profiling; int system_profiling;
int system_call_counting; int system_call_counting;
int system_pred_goal_expansion_all; int system_pred_goal_expansion_all;
@ -507,9 +503,7 @@ typedef struct various_codes {
struct logic_upd_index *db_erased_ilist; struct logic_upd_index *db_erased_ilist;
UInt expand_clauses_sz; UInt expand_clauses_sz;
struct stream_desc *yap_streams; struct stream_desc *yap_streams;
#ifdef DEBUG
int debugger_output_msg; int debugger_output_msg;
#endif
UInt n_of_file_aliases; UInt n_of_file_aliases;
UInt sz_of_file_aliases; UInt sz_of_file_aliases;
struct AliasDescS * file_aliases; struct AliasDescS * file_aliases;