use const char *

This commit is contained in:
Vítor Santos Costa 2014-12-14 11:52:07 +00:00
parent bed14749f8
commit f5ef30563b
3 changed files with 4 additions and 2 deletions

View File

@ -625,6 +625,7 @@ XAdjust__ (wamreg reg USES_REGS)
#define YAdjust(X) (X) #define YAdjust(X) (X)
#define HoldEntryAdjust(P) (P) #define HoldEntryAdjust(P) (P)
#define CodeCharPAdjust(P) (P) #define CodeCharPAdjust(P) (P)
#define CodeConstCharPAdjust(P) (P)
#define CodeVoidPAdjust(P) (P) #define CodeVoidPAdjust(P) (P)
#define HaltHookAdjust(P) (P) #define HaltHookAdjust(P) (P)

View File

@ -498,6 +498,7 @@ DBRefAdjust__ (DBRef dbt USES_REGS)
#define YAdjust(P) (P) #define YAdjust(P) (P)
#define HoldEntryAdjust(P) (P) #define HoldEntryAdjust(P) (P)
#define CodeCharPAdjust(P) (P) #define CodeCharPAdjust(P) (P)
#define CodeConstCharPAdjust(P) (P)
#define CodeVoidPAdjust(P) (P) #define CodeVoidPAdjust(P) (P)
#define HaltHookAdjust(P) (P) #define HaltHookAdjust(P) (P)

View File

@ -1427,7 +1427,7 @@ commit_to_saved_state(char *s, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *A
} }
static void static void
cat_file_name(char *s, char *prefix, char *name, unsigned int max_length) cat_file_name(char *s, const char *prefix, char *name, unsigned int max_length)
{ {
strncpy(s, prefix, max_length); strncpy(s, prefix, max_length);
#if _MSC_VER || defined(__MINGW32__) #if _MSC_VER || defined(__MINGW32__)
@ -1517,7 +1517,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
} }
#if HAVE_GETENV #if HAVE_GETENV
{ {
char *yap_env = getenv("YAPLIBDIR"); const char *yap_env = getenv("YAPLIBDIR");
if (yap_env != NULL) { if (yap_env != NULL) {
cat_file_name(LOCAL_FileNameBuf, yap_env, inpf, YAP_FILENAME_MAX); cat_file_name(LOCAL_FileNameBuf, yap_env, inpf, YAP_FILENAME_MAX);
if ((mode = try_open(LOCAL_FileNameBuf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) { if ((mode = try_open(LOCAL_FileNameBuf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) {