minor patches
This commit is contained in:
@@ -323,11 +323,11 @@ X_API Int YAP_IntOfTerm(Term t) {
|
||||
}
|
||||
}
|
||||
|
||||
X_API Term YAP_MkBigNumTerm(void *big) {
|
||||
X_API Term YAP_MkBigNumTerm(void*big) {
|
||||
#if USE_GMP
|
||||
Term I;
|
||||
BACKUP_H();
|
||||
I = Yap_MkBigIntTerm((MP_INT *) big);
|
||||
I = Yap_MkBigIntTerm(big);
|
||||
RECOVER_H();
|
||||
return I;
|
||||
#else
|
||||
@@ -2433,7 +2433,7 @@ static void do_bootfile(const char *bootfilename USES_REGS) {
|
||||
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
|
||||
if (!yap_init->Embedded) {
|
||||
GLOBAL_PrologShouldHandleInterrupts =
|
||||
~yap_init->PrologCannotHandleInterrupts;
|
||||
!yap_init->PrologCannotHandleInterrupts;
|
||||
Yap_InitSysbits(0); /* init signal handling and time, required by later
|
||||
functions */
|
||||
GLOBAL_argv = yap_init->Argv;
|
||||
|
@@ -205,7 +205,7 @@ static Int LoadForeign(StringList ofiles, StringList libs, char *proc_name,
|
||||
}
|
||||
#ifdef __osf__
|
||||
if ((handle = dlopen(LOCAL_FileNameBuf, RTLD_LAZY)) == 0)
|
||||
#else
|
||||
#elseö
|
||||
if ((handle = dlopen(LOCAL_FileNameBuf, RTLD_LAZY | RTLD_GLOBAL)) == 0)
|
||||
#endif
|
||||
{
|
||||
@@ -224,8 +224,8 @@ static Int LoadForeign(StringList ofiles, StringList libs, char *proc_name,
|
||||
}
|
||||
|
||||
if (!*init_proc && LOCAL_ErrorMessage == NULL) {
|
||||
LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE);
|
||||
snprintf(LOCAL_ErrorMessage,MAX_ERROR_MSG_SIZE-1,
|
||||
char *buf = malloc(1058);
|
||||
snprintf(buf,1058-1,
|
||||
"Could not locate routine %s in %s: %s\n",
|
||||
proc_name, LOCAL_FileNameBuf, dlerror());
|
||||
return LOAD_FAILLED;
|
||||
|
16
C/save.c
16
C/save.c
@@ -164,19 +164,19 @@ static Int
|
||||
do_SYSTEM_ERROR_INTERNAL(yap_error_number etype, const char *msg)
|
||||
{
|
||||
CACHE_REGS
|
||||
LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE+1);
|
||||
char *buf = malloc(1043);
|
||||
#if HAVE_SNPRINTF
|
||||
#if HAVE_STRERROR
|
||||
snprintf(LOCAL_ErrorMessage,MAX_ERROR_MSG_SIZE,"%s (%s when reading %s)", msg,
|
||||
snprintf(buf,1043-1,"%s (%s when reading %s)", msg,
|
||||
strerror(errno), LOCAL_FileNameBuf);
|
||||
#else
|
||||
snprintf(LOCAL_ErrorSay,MAX_ERROR_MSG_SIZE,"%s, (system error %d when reading %s)",msg,errno,LOCAL_FileNameBuf);
|
||||
snprintf(buf,1024-1,"%s, (system error %d when reading %s)",msg,errno,LOCAL_FileNameBuf);
|
||||
#endif
|
||||
#else
|
||||
#if HAVE_STRERROR
|
||||
sprintf(LOCAL_ErrorSay,"%s, (%s when reading %s)",msg,strerror(errno),LOCAL_FileNameBuf);
|
||||
snprintf(buf,1024-1,"%s, (%s when reading %s)",msg,strerror(errno),LOCAL_FileNameBuf);
|
||||
#else
|
||||
sprintf(LOCAL_ErrorSay,"%s, (system error %d when reading %s)",msg,errno,LOCAL_FileNameBuf);
|
||||
snprintf(buf,1024-1,"%s, (system error %d when reading %s)",msg,errno,LOCAL_FileNameBuf);
|
||||
#endif
|
||||
#endif
|
||||
LOCAL_Error_TYPE = etype;
|
||||
@@ -203,7 +203,7 @@ inline static
|
||||
Int
|
||||
mywrite(FILE *fd, char *buff, Int len) {
|
||||
size_t nwritten;
|
||||
|
||||
|
||||
while (len > 0) {
|
||||
nwritten = fwrite(buff, 1, (size_t)len, fd);
|
||||
if ((long int)nwritten < 0) {
|
||||
@@ -1376,7 +1376,7 @@ ShowAtoms()
|
||||
|
||||
static int
|
||||
commit_to_saved_state(char *s, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *AHeap) {
|
||||
CACHE_REGS
|
||||
CACHE_REGS
|
||||
int mode;
|
||||
|
||||
if ((mode = check_header(Astate,ATrail,AStack,AHeap PASS_REGS)) == FAIL_RESTORE)
|
||||
@@ -1422,7 +1422,7 @@ static int
|
||||
OpenRestore(const char *inpf, const char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *AHeap, FILE **streamp)
|
||||
{
|
||||
CACHE_REGS
|
||||
|
||||
|
||||
int mode;
|
||||
char fname[YAP_FILENAME_MAX +1];
|
||||
|
||||
|
Reference in New Issue
Block a user