use const char *

This commit is contained in:
Vítor Santos Costa 2014-12-14 11:49:51 +00:00
parent 15c79d8ecf
commit bed14749f8
7 changed files with 36 additions and 13 deletions

View File

@ -556,7 +556,7 @@ typedef struct opcode_tab_entry
{
OPCODE opc;
op_numbers opnum;
} opentry;
} op_entry;
#endif

View File

@ -277,6 +277,9 @@
#define ParserErrorStyle Yap_heap_regs->parser_error_style
#define Yap_LibDir Yap_heap_regs->yap_lib_dir
#define Yap_ForeignDir Yap_heap_regs->yap_foreign_dir
#define Yap_CommonsDir Yap_heap_regs->yap_commons_dir
#define Yap_BinDir Yap_heap_regs->yap_bin_dir
#define LastWtimePtr Yap_heap_regs->last_wtime

View File

@ -61,7 +61,7 @@
#if USE_THREADED_CODE
opentry *op_rtable;
op_entry *op_rtable;
#endif
OPCODE execute_cpred_op_code;
@ -276,7 +276,10 @@
int parser_error_style;
char *yap_lib_dir;
const char *yap_lib_dir;
const char *yap_foreign_dir;
const char *yap_commons_dir;
const char *yap_bin_dir;
void *last_wtime;

View File

@ -277,6 +277,9 @@
ParserErrorStyle = EXCEPTION_ON_PARSER_ERROR;
Yap_LibDir = NULL;
Yap_ForeignDir = NULL;
Yap_CommonsDir = NULL;
Yap_BinDir = NULL;
LastWtimePtr = NULL;

View File

@ -276,7 +276,10 @@
Yap_LibDir = CodeCharPAdjust(Yap_LibDir);
Yap_LibDir = CodeConstCharPAdjust(Yap_LibDir);
Yap_ForeignDir = CodeConstCharPAdjust(Yap_ForeignDir);
Yap_CommonsDir = CodeConstCharPAdjust(Yap_CommonsDir);
Yap_BinDir = CodeConstCharPAdjust(Yap_BinDir);
LastWtimePtr = CodeVoidPAdjust(LastWtimePtr);

View File

@ -107,6 +107,7 @@
#define TrailAdjust(P) TrailAdjust__(P PASS_REGS)
#define HoldEntryAdjust(P) HoldEntryAdjust__(P PASS_REGS)
#define CodeCharPAdjust(P) CodeCharPAdjust__(P PASS_REGS)
#define CodeConstCharPAdjust(P) CodeConstCharPAdjust__(P PASS_REGS)
#define CodeVoidPAdjust(P) CodeVoidPAdjust__(P PASS_REGS)
#define HaltHookAdjust(P) HaltHookAdjust__(P PASS_REGS)
#define TokEntryAdjust(P) TokEntryAdjust__(P PASS_REGS)
@ -720,6 +721,16 @@ CodeCharPAdjust__ (char * addr USES_REGS)
return addr + LOCAL_HDiff;
}
INLINE_ONLY inline EXTERN const char * CodeConstCharPAdjust__ (const char * CACHE_TYPE);
INLINE_ONLY inline EXTERN const char *
CodeConstCharPAdjust__ (const char * addr USES_REGS)
{
if (!addr)
return NULL;
return addr + LOCAL_HDiff;
}
INLINE_ONLY inline EXTERN void * CodeVoidPAdjust__ (void * CACHE_TYPE);
INLINE_ONLY inline EXTERN void *
@ -829,12 +840,12 @@ TermToGlobalOrAtomAdjust__ (Term t USES_REGS)
return t;
}
INLINE_ONLY inline EXTERN opentry *OpRTableAdjust__ (opentry * CACHE_TYPE);
INLINE_ONLY inline EXTERN op_entry *OpRTableAdjust__ (op_entry * CACHE_TYPE);
INLINE_ONLY inline EXTERN opentry *
OpRTableAdjust__ (opentry * ptr USES_REGS)
INLINE_ONLY inline EXTERN op_entry *
OpRTableAdjust__ (op_entry * ptr USES_REGS)
{
return (opentry *) (((opentry *) (CharP (ptr) + LOCAL_HDiff)));
return (op_entry *) (((op_entry *) (CharP (ptr) + LOCAL_HDiff)));
}
INLINE_ONLY inline EXTERN OpEntry *OpEntryAdjust__ (OpEntry * CACHE_TYPE);

View File

@ -59,7 +59,7 @@ UInt MaxTrail_ MaxTrail =0 void
/* execution info */
/* OPCODE TABLE, needed to recover op tables */
#if USE_THREADED_CODE
opentry *op_rtable OP_RTABLE void OpRTableAdjust
op_entry *op_rtable OP_RTABLE void OpRTableAdjust
#endif
/* popular opcodes */
@ -309,10 +309,10 @@ char *char_conversion_table2 CharConversionTable2 =NULL CodeCharPAdjust
int parser_error_style ParserErrorStyle =EXCEPTION_ON_PARSER_ERROR void
/* library location. */
const char *yap_lib_dir Yap_LibDir =NULL CodeCharPAdjust
const char *yap_foreign_dir Yap_ForeignDir =NULL CodeCharPAdjust
const char *yap_commons_dir Yap_CommonsDir =NULL CodeCharPAdjust
const char *yap_bin_dir Yap_BinDir =NULL CodeCharPAdjust
const char *yap_lib_dir Yap_LibDir =NULL CodeConstCharPAdjust
const char *yap_foreign_dir Yap_ForeignDir =NULL CodeConstCharPAdjust
const char *yap_commons_dir Yap_CommonsDir =NULL CodeConstCharPAdjust
const char *yap_bin_dir Yap_BinDir =NULL CodeConstCharPAdjust
/* time */
void *last_wtime LastWtimePtr =NULL CodeVoidPAdjust